[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 09/18] tests/tcg/s390x: Test MXDB and MXDBR
From: |
Thomas Huth |
Subject: |
[PULL 09/18] tests/tcg/s390x: Test MXDB and MXDBR |
Date: |
Tue, 6 Jun 2023 07:56:12 +0200 |
From: Ilya Leoshkevich <iii@linux.ibm.com>
Add a small test to prevent regressions.
Cc: qemu-stable@nongnu.org
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Message-Id: <20230601223027.795501-3-iii@linux.ibm.com>
Acked-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
tests/tcg/s390x/mxdb.c | 30 ++++++++++++++++++++++++++++++
tests/tcg/s390x/Makefile.target | 1 +
2 files changed, 31 insertions(+)
create mode 100644 tests/tcg/s390x/mxdb.c
diff --git a/tests/tcg/s390x/mxdb.c b/tests/tcg/s390x/mxdb.c
new file mode 100644
index 0000000000..ae922559d3
--- /dev/null
+++ b/tests/tcg/s390x/mxdb.c
@@ -0,0 +1,30 @@
+/*
+ * Test the MXDB and MXDBR instructions.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+#include <assert.h>
+#include <stdlib.h>
+
+int main(void)
+{
+ union {
+ double d[2];
+ long double ld;
+ } a;
+ double b;
+
+ a.d[0] = 1.2345;
+ a.d[1] = 999;
+ b = 6.789;
+ asm("mxdb %[a],%[b]" : [a] "+f" (a.ld) : [b] "R" (b));
+ assert(a.ld > 8.38 && a.ld < 8.39);
+
+ a.d[0] = 1.2345;
+ a.d[1] = 999;
+ b = 6.789;
+ asm("mxdbr %[a],%[b]" : [a] "+f" (a.ld) : [b] "f" (b));
+ assert(a.ld > 8.38 && a.ld < 8.39);
+
+ return EXIT_SUCCESS;
+}
diff --git a/tests/tcg/s390x/Makefile.target b/tests/tcg/s390x/Makefile.target
index a2a15c4a23..85abfbb98c 100644
--- a/tests/tcg/s390x/Makefile.target
+++ b/tests/tcg/s390x/Makefile.target
@@ -35,6 +35,7 @@ TESTS+=chrl
TESTS+=rxsbg
TESTS+=ex-relative-long
TESTS+=ex-branch
+TESTS+=mxdb
cdsg: CFLAGS+=-pthread
cdsg: LDFLAGS+=-pthread
--
2.31.1
- [PULL 01/18] target/s390x: Fix LCBB overwriting the top 32 bits, (continued)
- [PULL 01/18] target/s390x: Fix LCBB overwriting the top 32 bits, Thomas Huth, 2023/06/06
- [PULL 02/18] tests/tcg/s390x: Test LCBB, Thomas Huth, 2023/06/06
- [PULL 03/18] target/s390x: Fix LOCFHR taking the wrong half of R2, Thomas Huth, 2023/06/06
- [PULL 04/18] tests/tcg/s390x: Test LOCFHR, Thomas Huth, 2023/06/06
- [PULL 05/18] linux-user/s390x: Fix single-stepping SVC, Thomas Huth, 2023/06/06
- [PULL 07/18] Add conditional dependency for libkeyutils, Thomas Huth, 2023/06/06
- [PULL 06/18] tests/tcg/s390x: Test single-stepping SVC, Thomas Huth, 2023/06/06
- [PULL 08/18] target/s390x: Fix MXDB and MXDBR, Thomas Huth, 2023/06/06
- [PULL 10/18] tests/qtest: Run ipmi-bt-test only if CONFIG_IPMI_EXTERN is set, Thomas Huth, 2023/06/06
- [PULL 11/18] gitlab-ci: Remove unused Python package, Thomas Huth, 2023/06/06
- [PULL 09/18] tests/tcg/s390x: Test MXDB and MXDBR,
Thomas Huth <=
- [PULL 13/18] scripts: Add qom-cast-macro-clean-cocci-gen.py, Thomas Huth, 2023/06/06
- [PULL 12/18] hw/mips/malta: Fix the malta machine on big endian hosts, Thomas Huth, 2023/06/06
- [PULL 14/18] bulk: Remove pointless QOM casts, Thomas Huth, 2023/06/06
- [PULL 15/18] s390x/tcg: Fix CPU address returned by STIDP, Thomas Huth, 2023/06/06
- [PULL 16/18] linux-user/elfload: Expose get_elf_hwcap() on s390x, Thomas Huth, 2023/06/06
- [PULL 18/18] linux-user: Emulate /proc/cpuinfo on s390x, Thomas Huth, 2023/06/06
- [PULL 17/18] linux-user/elfload: Introduce elf_hwcap_str() on s390x, Thomas Huth, 2023/06/06
- Re: [PULL 00/18] s390x and misc patches, Richard Henderson, 2023/06/06