xref: /openbmc/qemu/tests/tcg/hexagon/Makefile.target (revision 593aab332f048347bd19893071caf44e1fb742ff)
1dff2441cSTaylor Simpson##
21c629814STaylor Simpson##  Copyright(c) 2019-2023 Qualcomm Innovation Center, Inc. All Rights Reserved.
3dff2441cSTaylor Simpson##
4dff2441cSTaylor Simpson##  This program is free software; you can redistribute it and/or modify
5dff2441cSTaylor Simpson##  it under the terms of the GNU General Public License as published by
6dff2441cSTaylor Simpson##  the Free Software Foundation; either version 2 of the License, or
7dff2441cSTaylor Simpson##  (at your option) any later version.
8dff2441cSTaylor Simpson##
9dff2441cSTaylor Simpson##  This program is distributed in the hope that it will be useful,
10dff2441cSTaylor Simpson##  but WITHOUT ANY WARRANTY; without even the implied warranty of
11dff2441cSTaylor Simpson##  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12dff2441cSTaylor Simpson##  GNU General Public License for more details.
13dff2441cSTaylor Simpson##
14dff2441cSTaylor Simpson##  You should have received a copy of the GNU General Public License
15dff2441cSTaylor Simpson##  along with this program; if not, see <http://www.gnu.org/licenses/>.
16dff2441cSTaylor Simpson##
17dff2441cSTaylor Simpson
18dff2441cSTaylor Simpson# Hexagon doesn't support gdb, so skip the EXTRA_RUNS
19dff2441cSTaylor SimpsonEXTRA_RUNS =
20dff2441cSTaylor Simpson
21dff2441cSTaylor SimpsonCFLAGS += -Wno-incompatible-pointer-types -Wno-undefined-internal
22580731dcSAkihiko OdakiCFLAGS += -fno-unroll-loops -fno-stack-protector
23825d6ebaSTaylor Simpson
24825d6ebaSTaylor SimpsonHEX_SRC=$(SRC_PATH)/tests/tcg/hexagon
25825d6ebaSTaylor SimpsonVPATH += $(HEX_SRC)
26825d6ebaSTaylor Simpson
27585a86b1SNiccolò Izzo%: $(HEX_SRC)/%.S $(HEX_SRC)/crt.S
28825d6ebaSTaylor Simpson	$(CC) -static -mv67 -nostdlib $^ -o $@
29825d6ebaSTaylor Simpson
30825d6ebaSTaylor SimpsonHEX_TESTS = first
31c23b5764STaylor SimpsonHEX_TESTS += hex_sigsegv
32825d6ebaSTaylor SimpsonHEX_TESTS += misc
334d04395aSTaylor SimpsonHEX_TESTS += usr
34825d6ebaSTaylor SimpsonHEX_TESTS += preg_alias
35825d6ebaSTaylor SimpsonHEX_TESTS += dual_stores
36d934c16dSTaylor SimpsonHEX_TESTS += multi_result
37825d6ebaSTaylor SimpsonHEX_TESTS += mem_noshuf
3815fc6badSTaylor SimpsonHEX_TESTS += mem_noshuf_exception
3946ef47e2STaylor SimpsonHEX_TESTS += circ
40af7f1821STaylor SimpsonHEX_TESTS += brev
410d0b91a8STaylor SimpsonHEX_TESTS += load_unpack
427aa9ffabSTaylor SimpsonHEX_TESTS += load_align
43825d6ebaSTaylor SimpsonHEX_TESTS += atomics
44703c08d9STaylor SimpsonHEX_TESTS += fpstuff
45b9dd6ff9STaylor SimpsonHEX_TESTS += overflow
46c979d901SMukilan ThiyagarajanHEX_TESTS += signal_context
47d63aeb3bSMarco LiebelHEX_TESTS += reg_mut
4800e64fdaSTaylor SimpsonHEX_TESTS += read_write_overlap
491c629814STaylor SimpsonHEX_TESTS += vector_add_int
501c629814STaylor SimpsonHEX_TESTS += scatter_gather
511c629814STaylor SimpsonHEX_TESTS += hvx_misc
521c629814STaylor SimpsonHEX_TESTS += hvx_histogram
5314edcf11SMatheus Tavares BernardinoHEX_TESTS += invalid-slots
54*e1b526f1SMatheus Tavares BernardinoHEX_TESTS += unaligned_pc
5514edcf11SMatheus Tavares Bernardino
5614edcf11SMatheus Tavares Bernardinorun-and-check-exception = $(call run-test,$2,$3 2>$2.stderr; \
5714edcf11SMatheus Tavares Bernardino	test $$? -eq 1 && grep -q "exception $(strip $1)" $2.stderr)
5814edcf11SMatheus Tavares Bernardino
5914edcf11SMatheus Tavares Bernardinorun-invalid-slots: invalid-slots
6014edcf11SMatheus Tavares Bernardino	$(call run-and-check-exception, 0x15, $@, $(QEMU) $(QEMU_OPTS) $<)
61825d6ebaSTaylor Simpson
62585a86b1SNiccolò IzzoHEX_TESTS += test_abs
63585a86b1SNiccolò IzzoHEX_TESTS += test_bitcnt
64585a86b1SNiccolò IzzoHEX_TESTS += test_bitsplit
65585a86b1SNiccolò IzzoHEX_TESTS += test_call
66585a86b1SNiccolò IzzoHEX_TESTS += test_clobber
67585a86b1SNiccolò IzzoHEX_TESTS += test_cmp
68585a86b1SNiccolò IzzoHEX_TESTS += test_dotnew
69585a86b1SNiccolò IzzoHEX_TESTS += test_ext
70585a86b1SNiccolò IzzoHEX_TESTS += test_fibonacci
71585a86b1SNiccolò IzzoHEX_TESTS += test_hl
72585a86b1SNiccolò IzzoHEX_TESTS += test_hwloops
73585a86b1SNiccolò IzzoHEX_TESTS += test_jmp
74585a86b1SNiccolò IzzoHEX_TESTS += test_lsr
75585a86b1SNiccolò IzzoHEX_TESTS += test_mpyi
76585a86b1SNiccolò IzzoHEX_TESTS += test_packet
77585a86b1SNiccolò IzzoHEX_TESTS += test_reorder
78585a86b1SNiccolò IzzoHEX_TESTS += test_round
79585a86b1SNiccolò IzzoHEX_TESTS += test_vavgw
80585a86b1SNiccolò IzzoHEX_TESTS += test_vcmpb
81585a86b1SNiccolò IzzoHEX_TESTS += test_vcmpw
82585a86b1SNiccolò IzzoHEX_TESTS += test_vlsrw
83585a86b1SNiccolò IzzoHEX_TESTS += test_vmaxh
84585a86b1SNiccolò IzzoHEX_TESTS += test_vminh
85585a86b1SNiccolò IzzoHEX_TESTS += test_vpmpyh
86585a86b1SNiccolò IzzoHEX_TESTS += test_vspliceb
87585a86b1SNiccolò Izzo
88860132e2STaylor SimpsonHEX_TESTS += v68_scalar
89d636fb70STaylor SimpsonHEX_TESTS += v68_hvx
906c61d4e1STaylor SimpsonHEX_TESTS += v69_hvx
914dd311edSTaylor SimpsonHEX_TESTS += v73_scalar
92860132e2STaylor Simpson
93825d6ebaSTaylor SimpsonTESTS += $(HEX_TESTS)
944d04395aSTaylor Simpson
950d57cd61STaylor Simpsonatomics: atomics.c hex_test.h
960d57cd61STaylor Simpsonbrev: brev.c hex_test.h
970d57cd61STaylor Simpsoncirc: circ.c hex_test.h
980d57cd61STaylor Simpsondual_stores: dual_stores.c hex_test.h
990d57cd61STaylor Simpsonfpstuff: fpstuff.c hex_test.h
1000d57cd61STaylor Simpsonhex_sigsegv: hex_sigsegv.c hex_test.h
1010d57cd61STaylor Simpsonload_align: load_align.c hex_test.h
1020d57cd61STaylor Simpsonload_unpack: load_unpack.c hex_test.h
1030d57cd61STaylor Simpsonmem_noshuf_exception: mem_noshuf_exception.c hex_test.h
1040d57cd61STaylor Simpsonmem_noshuf: mem_noshuf.c hex_test.h
1050d57cd61STaylor Simpsonmisc: misc.c hex_test.h
1060d57cd61STaylor Simpsonmulti_result: multi_result.c hex_test.h
1070d57cd61STaylor Simpsonoverflow: overflow.c hex_test.h
1080d57cd61STaylor Simpsonpreg_alias: preg_alias.c hex_test.h
1090d57cd61STaylor Simpsonread_write_overlap: read_write_overlap.c hex_test.h
1100d57cd61STaylor Simpsonreg_mut: reg_mut.c hex_test.h
111*e1b526f1SMatheus Tavares Bernardinounaligned_pc: unaligned_pc.c
1120d57cd61STaylor Simpson
1134d04395aSTaylor Simpson# This test has to be compiled for the -mv67t target
1140d57cd61STaylor Simpsonusr: usr.c hex_test.h
1154d04395aSTaylor Simpson	$(CC) $(CFLAGS) -mv67t -O2 -Wno-inline-asm -Wno-expansion-to-defined $< -o $@ $(LDFLAGS)
1164d04395aSTaylor Simpson
117fc2622f6STaylor Simpson# Build this test with -mv71 to exercise the CABAC instruction
118fc2622f6STaylor Simpsonmisc: misc.c
119fc2622f6STaylor Simpson	$(CC) $(CFLAGS) -mv71 -O2 $< -o $@ $(LDFLAGS)
1201c629814STaylor Simpsonscatter_gather: CFLAGS += -mhvx
1211c629814STaylor Simpsonvector_add_int: CFLAGS += -mhvx -fvectorize
122761e1c67STaylor Simpsonhvx_misc: hvx_misc.c hvx_misc.h
1231c629814STaylor Simpsonhvx_misc: CFLAGS += -mhvx
1241c629814STaylor Simpsonhvx_histogram: CFLAGS += -mhvx -Wno-gnu-folding-constant
125d636fb70STaylor Simpsonv68_hvx: v68_hvx.c hvx_misc.h v6mpy_ref.c.inc
126d636fb70STaylor Simpsonv68_hvx: CFLAGS += -mhvx -Wno-unused-function
1276c61d4e1STaylor Simpsonv69_hvx: v69_hvx.c hvx_misc.h
1286c61d4e1STaylor Simpsonv69_hvx: CFLAGS += -mhvx -Wno-unused-function
1294dd311edSTaylor Simpsonv73_scalar: CFLAGS += -Wno-unused-function
1301c629814STaylor Simpson
1311c629814STaylor Simpsonhvx_histogram: hvx_histogram.c hvx_histogram_row.S
1321c629814STaylor Simpson	$(CC) $(CFLAGS) $(CROSS_CC_GUEST_CFLAGS) $^ -o $@ $(LDFLAGS)
133