xref: /openbmc/qemu/tests/tcg/s390x/Makefile.target (revision feb58e3b)
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
48TESTS+=cvd
49TESTS+=cvb
50TESTS+=ts
51TESTS+=ex-smc
52
53cdsg: CFLAGS+=-pthread
54cdsg: LDFLAGS+=-pthread
55
56rxsbg: CFLAGS+=-O2
57
58cgebra: LDFLAGS+=-lm
59clgebr: LDFLAGS+=-lm
60
61include $(S390X_SRC)/pgm-specification.mak
62$(PGM_SPECIFICATION_TESTS): pgm-specification-user.o
63$(PGM_SPECIFICATION_TESTS): LDFLAGS+=pgm-specification-user.o
64TESTS += $(PGM_SPECIFICATION_TESTS)
65
66Z13_TESTS=vistr
67Z13_TESTS+=lcbb
68Z13_TESTS+=locfhr
69Z13_TESTS+=vcksm
70Z13_TESTS+=vstl
71Z13_TESTS+=vrep
72Z13_TESTS+=precise-smc-user
73$(Z13_TESTS): CFLAGS+=-march=z13 -O2
74TESTS+=$(Z13_TESTS)
75
76ifneq ($(CROSS_CC_HAS_Z14),)
77Z14_TESTS=vfminmax
78vfminmax: LDFLAGS+=-lm
79$(Z14_TESTS): CFLAGS+=-march=z14 -O2
80TESTS+=$(Z14_TESTS)
81endif
82
83ifneq ($(CROSS_CC_HAS_Z15),)
84Z15_TESTS=vxeh2_vs
85Z15_TESTS+=vxeh2_vcvt
86Z15_TESTS+=vxeh2_vlstr
87Z15_TESTS+=vxeh2_vstrs
88$(Z15_TESTS): CFLAGS+=-march=z15 -O2
89TESTS+=$(Z15_TESTS)
90endif
91
92ifneq ($(GDB),)
93GDB_SCRIPT=$(SRC_PATH)/tests/guest-debug/run-test.py
94
95run-gdbstub-signals-s390x: signals-s390x
96	$(call run-test, $@, $(GDB_SCRIPT) \
97		--gdb $(GDB) \
98		--qemu $(QEMU) --qargs "$(QEMU_OPTS)" \
99		--bin $< --test $(S390X_SRC)/gdbstub/test-signals-s390x.py, \
100	mixing signals and debugging)
101
102hello-s390x-asm: CFLAGS+=-nostdlib
103
104run-gdbstub-svc: hello-s390x-asm
105	$(call run-test, $@, $(GDB_SCRIPT) \
106		--gdb $(GDB) \
107		--qemu $(QEMU) --qargs "$(QEMU_OPTS)" \
108		--bin $< --test $(S390X_SRC)/gdbstub/test-svc.py, \
109	single-stepping svc)
110
111EXTRA_RUNS += run-gdbstub-signals-s390x run-gdbstub-svc
112endif
113
114# MVX versions of sha512
115sha512-mvx: CFLAGS=-march=z13 -mvx -O3
116sha512-mvx: sha512.c
117	$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
118
119TESTS+=sha512-mvx
120