[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 14/14] tests/tcg/s390x: Test VCKSM
From: |
Ilya Leoshkevich |
Subject: |
[PATCH v4 14/14] tests/tcg/s390x: Test VCKSM |
Date: |
Mon, 24 Jul 2023 10:16:07 +0200 |
Add a small test to prevent regressions.
Tested-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
---
tests/tcg/s390x/Makefile.target | 1 +
tests/tcg/s390x/vcksm.c | 31 +++++++++++++++++++++++++++++++
tests/tcg/s390x/vx.h | 2 ++
3 files changed, 34 insertions(+)
create mode 100644 tests/tcg/s390x/vcksm.c
diff --git a/tests/tcg/s390x/Makefile.target b/tests/tcg/s390x/Makefile.target
index 71bf39b78d3..1fc98099070 100644
--- a/tests/tcg/s390x/Makefile.target
+++ b/tests/tcg/s390x/Makefile.target
@@ -58,6 +58,7 @@ TESTS += $(PGM_SPECIFICATION_TESTS)
Z13_TESTS=vistr
Z13_TESTS+=lcbb
Z13_TESTS+=locfhr
+Z13_TESTS+=vcksm
$(Z13_TESTS): CFLAGS+=-march=z13 -O2
TESTS+=$(Z13_TESTS)
diff --git a/tests/tcg/s390x/vcksm.c b/tests/tcg/s390x/vcksm.c
new file mode 100644
index 00000000000..452daaae6ce
--- /dev/null
+++ b/tests/tcg/s390x/vcksm.c
@@ -0,0 +1,31 @@
+/*
+ * Test the VCKSM instruction.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+#include <assert.h>
+#include <stdlib.h>
+#include <string.h>
+#include "vx.h"
+
+int main(void)
+{
+ S390Vector v1;
+ S390Vector v2 = {
+ .d[0] = 0xb2261c8140edce49ULL,
+ .d[1] = 0x387bf5a433af39d1ULL,
+ };
+ S390Vector v3 = {
+ .d[0] = 0x73b03d2c7f9e654eULL,
+ .d[1] = 0x23d74e51fb479877ULL,
+ };
+ S390Vector exp = {.d[0] = 0xdedd7f8eULL, .d[1] = 0ULL};
+
+ asm volatile("vcksm %[v1],%[v2],%[v3]"
+ : [v1] "=v" (v1.v)
+ : [v2] "v" (v2.v)
+ , [v3] "v" (v3.v));
+ assert(memcmp(&v1, &exp, sizeof(v1)) == 0);
+
+ return EXIT_SUCCESS;
+}
diff --git a/tests/tcg/s390x/vx.h b/tests/tcg/s390x/vx.h
index 02e7fd518a8..00701dbe35f 100644
--- a/tests/tcg/s390x/vx.h
+++ b/tests/tcg/s390x/vx.h
@@ -1,6 +1,8 @@
#ifndef QEMU_TESTS_S390X_VX_H
#define QEMU_TESTS_S390X_VX_H
+#include <stdint.h>
+
typedef union S390Vector {
uint64_t d[2]; /* doubleword */
uint32_t w[4]; /* word */
--
2.41.0
- [PATCH v4 11/14] tests/tcg/s390x: Test ICM, (continued)
- [PATCH v4 11/14] tests/tcg/s390x: Test ICM, Ilya Leoshkevich, 2023/07/24
- [PATCH v4 12/14] tests/tcg/s390x: Test MC, Ilya Leoshkevich, 2023/07/24
- [PATCH v4 04/14] target/s390x: Fix ICM with M3=0, Ilya Leoshkevich, 2023/07/24
- [PATCH v4 05/14] target/s390x: Make MC raise specification exception when class >= 16, Ilya Leoshkevich, 2023/07/24
- [PATCH v4 06/14] tcg/{i386, s390x}: Add earlyclobber to the op_add2's first output, Ilya Leoshkevich, 2023/07/24
- [PATCH v4 08/14] tests/tcg/s390x: Test CKSM, Ilya Leoshkevich, 2023/07/24
- [PATCH v4 03/14] target/s390x: Fix CONVERT TO LOGICAL/FIXED with out-of-range inputs, Ilya Leoshkevich, 2023/07/24
- [PATCH v4 02/14] target/s390x: Fix CLM with M3=0, Ilya Leoshkevich, 2023/07/24
- [PATCH v4 07/14] target/s390x: Fix assertion failure in VFMIN/VFMAX with type 13, Ilya Leoshkevich, 2023/07/24
- [PATCH v4 13/14] tests/tcg/s390x: Test STPQ, Ilya Leoshkevich, 2023/07/24
- [PATCH v4 14/14] tests/tcg/s390x: Test VCKSM,
Ilya Leoshkevich <=
- [PATCH v4 10/14] tests/tcg/s390x: Test CLM, Ilya Leoshkevich, 2023/07/24