xbyak/test/test_avx.sh

52 lines
849 B
Bash
Raw Normal View History

#!/bin/sh
2012-03-16 06:04:44 -07:00
2022-11-28 07:52:58 -07:00
set -e
FILTER="grep -v warning"
2022-11-23 20:01:25 -07:00
CXX=${CXX:=g++}
2012-03-16 06:04:44 -07:00
case $1 in
Y)
2012-03-16 06:04:44 -07:00
echo "yasm(32bit)"
EXE=yasm
OPT2="-DUSE_YASM -DXBYAK32"
OPT3=win32
;;
64)
2012-03-16 06:04:44 -07:00
echo "nasm(64bit)"
EXE=nasm
OPT2=-DXBYAK64
OPT3=win64
FILTER=./normalize_prefix
;;
Y64)
2012-03-16 06:04:44 -07:00
echo "yasm(64bit)"
EXE=yasm
OPT2="-DUSE_YASM -DXBYAK64"
OPT3=win64
FILTER=./normalize_prefix
;;
*)
2012-03-16 06:04:44 -07:00
echo "nasm(32bit)"
EXE=nasm
OPT2=-DXBYAK32
OPT3=win32
;;
esac
2012-03-16 06:04:44 -07:00
2022-11-23 19:40:50 -07:00
CFLAGS="-Wall -I../ $OPT2 -DUSE_AVX"
2012-03-16 06:04:44 -07:00
echo "compile make_nm.cpp"
2022-11-23 19:22:37 -07:00
$CXX $CFLAGS make_nm.cpp -o make_nm
2012-03-16 06:04:44 -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
2012-03-16 06:04:44 -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
2012-03-16 06:04:44 -07:00
./nm_frame | $FILTER > x.lst
2023-07-26 20:20:24 -07:00
diff -bB ok.lst x.lst && echo "ok"