mirror of
https://gitlab.com/qemu-project/qemu
synced 2024-11-05 20:35:44 +00:00
fa7ce0b028
Adjust the test-avx.py generator to produce tests specifically for MMX and 3DNow. Using a separate generator introduces some code duplication, but is a simpler approach because of test-avx's extra complexity to support 3- and 4-operand AVX instructions. If needed, a common library can be introduced later. While at it, for consistency move all the -cpu max rules to the same place. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
108 lines
3.4 KiB
SYSTEMD
108 lines
3.4 KiB
SYSTEMD
# i386 cross compile notes
|
|
|
|
I386_SRC=$(SRC_PATH)/tests/tcg/i386
|
|
|
|
# Set search path for all sources
|
|
VPATH += $(I386_SRC)
|
|
|
|
I386_SRCS=$(notdir $(wildcard $(I386_SRC)/*.c))
|
|
ALL_X86_TESTS=$(I386_SRCS:.c=)
|
|
SKIP_I386_TESTS=test-i386-ssse3 test-avx test-3dnow test-mmx
|
|
X86_64_TESTS:=$(filter test-i386-bmi2 $(SKIP_I386_TESTS), $(ALL_X86_TESTS))
|
|
|
|
test-i386-sse-exceptions: CFLAGS += -msse4.1 -mfpmath=sse
|
|
run-test-i386-sse-exceptions: QEMU_OPTS += -cpu max
|
|
run-plugin-test-i386-sse-exceptions-%: QEMU_OPTS += -cpu max
|
|
|
|
test-i386-pcmpistri: CFLAGS += -msse4.2
|
|
run-test-i386-pcmpistri: QEMU_OPTS += -cpu max
|
|
run-plugin-test-i386-pcmpistri-%: QEMU_OPTS += -cpu max
|
|
|
|
test-i386-bmi2: CFLAGS=-O2
|
|
run-test-i386-bmi2: QEMU_OPTS += -cpu max
|
|
run-plugin-test-i386-bmi2-%: QEMU_OPTS += -cpu max
|
|
|
|
#
|
|
# hello-i386 is a barebones app
|
|
#
|
|
hello-i386: CFLAGS+=-ffreestanding
|
|
hello-i386: LDFLAGS+=-nostdlib
|
|
|
|
# test-386 includes a couple of additional objects that need to be
|
|
# linked together, we also need a no-pie capable compiler due to the
|
|
# non-pic calls into 16-bit mode
|
|
ifneq ($(CROSS_CC_HAS_I386_NOPIE),)
|
|
test-i386: CFLAGS += -fno-pie
|
|
|
|
test-i386: test-i386.c test-i386-code16.S test-i386-vm86.S test-i386.h test-i386-shift.h test-i386-muldiv.h
|
|
$(CC) $(CFLAGS) $(LDFLAGS) $(EXTRA_CFLAGS) -o $@ \
|
|
$(<D)/test-i386.c $(<D)/test-i386-code16.S $(<D)/test-i386-vm86.S -lm
|
|
else
|
|
test-i386:
|
|
$(call skip-test, "BUILD of $@", "missing -no-pie compiler support")
|
|
run-test-i386:
|
|
$(call skip-test, "RUN of test-i386", "not built")
|
|
run-plugin-test-i386-with-%:
|
|
$(call skip-test, "RUN of test-i386 ($*)", "not built")
|
|
endif
|
|
|
|
ifeq ($(SPEED), slow)
|
|
|
|
test-i386-fprem.ref: test-i386-fprem
|
|
$(call quiet-command, ./$< > $@,"GENREF","generating $@")
|
|
|
|
run-test-i386-fprem: TIMEOUT=60
|
|
run-test-i386-fprem: test-i386-fprem test-i386-fprem.ref
|
|
$(call run-test,test-i386-fprem, $(QEMU) $<,"$< on $(TARGET_NAME)")
|
|
$(call diff-out,test-i386-fprem, test-i386-fprem.ref)
|
|
else
|
|
SKIP_I386_TESTS+=test-i386-fprem
|
|
endif
|
|
|
|
# non-inline runs will trigger the duplicate instruction heuristics in libinsn.so
|
|
run-plugin-%-with-libinsn.so:
|
|
$(call run-test, $@, $(QEMU) $(QEMU_OPTS) \
|
|
-plugin ../../plugin/libinsn.so$(COMMA)inline=on \
|
|
-d plugin -D $*-with-libinsn.so.pout $*, \
|
|
"$* (inline) on $(TARGET_NAME)")
|
|
|
|
# Update TESTS
|
|
I386_TESTS:=$(filter-out $(SKIP_I386_TESTS), $(ALL_X86_TESTS))
|
|
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=-msse4.1 -O3
|
|
sha512-sse: sha512.c
|
|
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
|
|
|
|
run-sha512-sse: QEMU_OPTS+=-cpu max
|
|
run-plugin-sha512-sse-with-%: QEMU_OPTS+=-cpu max
|
|
|
|
TESTS+=sha512-sse
|
|
|
|
CLEANFILES += test-avx.h test-mmx.h test-3dnow.h
|
|
test-3dnow.h: test-mmx.py x86.csv
|
|
$(PYTHON) $(I386_SRC)/test-mmx.py $(I386_SRC)/x86.csv $@ 3DNOW
|
|
|
|
test-mmx.h: test-mmx.py x86.csv
|
|
$(PYTHON) $(I386_SRC)/test-mmx.py $(I386_SRC)/x86.csv $@ MMX SSE SSE2 SSE3 SSSE3
|
|
|
|
test-avx.h: test-avx.py x86.csv
|
|
$(PYTHON) $(I386_SRC)/test-avx.py $(I386_SRC)/x86.csv $@
|
|
|
|
test-3dnow: CFLAGS += -masm=intel -O -I.
|
|
run-test-3dnow: QEMU_OPTS += -cpu max
|
|
run-plugin-test-3dnow: QEMU_OPTS += -cpu max
|
|
test-3dnow: test-3dnow.h
|
|
|
|
test-mmx: CFLAGS += -masm=intel -O -I.
|
|
run-test-mmx: QEMU_OPTS += -cpu max
|
|
run-plugin-test-mmx: QEMU_OPTS += -cpu max
|
|
test-mmx: test-mmx.h
|
|
|
|
test-avx: CFLAGS += -masm=intel -O -I.
|
|
run-test-avx: QEMU_OPTS += -cpu max
|
|
run-plugin-test-avx: QEMU_OPTS += -cpu max
|
|
test-avx: test-avx.h
|