support adox, adcx

This commit is contained in:
MITSUNARI Shigeo 2015-01-28 12:38:08 +09:00
parent 95cf45e874
commit a45d11f467
6 changed files with 23 additions and 2 deletions

View file

@ -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

View file

@ -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のサポート

View file

@ -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);

View file

@ -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
{

View file

@ -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); }

View file

@ -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();
}