| 1 | # |
| 2 | # Test program for MIPS64R6 CRC32 instructions |
| 3 | # |
| 4 | # Copyright (C) 2025 Aleksandar Rakic <aleksandar.rakic@htecgroup.com> |
| 5 | # |
| 6 | # SPDX-License-Identifier: GPL-2.0-or-later |
| 7 | # |
| 8 | |
| 9 | ifndef PREFIX |
| 10 | $(error "PREFIX not set, please export GNU Toolchain install directory.") |
| 11 | endif |
| 12 | |
| 13 | ifndef SYSROOT |
| 14 | $(error "SYSROOT not set, please export GNU Toolchain system root directory.") |
| 15 | endif |
| 16 | |
| 17 | SIM = ../../../../../../../build/qemu-mips64 |
| 18 | SIM_FLAGS = -L $(SYSROOT) |
| 19 | |
| 20 | CC = $(PREFIX)/bin/mips64-r6-linux-gnu-gcc |
| 21 | |
| 22 | TESTCASES = test_mips64r6_crc32b.tst |
| 23 | TESTCASES += test_mips64r6_crc32h.tst |
| 24 | TESTCASES += test_mips64r6_crc32w.tst |
| 25 | TESTCASES += test_mips64r6_crc32d.tst |
| 26 | TESTCASES += test_mips64r6_crc32cb.tst |
| 27 | TESTCASES += test_mips64r6_crc32ch.tst |
| 28 | TESTCASES += test_mips64r6_crc32cw.tst |
| 29 | TESTCASES += test_mips64r6_crc32cd.tst |
| 30 | |
| 31 | all: $(TESTCASES) |
| 32 | @for case in $(TESTCASES); do \ |
| 33 | echo $(SIM) $(SIM_FLAGS) ./$$case; \ |
| 34 | $(SIM) $(SIM_FLAGS) ./$$case; \ |
| 35 | echo $(RM) -rf ./$$case; \ |
| 36 | $(RM) -rf ./$$case; \ |
| 37 | done |
| 38 | |
| 39 | %.tst: %.c |
| 40 | $(CC) $< -o $@ |