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