aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorMITSUNARI Shigeo <[email protected]>2024-10-13 11:57:55 +0900
committerMITSUNARI Shigeo <[email protected]>2024-10-13 13:51:06 +0900
commiteca17384c575d06474495e79fad87646bd7d067a (patch)
tree512e194effe48657ac7b8fe35c05dde64a1e3ce8 /test
parent7af7abbf954dd729f6eb95ef63495526ffd96b77 (diff)
downloadxbyak-eca17384c575d06474495e79fad87646bd7d067a.tar.gz
xbyak-eca17384c575d06474495e79fad87646bd7d067a.zip
add vmpsadbw for avx10.2
Diffstat (limited to 'test')
-rw-r--r--test/avx10/misc.txt9
-rw-r--r--test/avx10_test.cpp24
-rw-r--r--test/test_by_xed.cpp3
-rw-r--r--test/test_by_xed.py5
4 files changed, 40 insertions, 1 deletions
diff --git a/test/avx10/misc.txt b/test/avx10/misc.txt
index f7d1351..5c39e81 100644
--- a/test/avx10/misc.txt
+++ b/test/avx10/misc.txt
@@ -10,4 +10,11 @@ vdpphps(zm1, zm2, zm3);
vdpphps(zm1, zm2, ptr[rax+128]);
vdpphps(zm1, zm2, ptr_b[rax+128]);
-// skip vmpsadbw
+vmpsadbw(xm1, xm3, xm15, 3);
+vmpsadbw(xm1|T_z, xm4, ptr[rax+128], 5);
+
+vmpsadbw(ym1|k4, ym3, ym15, 3);
+vmpsadbw(ym1, ym4, ptr[rax+128], 5);
+
+vmpsadbw(zm1|k4, zm3, zm15, 3);
+vmpsadbw(zm1, zm4, ptr[rax+128], 5);
diff --git a/test/avx10_test.cpp b/test/avx10_test.cpp
index 9a4a848..5f742fe 100644
--- a/test/avx10_test.cpp
+++ b/test/avx10_test.cpp
@@ -228,3 +228,27 @@ CYBOZU_TEST_AUTO(ymm_with_sae)
CYBOZU_TEST_EQUAL(c.getSize(), n);
CYBOZU_TEST_EQUAL_ARRAY(c.getCode(), tbl, n);
}
+
+CYBOZU_TEST_AUTO(vmpsadbw)
+{
+ struct Code : Xbyak::CodeGenerator {
+ Code()
+ {
+ setDefaultEncoding();
+ vmpsadbw(xm1, xm3, xm15, 3); // vex(avx)
+ vmpsadbw(ym1, ym3, ptr[rax+128], 3); // vex(avx2)
+ setDefaultEncoding(VexEncoding, EvexEncoding);
+ vmpsadbw(ym1, ym3, ym15, 3); // evex(avx10.2)
+ vmpsadbw(ym1, ym3, ptr[rax+128], 3); // evex(avx10.2)
+ }
+ } c;
+ const uint8_t tbl[] = {
+ 0xc4, 0xc3, 0x61, 0x42, 0xcf, 0x03,
+ 0xc4, 0xe3, 0x65, 0x42, 0x88, 0x80, 0x00, 0x00, 0x00, 0x03,
+ 0x62, 0xd3, 0x66, 0x28, 0x42, 0xcf, 0x03,
+ 0x62, 0xf3, 0x66, 0x28, 0x42, 0x48, 0x04, 0x03,
+ };
+ const size_t n = sizeof(tbl) / sizeof(tbl[0]);
+ CYBOZU_TEST_EQUAL(c.getSize(), n);
+ CYBOZU_TEST_EQUAL_ARRAY(c.getCode(), tbl, n);
+}
diff --git a/test/test_by_xed.cpp b/test/test_by_xed.cpp
index 93c370c..ddac779 100644
--- a/test/test_by_xed.cpp
+++ b/test/test_by_xed.cpp
@@ -1,10 +1,13 @@
#include <stdio.h>
#include <xbyak/xbyak.h>
+using namespace Xbyak;
+
struct Code : Xbyak::CodeGenerator {
Code()
: Xbyak::CodeGenerator(4096*8)
{
+ setDefaultEncoding(VexEncoding, EvexEncoding);
#include "tmp.cpp"
}
};
diff --git a/test/test_by_xed.py b/test/test_by_xed.py
index 5b84995..afd77d8 100644
--- a/test/test_by_xed.py
+++ b/test/test_by_xed.py
@@ -210,6 +210,11 @@ def parseNmemonic(s):
args = []
attrs = []
+ # remove Xbyak::{Evex,Vex}Encoding
+ r = re.search(r'(,[^,]*Encoding)', s)
+ if r:
+ s = s.replace(r.group(1), '')
+
(s, broadcast) = parseBroadcast(s)
# replace xm0 with xmm0