xref: /openbmc/qemu/tests/tcg/s390x/Makefile.target (revision fc700996)
1S390X_SRC=$(SRC_PATH)/tests/tcg/s390x
2VPATH+=$(S390X_SRC)
3CFLAGS+=-march=zEC12 -m64
4
5%.o: %.c
6	$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c $< -o $@
7
8config-cc.mak: Makefile
9	$(quiet-@)( \
10	    $(call cc-option,-march=z14, CROSS_CC_HAS_Z14); \
11	    $(call cc-option,-march=z15, CROSS_CC_HAS_Z15)) 3> config-cc.mak
12-include config-cc.mak
13
14TESTS+=hello-s390x
15TESTS+=csst
16TESTS+=ipm
17TESTS+=exrl-trt
18TESTS+=exrl-trtr
19TESTS+=pack
20TESTS+=mie3-compl
21TESTS+=mie3-mvcrl
22TESTS+=mie3-sel
23TESTS+=mvo
24TESTS+=mvc
25TESTS+=shift
26TESTS+=trap
27TESTS+=signals-s390x
28TESTS+=branch-relative-long
29TESTS+=noexec
30TESTS+=div
31TESTS+=clst
32TESTS+=long-double
33TESTS+=cdsg
34TESTS+=chrl
35TESTS+=rxsbg
36TESTS+=ex-relative-long
37TESTS+=ex-branch
38TESTS+=mxdb
39TESTS+=epsw
40TESTS+=larl
41TESTS+=mdeb
42TESTS+=cgebra
43TESTS+=clgebr
44TESTS+=clc
45TESTS+=laalg
46TESTS+=add-logical-with-carry
47TESTS+=lae
48
49cdsg: CFLAGS+=-pthread
50cdsg: LDFLAGS+=-pthread
51
52rxsbg: CFLAGS+=-O2
53
54cgebra: LDFLAGS+=-lm
55clgebr: LDFLAGS+=-lm
56
57include $(S390X_SRC)/pgm-specification.mak
58$(PGM_SPECIFICATION_TESTS): pgm-specification-user.o
59$(PGM_SPECIFICATION_TESTS): LDFLAGS+=pgm-specification-user.o
60TESTS += $(PGM_SPECIFICATION_TESTS)
61
62Z13_TESTS=vistr
63Z13_TESTS+=lcbb
64Z13_TESTS+=locfhr
65Z13_TESTS+=vcksm
66Z13_TESTS+=vstl
67Z13_TESTS+=vrep
68Z13_TESTS+=precise-smc-user
69$(Z13_TESTS): CFLAGS+=-march=z13 -O2
70TESTS+=$(Z13_TESTS)
71
72ifneq ($(CROSS_CC_HAS_Z14),)
73Z14_TESTS=vfminmax
74vfminmax: LDFLAGS+=-lm
75$(Z14_TESTS): CFLAGS+=-march=z14 -O2
76TESTS+=$(Z14_TESTS)
77endif
78
79ifneq ($(CROSS_CC_HAS_Z15),)
80Z15_TESTS=vxeh2_vs
81Z15_TESTS+=vxeh2_vcvt
82Z15_TESTS+=vxeh2_vlstr
83Z15_TESTS+=vxeh2_vstrs
84$(Z15_TESTS): CFLAGS+=-march=z15 -O2
85TESTS+=$(Z15_TESTS)
86endif
87
88ifneq ($(GDB),)
89GDB_SCRIPT=$(SRC_PATH)/tests/guest-debug/run-test.py
90
91run-gdbstub-signals-s390x: signals-s390x
92	$(call run-test, $@, $(GDB_SCRIPT) \
93		--gdb $(GDB) \
94		--qemu $(QEMU) --qargs "$(QEMU_OPTS)" \
95		--bin $< --test $(S390X_SRC)/gdbstub/test-signals-s390x.py, \
96	mixing signals and debugging)
97
98hello-s390x-asm: CFLAGS+=-nostdlib
99
100run-gdbstub-svc: hello-s390x-asm
101	$(call run-test, $@, $(GDB_SCRIPT) \
102		--gdb $(GDB) \
103		--qemu $(QEMU) --qargs "$(QEMU_OPTS)" \
104		--bin $< --test $(S390X_SRC)/gdbstub/test-svc.py, \
105	single-stepping svc)
106
107EXTRA_RUNS += run-gdbstub-signals-s390x run-gdbstub-svc
108endif
109
110# MVX versions of sha512
111sha512-mvx: CFLAGS=-march=z13 -mvx -O3
112sha512-mvx: sha512.c
113	$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
114
115TESTS+=sha512-mvx
116