From: Ilya Leoshkevich <iii@linux.ibm.com>
To: Richard Henderson <richard.henderson@linaro.org>,
David Hildenbrand <david@redhat.com>
Cc: Thomas Huth <thuth@redhat.com>,
qemu-s390x@nongnu.org, qemu-devel@nongnu.org,
Michael Tokarev <mjt@tls.msk.ru>,
Ilya Leoshkevich <iii@linux.ibm.com>
Subject: [PATCH 4/4] tests/tcg/s390x: Test LAALG with negative cc_src
Date: Tue, 31 Oct 2023 06:32:30 +0100 [thread overview]
Message-ID: <20231031053718.347100-5-iii@linux.ibm.com> (raw)
In-Reply-To: <20231031053718.347100-1-iii@linux.ibm.com>
Add a small test to prevent regressions.
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
---
tests/tcg/s390x/Makefile.target | 1 +
tests/tcg/s390x/laalg.c | 27 +++++++++++++++++++++++++++
2 files changed, 28 insertions(+)
create mode 100644 tests/tcg/s390x/laalg.c
diff --git a/tests/tcg/s390x/Makefile.target b/tests/tcg/s390x/Makefile.target
index ccd4f4e68de..a476547b659 100644
--- a/tests/tcg/s390x/Makefile.target
+++ b/tests/tcg/s390x/Makefile.target
@@ -42,6 +42,7 @@ TESTS+=mdeb
TESTS+=cgebra
TESTS+=clgebr
TESTS+=clc
+TESTS+=laalg
cdsg: CFLAGS+=-pthread
cdsg: LDFLAGS+=-pthread
diff --git a/tests/tcg/s390x/laalg.c b/tests/tcg/s390x/laalg.c
new file mode 100644
index 00000000000..797d168bb16
--- /dev/null
+++ b/tests/tcg/s390x/laalg.c
@@ -0,0 +1,27 @@
+/*
+ * Test the LAALG instruction.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+#include <assert.h>
+#include <stdlib.h>
+
+int main(void)
+{
+ unsigned long cc = 0, op1, op2 = 40, op3 = 2;
+
+ asm("slgfi %[cc],1\n" /* Set cc_src = -1. */
+ "laalg %[op1],%[op3],%[op2]\n"
+ "ipm %[cc]"
+ : [cc] "+r" (cc)
+ , [op1] "=r" (op1)
+ , [op2] "+T" (op2)
+ : [op3] "r" (op3)
+ : "cc");
+
+ assert(cc == 0xffffffff10ffffff);
+ assert(op1 == 40);
+ assert(op2 == 42);
+
+ return EXIT_SUCCESS;
+}
--
2.41.0
next prev parent reply other threads:[~2023-10-31 5:39 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-31 5:32 [PATCH 0/4] target/s390x: CC fixes Ilya Leoshkevich
2023-10-31 5:32 ` [PATCH 1/4] target/s390x: Fix CLC corrupting cc_src Ilya Leoshkevich
2023-10-31 22:49 ` Richard Henderson
2023-10-31 5:32 ` [PATCH 2/4] tests/tcg/s390x: Test CLC with inaccessible second operand Ilya Leoshkevich
2023-10-31 22:53 ` Richard Henderson
2023-11-06 9:20 ` Ilya Leoshkevich
2023-10-31 5:32 ` [PATCH 3/4] target/s390x: Fix LAALG not updating cc_src Ilya Leoshkevich
2023-10-31 22:57 ` Richard Henderson
2023-10-31 5:32 ` Ilya Leoshkevich [this message]
2023-10-31 8:38 ` [PATCH 0/4] target/s390x: CC fixes David Hildenbrand
2023-11-03 16:44 ` Ilya Leoshkevich
2023-11-03 17:02 ` David Hildenbrand
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=20231031053718.347100-5-iii@linux.ibm.com \
--to=iii@linux.ibm.com \
--cc=david@redhat.com \
--cc=mjt@tls.msk.ru \
--cc=qemu-devel@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=thuth@redhat.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).