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