1 # i386 cross compile notes
3 I386_SRC=$(SRC_PATH)/tests/tcg/i386
5 # Set search path for all sources
8 I386_SRCS=$(notdir $(wildcard $(I386_SRC)/*.c))
9 ALL_X86_TESTS=$(I386_SRCS:.c=)
10 SKIP_I386_TESTS=test-i386-ssse3 test-avx
11 X86_64_TESTS:=$(filter test-i386-bmi2 test-i386-ssse3 test-avx, $(ALL_X86_TESTS))
13 test-i386-sse-exceptions: CFLAGS += -msse4.1 -mfpmath=sse
14 run-test-i386-sse-exceptions: QEMU_OPTS += -cpu max
15 run-plugin-test-i386-sse-exceptions-%: QEMU_OPTS += -cpu max
17 test-i386-pcmpistri: CFLAGS += -msse4.2
18 run-test-i386-pcmpistri: QEMU_OPTS += -cpu max
19 run-plugin-test-i386-pcmpistri-%: QEMU_OPTS += -cpu max
21 test-i386-bmi2: CFLAGS=-O2
22 run-test-i386-bmi2: QEMU_OPTS += -cpu max
23 run-plugin-test-i386-bmi2-%: QEMU_OPTS += -cpu max
26 # hello-i386 is a barebones app
28 hello-i386: CFLAGS+=-ffreestanding
29 hello-i386: LDFLAGS+=-nostdlib
31 # test-386 includes a couple of additional objects that need to be
32 # linked together, we also need a no-pie capable compiler due to the
33 # non-pic calls into 16-bit mode
34 ifneq ($(CROSS_CC_HAS_I386_NOPIE),)
35 test-i386: CFLAGS += -fno-pie
37 test-i386: test-i386.c test-i386-code16.S test-i386-vm86.S test-i386.h test-i386-shift.h test-i386-muldiv.h
38 $(CC) $(CFLAGS) $(LDFLAGS) $(EXTRA_CFLAGS) -o $@ \
39 $(<D)/test-i386.c $(<D)/test-i386-code16.S $(<D)/test-i386-vm86.S -lm
42 $(call skip-test, "BUILD of $@", "missing -no-pie compiler support")
44 $(call skip-test, "RUN of test-i386", "not built")
45 run-plugin-test-i386-with-%:
46 $(call skip-test, "RUN of test-i386 ($*)", "not built")
51 test-i386-fprem.ref: test-i386-fprem
52 $(call quiet-command, ./$< > $@,"GENREF","generating $@")
54 run-test-i386-fprem: TIMEOUT=60
55 run-test-i386-fprem: test-i386-fprem test-i386-fprem.ref
56 $(call run-test,test-i386-fprem, $(QEMU) $<,"$< on $(TARGET_NAME)")
57 $(call diff-out,test-i386-fprem, test-i386-fprem.ref)
59 SKIP_I386_TESTS+=test-i386-fprem
62 # non-inline runs will trigger the duplicate instruction heuristics in libinsn.so
63 run-plugin-%-with-libinsn.so:
64 $(call run-test, $@, $(QEMU) $(QEMU_OPTS) \
65 -plugin ../../plugin/libinsn.so$(COMMA)inline=on \
66 -d plugin -D $*-with-libinsn.so.pout $*, \
67 "$* (inline) on $(TARGET_NAME)")
70 I386_TESTS:=$(filter-out $(SKIP_I386_TESTS), $(ALL_X86_TESTS))
71 TESTS=$(MULTIARCH_TESTS) $(I386_TESTS)
73 # On i386 and x86_64 Linux only supports 4k pages (large pages are a different hack)
74 EXTRA_RUNS+=run-test-mmap-4096
76 sha512-sse: CFLAGS=-msse4.1 -O3
78 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
80 run-sha512-sse: QEMU_OPTS+=-cpu max
81 run-plugin-sha512-sse-with-%: QEMU_OPTS+=-cpu max
85 CLEANFILES += test-avx.h
86 test-avx.h: test-avx.py x86.csv
87 $(PYTHON) $(I386_SRC)/test-avx.py $(I386_SRC)/x86.csv $@
89 test-avx: CFLAGS += -masm=intel -O -I.