Skip to content

Commit

Permalink
tests/tcg: build sha1-vector with O3 and compare
Browse files Browse the repository at this point in the history
The aim of this is to test code generation for vectorised operations.
Unfortunately gcc struggles to do much with the messy sha1 code (try
-fopt-info-vec-missed to see why). However it's better than nothing.

We assume the non-vectorised output is gold and baring compiler bugs
the outputs should match.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220225172021.3493923-12-alex.bennee@linaro.org>
  • Loading branch information
stsquad committed Feb 28, 2022
1 parent 93f4489 commit c96e593
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/tcg/aarch64/Makefile.target
Expand Up @@ -50,6 +50,16 @@ sysregs: CFLAGS+=-march=armv8.1-a+sve
AARCH64_TESTS += sve-ioctls
sve-ioctls: CFLAGS+=-march=armv8.1-a+sve

# Vector SHA1
sha1-vector: CFLAGS=-O3
sha1-vector: sha1.c
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
run-sha1-vector: sha1-vector run-sha1
$(call run-test, $<, $(QEMU) $(QEMU_OPTS) $<, "$< on $(TARGET_NAME)")
$(call diff-out, sha1-vector, sha1.out)

TESTS += sha1-vector

ifneq ($(HAVE_GDB_BIN),)
GDB_SCRIPT=$(SRC_PATH)/tests/guest-debug/run-test.py

Expand Down
9 changes: 9 additions & 0 deletions tests/tcg/arm/Makefile.target
Expand Up @@ -70,6 +70,15 @@ endif

ARM_TESTS += commpage

# Vector SHA1
sha1-vector: CFLAGS=-O3
sha1-vector: sha1.c
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
run-sha1-vector: sha1-vector run-sha1
$(call run-test, $<, $(QEMU) $(QEMU_OPTS) $<, "$< on $(TARGET_NAME)")
$(call diff-out, sha1-vector, sha1.out)

ARM_TESTS += sha1-vector
TESTS += $(ARM_TESTS)

# On ARM Linux only supports 4k pages
Expand Down

0 comments on commit c96e593

Please sign in to comment.