[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 09/21] tests/tcg/s390x: Test EPSW
From: |
Thomas Huth |
Subject: |
[PULL 09/21] tests/tcg/s390x: Test EPSW |
Date: |
Mon, 10 Jul 2023 14:15:31 +0200 |
From: Ilya Leoshkevich <iii@linux.ibm.com>
Add a small test to prevent regressions.
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Message-Id: <20230704081506.276055-9-iii@linux.ibm.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
tests/tcg/s390x/epsw.c | 23 +++++++++++++++++++++++
tests/tcg/s390x/Makefile.target | 1 +
2 files changed, 24 insertions(+)
create mode 100644 tests/tcg/s390x/epsw.c
diff --git a/tests/tcg/s390x/epsw.c b/tests/tcg/s390x/epsw.c
new file mode 100644
index 0000000000..affb1a5e3a
--- /dev/null
+++ b/tests/tcg/s390x/epsw.c
@@ -0,0 +1,23 @@
+/*
+ * Test the EPSW instruction.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+#include <assert.h>
+#include <stdlib.h>
+
+int main(void)
+{
+ unsigned long r1 = 0x1234567887654321UL, r2 = 0x8765432112345678UL;
+
+ asm("cr %[r1],%[r2]\n" /* cc = 1 */
+ "epsw %[r1],%[r2]"
+ : [r1] "+r" (r1), [r2] "+r" (r2) : : "cc");
+
+ /* Do not check the R and RI bits. */
+ r1 &= ~0x40000008UL;
+ assert(r1 == 0x1234567807051001UL);
+ assert(r2 == 0x8765432180000000UL);
+
+ return EXIT_SUCCESS;
+}
diff --git a/tests/tcg/s390x/Makefile.target b/tests/tcg/s390x/Makefile.target
index 85abfbb98c..2ef22c88d9 100644
--- a/tests/tcg/s390x/Makefile.target
+++ b/tests/tcg/s390x/Makefile.target
@@ -36,6 +36,7 @@ TESTS+=rxsbg
TESTS+=ex-relative-long
TESTS+=ex-branch
TESTS+=mxdb
+TESTS+=epsw
cdsg: CFLAGS+=-pthread
cdsg: LDFLAGS+=-pthread
--
2.39.3
- [PULL 00/21] s390x, qtest and misc patches before the 8.1 soft freeze, Thomas Huth, 2023/07/10
- [PULL 01/21] hw/s390x: Move KVM specific PV from hw/ to target/s390x/kvm/, Thomas Huth, 2023/07/10
- [PULL 03/21] target/s390x: Fix EPSW CC reporting, Thomas Huth, 2023/07/10
- [PULL 04/21] target/s390x: Fix MDEB and MDEBR, Thomas Huth, 2023/07/10
- [PULL 09/21] tests/tcg/s390x: Test EPSW,
Thomas Huth <=
- [PULL 02/21] linux-user: elfload: Add more initial s390x PSW bits, Thomas Huth, 2023/07/10
- [PULL 07/21] target/s390x: Fix LRA when DAT is off, Thomas Huth, 2023/07/10
- [PULL 05/21] target/s390x: Fix MVCRL with a large value in R0, Thomas Huth, 2023/07/10
- [PULL 06/21] target/s390x: Fix LRA overwriting the top 32 bits on DAT error, Thomas Huth, 2023/07/10
- [PULL 08/21] target/s390x: Fix relative long instructions with large offsets, Thomas Huth, 2023/07/10
- [PULL 12/21] tests/tcg/s390x: Test MDEB and MDEBR, Thomas Huth, 2023/07/10
- [PULL 10/21] tests/tcg/s390x: Test LARL with a large offset, Thomas Huth, 2023/07/10
- [PULL 11/21] tests/tcg/s390x: Test LRA, Thomas Huth, 2023/07/10
- [PULL 13/21] tests/tcg/s390x: Test MVCRL with a large value in R0, Thomas Huth, 2023/07/10