1 # -*- Mode: makefile -*-
3 # AArch64 specific tweaks
5 ARM_SRC=$(SRC_PATH)/tests/tcg/arm
8 AARCH64_SRC=$(SRC_PATH)/tests/tcg/aarch64
9 VPATH += $(AARCH64_SRC)
11 # Base architecture tests
12 AARCH64_TESTS=fcvt pcalign-a64
17 $(call run-test,$<,$(QEMU) $<, "$< on $(TARGET_NAME)")
18 $(call diff-out,$<,$(AARCH64_SRC)/fcvt.ref)
20 config-cc.mak: Makefile
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
31 ifneq ($(CROSS_CC_HAS_ARMV8_3),)
32 AARCH64_TESTS += pauth-1 pauth-2 pauth-4 pauth-5
33 pauth-%: CFLAGS += -march=armv8.3-a
34 run-pauth-%: QEMU_OPTS += -cpu max
35 run-plugin-pauth-%: QEMU_OPTS += -cpu max
39 # bti-1 tests the elf notes, so we require special compiler support.
40 ifneq ($(CROSS_CC_HAS_ARMV8_BTI),)
41 AARCH64_TESTS += bti-1 bti-3
42 bti-1 bti-3: CFLAGS += -mbranch-protection=standard
43 bti-1 bti-3: LDFLAGS += -nostdlib
45 # bti-2 tests PROT_BTI, so no special compiler support required.
46 AARCH64_TESTS += bti-2
49 ifneq ($(CROSS_CC_HAS_ARMV8_MTE),)
50 AARCH64_TESTS += mte-1 mte-2 mte-3 mte-4 mte-5 mte-6 mte-7
51 mte-%: CFLAGS += -march=armv8.5-a+memtag
54 ifneq ($(CROSS_CC_HAS_SVE),)
55 # System Registers Tests
56 AARCH64_TESTS += sysregs
57 ifneq ($(CROSS_CC_HAS_ARMV9_SME),)
58 sysregs: CFLAGS+=-march=armv9-a+sme -DHAS_ARMV9_SME
60 sysregs: CFLAGS+=-march=armv8.1-a+sve
64 AARCH64_TESTS += sve-ioctls
65 sve-ioctls: CFLAGS+=-march=armv8.1-a+sve
68 sha1-vector: CFLAGS=-O3
70 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
71 run-sha1-vector: sha1-vector run-sha1
72 $(call run-test, $<, $(QEMU) $(QEMU_OPTS) $<)
73 $(call diff-out, sha1-vector, sha1.out)
77 # Vector versions of sha512 (-O3 triggers vectorisation)
78 sha512-vector: CFLAGS=-O3
79 sha512-vector: sha512.c
80 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
82 TESTS += sha512-vector
84 ifneq ($(HAVE_GDB_BIN),)
85 GDB_SCRIPT=$(SRC_PATH)/tests/guest-debug/run-test.py
87 run-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)
94 run-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)
101 EXTRA_RUNS += run-gdbstub-sysregs run-gdbstub-sve-ioctls
105 ifneq ($(CROSS_CC_HAS_SVE2),)
106 AARCH64_TESTS += test-826
107 test-826: CFLAGS+=-march=armv8.1-a+sve2
110 TESTS += $(AARCH64_TESTS)