xbyak/test/Makefile

135 lines
3.2 KiB
Makefile
Raw Normal View History

TARGET = make_nm normalize_prefix bad_address misc cvt_test cvt_test32 noexception misc32 detect_x32 avx10_test
2023-11-07 17:25:41 -07:00
XBYAK_INC=../xbyak/xbyak.h ../xbyak/xbyak_mnemonic.h
2020-05-09 22:20:11 -07:00
UNAME_S=$(shell uname -s)
ifeq ($(shell ./detect_x32),x32)
X32?=1
2022-11-19 19:27:19 -07:00
endif
2012-05-02 23:27:49 -07:00
BIT=32
ifeq ($(shell uname -m),x86_64)
BIT=64
endif
2020-05-09 22:20:11 -07:00
ONLY_64BIT=0
ifeq ($(UNAME_S),Darwin)
# 32-bit binary is not supported
ONLY_64BIT=1
endif
2023-07-26 20:18:31 -07:00
ifeq ($(findstring MINGW64,$(UNAME_S)),MINGW64)
ONLY_64BIT=1
endif
2020-05-09 22:20:11 -07:00
ifeq ($(ONLY_64BIT),0)
TARGET += jmp address
endif
2010-04-15 18:33:04 -07:00
2018-01-05 07:43:07 -07:00
ifeq ($(BIT),64)
TARGET += jmp64 address64 apx
2010-04-15 18:33:04 -07:00
endif
all: $(TARGET)
2022-11-23 19:40:50 -07:00
CFLAGS_WARN=-Wall -Wextra -Wformat=2 -Wcast-qual -Wwrite-strings -Wfloat-equal -Wpointer-arith
2010-04-15 18:33:04 -07:00
2023-07-26 20:18:56 -07:00
CFLAGS=-O2 -Wall -I.. -I. $(CFLAGS_WARN) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) #-std=c++0x
2010-04-15 18:33:04 -07:00
make_nm:
2012-03-15 23:44:04 -07:00
$(CXX) $(CFLAGS) make_nm.cpp -o $@
2023-11-07 17:25:41 -07:00
normalize_prefix: normalize_prefix.cpp $(XBYAK_INC)
2012-03-15 23:44:04 -07:00
$(CXX) $(CFLAGS) normalize_prefix.cpp -o $@
2023-11-07 17:25:41 -07:00
test_mmx: test_mmx.cpp $(XBYAK_INC)
2012-03-15 23:44:04 -07:00
$(CXX) $(CFLAGS) test_mmx.cpp -o $@ -lpthread
2023-11-07 17:25:41 -07:00
jmp: jmp.cpp $(XBYAK_INC)
2012-03-19 08:07:29 -07:00
$(CXX) $(CFLAGS) jmp.cpp -o $@ -m32
2023-11-07 17:25:41 -07:00
jmp64: jmp.cpp $(XBYAK_INC)
2013-03-24 20:08:13 -07:00
$(CXX) $(CFLAGS) jmp.cpp -o $@ -m64
2023-11-07 17:25:41 -07:00
address: address.cpp $(XBYAK_INC)
2012-05-02 23:27:49 -07:00
$(CXX) $(CFLAGS) address.cpp -o $@ -m32
2023-11-07 17:25:41 -07:00
address64: address.cpp $(XBYAK_INC)
2013-03-12 23:22:35 -07:00
$(CXX) $(CFLAGS) address.cpp -o $@ -m64
2023-11-07 17:25:41 -07:00
bad_address: bad_address.cpp $(XBYAK_INC)
2013-07-29 23:00:07 -07:00
$(CXX) $(CFLAGS) bad_address.cpp -o $@
2023-11-07 17:25:41 -07:00
misc: misc.cpp $(XBYAK_INC)
2015-04-24 15:47:44 -07:00
$(CXX) $(CFLAGS) misc.cpp -o $@
2023-11-07 17:25:41 -07:00
misc32: misc.cpp $(XBYAK_INC)
2022-03-12 22:57:56 -07:00
$(CXX) $(CFLAGS) misc.cpp -o $@ -DXBYAK32
2023-11-07 17:25:41 -07:00
cvt_test: cvt_test.cpp $(XBYAK_INC)
2019-04-15 05:44:11 -07:00
$(CXX) $(CFLAGS) $< -o $@
2023-11-07 17:25:41 -07:00
cvt_test32: cvt_test.cpp $(XBYAK_INC)
2019-04-15 05:44:11 -07:00
$(CXX) $(CFLAGS) $< -o $@ -DXBYAK32
2023-11-07 17:25:41 -07:00
noexception: noexception.cpp $(XBYAK_INC)
2020-07-20 02:24:34 -07:00
$(CXX) $(CFLAGS) $< -o $@ -fno-exceptions
2023-11-07 17:25:41 -07:00
apx: apx.cpp $(XBYAK_INC)
2023-10-12 17:45:33 -07:00
$(CXX) $(CFLAGS) apx.cpp -o $@
avx10_test: avx10_test.cpp $(XBYAK_INC)
$(CXX) $(CFLAGS) avx10_test.cpp -o $@ -DXBYAK64
2010-04-15 18:33:04 -07:00
TEST_FILES=old.txt new-ymm.txt bf16.txt comp.txt misc.txt convert.txt minmax.txt saturation.txt
2024-10-09 19:14:21 -07:00
xed_test:
2024-10-14 02:04:25 -07:00
@set -e; \
for target in $(addprefix avx10/, $(TEST_FILES)); do \
./test_by_xed.sh $$target || exit 1; \
done
2024-10-09 19:14:21 -07:00
2020-05-09 22:20:11 -07:00
test_nm: normalize_prefix $(TARGET)
2017-07-11 23:15:22 -07:00
$(MAKE) -C ../gen
2020-05-09 22:20:11 -07:00
ifneq ($(ONLY_64BIT),1)
2022-11-28 07:52:58 -07:00
CXX=$(CXX) ./test_nm.sh
CXX=$(CXX) ./test_nm.sh noexcept
CXX=$(CXX) ./test_nm.sh Y
CXX=$(CXX) ./test_nm.sh avx512
CXX=$(CXX) ./test_address.sh
./jmp
2020-05-09 22:20:11 -07:00
./cvt_test32
endif
2013-07-29 23:00:07 -07:00
./bad_address
2017-08-18 04:15:48 -07:00
./misc
2022-03-12 22:57:56 -07:00
./misc32
2019-04-15 05:44:11 -07:00
./cvt_test
2013-03-12 23:22:35 -07:00
ifeq ($(BIT),64)
2022-11-28 07:52:58 -07:00
CXX=$(CXX) ./test_address.sh 64
2022-11-19 19:27:19 -07:00
ifneq ($(X32),1)
2022-11-28 07:52:58 -07:00
CXX=$(CXX) ./test_nm.sh 64
CXX=$(CXX) ./test_nm.sh Y64
2022-11-19 19:27:19 -07:00
endif
2013-03-12 23:22:35 -07:00
./jmp64
./apx
./avx10_test
2013-03-12 23:22:35 -07:00
endif
2010-04-15 18:33:04 -07:00
2012-05-02 23:27:49 -07:00
test_avx: normalize_prefix
2020-05-09 22:20:11 -07:00
ifneq ($(ONLY_64BIT),0)
2022-11-28 07:52:58 -07:00
CXX=$(CXX) ./test_avx.sh
CXX=$(CXX) ./test_avx.sh Y
2020-05-09 22:20:11 -07:00
endif
2013-03-12 23:22:35 -07:00
ifeq ($(BIT),64)
2022-11-28 07:52:58 -07:00
CXX=$(CXX) ./test_avx.sh 64
2022-11-19 19:27:19 -07:00
ifneq ($(X32),1)
2022-11-28 07:52:58 -07:00
CXX=$(CXX) ./test_avx.sh Y64
2013-03-12 23:22:35 -07:00
endif
2022-11-19 19:27:19 -07:00
endif
2013-03-12 23:22:35 -07:00
2016-06-08 19:46:11 -07:00
test_avx512: normalize_prefix
2020-05-09 22:20:11 -07:00
ifneq ($(ONLY_64BIT),0)
2022-11-28 07:52:58 -07:00
CXX=$(CXX) ./test_avx512.sh
2020-05-09 22:20:11 -07:00
endif
2016-06-26 06:07:18 -07:00
ifeq ($(BIT),64)
2022-11-28 07:52:58 -07:00
CXX=$(CXX) ./test_avx512.sh 64
2016-06-26 06:07:18 -07:00
endif
2020-01-03 06:13:55 -07:00
test_avx10: avx10_test
./avx10_test
detect_x32: detect_x32.c
$(CC) $< -o $@
test: detect_x32
2020-01-03 06:13:55 -07:00
$(MAKE) test_nm
$(MAKE) test_avx
$(MAKE) test_avx512
2010-04-15 18:33:04 -07:00
clean:
2024-10-09 19:14:21 -07:00
$(RM) a.asm *.lst *.obj *.o $(TARGET) lib_run nm.cpp nm_frame make_512 avx10_test detect_x32
2010-04-15 18:33:04 -07:00
lib_run: lib_test.cpp lib_run.cpp lib.h
2012-12-02 05:28:30 -07:00
$(CXX) $(CFLAGS) lib_run.cpp lib_test.cpp -o lib_run
2010-04-15 18:33:04 -07:00
make_nm: make_nm.cpp $(XBYAK_INC)
2023-08-01 17:42:22 -07:00
.PHONY: test