diff options
author | MITSUNARI Shigeo <[email protected]> | 2015-01-28 12:38:08 +0900 |
---|---|---|
committer | MITSUNARI Shigeo <[email protected]> | 2015-01-28 12:38:08 +0900 |
commit | a45d11f467eef628158a340756cb20908ffe4cdf (patch) | |
tree | 5221a2139697e50a00eb35247cb2f30846860696 | |
parent | 95cf45e8740cf89a7b1bbe20ce5d01a1ade52213 (diff) | |
download | xbyak-a45d11f467eef628158a340756cb20908ffe4cdf.tar.gz xbyak-a45d11f467eef628158a340756cb20908ffe4cdf.zip |
support adox, adcx
-rw-r--r-- | readme.md | 2 | ||||
-rw-r--r-- | readme.txt | 2 | ||||
-rw-r--r-- | sample/test_util.cpp | 1 | ||||
-rw-r--r-- | test/make_nm.cpp | 11 | ||||
-rw-r--r-- | xbyak/xbyak.h | 7 | ||||
-rw-r--r-- | xbyak/xbyak_util.h | 2 |
6 files changed, 23 insertions, 2 deletions
@@ -277,7 +277,7 @@ The header files under xbyak/ are independent of cybozulib. History ------------- -* 2015/Jar/28 ver 4.71 support cmpxchg +* 2015/Jar/28 ver 4.71 support adcx, adox, cmpxchg * 2014/Oct/14 ver 4.70 support MmapAllocator * 2014/Jun/13 ver 4.62 disable warning of VC2014 * 2014/May/30 ver 4.61 support bt, bts, btr, btc @@ -296,7 +296,7 @@ cybozulibは単体テストでのみ利用されていて、xbyak/ディレク� -----------------------------------------------------------------------------
◎履歴
-2015/01/28 ver 4.71 cmpxchgのサポート
+2015/01/28 ver 4.71 adcx, adox, cmpxchgのサポート
2014/10/14 ver 4.70 MmapAllocatorのサポート
2014/06/13 ver 4.62 VC2014で警告抑制
2014/05/30 ver 4.61 bt, bts, btr, btcのサポート
diff --git a/sample/test_util.cpp b/sample/test_util.cpp index 9dec376..022f78d 100644 --- a/sample/test_util.cpp +++ b/sample/test_util.cpp @@ -49,6 +49,7 @@ void putCPUinfo() { Cpu::tLZCNT, "lzcnt" }, { Cpu::tENHANCED_REP, "enh_rep" }, { Cpu::tRDRAND, "rdrand" }, + { Cpu::tADX, "adx" }, }; 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/test/make_nm.cpp b/test/make_nm.cpp index 11701dc..50ccf1e 100644 --- a/test/make_nm.cpp +++ b/test/make_nm.cpp @@ -828,6 +828,17 @@ class Test { put(p, REG16|AX, IMM8|IMM16|NEG8|NEG16); put(p, REG8|REG8_3|AL, IMM|NEG8); } + { + const char tbl[][8] = { + "adcx", + "adox", + }; + for (size_t i = 0; i < NUM_OF_ARRAY(tbl); i++) { + const char *p = tbl[i]; + put(p, REG32, REG32|MEM); + put(p, REG64, REG64|MEM); + } + } } void putBt() const { diff --git a/xbyak/xbyak.h b/xbyak/xbyak.h index 480b217..c682043 100644 --- a/xbyak/xbyak.h +++ b/xbyak/xbyak.h @@ -1229,6 +1229,11 @@ private: { return op1.isREG(i32e) && (op2.isXMM() || op2.isMEM()); } + // (REG32, REG32|MEM) + static inline bool isREG32_REG32orMEM(const Operand& op1, const Operand& op2) + { + return op1.isREG(i32e) && ((op2.isREG(i32e) && op1.getBit() == op2.getBit()) || op2.isMEM()); + } void rex(const Operand& op1, const Operand& op2 = Operand()) { uint8 rex = 0; @@ -1843,6 +1848,8 @@ public: */ void putL(std::string label) { putL_inner(label); } void putL(const Label& label) { putL_inner(label); } + void adcx(const Reg32e& reg, const Operand& op) { opGen(reg, op, 0xF6, 0x66, isREG32_REG32orMEM, NONE, 0x38); } + void adox(const Reg32e& reg, const Operand& op) { opGen(reg, op, 0xF6, 0xF3, isREG32_REG32orMEM, NONE, 0x38); } void cmpxchg8b(const Address& addr) { opModM(addr, Reg32(1), 0x0F, B11000111); } #ifdef XBYAK64 void cmpxchg16b(const Address& addr) { opModM(addr, Reg64(1), 0x0F, B11000111); } diff --git a/xbyak/xbyak_util.h b/xbyak/xbyak_util.h index 1fa4c9a..d22df11 100644 --- a/xbyak/xbyak_util.h +++ b/xbyak/xbyak_util.h @@ -150,6 +150,7 @@ public: tAVX2 = 1 << 20, tBMI1 = 1 << 21, // andn, bextr, blsi, blsmsk, blsr, tzcnt tBMI2 = 1 << 22, // bzhi, mulx, pdep, pext, rorx, sarx, shlx, shrx + tADX = 1 << 23, // adcx, adox tGPR1 = tBMI1, // backward compatibility tGPR2 = tBMI2, // backward compatibility tLZCNT = 1 << 23, @@ -212,6 +213,7 @@ public: if (data[1] & (1U << 3)) type_ |= tBMI1; if (data[1] & (1U << 8)) type_ |= tBMI2; if (data[1] & (1U << 9)) type_ |= tENHANCED_REP; + if (data[1] & (1U << 19)) type_ |= tADX; } setFamily(); } |