aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMITSUNARI Shigeo <[email protected]>2023-11-20 11:35:52 +0900
committerMITSUNARI Shigeo <[email protected]>2023-11-20 11:35:52 +0900
commit6703d43447f0d9743859b44b0be08c82aac98485 (patch)
tree409048e4eb3ff1f95f7aab513e9e7238b9065987
parented5dc351610cefdb79ffe72f8757384380d4d32b (diff)
downloadxbyak-6703d43447f0d9743859b44b0be08c82aac98485.tar.gz
xbyak-6703d43447f0d9743859b44b0be08c82aac98485.zip
movdir64b supports apx
-rw-r--r--gen/gen_code.cpp2
-rw-r--r--test/apx.cpp16
-rw-r--r--xbyak/xbyak_mnemonic.h2
3 files changed, 18 insertions, 2 deletions
diff --git a/gen/gen_code.cpp b/gen/gen_code.cpp
index 2188f4a..5c3ccd0 100644
--- a/gen/gen_code.cpp
+++ b/gen/gen_code.cpp
@@ -1113,7 +1113,7 @@ void put()
puts("void movbe(const Reg& reg, const Address& addr) { opMR(addr, reg, T_0F38, 0xF0); }");
puts("void movbe(const Address& addr, const Reg& reg) { opMR(addr, reg, T_0F38, 0xF1); }");
puts("void movdiri(const Address& addr, const Reg32e& reg) { opMR(addr, reg, T_0F38, 0xF9); }");
- puts("void movdir64b(const Reg& reg, const Address& addr) { opMR(addr, reg.cvt32(), T_66 | T_0F38, 0xF8); }");
+ puts("void movdir64b(const Reg& reg, const Address& addr) { if (opROO(Reg(), addr, reg.cvt32(), T_VEX|T_66, 0xF8)) return; opMR(addr, reg.cvt32(), T_66 | T_0F38, 0xF8); }");
puts("void cmpxchg8b(const Address& addr) { opMR(addr, Reg32(1), T_0F, 0xC7); }");
puts("void pextrw(const Operand& op, const Mmx& xmm, uint8_t imm) { opExt(op, xmm, 0x15, imm, true); }");
diff --git a/test/apx.cpp b/test/apx.cpp
index fde981f..e17ae1d 100644
--- a/test/apx.cpp
+++ b/test/apx.cpp
@@ -1009,3 +1009,19 @@ CYBOZU_TEST_AUTO(shld)
CYBOZU_TEST_EQUAL(c.getSize(), n);
CYBOZU_TEST_EQUAL_ARRAY(c.getCode(), tbl, n);
}
+
+CYBOZU_TEST_AUTO(mov)
+{
+ struct Code : Xbyak::CodeGenerator {
+ Code()
+ {
+ movdir64b(r16, ptr [r20+r21*8+0x4]);
+ }
+ } c;
+ const uint8_t tbl[] = {
+ 0x62, 0xec, 0x79, 0x08, 0xf8, 0x44, 0xec, 0x04,
+ };
+ const size_t n = sizeof(tbl);
+ CYBOZU_TEST_EQUAL(c.getSize(), n);
+ CYBOZU_TEST_EQUAL_ARRAY(c.getCode(), tbl, n);
+}
diff --git a/xbyak/xbyak_mnemonic.h b/xbyak/xbyak_mnemonic.h
index 6ef9994..a8ab2a8 100644
--- a/xbyak/xbyak_mnemonic.h
+++ b/xbyak/xbyak_mnemonic.h
@@ -518,7 +518,7 @@ void movd(const Mmx& mmx, const Address& addr) { if (mmx.isXMM()) db(0x66); opMR
void movd(const Mmx& mmx, const Reg32& reg) { if (mmx.isXMM()) db(0x66); opRR(mmx, reg, T_0F, 0x6E); }
void movd(const Reg32& reg, const Mmx& mmx) { if (mmx.isXMM()) db(0x66); opRR(mmx, reg, T_0F, 0x7E); }
void movddup(const Xmm& xmm, const Operand& op) { opSSE(xmm, op, T_DUP|T_F2|T_0F|T_EW1|T_YMM|T_EVEX|T_ER_X|T_ER_Y|T_ER_Z, 0x12, isXMM_XMMorMEM, NONE); }
-void movdir64b(const Reg& reg, const Address& addr) { opMR(addr, reg.cvt32(), T_66 | T_0F38, 0xF8); }
+void movdir64b(const Reg& reg, const Address& addr) { if (opROO(Reg(), addr, reg.cvt32(), T_VEX|T_66, 0xF8)) return; opMR(addr, reg.cvt32(), T_66 | T_0F38, 0xF8); }
void movdiri(const Address& addr, const Reg32e& reg) { opMR(addr, reg, T_0F38, 0xF9); }
void movdq2q(const Mmx& mmx, const Xmm& xmm) { opRR(mmx, xmm, T_F2 | T_0F, 0xD6); }
void movdqa(const Address& addr, const Xmm& xmm) { opMR(addr, xmm, T_0F|T_66, 0x7F); }