From: Richard Henderson <richard.henderson@linaro.org>
To: qemu-devel@nongnu.org
Cc: iii@linux.ibm.com, david@redhat.com
Subject: [PATCH for-8.0 v2 01/13] tests/tcg/s390x: Add div.c
Date: Fri, 11 Nov 2022 18:08:08 +1000 [thread overview]
Message-ID: <20221111080820.2132412-2-richard.henderson@linaro.org> (raw)
In-Reply-To: <20221111080820.2132412-1-richard.henderson@linaro.org>
From: Ilya Leoshkevich <iii@linux.ibm.com>
Add a basic test to prevent regressions.
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Message-Id: <20221101111300.2539919-1-iii@linux.ibm.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
tests/tcg/s390x/div.c | 40 +++++++++++++++++++++++++++++++++
tests/tcg/s390x/Makefile.target | 1 +
2 files changed, 41 insertions(+)
create mode 100644 tests/tcg/s390x/div.c
diff --git a/tests/tcg/s390x/div.c b/tests/tcg/s390x/div.c
new file mode 100644
index 0000000000..5807295614
--- /dev/null
+++ b/tests/tcg/s390x/div.c
@@ -0,0 +1,40 @@
+#include <assert.h>
+#include <stdint.h>
+
+static void test_dr(void)
+{
+ register int32_t r0 asm("r0") = -1;
+ register int32_t r1 asm("r1") = -4241;
+ int32_t b = 101, q, r;
+
+ asm("dr %[r0],%[b]"
+ : [r0] "+r" (r0), [r1] "+r" (r1)
+ : [b] "r" (b)
+ : "cc");
+ q = r1;
+ r = r0;
+ assert(q == -41);
+ assert(r == -100);
+}
+
+static void test_dlr(void)
+{
+ register uint32_t r0 asm("r0") = 0;
+ register uint32_t r1 asm("r1") = 4243;
+ uint32_t b = 101, q, r;
+
+ asm("dlr %[r0],%[b]"
+ : [r0] "+r" (r0), [r1] "+r" (r1)
+ : [b] "r" (b)
+ : "cc");
+ q = r1;
+ r = r0;
+ assert(q == 42);
+ assert(r == 1);
+}
+
+int main(void)
+{
+ test_dr();
+ test_dlr();
+}
diff --git a/tests/tcg/s390x/Makefile.target b/tests/tcg/s390x/Makefile.target
index 07fcc6d0ce..ab7a3bcfb2 100644
--- a/tests/tcg/s390x/Makefile.target
+++ b/tests/tcg/s390x/Makefile.target
@@ -24,6 +24,7 @@ TESTS+=trap
TESTS+=signals-s390x
TESTS+=branch-relative-long
TESTS+=noexec
+TESTS+=div
Z13_TESTS=vistr
$(Z13_TESTS): CFLAGS+=-march=z13 -O2
--
2.34.1
next prev parent reply other threads:[~2022-11-11 8:10 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-11 8:08 [PATCH for-8.0 v2 00/13] target/s390x: Use TCGv_i128 Richard Henderson
2022-11-11 8:08 ` Richard Henderson [this message]
2022-11-11 8:08 ` [PATCH for-8.0 v2 02/13] tests/tcg/s390x: Add clst.c Richard Henderson
2022-11-11 8:08 ` [PATCH for-8.0 v2 03/13] tests/tcg/s390x: Add long-double.c Richard Henderson
2022-11-11 8:08 ` [PATCH for-8.0 v2 04/13] target/s390x: Use a single return for helper_divs32/u32 Richard Henderson
2022-11-28 21:42 ` Ilya Leoshkevich
2022-11-11 8:08 ` [PATCH for-8.0 v2 05/13] target/s390x: Use a single return for helper_divs64/u64 Richard Henderson
2022-11-11 8:08 ` [PATCH for-8.0 v2 06/13] target/s390x: Use Int128 for return from CLST Richard Henderson
2022-11-11 8:08 ` [PATCH for-8.0 v2 07/13] target/s390x: Use Int128 for return from CKSM Richard Henderson
2022-11-11 8:08 ` [PATCH for-8.0 v2 08/13] target/s390x: Use Int128 for return from TRE Richard Henderson
2022-11-11 8:08 ` [PATCH for-8.0 v2 09/13] target/s390x: Copy wout_x1 to wout_x1_P Richard Henderson
2022-11-11 8:08 ` [PATCH for-8.0 v2 10/13] target/s390x: Use Int128 for returning float128 Richard Henderson
2022-11-28 21:53 ` Ilya Leoshkevich
2022-11-11 8:08 ` [PATCH for-8.0 v2 11/13] target/s390x: Use Int128 for passing float128 Richard Henderson
2022-11-28 22:07 ` Ilya Leoshkevich
2022-11-11 8:08 ` [PATCH for-8.0 v2 12/13] target/s390x: Use tcg_gen_atomic_cmpxchg_i128 for CDSG Richard Henderson
2022-11-28 23:40 ` Ilya Leoshkevich
2022-11-28 23:48 ` [PATCH] tests/tcg/s390x: Add cdsg.c Ilya Leoshkevich
2022-11-29 8:54 ` David Hildenbrand
2022-11-29 14:28 ` Ilya Leoshkevich
2022-11-29 14:30 ` [PATCH v2] " Ilya Leoshkevich
2022-11-29 15:24 ` [PATCH v3] " Ilya Leoshkevich
2022-11-29 0:02 ` [PATCH for-8.0 v2 12/13] target/s390x: Use tcg_gen_atomic_cmpxchg_i128 for CDSG Richard Henderson
2022-11-11 8:08 ` [PATCH for-8.0 v2 13/13] target/s390x: Implement CC_OP_NZ in gen_op_calc_cc Richard Henderson
2022-11-28 23:45 ` Ilya Leoshkevich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221111080820.2132412-2-richard.henderson@linaro.org \
--to=richard.henderson@linaro.org \
--cc=david@redhat.com \
--cc=iii@linux.ibm.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.