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