aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMITSUNARI Shigeo <[email protected]>2018-02-07 16:41:48 +0900
committerMITSUNARI Shigeo <[email protected]>2018-02-07 16:41:48 +0900
commitc04141ef169da25ac00cacf15531f1712fa1130a (patch)
tree3ad15f953af12e1cee00b63225824e96c08a129a
parentaf7f05ee585501e62204aa783ecf814778c68d2c (diff)
downloadxbyak-c04141ef169da25ac00cacf15531f1712fa1130a.tar.gz
xbyak-c04141ef169da25ac00cacf15531f1712fa1130a.zip
define XBYAK_NO_OP_NAMES for test
-rw-r--r--test/Makefile1
-rw-r--r--test/make_nm.cpp24
-rwxr-xr-xtest/test_nm.sh6
3 files changed, 25 insertions, 6 deletions
diff --git a/test/Makefile b/test/Makefile
index e07e1bf..3180f18 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -37,6 +37,7 @@ test: normalize_prefix jmp bad_address $(TARGET)
$(MAKE) -C ../gen
./test_nm.sh
./test_nm.sh Y
+ ./test_nm.sh avx512
./test_address.sh
./jmp
./bad_address
diff --git a/test/make_nm.cpp b/test/make_nm.cpp
index 72c8247..862c0ad 100644
--- a/test/make_nm.cpp
+++ b/test/make_nm.cpp
@@ -1,4 +1,5 @@
#include <stdio.h>
+#define XBYAK_NO_OP_NAMES
#include "xbyak/xbyak.h"
#include "xbyak/xbyak_bin2hex.h"
#include <stdlib.h>
@@ -121,6 +122,15 @@ class Test {
void operator=(const Test&);
const bool isXbyak_;
int funcNum_;
+ /*
+ and_, or_, xor_, not_ => and, or, xor, not
+ */
+ std::string removeUnderScore(std::string s) const
+ {
+ if (!isXbyak_ && s[s.size() - 1] == '_') s.resize(s.size() - 1);
+ return s;
+ }
+
// check all op1, op2, op3
void put(const std::string& nm, uint64 op1 = NOPARA, uint64 op2 = NOPARA, uint64 op3 = NOPARA, uint64 op4 = NOPARA) const
{
@@ -951,15 +961,16 @@ class Test {
static const char tbl[][16] = {
"adc",
"add",
- "and",
+ "and_",
"cmp",
- "or",
+ "or_",
"sbb",
"sub",
- "xor",
+ "xor_",
};
for (size_t i = 0; i < NUM_OF_ARRAY(tbl); i++) {
- const char *p = tbl[i];
+ const std::string s = removeUnderScore(tbl[i]);
+ const char *p = s.c_str();
put(p, REG32, REG32|MEM);
put(p, REG64, REG64|MEM);
put(p, REG16, REG16|MEM);
@@ -1017,10 +1028,11 @@ class Test {
"imul",
"mul",
"neg",
- "not",
+ "not_",
};
for (size_t i = 0; i < NUM_OF_ARRAY(tbl); i++) {
- const char *p = tbl[i];
+ const std::string s = removeUnderScore(tbl[i]);
+ const char *p = s.c_str();
put(p, REG32e|REG16|REG8|REG8_3);
put(p, MEM32|MEM16|MEM8);
}
diff --git a/test/test_nm.sh b/test/test_nm.sh
index 412dbf4..6001ace 100755
--- a/test/test_nm.sh
+++ b/test/test_nm.sh
@@ -19,6 +19,12 @@ else if ($1 == "Y64") then
set OPT2="-DUSE_YASM -DXBYAK64"
set OPT3=win64
set FILTER=./normalize_prefix
+else if ($1 == "avx512") then
+ echo "nasm(64bit) + avx512"
+ set EXE=nasm
+ set OPT2="-DXBYAK64 -DUSE_AVX512"
+ set OPT3=win64
+ set FILTER=./normalize_prefix
else
echo "nasm(32bit)"
set EXE=nasm