aboutsummaryrefslogtreecommitdiffhomepage
path: root/sample
diff options
context:
space:
mode:
Diffstat (limited to 'sample')
-rw-r--r--sample/Makefile7
-rw-r--r--sample/quantize.cpp2
-rw-r--r--sample/test_util.cpp1
-rw-r--r--sample/toyvm.cpp8
4 files changed, 11 insertions, 7 deletions
diff --git a/sample/Makefile b/sample/Makefile
index 7c910bb..7e8ab7b 100644
--- a/sample/Makefile
+++ b/sample/Makefile
@@ -1,6 +1,9 @@
XBYAK_INC=../xbyak/xbyak.h
+CXX?=g++
-BOOST_EXIST=$(shell echo "\#include <boost/spirit/core.hpp>" | (gcc -E - 2>/dev/null) | grep "boost/spirit/core.hpp" >/dev/null && echo "1")
+#BOOST_EXIST=$(shell echo "#include <boost/spirit/core.hpp>" | $CXX -x c++ -c - 2>/dev/null && echo 1)
+# I don't know why the above code causes an error on GitHub action.
+BOOST_EXIST?=0
UNAME_M=$(shell uname -m)
ONLY_64BIT=0
@@ -104,7 +107,7 @@ profiler-vtune: profiler.cpp ../xbyak/xbyak_util.h
$(CXX) $(CFLAGS) profiler.cpp -o $@ -DXBYAK_USE_VTUNE -I /opt/intel/vtune_amplifier/include/ -L /opt/intel/vtune_amplifier/lib64 -ljitprofiling -ldl
clean:
- rm -rf *.o $(TARGET) *.exe profiler profiler-vtune
+ rm -rf $(TARGET) profiler profiler-vtune
test : test0.cpp $(XBYAK_INC)
test64: test0.cpp $(XBYAK_INC)
diff --git a/sample/quantize.cpp b/sample/quantize.cpp
index 6bdf0d0..ba0fd22 100644
--- a/sample/quantize.cpp
+++ b/sample/quantize.cpp
@@ -199,7 +199,7 @@ int main(int argc, char *argv[])
quantize2(dest2, src, qTbl);
for (int i = 0; i < N; i++) {
if (dest[i] != dest2[i]) {
- printf("err[%d] %d %d\n", i, dest[i], dest2[i]);
+ printf("err[%d] %u %u\n", i, dest[i], dest2[i]);
}
}
diff --git a/sample/test_util.cpp b/sample/test_util.cpp
index a20d2df..ef6e3fa 100644
--- a/sample/test_util.cpp
+++ b/sample/test_util.cpp
@@ -93,6 +93,7 @@ void putCPUinfo(bool onlyCpuidFeature)
{ Cpu::tAVX_VNNI_INT8, "avx_vnni_int8" },
{ Cpu::tAVX_NE_CONVERT, "avx_ne_convert" },
{ Cpu::tAVX_IFMA, "avx_ifma" },
+ { Cpu::tRAO_INT, "rao-int" },
};
for (size_t i = 0; i < NUM_OF_ARRAY(tbl); i++) {
if (cpu.has(tbl[i].type)) printf(" %s", tbl[i].str);
diff --git a/sample/toyvm.cpp b/sample/toyvm.cpp
index 1e558ff..dff0cb7 100644
--- a/sample/toyvm.cpp
+++ b/sample/toyvm.cpp
@@ -5,8 +5,8 @@
mem_ 4byte x 65536
- ���٤Ƥ�̿���4byte����
- ¨�ͤ�����16bit
+ all instructions are fixed at 4 bytes.
+ all immediate values are 16-bit.
R = A or B
vldiR, imm ; R = imm
@@ -109,7 +109,7 @@ public:
reg[r] -= imm;
break;
case PUT:
- printf("%c %8d(0x%08x)\n", 'A' + r, reg[r], reg[r]);
+ printf("%c %8u(0x%08x)\n", 'A' + r, reg[r], reg[r]);
break;
case JNZ:
if (reg[r] != 0) pc += static_cast<signed short>(imm);
@@ -294,7 +294,7 @@ lp:
p = t;
n--;
if (n != 0) goto lp;
- printf("c=%d(0x%08x)\n", c, c);
+ printf("c=%u(0x%08x)\n", c, c);
}
int main()