From: "Alex Bennée" <alex.bennee@linaro.org>
To: richard.henderson@linaro.org, qemu-devel@nongnu.org
Cc: fam@euphon.net, "Peter Maydell" <peter.maydell@linaro.org>,
berrange@redhat.com, "David Hildenbrand" <david@redhat.com>,
f4bug@amsat.org, "Eduardo Habkost" <eduardo@habkost.net>,
"open list:S390 TCG CPUs" <qemu-s390x@nongnu.org>,
qemu-arm@nongnu.org, stefanha@redhat.com, crosa@redhat.com,
pbonzini@redhat.com, "Alex Bennée" <alex.bennee@linaro.org>,
aurelien@aurel32.net
Subject: [RFC PATCH 4/4] tests/tcg: add vectorised sha512 versions
Date: Wed, 2 Feb 2022 19:12:42 +0000 [thread overview]
Message-ID: <20220202191242.652607-5-alex.bennee@linaro.org> (raw)
In-Reply-To: <20220202191242.652607-1-alex.bennee@linaro.org>
This builds vectorised versions of sha512 to exercise the vector code:
- aarch64 (sve and sve2)
- i385 (SSE)
- s390x (MVX)
- ppc64 (vector)
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
tests/tcg/aarch64/Makefile.target | 11 +++++++++++
tests/tcg/i386/Makefile.target | 6 ++++++
tests/tcg/ppc64le/Makefile.target | 5 ++++-
tests/tcg/s390x/Makefile.target | 9 +++++++++
tests/tcg/x86_64/Makefile.target | 7 +++++++
5 files changed, 37 insertions(+), 1 deletion(-)
diff --git a/tests/tcg/aarch64/Makefile.target b/tests/tcg/aarch64/Makefile.target
index a03844ce48..33e3cea7fd 100644
--- a/tests/tcg/aarch64/Makefile.target
+++ b/tests/tcg/aarch64/Makefile.target
@@ -62,6 +62,17 @@ run-sha1-vector: sha1-vector run-sha1
TESTS += sha1-vector
+# SVE versions of sha512
+sha512-sve: CFLAGS=-march=armv8.1-a+sve -O3
+sha512-sve: sha512.c
+ $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
+
+sha512-sve2: CFLAGS=-march=armv8.1-a+sve2 -O3
+sha512-sve2: sha512.c
+ $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
+
+TESTS += sha512-sve sha512-sve2
+
ifneq ($(HAVE_GDB_BIN),)
GDB_SCRIPT=$(SRC_PATH)/tests/guest-debug/run-test.py
diff --git a/tests/tcg/i386/Makefile.target b/tests/tcg/i386/Makefile.target
index 38c10379af..0ff7e1bfcc 100644
--- a/tests/tcg/i386/Makefile.target
+++ b/tests/tcg/i386/Makefile.target
@@ -71,3 +71,9 @@ TESTS=$(MULTIARCH_TESTS) $(I386_TESTS)
# On i386 and x86_64 Linux only supports 4k pages (large pages are a different hack)
EXTRA_RUNS+=run-test-mmap-4096
+
+sha512-sse: CFLAGS=-march=pentium4 -O3
+sha512-sse: sha512.c
+ $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
+
+TESTS+=sha512-sse
diff --git a/tests/tcg/ppc64le/Makefile.target b/tests/tcg/ppc64le/Makefile.target
index 480ff0898d..4f1d03dfcf 100644
--- a/tests/tcg/ppc64le/Makefile.target
+++ b/tests/tcg/ppc64le/Makefile.target
@@ -5,10 +5,13 @@
VPATH += $(SRC_PATH)/tests/tcg/ppc64le
ifneq ($(DOCKER_IMAGE)$(CROSS_CC_HAS_POWER8_VECTOR),)
-PPC64LE_TESTS=bcdsub non_signalling_xscv
+PPC64LE_TESTS=bcdsub non_signalling_xscv sha512-vector
endif
$(PPC64LE_TESTS): CFLAGS += -mpower8-vector
+sha512-vector: sha512.c
+ $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
+
ifneq ($(DOCKER_IMAGE)$(CROSS_CC_HAS_POWER10),)
PPC64LE_TESTS += byte_reverse
endif
diff --git a/tests/tcg/s390x/Makefile.target b/tests/tcg/s390x/Makefile.target
index 1a7238b4eb..e53b599b22 100644
--- a/tests/tcg/s390x/Makefile.target
+++ b/tests/tcg/s390x/Makefile.target
@@ -25,3 +25,12 @@ run-gdbstub-signals-s390x: signals-s390x
EXTRA_RUNS += run-gdbstub-signals-s390x
endif
+
+# MVX versions of sha512
+sha512-mvx: CFLAGS=-march=z13 -mvx -O3
+sha512-mvx: sha512.c
+ $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
+
+run-sha512-mvx: QEMU_OPTS+=-cpu max
+
+TESTS+=sha512-mvx
diff --git a/tests/tcg/x86_64/Makefile.target b/tests/tcg/x86_64/Makefile.target
index 4a8a464c57..17cf168f0a 100644
--- a/tests/tcg/x86_64/Makefile.target
+++ b/tests/tcg/x86_64/Makefile.target
@@ -22,3 +22,10 @@ test-x86_64: test-i386.c test-i386.h test-i386-shift.h test-i386-muldiv.h
vsyscall: $(SRC_PATH)/tests/tcg/x86_64/vsyscall.c
$(CC) $(CFLAGS) $< -o $@ $(LDFLAGS)
+
+# TCG does not yet support all SSE (SIGILL on pshufb)
+# sha512-sse: CFLAGS=-march=core2 -O3
+# sha512-sse: sha512.c
+# $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
+
+TESTS+=sha512-sse
--
2.30.2
next prev parent reply other threads:[~2022-02-02 20:09 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-02 19:12 [RFC PATCH 0/4] improve coverage of vector backend Alex Bennée
2022-02-02 19:12 ` [RFC PATCH 1/4] tests/tcg: cleanup sha1 source code Alex Bennée
2022-02-02 21:05 ` Richard Henderson
2022-02-02 19:12 ` [RFC PATCH 2/4] tests/tcg: build sha1-vector for SVE and compare Alex Bennée
2022-02-02 21:09 ` Richard Henderson
2022-02-02 19:12 ` [RFC PATCH 3/4] tests/tcg: add sha512 test Alex Bennée
2022-02-02 21:19 ` Richard Henderson
2022-02-02 19:12 ` Alex Bennée [this message]
2022-02-02 21:18 ` [RFC PATCH 4/4] tests/tcg: add vectorised sha512 versions Richard Henderson
2022-02-02 23:16 ` [RFC PATCH 0/4] improve coverage of vector backend Alex Bennée
2022-02-03 1:45 ` Taylor Simpson
2022-02-03 16:33 ` Taylor Simpson
2022-02-03 17:50 ` Alex Bennée
2022-02-03 17:57 ` Taylor Simpson
2022-02-03 18:26 ` Alex Bennée
2022-02-03 19:01 ` Taylor Simpson
2022-02-03 20:00 ` Alex Bennée
2022-02-03 21:05 ` Taylor Simpson
2022-02-03 21:31 ` Richard Henderson
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=20220202191242.652607-5-alex.bennee@linaro.org \
--to=alex.bennee@linaro.org \
--cc=aurelien@aurel32.net \
--cc=berrange@redhat.com \
--cc=crosa@redhat.com \
--cc=david@redhat.com \
--cc=eduardo@habkost.net \
--cc=f4bug@amsat.org \
--cc=fam@euphon.net \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=stefanha@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).