diff options
-rwxr-xr-x | test/test_address.sh | 2 | ||||
-rwxr-xr-x | test/test_avx.sh | 51 | ||||
-rwxr-xr-x | test/test_avx512.sh | 31 | ||||
-rwxr-xr-x | test/test_nm.sh | 71 |
4 files changed, 85 insertions, 70 deletions
diff --git a/test/test_address.sh b/test/test_address.sh index d63a4ef..d283a5f 100755 --- a/test/test_address.sh +++ b/test/test_address.sh @@ -12,7 +12,7 @@ g++ $CFLAGS address.cpp -o address ./address $1 > a.asm echo "asm" $EXE -f$OPT3 a.asm -l a.lst -awk '{if (index($3, "-")) { conti=substr($3, 0, length($3) - 1) } else { conti = conti $3; print conti; conti = "" }} ' < a.lst | $FILTER > ok.lst +awk '{printf "%s", sub(/-$/, "", $3) ? $3 : $3 ORS}' a.lst | $FILTER > ok.lst echo "xbyak" ./address $1 jit > nm.cpp diff --git a/test/test_avx.sh b/test/test_avx.sh index 236f7aa..34dc1e5 100755 --- a/test/test_avx.sh +++ b/test/test_avx.sh @@ -1,39 +1,44 @@ -#!/bin/tcsh +#!/bin/sh -set FILTER="grep -v warning" +FILTER="grep -v warning" -if ($1 == "Y") then +case $1 in +Y) echo "yasm(32bit)" - set EXE=yasm - set OPT2="-DUSE_YASM -DXBYAK32" - set OPT3=win32 -else if ($1 == "64") then + EXE=yasm + OPT2="-DUSE_YASM -DXBYAK32" + OPT3=win32 + ;; +64) echo "nasm(64bit)" - set EXE=nasm - set OPT2=-DXBYAK64 - set OPT3=win64 - set FILTER=./normalize_prefix -else if ($1 == "Y64") then + EXE=nasm + OPT2=-DXBYAK64 + OPT3=win64 + FILTER=./normalize_prefix + ;; +Y64) echo "yasm(64bit)" - set EXE=yasm - set OPT2="-DUSE_YASM -DXBYAK64" - set OPT3=win64 - set FILTER=./normalize_prefix -else + EXE=yasm + OPT2="-DUSE_YASM -DXBYAK64" + OPT3=win64 + FILTER=./normalize_prefix + ;; +*) echo "nasm(32bit)" - set EXE=nasm - set OPT2=-DXBYAK32 - set OPT3=win32 -endif + EXE=nasm + OPT2=-DXBYAK32 + OPT3=win32 + ;; +esac -set CFLAGS="-Wall -fno-operator-names -I../ $OPT2 -DUSE_AVX" +CFLAGS="-Wall -fno-operator-names -I../ $OPT2 -DUSE_AVX" echo "compile make_nm.cpp" g++ $CFLAGS make_nm.cpp -o make_nm ./make_nm > a.asm echo "asm" $EXE -f$OPT3 a.asm -l a.lst -awk '{if (index($3, "-")) { conti=substr($3, 0, length($3) - 1) } else { conti = conti $3; print conti; conti = "" }} ' < a.lst | $FILTER | grep -v "1+1" > ok.lst +awk '$3 != "1+1" {printf "%s", sub(/-$/, "", $3) ? $3 : $3 ORS}' a.lst | $FILTER > ok.lst echo "xbyak" ./make_nm jit > nm.cpp diff --git a/test/test_avx512.sh b/test/test_avx512.sh index cce5de0..17edfee 100755 --- a/test/test_avx512.sh +++ b/test/test_avx512.sh @@ -1,28 +1,31 @@ -#!/bin/tcsh +#!/bin/sh -set FILTER="grep -v warning" +FILTER="grep -v warning" -if ($1 == "64") then +case $1 in +64) echo "nasm(64bit)" - set EXE=nasm - set OPT2=-DXBYAK64 - set OPT3=win64 - set FILTER=./normalize_prefix -else + EXE=nasm + OPT2=-DXBYAK64 + OPT3=win64 + FILTER=./normalize_prefix + ;; +*) echo "nasm(32bit)" - set EXE=nasm - set OPT2=-DXBYAK32 - set OPT3=win32 -endif + EXE=nasm + OPT2=-DXBYAK32 + OPT3=win32 + ;; +esac -set CFLAGS="-Wall -fno-operator-names -I../ $OPT2 -DUSE_AVX512" +CFLAGS="-Wall -fno-operator-names -I../ $OPT2 -DUSE_AVX512" echo "compile make_512.cpp" g++ $CFLAGS make_512.cpp -o make_512 ./make_512 > a.asm echo "asm" $EXE -f$OPT3 a.asm -l a.lst -awk '{if (index($3, "-")) { conti=substr($3, 0, length($3) - 1) } else { conti = conti $3; print conti; conti = "" }} ' < a.lst | $FILTER > ok.lst +awk '{printf "%s", sub(/-$/, "", $3) ? $3 : $3 ORS}' a.lst | $FILTER > ok.lst echo "xbyak" ./make_512 jit > nm.cpp diff --git a/test/test_nm.sh b/test/test_nm.sh index 3e32801..afa2b1e 100755 --- a/test/test_nm.sh +++ b/test/test_nm.sh @@ -1,50 +1,57 @@ -#!/bin/tcsh +#!/bin/sh -set FILTER=cat +FILTER=cat -if ($1 == "Y") then +case $1 in +Y) echo "yasm(32bit)" - set EXE=yasm - set OPT2="-DUSE_YASM -DXBYAK32" - set OPT3=win32 -else if ($1 == "64") then + EXE=yasm + OPT2="-DUSE_YASM -DXBYAK32" + OPT3=win32 + ;; +64) echo "nasm(64bit)" - set EXE=nasm - set OPT2=-DXBYAK64 - set OPT3=win64 - set FILTER=./normalize_prefix -else if ($1 == "Y64") then + EXE=nasm + OPT2=-DXBYAK64 + OPT3=win64 + FILTER=./normalize_prefix + ;; +Y64) echo "yasm(64bit)" - set EXE=yasm - set OPT2="-DUSE_YASM -DXBYAK64" - set OPT3=win64 - set FILTER=./normalize_prefix -else if ($1 == "avx512") then + EXE=yasm + OPT2="-DUSE_YASM -DXBYAK64" + OPT3=win64 + FILTER=./normalize_prefix + ;; +avx512) echo "nasm(64bit) + avx512" - set EXE=nasm - set OPT2="-DXBYAK64 -DUSE_AVX512" - set OPT3=win64 - set FILTER=./normalize_prefix -else if ($1 == "noexcept") then + EXE=nasm + OPT2="-DXBYAK64 -DUSE_AVX512" + OPT3=win64 + FILTER=./normalize_prefix + ;; +noexcept) echo "nasm(32bit) without exception" - set EXE=nasm - set OPT2="-DXBYAK32 -DXBYAK_NO_EXCEPTION" - set OPT3=win32 -else + EXE=nasm + OPT2="-DXBYAK32 -DXBYAK_NO_EXCEPTION" + OPT3=win32 + ;; +*) echo "nasm(32bit)" - set EXE=nasm - set OPT2=-DXBYAK32 - set OPT3=win32 -endif + EXE=nasm + OPT2=-DXBYAK32 + OPT3=win32 + ;; +esac -set CFLAGS="-Wall -fno-operator-names -I../ $OPT2" +CFLAGS="-Wall -fno-operator-names -I../ $OPT2" echo "compile make_nm.cpp with $CFLAGS" g++ $CFLAGS make_nm.cpp -o make_nm ./make_nm > a.asm echo "asm" $EXE -f$OPT3 a.asm -l a.lst -awk '{if (index($3, "-")) { conti=substr($3, 0, length($3) - 1) } else { conti = conti $3; print conti; conti = "" }} ' < a.lst | $FILTER | grep -v "1+1" > ok.lst +awk '$3 != "1+1" {printf "%s", sub(/-$/, "", $3) ? $3 : $3 ORS}' a.lst | $FILTER > ok.lst echo "xbyak" ./make_nm jit > nm.cpp |