xref: /openbmc/qemu/tests/tcg/aarch64/Makefile.target (revision 414b180d)
1# -*- Mode: makefile -*-
2#
3# AArch64 specific tweaks
4
5ARM_SRC=$(SRC_PATH)/tests/tcg/arm
6VPATH 		+= $(ARM_SRC)
7
8AARCH64_SRC=$(SRC_PATH)/tests/tcg/aarch64
9VPATH 		+= $(AARCH64_SRC)
10
11# Base architecture tests
12AARCH64_TESTS=fcvt pcalign-a64 lse2-fault
13AARCH64_TESTS += test-2248 test-2150
14
15fcvt: LDFLAGS+=-lm
16
17run-fcvt: fcvt
18	$(call run-test,$<,$(QEMU) $<)
19	$(call diff-out,$<,$(AARCH64_SRC)/fcvt.ref)
20
21config-cc.mak: Makefile
22	$(quiet-@)( \
23	    $(call cc-option,-march=armv8.1-a+sve,          CROSS_CC_HAS_SVE); \
24	    $(call cc-option,-march=armv8.1-a+sve2,         CROSS_CC_HAS_SVE2); \
25	    $(call cc-option,-march=armv8.2-a,              CROSS_CC_HAS_ARMV8_2); \
26	    $(call cc-option,-march=armv8.3-a,              CROSS_CC_HAS_ARMV8_3); \
27	    $(call cc-option,-march=armv8.5-a,              CROSS_CC_HAS_ARMV8_5); \
28	    $(call cc-option,-mbranch-protection=standard,  CROSS_CC_HAS_ARMV8_BTI); \
29	    $(call cc-option,-march=armv8.5-a+memtag,       CROSS_CC_HAS_ARMV8_MTE); \
30	    $(call cc-option,-Wa$(COMMA)-march=armv9-a+sme, CROSS_AS_HAS_ARMV9_SME)) 3> config-cc.mak
31-include config-cc.mak
32
33ifneq ($(CROSS_CC_HAS_ARMV8_2),)
34AARCH64_TESTS += dcpop
35dcpop: CFLAGS += -march=armv8.2-a
36endif
37ifneq ($(CROSS_CC_HAS_ARMV8_5),)
38AARCH64_TESTS += dcpodp
39dcpodp: CFLAGS += -march=armv8.5-a
40endif
41
42# Pauth Tests
43ifneq ($(CROSS_CC_HAS_ARMV8_3),)
44AARCH64_TESTS += pauth-1 pauth-2 pauth-4 pauth-5 test-2375
45pauth-%: CFLAGS += -march=armv8.3-a
46test-2375: CFLAGS += -march=armv8.3-a
47run-pauth-1: QEMU_OPTS += -cpu max
48run-pauth-2: QEMU_OPTS += -cpu max
49# Choose a cpu with FEAT_Pauth but without FEAT_FPAC for pauth-[45].
50run-pauth-4: QEMU_OPTS += -cpu neoverse-v1
51run-pauth-5: QEMU_OPTS += -cpu neoverse-v1
52endif
53
54# BTI Tests
55# bti-1 tests the elf notes, so we require special compiler support.
56ifneq ($(CROSS_CC_HAS_ARMV8_BTI),)
57AARCH64_TESTS += bti-1 bti-3
58bti-1 bti-3: CFLAGS += -fno-stack-protector -mbranch-protection=standard
59bti-1 bti-3: LDFLAGS += -nostdlib
60endif
61# bti-2 tests PROT_BTI, so no special compiler support required.
62AARCH64_TESTS += bti-2
63
64# MTE Tests
65ifneq ($(CROSS_CC_HAS_ARMV8_MTE),)
66AARCH64_TESTS += mte-1 mte-2 mte-3 mte-4 mte-5 mte-6 mte-7
67mte-%: CFLAGS += -march=armv8.5-a+memtag
68endif
69
70# SME Tests
71ifneq ($(CROSS_AS_HAS_ARMV9_SME),)
72AARCH64_TESTS += sme-outprod1 sme-smopa-1 sme-smopa-2
73endif
74
75# System Registers Tests
76AARCH64_TESTS += sysregs
77
78AARCH64_TESTS += test-aes
79test-aes: CFLAGS += -O -march=armv8-a+aes
80test-aes: test-aes-main.c.inc
81
82# Vector SHA1
83sha1-vector: CFLAGS=-O3
84sha1-vector: sha1.c
85	$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
86run-sha1-vector: sha1-vector run-sha1
87	$(call run-test, $<, $(QEMU) $(QEMU_OPTS) $<)
88	$(call diff-out, sha1-vector, sha1.out)
89
90TESTS += sha1-vector
91
92# Vector versions of sha512 (-O3 triggers vectorisation)
93sha512-vector: CFLAGS=-O3
94sha512-vector: sha512.c
95	$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
96
97TESTS += sha512-vector
98
99ifneq ($(CROSS_CC_HAS_SVE),)
100# SVE ioctl test
101AARCH64_TESTS += sve-ioctls
102sve-ioctls: CFLAGS+=-march=armv8.1-a+sve
103
104sha512-sve: CFLAGS=-O3 -march=armv8.1-a+sve
105sha512-sve: sha512.c
106	$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
107
108sve-str: CFLAGS=-O1 -march=armv8.1-a+sve
109sve-str: sve-str.c
110	$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
111
112TESTS += sha512-sve sve-str
113
114ifneq ($(GDB),)
115GDB_SCRIPT=$(SRC_PATH)/tests/guest-debug/run-test.py
116
117run-gdbstub-sysregs: sysregs
118	$(call run-test, $@, $(GDB_SCRIPT) \
119		--gdb $(GDB) \
120		--qemu $(QEMU) --qargs "$(QEMU_OPTS)" \
121		--bin $< --test $(AARCH64_SRC)/gdbstub/test-sve.py, \
122	basic gdbstub SVE support)
123
124run-gdbstub-sve-ioctls: sve-ioctls
125	$(call run-test, $@, $(GDB_SCRIPT) \
126		--gdb $(GDB) \
127		--qemu $(QEMU) --qargs "$(QEMU_OPTS)" \
128		--bin $< --test $(AARCH64_SRC)/gdbstub/test-sve-ioctl.py, \
129	basic gdbstub SVE ZLEN support)
130
131EXTRA_RUNS += run-gdbstub-sysregs run-gdbstub-sve-ioctls
132endif
133endif
134
135ifneq ($(CROSS_CC_HAS_SVE2),)
136AARCH64_TESTS += test-826
137test-826: CFLAGS+=-march=armv8.1-a+sve2
138endif
139
140TESTS += $(AARCH64_TESTS)
141