xref: /openbmc/qemu/tests/tcg/arm/Makefile.target (revision 764a6ee9)
1# -*- Mode: makefile -*-
2#
3# ARM - included from tests/tcg/Makefile
4#
5
6ARM_SRC=$(SRC_PATH)/tests/tcg/arm
7
8# Set search path for all sources
9VPATH 		+= $(ARM_SRC)
10
11config-cc.mak: Makefile
12	$(quiet-@)( \
13	    $(call cc-option,-fno-integrated-as, CROSS_CC_HAS_FNIA)) 3> config-cc.mak
14-include config-cc.mak
15
16float_madds: CFLAGS+=-mfpu=neon-vfpv4
17
18# Basic Hello World
19ARM_TESTS = hello-arm
20hello-arm: CFLAGS+=-marm -ffreestanding -fno-stack-protector
21hello-arm: LDFLAGS+=-nostdlib
22
23# IWMXT floating point extensions
24ARM_TESTS += test-arm-iwmmxt
25# Clang assembler does not support IWMXT, so use the external assembler.
26test-arm-iwmmxt: CFLAGS += -marm -march=iwmmxt -mabi=aapcs -mfpu=fpv4-sp-d16 $(CROSS_CC_HAS_FNIA)
27test-arm-iwmmxt: test-arm-iwmmxt.S
28	$(CC) $(CFLAGS) -Wa,--noexecstack $< -o $@ $(LDFLAGS)
29
30# Float-convert Tests
31ARM_TESTS += fcvt
32fcvt: LDFLAGS += -lm
33fcvt: CFLAGS += -march=armv8.2-a+fp16 -mfpu=neon-fp-armv8
34run-fcvt: fcvt
35	$(call run-test,fcvt,$(QEMU) $<)
36	$(call diff-out,fcvt,$(ARM_SRC)/fcvt.ref)
37
38# PC alignment test
39ARM_TESTS += pcalign-a32
40pcalign-a32: CFLAGS+=-marm
41
42ifeq ($(CONFIG_ARM_COMPATIBLE_SEMIHOSTING),y)
43
44# Semihosting smoke test for linux-user
45semihosting: CFLAGS += -mthumb
46
47ARM_TESTS += semihosting-arm
48semihosting-arm: CFLAGS += -marm -I$(SRC_PATH)/tests/tcg/$(TARGET_NAME)
49semihosting-arm: semihosting.c
50	$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
51
52run-semihosting-arm: semihosting-arm
53	$(call run-test,$<,$(QEMU) $< 2> $<.err)
54
55ARM_TESTS += semiconsole-arm
56
57semiconsole: CFLAGS += -mthumb
58
59semiconsole-arm: CFLAGS += -marm -I$(SRC_PATH)/tests/tcg/$(TARGET_NAME)
60semiconsole-arm: semihosting.c
61	$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
62
63run-semiconsole-arm: semiconsole-arm
64	$(call skip-test, $<, "MANUAL ONLY")
65
66endif
67
68ARM_TESTS += commpage
69
70# Vector SHA1
71sha1-vector: CFLAGS=-O3
72sha1-vector: sha1.c
73	$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
74run-sha1-vector: sha1-vector run-sha1
75	$(call run-test, $<, $(QEMU) $(QEMU_OPTS) $<)
76	$(call diff-out, sha1-vector, sha1.out)
77
78ARM_TESTS += sha1-vector
79
80# Vector versions of sha512 (-O3 triggers vectorisation)
81sha512-vector: CFLAGS=-O3
82sha512-vector: sha512.c
83	$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
84
85ARM_TESTS += sha512-vector
86
87TESTS += $(ARM_TESTS)
88