xref: /openbmc/qemu/tests/tcg/aarch64/Makefile.target (revision 39920a04)
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
13
14fcvt: LDFLAGS+=-lm
15
16run-fcvt: fcvt
17	$(call run-test,$<,$(QEMU) $<, "$< on $(TARGET_NAME)")
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.3-a,              CROSS_CC_HAS_ARMV8_3); \
25	    $(call cc-option,-mbranch-protection=standard,  CROSS_CC_HAS_ARMV8_BTI); \
26	    $(call cc-option,-march=armv8.5-a+memtag,       CROSS_CC_HAS_ARMV8_MTE); \
27	    $(call cc-option,-march=armv9-a+sme,            CROSS_CC_HAS_ARMV9_SME)) 3> config-cc.mak
28-include config-cc.mak
29
30# Pauth Tests
31ifneq ($(CROSS_CC_HAS_ARMV8_3),)
32AARCH64_TESTS += pauth-1 pauth-2 pauth-4 pauth-5
33pauth-%: CFLAGS += -march=armv8.3-a
34run-pauth-%: QEMU_OPTS += -cpu max
35endif
36
37# BTI Tests
38# bti-1 tests the elf notes, so we require special compiler support.
39ifneq ($(CROSS_CC_HAS_ARMV8_BTI),)
40AARCH64_TESTS += bti-1 bti-3
41bti-1 bti-3: CFLAGS += -mbranch-protection=standard
42bti-1 bti-3: LDFLAGS += -nostdlib
43endif
44# bti-2 tests PROT_BTI, so no special compiler support required.
45AARCH64_TESTS += bti-2
46
47# MTE Tests
48ifneq ($(CROSS_CC_HAS_ARMV8_MTE),)
49AARCH64_TESTS += mte-1 mte-2 mte-3 mte-4 mte-5 mte-6 mte-7
50mte-%: CFLAGS += -march=armv8.5-a+memtag
51endif
52
53ifneq ($(CROSS_CC_HAS_SVE),)
54# System Registers Tests
55AARCH64_TESTS += sysregs
56ifneq ($(CROSS_CC_HAS_ARMV9_SME),)
57sysregs: CFLAGS+=-march=armv9-a+sme -DHAS_ARMV9_SME
58else
59sysregs: CFLAGS+=-march=armv8.1-a+sve
60endif
61
62# SVE ioctl test
63AARCH64_TESTS += sve-ioctls
64sve-ioctls: CFLAGS+=-march=armv8.1-a+sve
65
66# Vector SHA1
67sha1-vector: CFLAGS=-O3
68sha1-vector: sha1.c
69	$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
70run-sha1-vector: sha1-vector run-sha1
71	$(call run-test, $<, $(QEMU) $(QEMU_OPTS) $<)
72	$(call diff-out, sha1-vector, sha1.out)
73
74TESTS += sha1-vector
75
76# Vector versions of sha512 (-O3 triggers vectorisation)
77sha512-vector: CFLAGS=-O3
78sha512-vector: sha512.c
79	$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
80
81TESTS += sha512-vector
82
83ifeq ($(HOST_GDB_SUPPORTS_ARCH),y)
84GDB_SCRIPT=$(SRC_PATH)/tests/guest-debug/run-test.py
85
86run-gdbstub-sysregs: sysregs
87	$(call run-test, $@, $(GDB_SCRIPT) \
88		--gdb $(HAVE_GDB_BIN) \
89		--qemu $(QEMU) --qargs "$(QEMU_OPTS)" \
90		--bin $< --test $(AARCH64_SRC)/gdbstub/test-sve.py, \
91	basic gdbstub SVE support)
92
93run-gdbstub-sve-ioctls: sve-ioctls
94	$(call run-test, $@, $(GDB_SCRIPT) \
95		--gdb $(HAVE_GDB_BIN) \
96		--qemu $(QEMU) --qargs "$(QEMU_OPTS)" \
97		--bin $< --test $(AARCH64_SRC)/gdbstub/test-sve-ioctl.py, \
98	basic gdbstub SVE ZLEN support)
99
100EXTRA_RUNS += run-gdbstub-sysregs run-gdbstub-sve-ioctls
101endif
102endif
103
104ifneq ($(CROSS_CC_HAS_SVE2),)
105AARCH64_TESTS += test-826
106test-826: CFLAGS+=-march=armv8.1-a+sve2
107endif
108
109TESTS += $(AARCH64_TESTS)
110