xref: /openbmc/qemu/tests/tcg/hexagon/Makefile.target (revision 764a6ee9)
1##
2##  Copyright(c) 2019-2023 Qualcomm Innovation Center, Inc. All Rights Reserved.
3##
4##  This program is free software; you can redistribute it and/or modify
5##  it under the terms of the GNU General Public License as published by
6##  the Free Software Foundation; either version 2 of the License, or
7##  (at your option) any later version.
8##
9##  This program is distributed in the hope that it will be useful,
10##  but WITHOUT ANY WARRANTY; without even the implied warranty of
11##  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12##  GNU General Public License for more details.
13##
14##  You should have received a copy of the GNU General Public License
15##  along with this program; if not, see <http://www.gnu.org/licenses/>.
16##
17
18# Hexagon doesn't support gdb, so skip the EXTRA_RUNS
19EXTRA_RUNS =
20
21CFLAGS += -Wno-incompatible-pointer-types -Wno-undefined-internal
22CFLAGS += -fno-unroll-loops -fno-stack-protector
23
24HEX_SRC=$(SRC_PATH)/tests/tcg/hexagon
25VPATH += $(HEX_SRC)
26
27%: $(HEX_SRC)/%.S $(HEX_SRC)/crt.S
28	$(CC) -static -mv67 -nostdlib $^ -o $@
29
30HEX_TESTS = first
31HEX_TESTS += hex_sigsegv
32HEX_TESTS += misc
33HEX_TESTS += usr
34HEX_TESTS += preg_alias
35HEX_TESTS += dual_stores
36HEX_TESTS += multi_result
37HEX_TESTS += mem_noshuf
38HEX_TESTS += mem_noshuf_exception
39HEX_TESTS += circ
40HEX_TESTS += brev
41HEX_TESTS += load_unpack
42HEX_TESTS += load_align
43HEX_TESTS += atomics
44HEX_TESTS += fpstuff
45HEX_TESTS += overflow
46HEX_TESTS += signal_context
47HEX_TESTS += reg_mut
48HEX_TESTS += read_write_overlap
49HEX_TESTS += vector_add_int
50HEX_TESTS += scatter_gather
51HEX_TESTS += hvx_misc
52HEX_TESTS += hvx_histogram
53HEX_TESTS += invalid-slots
54HEX_TESTS += unaligned_pc
55
56run-and-check-exception = $(call run-test,$2,$3 2>$2.stderr; \
57	test $$? -eq 1 && grep -q "exception $(strip $1)" $2.stderr)
58
59run-invalid-slots: invalid-slots
60	$(call run-and-check-exception, 0x15, $@, $(QEMU) $(QEMU_OPTS) $<)
61
62HEX_TESTS += test_abs
63HEX_TESTS += test_bitcnt
64HEX_TESTS += test_bitsplit
65HEX_TESTS += test_call
66HEX_TESTS += test_clobber
67HEX_TESTS += test_cmp
68HEX_TESTS += test_dotnew
69HEX_TESTS += test_ext
70HEX_TESTS += test_fibonacci
71HEX_TESTS += test_hl
72HEX_TESTS += test_hwloops
73HEX_TESTS += test_jmp
74HEX_TESTS += test_lsr
75HEX_TESTS += test_mpyi
76HEX_TESTS += test_packet
77HEX_TESTS += test_reorder
78HEX_TESTS += test_round
79HEX_TESTS += test_vavgw
80HEX_TESTS += test_vcmpb
81HEX_TESTS += test_vcmpw
82HEX_TESTS += test_vlsrw
83HEX_TESTS += test_vmaxh
84HEX_TESTS += test_vminh
85HEX_TESTS += test_vpmpyh
86HEX_TESTS += test_vspliceb
87
88HEX_TESTS += v68_scalar
89HEX_TESTS += v68_hvx
90HEX_TESTS += v69_hvx
91HEX_TESTS += v73_scalar
92
93TESTS += $(HEX_TESTS)
94
95atomics: atomics.c hex_test.h
96brev: brev.c hex_test.h
97circ: circ.c hex_test.h
98dual_stores: dual_stores.c hex_test.h
99fpstuff: fpstuff.c hex_test.h
100hex_sigsegv: hex_sigsegv.c hex_test.h
101load_align: load_align.c hex_test.h
102load_unpack: load_unpack.c hex_test.h
103mem_noshuf_exception: mem_noshuf_exception.c hex_test.h
104mem_noshuf: mem_noshuf.c hex_test.h
105misc: misc.c hex_test.h
106multi_result: multi_result.c hex_test.h
107overflow: overflow.c hex_test.h
108preg_alias: preg_alias.c hex_test.h
109read_write_overlap: read_write_overlap.c hex_test.h
110reg_mut: reg_mut.c hex_test.h
111unaligned_pc: unaligned_pc.c
112
113# This test has to be compiled for the -mv67t target
114usr: usr.c hex_test.h
115	$(CC) $(CFLAGS) -mv67t -O2 -Wno-inline-asm -Wno-expansion-to-defined $< -o $@ $(LDFLAGS)
116
117# Build this test with -mv71 to exercise the CABAC instruction
118misc: misc.c
119	$(CC) $(CFLAGS) -mv71 -O2 $< -o $@ $(LDFLAGS)
120scatter_gather: CFLAGS += -mhvx
121vector_add_int: CFLAGS += -mhvx -fvectorize
122hvx_misc: hvx_misc.c hvx_misc.h
123hvx_misc: CFLAGS += -mhvx
124hvx_histogram: CFLAGS += -mhvx -Wno-gnu-folding-constant
125v68_hvx: v68_hvx.c hvx_misc.h v6mpy_ref.c.inc
126v68_hvx: CFLAGS += -mhvx -Wno-unused-function
127v69_hvx: v69_hvx.c hvx_misc.h
128v69_hvx: CFLAGS += -mhvx -Wno-unused-function
129v73_scalar: CFLAGS += -Wno-unused-function
130
131hvx_histogram: hvx_histogram.c hvx_histogram_row.S
132	$(CC) $(CFLAGS) $(CROSS_CC_GUEST_CFLAGS) $^ -o $@ $(LDFLAGS)
133