xbyak/test/test_nm.sh

65 lines
1 KiB
Bash
Raw Normal View History

#!/bin/sh
2011-02-04 00:22:38 -07:00
2022-11-28 07:52:58 -07:00
set -e
FILTER=cat
2022-11-23 20:01:25 -07:00
CXX=${CXX:=g++}
2011-02-04 00:22:38 -07:00
case $1 in
Y)
2010-04-15 18:33:04 -07:00
echo "yasm(32bit)"
EXE=yasm
OPT2="-DUSE_YASM -DXBYAK32"
OPT3=win32
;;
64)
2010-04-15 18:33:04 -07:00
echo "nasm(64bit)"
EXE=nasm
OPT2=-DXBYAK64
OPT3=win64
FILTER=./normalize_prefix
;;
Y64)
2011-03-23 23:48:58 -07:00
echo "yasm(64bit)"
EXE=yasm
OPT2="-DUSE_YASM -DXBYAK64"
OPT3=win64
FILTER=./normalize_prefix
;;
avx512)
2018-02-07 00:41:48 -07:00
echo "nasm(64bit) + avx512"
EXE=nasm
OPT2="-DXBYAK64 -DUSE_AVX512"
OPT3=win64
FILTER=./normalize_prefix
;;
noexcept)
2020-07-20 02:24:34 -07:00
echo "nasm(32bit) without exception"
EXE=nasm
OPT2="-DXBYAK32 -DXBYAK_NO_EXCEPTION"
OPT3=win32
;;
*)
2010-04-15 18:33:04 -07:00
echo "nasm(32bit)"
EXE=nasm
OPT2=-DXBYAK32
OPT3=win32
;;
esac
2010-04-15 18:33:04 -07:00
2022-11-23 19:40:50 -07:00
CFLAGS="-Wall -I../ $OPT2"
2020-07-20 02:24:34 -07:00
echo "compile make_nm.cpp with $CFLAGS"
2022-11-23 19:22:37 -07:00
$CXX $CFLAGS make_nm.cpp -o make_nm
2010-04-15 18:33:04 -07:00
./make_nm > a.asm
echo "asm"
$EXE -f$OPT3 a.asm -l a.lst
awk '$3 != "1+1" {printf "%s", sub(/-$/, "", $3) ? $3 : $3 ORS}' a.lst | $FILTER > ok.lst
2010-04-15 18:33:04 -07:00
echo "xbyak"
./make_nm jit > nm.cpp
echo "compile nm_frame.cpp"
2022-11-23 19:22:37 -07:00
$CXX $CFLAGS -DXBYAK_TEST nm_frame.cpp -o nm_frame
2010-04-15 18:33:04 -07:00
./nm_frame | $FILTER > x.lst
2023-07-26 20:20:24 -07:00
diff -bB ok.lst x.lst && echo "ok"