From: David Miller <dmiller423@gmail.com>
To: qemu-s390x@nongnu.org, qemu-devel@nongnu.org
Cc: Thomas Huth <thuth@redhat.com>,
David Hildenbrand <david@redhat.com>,
cohuck@redhat.com,
Richard Henderson <richard.henderson@linaro.org>,
farman@linux.ibm.com, pasic@linux.ibm.com,
Christian Borntraeger <borntraeger@linux.ibm.com>
Subject: Re: [PATCH] tests/tcg/s390x: Cleanup of mie3 tests.
Date: Tue, 1 Mar 2022 15:00:22 -0500 [thread overview]
Message-ID: <CAEgyohXXAsNnXasD+UzE8xWCFTdtKBNyHa5o5jkpXYeshKX-Fw@mail.gmail.com> (raw)
In-Reply-To: <20220301191455.19004-1-dmiller423@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 5667 bytes --]
Please disregard, v2 sent.
On Tue, Mar 1, 2022 at 2:15 PM David Miller <dmiller423@gmail.com> wrote:
> Adds clobbers and merges remaining separate asm statements.
>
> Signed-off-by: David Miller <dmiller423@gmail.com>
> ---
> tests/tcg/s390x/mie3-compl.c | 42 +++++++++++++++++++++++-------------
> tests/tcg/s390x/mie3-mvcrl.c | 12 +++++++----
> tests/tcg/s390x/mie3-sel.c | 40 ++++++++++++++++++----------------
> 3 files changed, 57 insertions(+), 37 deletions(-)
>
> diff --git a/tests/tcg/s390x/mie3-compl.c b/tests/tcg/s390x/mie3-compl.c
> index 35649f3b02..85b23a9b7a 100644
> --- a/tests/tcg/s390x/mie3-compl.c
> +++ b/tests/tcg/s390x/mie3-compl.c
> @@ -1,32 +1,44 @@
> #include <stdint.h>
>
> +
> #define FbinOp(S, ASM) uint64_t S(uint64_t a, uint64_t b) \
> -{ \
> - uint64_t res = 0; \
> - asm ("llihf %[res],801\n" ASM \
> - : [res]"=&r"(res) : [a]"r"(a), [b]"r"(b) : "cc"); \
> - return res; \
> +{ \
> + uint64_t res = 0; \
> +asm volatile ( \
> + "llihf %%r0,801\n" \
> + "lg %%r2, %[a]\n" \
> + "lg %%r3, %[b]\n" \
> + ASM \
> + "stg %%r0, %[res] " \
> + : [res] "=m" (res) \
> + : [a] "m" (a) \
> + , [b] "m" (b) \
> + : "r0", "r2", "r3" \
> +); \
> + return res; \
> }
>
> +
> /* AND WITH COMPLEMENT */
> -FbinOp(_ncrk, ".insn rrf, 0xB9F50000, %[res], %[b], %[a], 0\n")
> -FbinOp(_ncgrk, ".insn rrf, 0xB9E50000, %[res], %[b], %[a], 0\n")
> +FbinOp(_ncrk, ".insn rrf, 0xB9F50000, %%r0, %%r3, %%r2, 0\n")
> +FbinOp(_ncgrk, ".insn rrf, 0xB9E50000, %%r0, %%r3, %%r2, 0\n")
>
> /* NAND */
> -FbinOp(_nnrk, ".insn rrf, 0xB9740000, %[res], %[b], %[a], 0\n")
> -FbinOp(_nngrk, ".insn rrf, 0xB9640000, %[res], %[b], %[a], 0\n")
> +FbinOp(_nnrk, ".insn rrf, 0xB9740000, %%r0, %%r3, %%r2, 0\n")
> +FbinOp(_nngrk, ".insn rrf, 0xB9640000, %%r0, %%r3, %%r2, 0\n")
>
> /* NOT XOR */
> -FbinOp(_nxrk, ".insn rrf, 0xB9770000, %[res], %[b], %[a], 0\n")
> -FbinOp(_nxgrk, ".insn rrf, 0xB9670000, %[res], %[b], %[a], 0\n")
> +FbinOp(_nxrk, ".insn rrf, 0xB9770000, %%r0, %%r3, %%r2, 0\n")
> +FbinOp(_nxgrk, ".insn rrf, 0xB9670000, %%r0, %%r3, %%r2, 0\n")
>
> /* NOR */
> -FbinOp(_nork, ".insn rrf, 0xB9760000, %[res], %[b], %[a], 0\n")
> -FbinOp(_nogrk, ".insn rrf, 0xB9660000, %[res], %[b], %[a], 0\n")
> +FbinOp(_nork, ".insn rrf, 0xB9760000, %%r0, %%r3, %%r2, 0\n")
> +FbinOp(_nogrk, ".insn rrf, 0xB9660000, %%r0, %%r3, %%r2, 0\n")
>
> /* OR WITH COMPLEMENT */
> -FbinOp(_ocrk, ".insn rrf, 0xB9750000, %[res], %[b], %[a], 0\n")
> -FbinOp(_ocgrk, ".insn rrf, 0xB9650000, %[res], %[b], %[a], 0\n")
> +FbinOp(_ocrk, ".insn rrf, 0xB9750000, %%r0, %%r3, %%r2, 0\n")
> +FbinOp(_ocgrk, ".insn rrf, 0xB9650000, %%r0, %%r3, %%r2, 0\n")
> +
>
> int main(int argc, char *argv[])
> {
> diff --git a/tests/tcg/s390x/mie3-mvcrl.c b/tests/tcg/s390x/mie3-mvcrl.c
> index 57b08e48d0..f749dad9c2 100644
> --- a/tests/tcg/s390x/mie3-mvcrl.c
> +++ b/tests/tcg/s390x/mie3-mvcrl.c
> @@ -1,15 +1,17 @@
> #include <stdint.h>
> #include <string.h>
>
> +
> static inline void mvcrl_8(const char *dst, const char *src)
> {
> asm volatile (
> - "llill %%r0, 8\n"
> - ".insn sse, 0xE50A00000000, 0(%[dst]), 0(%[src])"
> - : : [dst] "d" (dst), [src] "d" (src)
> - : "memory");
> + "llill %%r0, 8\n"
> + ".insn sse, 0xE50A00000000, 0(%[dst]), 0(%[src])"
> + : : [dst] "d" (dst), [src] "d" (src)
> + : "r0", "memory");
> }
>
> +
> int main(int argc, char *argv[])
> {
> const char *alpha = "abcdefghijklmnop";
> @@ -25,3 +27,5 @@ int main(int argc, char *argv[])
>
> return strncmp(alpha, tstr, 16ul);
> }
> +
> +
> diff --git a/tests/tcg/s390x/mie3-sel.c b/tests/tcg/s390x/mie3-sel.c
> index b0c5c9857d..98cf4d40f5 100644
> --- a/tests/tcg/s390x/mie3-sel.c
> +++ b/tests/tcg/s390x/mie3-sel.c
> @@ -1,29 +1,32 @@
> #include <stdint.h>
>
> +
> #define Fi3(S, ASM) uint64_t S(uint64_t a, uint64_t b, uint64_t c) \
> -{ \
> - uint64_t res = 0; \
> - asm ( \
> - "lg %%r2, %[a]\n" \
> - "lg %%r3, %[b]\n" \
> - "lg %%r0, %[c]\n" \
> - "ltgr %%r0, %%r0\n" \
> - ASM \
> - "stg %%r0, %[res] " \
> - : [res] "=m" (res) \
> - : [a] "m" (a), \
> - [b] "m" (b), \
> - [c] "m" (c) \
> - : "r0", "r2", \
> - "r3", "r4" \
> - ); \
> - return res; \
> +{ \
> + uint64_t res = 0; \
> +asm volatile ( \
> + "lg %%r2, %[a]\n" \
> + "lg %%r3, %[b]\n" \
> + "lg %%r0, %[c]\n" \
> + "ltgr %%r0, %%r0\n" \
> + ASM \
> + "stg %%r0, %[res] " \
> + : [res] "=m" (res) \
> + : [a] "m" (a), \
> + [b] "m" (b), \
> + [c] "m" (c) \
> + : "r0", "r2", \
> + "r3", "r4" \
> +); \
> + return res; \
> }
>
> +
> Fi3 (_selre, ".insn rrf, 0xB9F00000, %%r0, %%r3, %%r2, 8\n")
> Fi3 (_selgrz, ".insn rrf, 0xB9E30000, %%r0, %%r3, %%r2, 8\n")
> Fi3 (_selfhrnz, ".insn rrf, 0xB9C00000, %%r0, %%r3, %%r2, 7\n")
>
> +
> int main(int argc, char *argv[])
> {
> uint64_t a = ~0, b = ~0, c = ~0;
> @@ -34,5 +37,6 @@ int main(int argc, char *argv[])
> return (int) (
> (0xFFFFFFFF00000066ull != a) ||
> (0x0000F00D00000005ull != b) ||
> - (0x00000654FFFFFFFFull != c));
> + (0x00000654FFFFFFFFull != c) );
> }
> +
> --
> 2.34.1
>
>
[-- Attachment #2: Type: text/html, Size: 7872 bytes --]
prev parent reply other threads:[~2022-03-01 20:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-01 19:14 [PATCH] tests/tcg/s390x: Cleanup of mie3 tests David Miller
2022-03-01 20:00 ` David Miller [this message]
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=CAEgyohXXAsNnXasD+UzE8xWCFTdtKBNyHa5o5jkpXYeshKX-Fw@mail.gmail.com \
--to=dmiller423@gmail.com \
--cc=borntraeger@linux.ibm.com \
--cc=cohuck@redhat.com \
--cc=david@redhat.com \
--cc=farman@linux.ibm.com \
--cc=pasic@linux.ibm.com \
--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).