T_MAP1 is not necessary

This commit is contained in:
MITSUNARI Shigeo 2023-12-27 11:07:07 +09:00
parent 5c95842beb
commit ee49842226
3 changed files with 10 additions and 15 deletions

View file

@ -67,7 +67,6 @@ std::string type2String(uint64_t type)
if (type & T_MAP3) str += "|T_MAP3";
if (type & T_ND1) str += "|T_ND1";
if (type & T_ZU) str += "|T_ZU";
if (type & T_MAP1) str += "|T_MAP1";
if (str[0] == '|') str = str.substr(1);
return str;

View file

@ -47,9 +47,7 @@
static const uint64_t T_ND1 = 1ull << 35; // ND=1
static const uint64_t T_ZU = 1ull << 36; // ND=ZU
static const uint64_t T_F2 = 1ull << 37; // pp = 3
static const uint64_t T_MAP1 = 1ull << 38; // kmov
// T_66 = 1, T_F3 = 2, T_F2 = 3
static inline uint32_t getPP(uint64_t type) { return (type & T_66) ? 1 : (type & T_F3) ? 2 : (type & T_F2) ? 3 : 0; }
static inline uint32_t getMMM(uint64_t type) { return (type & T_0F) ? 1 : (type & T_0F38) ? 2 : (type & T_0F3A) ? 3 : 0; }
// @@@end of avx_type_def.h

View file

@ -1830,11 +1830,9 @@ private:
static const uint64_t T_ND1 = 1ull << 35; // ND=1
static const uint64_t T_ZU = 1ull << 36; // ND=ZU
static const uint64_t T_F2 = 1ull << 37; // pp = 3
static const uint64_t T_MAP1 = 1ull << 38; // kmov
// T_66 = 1, T_F3 = 2, T_F2 = 3
static inline uint32_t getPP(uint64_t type) { return (type & T_66) ? 1 : (type & T_F3) ? 2 : (type & T_F2) ? 3 : 0; }
static inline uint32_t getMMM(uint64_t type) { return (type & T_0F) ? 1 : (type & T_0F38) ? 2 : (type & T_0F3A) ? 3 : 0; }
// @@@end of avx_type_def.h
void vex(const Reg& reg, const Reg& base, const Operand *v, uint64_t type, int code, bool x = false)
{
@ -1930,9 +1928,9 @@ private:
}
static inline int getMap(uint64_t type)
{
if (type & T_MAP1) return 1;
if (type & T_MAP3) return 3;
if (type & (T_0F38|T_0F3A)) return 2;
if (type & T_0F) return 1;
if (type & T_0F38) return 2;
if (type & T_0F3A) return 3;
return 4; // legacy
}
// evex of Legacy
@ -2726,17 +2724,17 @@ private:
code = op.isOPMASK() || op.isMEM() ? 0x90 : isReg ? 0x92 : 0;
}
if (code == 0) XBYAK_THROW(ERR_BAD_COMBINATION)
uint64_t type = 0;
uint64_t type = T_0F;
switch (size) {
case 8: type = T_W0|T_66; break;
case 16: type = T_W0; break;
case 32: type = isReg ? T_W0|T_F2 : T_W1|T_66; break;
case 64: type = isReg ? T_W1|T_F2 : T_W1; break;
case 8: type |= T_W0|T_66; break;
case 16: type |= T_W0; break;
case 32: type |= isReg ? T_W0|T_F2 : T_W1|T_66; break;
case 64: type |= isReg ? T_W1|T_F2 : T_W1; break;
}
const Operand *p1 = &k, *p2 = &op;
if (code == 0x93) { std::swap(p1, p2); }
if (opROO(Reg(), *p2, *p1, T_MAP1|type, code)) return;
opVex(static_cast<const Reg&>(*p1), 0, *p2, T_L0|T_0F|type, code);
if (opROO(Reg(), *p2, *p1, T_APX|type, code)) return;
opVex(static_cast<const Reg&>(*p1), 0, *p2, T_L0|type, code);
}
void opEncodeKey(const Reg32& r1, const Reg32& r2, uint8_t code1, uint8_t code2)
{