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