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