mirror of
https://github.com/herumi/xbyak
synced 2024-11-21 16:09:11 -07:00
replace uint32 with uint32_t etc.
This commit is contained in:
parent
c306b8e578
commit
bb967ae752
17 changed files with 807 additions and 814 deletions
|
@ -23,7 +23,7 @@ void putOpmask(bool only64bit)
|
|||
{
|
||||
const struct Tbl {
|
||||
const char *name;
|
||||
uint8 code;
|
||||
uint8_t code;
|
||||
} tbl[] = {
|
||||
{ "kadd", 0x4A },
|
||||
{ "kand", 0x41 },
|
||||
|
@ -46,7 +46,7 @@ void putOpmask(bool only64bit)
|
|||
{
|
||||
const struct Tbl {
|
||||
const char *name;
|
||||
uint8 code;
|
||||
uint8_t code;
|
||||
} tbl[] = {
|
||||
{ "knot", 0x44 },
|
||||
{ "kortest", 0x98 },
|
||||
|
@ -63,17 +63,17 @@ void putOpmask(bool only64bit)
|
|||
{
|
||||
const struct Tbl {
|
||||
const char *name;
|
||||
uint8 code;
|
||||
uint8_t code;
|
||||
} tbl[] = {
|
||||
{ "kshiftl", 0x32 },
|
||||
{ "kshiftr", 0x30 },
|
||||
};
|
||||
for (size_t i = 0; i < NUM_OF_ARRAY(tbl); i++) {
|
||||
const Tbl& p = tbl[i];
|
||||
printf("void %sw(const Opmask& r1, const Opmask& r2, uint8 imm) { opVex(r1, 0, r2, T_66 | T_0F3A | T_W1, 0x%02X, imm); }\n", p.name, p.code);
|
||||
printf("void %sq(const Opmask& r1, const Opmask& r2, uint8 imm) { opVex(r1, 0, r2, T_66 | T_0F3A | T_W1, 0x%02X, imm); }\n", p.name, p.code + 1);
|
||||
printf("void %sb(const Opmask& r1, const Opmask& r2, uint8 imm) { opVex(r1, 0, r2, T_66 | T_0F3A | T_W0, 0x%02X, imm); }\n", p.name, p.code);
|
||||
printf("void %sd(const Opmask& r1, const Opmask& r2, uint8 imm) { opVex(r1, 0, r2, T_66 | T_0F3A | T_W0, 0x%02X, imm); }\n", p.name, p.code + 1);
|
||||
printf("void %sw(const Opmask& r1, const Opmask& r2, uint8_t imm) { opVex(r1, 0, r2, T_66 | T_0F3A | T_W1, 0x%02X, imm); }\n", p.name, p.code);
|
||||
printf("void %sq(const Opmask& r1, const Opmask& r2, uint8_t imm) { opVex(r1, 0, r2, T_66 | T_0F3A | T_W1, 0x%02X, imm); }\n", p.name, p.code + 1);
|
||||
printf("void %sb(const Opmask& r1, const Opmask& r2, uint8_t imm) { opVex(r1, 0, r2, T_66 | T_0F3A | T_W0, 0x%02X, imm); }\n", p.name, p.code);
|
||||
printf("void %sd(const Opmask& r1, const Opmask& r2, uint8_t imm) { opVex(r1, 0, r2, T_66 | T_0F3A | T_W0, 0x%02X, imm); }\n", p.name, p.code + 1);
|
||||
}
|
||||
}
|
||||
puts("void kmovw(const Opmask& k, const Operand& op) { if (!op.isMEM() && !op.isOPMASK()) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(k, 0, op, T_L0 | T_0F | T_W0, 0x90); }");
|
||||
|
@ -98,7 +98,7 @@ void putOpmask(bool only64bit)
|
|||
void putVcmp()
|
||||
{
|
||||
const struct Tbl {
|
||||
uint8 code;
|
||||
uint8_t code;
|
||||
const char *name;
|
||||
int type;
|
||||
bool hasIMM;
|
||||
|
@ -142,7 +142,7 @@ void putVcmp()
|
|||
const Tbl *p = &tbl[i];
|
||||
std::string type = type2String(p->type);
|
||||
printf("void %s(const Opmask& k, const Xmm& x, const Operand& op%s) { opAVX_K_X_XM(k, x, op, %s, 0x%02X%s); }\n"
|
||||
, p->name, p->hasIMM ? ", uint8 imm" : "", type.c_str(), p->code, p->hasIMM ? ", imm" : "");
|
||||
, p->name, p->hasIMM ? ", uint8_t imm" : "", type.c_str(), p->code, p->hasIMM ? ", imm" : "");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -150,7 +150,7 @@ void putVcmp()
|
|||
void putX_XM()
|
||||
{
|
||||
const struct Tbl {
|
||||
uint8 code;
|
||||
uint8_t code;
|
||||
const char *name;
|
||||
int type;
|
||||
} tbl[] = {
|
||||
|
@ -198,7 +198,7 @@ void putX_XM()
|
|||
void putM_X()
|
||||
{
|
||||
const struct Tbl {
|
||||
uint8 code;
|
||||
uint8_t code;
|
||||
const char *name;
|
||||
int type;
|
||||
} tbl[] = {
|
||||
|
@ -219,7 +219,7 @@ void putM_X()
|
|||
void putXM_X()
|
||||
{
|
||||
const struct Tbl {
|
||||
uint8 code;
|
||||
uint8_t code;
|
||||
const char *name;
|
||||
int type;
|
||||
} tbl[] = {
|
||||
|
@ -242,7 +242,7 @@ void putXM_X()
|
|||
void putX_X_XM_IMM()
|
||||
{
|
||||
const struct Tbl {
|
||||
uint8 code;
|
||||
uint8_t code;
|
||||
const char *name;
|
||||
int type;
|
||||
bool hasIMM;
|
||||
|
@ -376,7 +376,7 @@ void putX_X_XM_IMM()
|
|||
const Tbl *p = &tbl[i];
|
||||
std::string type = type2String(p->type);
|
||||
printf("void %s(const Xmm& x1, const Xmm& x2, const Operand& op%s) { opAVX_X_X_XM(x1, x2, op, %s, 0x%02X%s); }\n"
|
||||
, p->name, p->hasIMM ? ", uint8 imm" : "", type.c_str(), p->code, p->hasIMM ? ", imm" : "");
|
||||
, p->name, p->hasIMM ? ", uint8_t imm" : "", type.c_str(), p->code, p->hasIMM ? ", imm" : "");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -384,7 +384,7 @@ void putShift()
|
|||
{
|
||||
const struct Tbl {
|
||||
const char *name;
|
||||
uint8 code;
|
||||
uint8_t code;
|
||||
int idx;
|
||||
int type;
|
||||
} tbl[] = {
|
||||
|
@ -397,7 +397,7 @@ void putShift()
|
|||
for (size_t i = 0; i < NUM_OF_ARRAY(tbl); i++) {
|
||||
const Tbl& p = tbl[i];
|
||||
std::string type = type2String(p.type);
|
||||
printf("void %s(const Xmm& x, const Operand& op, uint8 imm) { opAVX_X_X_XM(Xmm(x.getKind(), %d), x, op, %s, 0x%02X, imm); }\n", p.name, p.idx, type.c_str(), p.code);
|
||||
printf("void %s(const Xmm& x, const Operand& op, uint8_t imm) { opAVX_X_X_XM(Xmm(x.getKind(), %d), x, op, %s, 0x%02X, imm); }\n", p.name, p.idx, type.c_str(), p.code);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -406,7 +406,7 @@ void putExtractInsert()
|
|||
{
|
||||
const struct Tbl {
|
||||
const char *name;
|
||||
uint8 code;
|
||||
uint8_t code;
|
||||
int type;
|
||||
bool isZMM;
|
||||
} tbl[] = {
|
||||
|
@ -424,13 +424,13 @@ void putExtractInsert()
|
|||
const Tbl& p = tbl[i];
|
||||
std::string type = type2String(p.type);
|
||||
const char *kind = p.isZMM ? "Operand::MEM | Operand::YMM" : "Operand::MEM | Operand::XMM";
|
||||
printf("void %s(const Operand& op, const %s& r, uint8 imm) { if (!op.is(%s)) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(r, 0, op, %s, 0x%2X, imm); }\n", p.name, p.isZMM ? "Zmm" : "Ymm", kind, type.c_str(), p.code);
|
||||
printf("void %s(const Operand& op, const %s& r, uint8_t imm) { if (!op.is(%s)) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(r, 0, op, %s, 0x%2X, imm); }\n", p.name, p.isZMM ? "Zmm" : "Ymm", kind, type.c_str(), p.code);
|
||||
}
|
||||
}
|
||||
{
|
||||
const struct Tbl {
|
||||
const char *name;
|
||||
uint8 code;
|
||||
uint8_t code;
|
||||
int type;
|
||||
bool isZMM;
|
||||
} tbl[] = {
|
||||
|
@ -449,7 +449,7 @@ void putExtractInsert()
|
|||
std::string type = type2String(p.type);
|
||||
const char *x = p.isZMM ? "Zmm" : "Ymm";
|
||||
const char *cond = p.isZMM ? "op.is(Operand::MEM | Operand::YMM)" : "(r1.getKind() == r2.getKind() && op.is(Operand::MEM | Operand::XMM))";
|
||||
printf("void %s(const %s& r1, const %s& r2, const Operand& op, uint8 imm) {"
|
||||
printf("void %s(const %s& r1, const %s& r2, const Operand& op, uint8_t imm) {"
|
||||
"if (!%s) XBYAK_THROW(ERR_BAD_COMBINATION) "
|
||||
"opVex(r1, &r2, op, %s, 0x%2X, imm); }\n", p.name, x, x, cond, type.c_str(), p.code);
|
||||
}
|
||||
|
@ -460,7 +460,7 @@ void putBroadcast(bool only64bit)
|
|||
{
|
||||
{
|
||||
const struct Tbl {
|
||||
uint8 code;
|
||||
uint8_t code;
|
||||
const char *name;
|
||||
int type;
|
||||
int reg;
|
||||
|
@ -522,7 +522,7 @@ void putGather()
|
|||
const struct Tbl {
|
||||
const char *name;
|
||||
int type;
|
||||
uint8 code;
|
||||
uint8_t code;
|
||||
int mode;
|
||||
} tbl[] = {
|
||||
{ "vpgatherdd", T_66 | T_0F38 | T_YMM | T_MUST_EVEX | T_EW0 | T_N4, 0x90, xx_yy_zz },
|
||||
|
@ -545,7 +545,7 @@ void putScatter()
|
|||
const struct Tbl {
|
||||
const char *name;
|
||||
int type;
|
||||
uint8 code;
|
||||
uint8_t code;
|
||||
int mode; // reverse of gather
|
||||
} tbl[] = {
|
||||
{ "vpscatterdd", T_66 | T_0F38 | T_YMM | T_MUST_EVEX | T_EW0 | T_N4 | T_M_K, 0xA0, xx_yy_zz },
|
||||
|
@ -567,10 +567,10 @@ void putScatter()
|
|||
|
||||
void putShuff()
|
||||
{
|
||||
puts("void vshuff32x4(const Ymm& y1, const Ymm& y2, const Operand& op, uint8 imm) { opAVX_X_X_XM(y1, y2, op, T_66 | T_0F3A | T_YMM | T_MUST_EVEX | T_EW0 | T_B32, 0x23, imm); }");
|
||||
puts("void vshuff64x2(const Ymm& y1, const Ymm& y2, const Operand& op, uint8 imm) { opAVX_X_X_XM(y1, y2, op, T_66 | T_0F3A | T_YMM | T_MUST_EVEX | T_EW1 | T_B64, 0x23, imm); }");
|
||||
puts("void vshufi32x4(const Ymm& y1, const Ymm& y2, const Operand& op, uint8 imm) { opAVX_X_X_XM(y1, y2, op, T_66 | T_0F3A | T_YMM | T_MUST_EVEX | T_EW0 | T_B32, 0x43, imm); }");
|
||||
puts("void vshufi64x2(const Ymm& y1, const Ymm& y2, const Operand& op, uint8 imm) { opAVX_X_X_XM(y1, y2, op, T_66 | T_0F3A | T_YMM | T_MUST_EVEX | T_EW1 | T_B64, 0x43, imm); }");
|
||||
puts("void vshuff32x4(const Ymm& y1, const Ymm& y2, const Operand& op, uint8_t imm) { opAVX_X_X_XM(y1, y2, op, T_66 | T_0F3A | T_YMM | T_MUST_EVEX | T_EW0 | T_B32, 0x23, imm); }");
|
||||
puts("void vshuff64x2(const Ymm& y1, const Ymm& y2, const Operand& op, uint8_t imm) { opAVX_X_X_XM(y1, y2, op, T_66 | T_0F3A | T_YMM | T_MUST_EVEX | T_EW1 | T_B64, 0x23, imm); }");
|
||||
puts("void vshufi32x4(const Ymm& y1, const Ymm& y2, const Operand& op, uint8_t imm) { opAVX_X_X_XM(y1, y2, op, T_66 | T_0F3A | T_YMM | T_MUST_EVEX | T_EW0 | T_B32, 0x43, imm); }");
|
||||
puts("void vshufi64x2(const Ymm& y1, const Ymm& y2, const Operand& op, uint8_t imm) { opAVX_X_X_XM(y1, y2, op, T_66 | T_0F3A | T_YMM | T_MUST_EVEX | T_EW1 | T_B64, 0x43, imm); }");
|
||||
}
|
||||
|
||||
void putMov()
|
||||
|
@ -627,7 +627,7 @@ void putMov()
|
|||
void putX_XM_IMM()
|
||||
{
|
||||
const struct Tbl {
|
||||
uint8 code;
|
||||
uint8_t code;
|
||||
const char *name;
|
||||
int type;
|
||||
bool hasIMM;
|
||||
|
@ -664,7 +664,7 @@ void putX_XM_IMM()
|
|||
const Tbl *p = &tbl[i];
|
||||
std::string type = type2String(p->type);
|
||||
printf("void %s(const Xmm& x, const Operand& op%s) { opAVX_X_XM_IMM(x, op, %s, 0x%02X%s); }\n"
|
||||
, p->name, p->hasIMM ? ", uint8 imm" : "", type.c_str(), p->code, p->hasIMM ? ", imm" : "");
|
||||
, p->name, p->hasIMM ? ", uint8_t imm" : "", type.c_str(), p->code, p->hasIMM ? ", imm" : "");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -677,7 +677,7 @@ void putMisc()
|
|||
const char *name;
|
||||
int zm;
|
||||
int type;
|
||||
uint8 code;
|
||||
uint8_t code;
|
||||
bool isZmm;
|
||||
} tbl[] = {
|
||||
{ "vgatherpf0dps", 1, T_EW0 | T_N4, 0xC6, true },
|
||||
|
@ -708,10 +708,10 @@ void putMisc()
|
|||
}
|
||||
}
|
||||
|
||||
puts("void vfpclasspd(const Opmask& k, const Operand& op, uint8 imm) { if (!op.isBit(128|256|512)) XBYAK_THROW(ERR_BAD_MEM_SIZE) opVex(k.changeBit(op.getBit()), 0, op, T_66 | T_0F3A | T_MUST_EVEX | T_YMM | T_EW1 | T_B64, 0x66, imm); }");
|
||||
puts("void vfpclassps(const Opmask& k, const Operand& op, uint8 imm) { if (!op.isBit(128|256|512)) XBYAK_THROW(ERR_BAD_MEM_SIZE) opVex(k.changeBit(op.getBit()), 0, op, T_66 | T_0F3A | T_MUST_EVEX | T_YMM | T_EW0 | T_B32, 0x66, imm); }");
|
||||
puts("void vfpclasssd(const Opmask& k, const Operand& op, uint8 imm) { if (!op.isXMEM()) XBYAK_THROW(ERR_BAD_MEM_SIZE) opVex(k, 0, op, T_66 | T_0F3A | T_MUST_EVEX | T_EW1 | T_N8, 0x67, imm); }");
|
||||
puts("void vfpclassss(const Opmask& k, const Operand& op, uint8 imm) { if (!op.isXMEM()) XBYAK_THROW(ERR_BAD_MEM_SIZE) opVex(k, 0, op, T_66 | T_0F3A | T_MUST_EVEX | T_EW0 | T_N4, 0x67, imm); }");
|
||||
puts("void vfpclasspd(const Opmask& k, const Operand& op, uint8_t imm) { if (!op.isBit(128|256|512)) XBYAK_THROW(ERR_BAD_MEM_SIZE) opVex(k.changeBit(op.getBit()), 0, op, T_66 | T_0F3A | T_MUST_EVEX | T_YMM | T_EW1 | T_B64, 0x66, imm); }");
|
||||
puts("void vfpclassps(const Opmask& k, const Operand& op, uint8_t imm) { if (!op.isBit(128|256|512)) XBYAK_THROW(ERR_BAD_MEM_SIZE) opVex(k.changeBit(op.getBit()), 0, op, T_66 | T_0F3A | T_MUST_EVEX | T_YMM | T_EW0 | T_B32, 0x66, imm); }");
|
||||
puts("void vfpclasssd(const Opmask& k, const Operand& op, uint8_t imm) { if (!op.isXMEM()) XBYAK_THROW(ERR_BAD_MEM_SIZE) opVex(k, 0, op, T_66 | T_0F3A | T_MUST_EVEX | T_EW1 | T_N8, 0x67, imm); }");
|
||||
puts("void vfpclassss(const Opmask& k, const Operand& op, uint8_t imm) { if (!op.isXMEM()) XBYAK_THROW(ERR_BAD_MEM_SIZE) opVex(k, 0, op, T_66 | T_0F3A | T_MUST_EVEX | T_EW0 | T_N4, 0x67, imm); }");
|
||||
|
||||
puts("void vpshufbitqmb(const Opmask& k, const Xmm& x, const Operand& op) { opVex(k, &x, op, T_66 | T_0F38 | T_EW0 | T_YMM | T_MUST_EVEX, 0x8F); }");
|
||||
puts("void vcvtneps2bf16(const Xmm& x, const Operand& op) { opCvt2(x, op, T_F3 | T_0F38 | T_EW0 | T_YMM | T_SAE_Z | T_MUST_EVEX | T_B32, 0x72); }");
|
||||
|
|
234
gen/gen_code.cpp
234
gen/gen_code.cpp
|
@ -23,9 +23,9 @@ void put_jREGz(const char *reg, bool prefix)
|
|||
|
||||
struct GenericTbl {
|
||||
const char *name;
|
||||
uint8 code1;
|
||||
uint8 code2;
|
||||
uint8 code3;
|
||||
uint8_t code1;
|
||||
uint8_t code2;
|
||||
uint8_t code3;
|
||||
};
|
||||
|
||||
void putGeneric(const GenericTbl *p, size_t n)
|
||||
|
@ -44,7 +44,7 @@ void putX_X_XM(bool omitOnly)
|
|||
// (x, x, x/m[, imm]) or (y, y, y/m[, imm])
|
||||
{
|
||||
const struct Tbl {
|
||||
uint8 code;
|
||||
uint8_t code;
|
||||
const char *name;
|
||||
int type;
|
||||
bool hasIMM;
|
||||
|
@ -212,33 +212,33 @@ void putX_X_XM(bool omitOnly)
|
|||
std::string type = type2String(p->type);
|
||||
if (omitOnly) {
|
||||
if (p->enableOmit) {
|
||||
printf("void v%s(const Xmm& x, const Operand& op%s) { v%s(x, x, op%s); }\n", p->name, p->hasIMM ? ", uint8 imm" : "", p->name, p->hasIMM ? ", imm" : "");
|
||||
printf("void v%s(const Xmm& x, const Operand& op%s) { v%s(x, x, op%s); }\n", p->name, p->hasIMM ? ", uint8_t imm" : "", p->name, p->hasIMM ? ", imm" : "");
|
||||
}
|
||||
} else {
|
||||
if (p->mode & 1) {
|
||||
if (p->hasIMM) {
|
||||
printf("void %s(const Xmm& xmm, const Operand& op, int imm) { opGen(xmm, op, 0x%02X, 0x66, isXMM_XMMorMEM, static_cast<uint8>(imm), 0x3A); }\n", p->name, p->code);
|
||||
printf("void %s(const Xmm& xmm, const Operand& op, int imm) { opGen(xmm, op, 0x%02X, 0x66, isXMM_XMMorMEM, static_cast<uint8_t>(imm), 0x3A); }\n", p->name, p->code);
|
||||
} else {
|
||||
printf("void %s(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x%02X, 0x66, isXMM_XMMorMEM, NONE, 0x38); }\n", p->name, p->code);
|
||||
}
|
||||
}
|
||||
if (p->mode & 2) {
|
||||
printf("void v%s(const Xmm& x1, const Xmm& x2, const Operand& op%s) { opAVX_X_X_XM(x1, x2, op, %s, 0x%02X%s); }\n"
|
||||
, p->name, p->hasIMM ? ", uint8 imm" : "", type.c_str(), p->code, p->hasIMM ? ", imm" : "");
|
||||
, p->name, p->hasIMM ? ", uint8_t imm" : "", type.c_str(), p->code, p->hasIMM ? ", imm" : "");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void putMemOp(const char *name, uint8 prefix, uint8 ext, uint8 code1, int code2, int bit = 32)
|
||||
void putMemOp(const char *name, uint8_t prefix, uint8_t ext, uint8_t code1, int code2, int bit = 32)
|
||||
{
|
||||
printf("void %s(const Address& addr) { ", name);
|
||||
if (prefix) printf("db(0x%02X); ", prefix);
|
||||
printf("opModM(addr, Reg%d(%d), 0x%02X, 0x%02X); }\n", bit, ext, code1, code2);
|
||||
}
|
||||
|
||||
void putLoadSeg(const char *name, uint8 code1, int code2 = NONE)
|
||||
void putLoadSeg(const char *name, uint8_t code1, int code2 = NONE)
|
||||
{
|
||||
printf("void %s(const Reg& reg, const Address& addr) { opLoadSeg(addr, reg, 0x%02X, 0x%02X); }\n", name, code1, code2);
|
||||
}
|
||||
|
@ -262,7 +262,7 @@ void put()
|
|||
const int Q = 1 << 3;
|
||||
{
|
||||
const struct Tbl {
|
||||
uint8 code;
|
||||
uint8_t code;
|
||||
const char *name;
|
||||
} tbl[] = {
|
||||
// MMX
|
||||
|
@ -312,7 +312,7 @@ void put()
|
|||
|
||||
{
|
||||
const struct Tbl {
|
||||
uint8 code;
|
||||
uint8_t code;
|
||||
int mode;
|
||||
const char *name;
|
||||
} tbl[] = {
|
||||
|
@ -346,7 +346,7 @@ void put()
|
|||
|
||||
{
|
||||
const struct Tbl {
|
||||
uint8 code;
|
||||
uint8_t code;
|
||||
int ext;
|
||||
int mode;
|
||||
const char *name;
|
||||
|
@ -376,8 +376,8 @@ void put()
|
|||
|
||||
{
|
||||
const struct Tbl {
|
||||
uint8 code;
|
||||
uint8 pref;
|
||||
uint8_t code;
|
||||
uint8_t pref;
|
||||
const char *name;
|
||||
} tbl[] = {
|
||||
{ 0x70, 0, "pshufw" },
|
||||
|
@ -387,13 +387,13 @@ void put()
|
|||
};
|
||||
for (size_t i = 0; i < NUM_OF_ARRAY(tbl); i++) {
|
||||
const Tbl *p = &tbl[i];
|
||||
printf("void %s(const Mmx& mmx, const Operand& op, uint8 imm8) { opMMX(mmx, op, 0x%02X, 0x%02X, imm8); }\n", p->name, p->code, p->pref);
|
||||
printf("void %s(const Mmx& mmx, const Operand& op, uint8_t imm8) { opMMX(mmx, op, 0x%02X, 0x%02X, imm8); }\n", p->name, p->code, p->pref);
|
||||
}
|
||||
}
|
||||
{
|
||||
const struct MmxTbl6 {
|
||||
uint8 code; // for (reg, reg/[mem])
|
||||
uint8 code2; // for ([mem], reg)
|
||||
uint8_t code; // for (reg, reg/[mem])
|
||||
uint8_t code2; // for ([mem], reg)
|
||||
int pref;
|
||||
const char *name;
|
||||
} mmxTbl6[] = {
|
||||
|
@ -432,7 +432,7 @@ void put()
|
|||
{ 0xF2, "sd" },
|
||||
};
|
||||
const struct Tbl {
|
||||
uint8 code;
|
||||
uint8_t code;
|
||||
int mode;
|
||||
const char *name;
|
||||
bool hasImm;
|
||||
|
@ -461,8 +461,8 @@ void put()
|
|||
for (size_t j = 0; j < NUM_OF_ARRAY(sufTbl); j++) {
|
||||
if (!(p->mode & (1 << j))) continue;
|
||||
if (p->hasImm) {
|
||||
// don't change uint8 to int because NO is not in byte
|
||||
printf("void %s%s(const Xmm& xmm, const Operand& op, uint8 imm8) { opGen(xmm, op, 0x%2X, 0x%02X, isXMM_XMMorMEM, imm8); }\n", p->name, sufTbl[j].name, p->code, sufTbl[j].code);
|
||||
// don't change uint8_t to int because NO is not in byte
|
||||
printf("void %s%s(const Xmm& xmm, const Operand& op, uint8_t imm8) { opGen(xmm, op, 0x%2X, 0x%02X, isXMM_XMMorMEM, imm8); }\n", p->name, sufTbl[j].name, p->code, sufTbl[j].code);
|
||||
} else {
|
||||
printf("void %s%s(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x%2X, 0x%02X, isXMM_XMMorMEM); }\n", p->name, sufTbl[j].name, p->code, sufTbl[j].code);
|
||||
}
|
||||
|
@ -472,8 +472,8 @@ void put()
|
|||
{
|
||||
// (XMM, XMM)
|
||||
const struct Tbl {
|
||||
uint8 code;
|
||||
uint8 pref;
|
||||
uint8_t code;
|
||||
uint8_t pref;
|
||||
const char *name;
|
||||
} tbl[] = {
|
||||
{ 0xF7, 0x66, "maskmovdqu" },
|
||||
|
@ -490,7 +490,7 @@ void put()
|
|||
{
|
||||
// (XMM, XMM|MEM)
|
||||
const struct Tbl {
|
||||
uint8 code;
|
||||
uint8_t code;
|
||||
int pref;
|
||||
const char *name;
|
||||
} tbl[] = {
|
||||
|
@ -522,7 +522,7 @@ void put()
|
|||
{
|
||||
// special type
|
||||
const struct Tbl {
|
||||
uint8 code;
|
||||
uint8_t code;
|
||||
int pref;
|
||||
const char *name;
|
||||
const char *cond;
|
||||
|
@ -566,7 +566,7 @@ void put()
|
|||
}
|
||||
{
|
||||
const struct Tbl {
|
||||
uint8 code;
|
||||
uint8_t code;
|
||||
int pref;
|
||||
const char *name;
|
||||
} tbl[] = {
|
||||
|
@ -583,7 +583,7 @@ void put()
|
|||
{
|
||||
// cmov
|
||||
const struct Tbl {
|
||||
uint8 ext;
|
||||
uint8_t ext;
|
||||
const char *name;
|
||||
} tbl[] = {
|
||||
{ 0, "o" },
|
||||
|
@ -631,7 +631,7 @@ void put()
|
|||
{
|
||||
const struct Tbl {
|
||||
const char *name;
|
||||
uint8 code;
|
||||
uint8_t code;
|
||||
} tbl[] = {
|
||||
{ "loop", 0xE2 },
|
||||
{ "loope", 0xE1 },
|
||||
|
@ -774,16 +774,16 @@ void put()
|
|||
{ "clzero", 0x0F, 0x01, 0xFC },
|
||||
};
|
||||
putGeneric(tbl, NUM_OF_ARRAY(tbl));
|
||||
puts("void enter(uint16 x, uint8 y) { db(0xC8); dw(x); db(y); }");
|
||||
puts("void int_(uint8 x) { db(0xCD); db(x); }");
|
||||
puts("void enter(uint16_t x, uint8_t y) { db(0xC8); dw(x); db(y); }");
|
||||
puts("void int_(uint8_t x) { db(0xCD); db(x); }");
|
||||
putLoadSeg("lss", 0x0F, 0xB2);
|
||||
putLoadSeg("lfs", 0x0F, 0xB4);
|
||||
putLoadSeg("lgs", 0x0F, 0xB5);
|
||||
}
|
||||
{
|
||||
const struct Tbl {
|
||||
uint8 code; // (reg, reg)
|
||||
uint8 ext; // (reg, imm)
|
||||
uint8_t code; // (reg, reg)
|
||||
uint8_t ext; // (reg, imm)
|
||||
const char *name;
|
||||
} tbl[] = {
|
||||
{ 0x10, 2, "adc" },
|
||||
|
@ -798,14 +798,14 @@ void put()
|
|||
for (size_t i = 0; i < NUM_OF_ARRAY(tbl); i++) {
|
||||
const Tbl *p = &tbl[i];
|
||||
printf("void %s(const Operand& op1, const Operand& op2) { opRM_RM(op1, op2, 0x%02X); }\n", p->name, p->code);
|
||||
printf("void %s(const Operand& op, uint32 imm) { opRM_I(op, imm, 0x%02X, %d); }\n", p->name, p->code, p->ext);
|
||||
printf("void %s(const Operand& op, uint32_t imm) { opRM_I(op, imm, 0x%02X, %d); }\n", p->name, p->code, p->ext);
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
const struct Tbl {
|
||||
uint8 code;
|
||||
uint8 ext;
|
||||
uint8_t code;
|
||||
uint8_t ext;
|
||||
const char *name;
|
||||
} tbl[] = {
|
||||
{ 0x48, 1, "dec" },
|
||||
|
@ -818,8 +818,8 @@ void put()
|
|||
}
|
||||
{
|
||||
const struct Tbl {
|
||||
uint8 code;
|
||||
uint8 ext;
|
||||
uint8_t code;
|
||||
uint8_t ext;
|
||||
const char *name;
|
||||
} tbl[] = {
|
||||
{ 0xa3, 4, "bt" },
|
||||
|
@ -830,13 +830,13 @@ void put()
|
|||
for (size_t i = 0; i < NUM_OF_ARRAY(tbl); i++) {
|
||||
const Tbl *p = &tbl[i];
|
||||
printf("void %s(const Operand& op, const Reg& reg) { opModRM(reg, op, op.isREG(16|32|64) && op.getBit() == reg.getBit(), op.isMEM(), 0x0f, 0x%02X); }\n", p->name, p->code);
|
||||
printf("void %s(const Operand& op, uint8 imm) { opR_ModM(op, 16|32|64, %d, 0x0f, 0xba, NONE, false, 1); db(imm); }\n", p->name, p->ext);
|
||||
printf("void %s(const Operand& op, uint8_t imm) { opR_ModM(op, 16|32|64, %d, 0x0f, 0xba, NONE, false, 1); db(imm); }\n", p->name, p->ext);
|
||||
}
|
||||
}
|
||||
{
|
||||
const struct Tbl {
|
||||
uint8 code;
|
||||
uint8 ext;
|
||||
uint8_t code;
|
||||
uint8_t ext;
|
||||
const char *name;
|
||||
} tbl[] = {
|
||||
{ 0xF6, 6, "div" },
|
||||
|
@ -855,7 +855,7 @@ void put()
|
|||
{
|
||||
const struct Tbl {
|
||||
const char *name;
|
||||
uint8 ext;
|
||||
uint8_t ext;
|
||||
} tbl[] = {
|
||||
{ "rcl", 2 },
|
||||
{ "rcr", 3 },
|
||||
|
@ -876,21 +876,21 @@ void put()
|
|||
{
|
||||
const struct Tbl {
|
||||
const char *name;
|
||||
uint8 code;
|
||||
uint8_t code;
|
||||
} tbl[] = {
|
||||
{ "shld", 0xA4 },
|
||||
{ "shrd", 0xAC },
|
||||
};
|
||||
for (size_t i = 0; i < NUM_OF_ARRAY(tbl); i++) {
|
||||
const Tbl *p = &tbl[i];
|
||||
printf("void %s(const Operand& op, const Reg& reg, uint8 imm) { opShxd(op, reg, imm, 0x%02X); }\n", p->name, p->code);
|
||||
printf("void %s(const Operand& op, const Reg& reg, uint8_t imm) { opShxd(op, reg, imm, 0x%02X); }\n", p->name, p->code);
|
||||
printf("void %s(const Operand& op, const Reg& reg, const Reg8& _cl) { opShxd(op, reg, 0, 0x%02X, &_cl); }\n", p->name, p->code);
|
||||
}
|
||||
}
|
||||
{
|
||||
const struct Tbl {
|
||||
const char *name;
|
||||
uint8 code;
|
||||
uint8_t code;
|
||||
} tbl[] = {
|
||||
{ "bsf", 0xBC },
|
||||
{ "bsr", 0xBD },
|
||||
|
@ -903,7 +903,7 @@ void put()
|
|||
{
|
||||
const struct Tbl {
|
||||
const char *name;
|
||||
uint8 code;
|
||||
uint8_t code;
|
||||
} tbl[] = {
|
||||
{ "popcnt", 0xB8 },
|
||||
{ "tzcnt", 0xBC },
|
||||
|
@ -917,7 +917,7 @@ void put()
|
|||
// SSSE3
|
||||
{
|
||||
const struct Tbl {
|
||||
uint8 code;
|
||||
uint8_t code;
|
||||
const char *name;
|
||||
} tbl[] = {
|
||||
{ 0x00, "pshufb" },
|
||||
|
@ -940,12 +940,12 @@ void put()
|
|||
const Tbl *p = &tbl[i];
|
||||
printf("void %s(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x%02X, 0x66, NONE, 0x38); }\n", p->name, p->code);
|
||||
}
|
||||
printf("void palignr(const Mmx& mmx, const Operand& op, int imm) { opMMX(mmx, op, 0x0f, 0x66, static_cast<uint8>(imm), 0x3a); }\n");
|
||||
printf("void palignr(const Mmx& mmx, const Operand& op, int imm) { opMMX(mmx, op, 0x0f, 0x66, static_cast<uint8_t>(imm), 0x3a); }\n");
|
||||
}
|
||||
{
|
||||
const struct Tbl {
|
||||
const char *name;
|
||||
uint8 code;
|
||||
uint8_t code;
|
||||
} tbl[] = {
|
||||
{ "pclmullqlqdq", 0 },
|
||||
{ "pclmulhqlqdq", 1 },
|
||||
|
@ -959,11 +959,11 @@ void put()
|
|||
}
|
||||
{
|
||||
const struct Tbl {
|
||||
uint8 code1;
|
||||
uint8_t code1;
|
||||
int code2;
|
||||
uint8 ext;
|
||||
uint8_t ext;
|
||||
const char *name;
|
||||
uint8 prefix;
|
||||
uint8_t prefix;
|
||||
} tbl[] = {
|
||||
{ 0x0F, 0xAE, 2, "ldmxcsr", 0 },
|
||||
{ 0x0F, 0xAE, 3, "stmxcsr", 0 },
|
||||
|
@ -993,7 +993,7 @@ void put()
|
|||
}
|
||||
{
|
||||
const struct Tbl {
|
||||
uint8 code;
|
||||
uint8_t code;
|
||||
const char *name;
|
||||
} tbl[] = {
|
||||
{ 0x2B, "movntpd" },
|
||||
|
@ -1007,7 +1007,7 @@ void put()
|
|||
}
|
||||
{
|
||||
const struct Tbl {
|
||||
uint8 code;
|
||||
uint8_t code;
|
||||
const char *name;
|
||||
} tbl[] = {
|
||||
{ 0xBE, "movsx" },
|
||||
|
@ -1019,9 +1019,9 @@ void put()
|
|||
}
|
||||
}
|
||||
{ // in/out
|
||||
puts("void in_(const Reg& a, uint8 v) { opInOut(a, 0xE4, v); }");
|
||||
puts("void in_(const Reg& a, uint8_t v) { opInOut(a, 0xE4, v); }");
|
||||
puts("void in_(const Reg& a, const Reg& d) { opInOut(a, d, 0xEC); }");
|
||||
puts("void out_(uint8 v, const Reg& a) { opInOut(a, 0xE6, v); }");
|
||||
puts("void out_(uint8_t v, const Reg& a) { opInOut(a, 0xE6, v); }");
|
||||
puts("void out_(const Reg& d, const Reg& a) { opInOut(a, d, 0xEE); }");
|
||||
}
|
||||
// mpx
|
||||
|
@ -1049,14 +1049,14 @@ void put()
|
|||
puts("void adox(const Reg32e& reg, const Operand& op) { opGen(reg, op, 0xF6, 0xF3, isREG32_REG32orMEM, NONE, 0x38); }");
|
||||
puts("void cmpxchg8b(const Address& addr) { opModM(addr, Reg32(1), 0x0F, 0xC7); }");
|
||||
|
||||
puts("void pextrw(const Operand& op, const Mmx& xmm, uint8 imm) { opExt(op, xmm, 0x15, imm, true); }");
|
||||
puts("void pextrb(const Operand& op, const Xmm& xmm, uint8 imm) { opExt(op, xmm, 0x14, imm); }");
|
||||
puts("void pextrd(const Operand& op, const Xmm& xmm, uint8 imm) { opExt(op, xmm, 0x16, imm); }");
|
||||
puts("void extractps(const Operand& op, const Xmm& xmm, uint8 imm) { opExt(op, xmm, 0x17, imm); }");
|
||||
puts("void pextrw(const Operand& op, const Mmx& xmm, uint8_t imm) { opExt(op, xmm, 0x15, imm, true); }");
|
||||
puts("void pextrb(const Operand& op, const Xmm& xmm, uint8_t imm) { opExt(op, xmm, 0x14, imm); }");
|
||||
puts("void pextrd(const Operand& op, const Xmm& xmm, uint8_t imm) { opExt(op, xmm, 0x16, imm); }");
|
||||
puts("void extractps(const Operand& op, const Xmm& xmm, uint8_t imm) { opExt(op, xmm, 0x17, imm); }");
|
||||
puts("void pinsrw(const Mmx& mmx, const Operand& op, int imm) { if (!op.isREG(32) && !op.isMEM()) XBYAK_THROW(ERR_BAD_COMBINATION) opGen(mmx, op, 0xC4, mmx.isXMM() ? 0x66 : NONE, 0, imm); }");
|
||||
puts("void insertps(const Xmm& xmm, const Operand& op, uint8 imm) { opGen(xmm, op, 0x21, 0x66, isXMM_XMMorMEM, imm, 0x3A); }");
|
||||
puts("void pinsrb(const Xmm& xmm, const Operand& op, uint8 imm) { opGen(xmm, op, 0x20, 0x66, isXMM_REG32orMEM, imm, 0x3A); }");
|
||||
puts("void pinsrd(const Xmm& xmm, const Operand& op, uint8 imm) { opGen(xmm, op, 0x22, 0x66, isXMM_REG32orMEM, imm, 0x3A); }");
|
||||
puts("void insertps(const Xmm& xmm, const Operand& op, uint8_t imm) { opGen(xmm, op, 0x21, 0x66, isXMM_XMMorMEM, imm, 0x3A); }");
|
||||
puts("void pinsrb(const Xmm& xmm, const Operand& op, uint8_t imm) { opGen(xmm, op, 0x20, 0x66, isXMM_REG32orMEM, imm, 0x3A); }");
|
||||
puts("void pinsrd(const Xmm& xmm, const Operand& op, uint8_t imm) { opGen(xmm, op, 0x22, 0x66, isXMM_REG32orMEM, imm, 0x3A); }");
|
||||
|
||||
puts("void pmovmskb(const Reg32e& reg, const Mmx& mmx) { if (mmx.isXMM()) db(0x66); opModR(reg, mmx, 0x0F, 0xD7); }");
|
||||
puts("void maskmovq(const Mmx& reg1, const Mmx& reg2) { if (!reg1.isMMX() || !reg2.isMMX()) XBYAK_THROW(ERR_BAD_COMBINATION) opModR(reg1, reg2, 0x0F, 0xF7); }");
|
||||
|
@ -1082,12 +1082,12 @@ void put()
|
|||
}
|
||||
{
|
||||
const struct Tbl {
|
||||
uint8 m16;
|
||||
uint8 m32;
|
||||
uint8 m64;
|
||||
uint8 ext;
|
||||
uint8_t m16;
|
||||
uint8_t m32;
|
||||
uint8_t m64;
|
||||
uint8_t ext;
|
||||
const char *name;
|
||||
uint8 m64ext;
|
||||
uint8_t m64ext;
|
||||
} tbl[] = {
|
||||
{ 0x00, 0xD8, 0xDC, 0, "fadd" },
|
||||
{ 0xDE, 0xDA, 0x00, 0, "fiadd" },
|
||||
|
@ -1120,8 +1120,8 @@ void put()
|
|||
}
|
||||
{
|
||||
const struct Tbl {
|
||||
uint32 code1;
|
||||
uint32 code2;
|
||||
uint32_t code1;
|
||||
uint32_t code2;
|
||||
const char *name;
|
||||
} tbl[] = {
|
||||
{ 0xD8C0, 0xDCC0, "fadd" },
|
||||
|
@ -1165,8 +1165,8 @@ void put()
|
|||
}
|
||||
{
|
||||
const struct Tbl {
|
||||
uint8 code1;
|
||||
uint8 code2;
|
||||
uint8_t code1;
|
||||
uint8_t code2;
|
||||
const char *name;
|
||||
} tbl[] = {
|
||||
{ 0xD8, 0xD0, "fcom" },
|
||||
|
@ -1187,7 +1187,7 @@ void put()
|
|||
// AVX
|
||||
{ // pd, ps, sd, ss
|
||||
const struct Tbl {
|
||||
uint8 code;
|
||||
uint8_t code;
|
||||
const char *name;
|
||||
bool only_pd_ps;
|
||||
} tbl[] = {
|
||||
|
@ -1216,7 +1216,7 @@ void put()
|
|||
// (x, x/m[, imm]) or (y, y/m[, imm])
|
||||
{
|
||||
const struct Tbl {
|
||||
uint8 code;
|
||||
uint8_t code;
|
||||
const char *name;
|
||||
int type;
|
||||
bool hasIMM;
|
||||
|
@ -1297,7 +1297,7 @@ void put()
|
|||
const Tbl *p = &tbl[i];
|
||||
std::string type = type2String(p->type);
|
||||
if (p->mode & 1) {
|
||||
const char *immS1 = p->hasIMM ? ", uint8 imm" : "";
|
||||
const char *immS1 = p->hasIMM ? ", uint8_t imm" : "";
|
||||
const char *immS2 = p->hasIMM ? ", imm" : ", NONE";
|
||||
const char *pref = p->type & T_66 ? "0x66" : p->type & T_F2 ? "0xF2" : p->type & T_F3 ? "0xF3" : "NONE";
|
||||
const char *suf = p->type & T_0F38 ? "0x38" : p->type & T_0F3A ? "0x3A" : "NONE";
|
||||
|
@ -1305,14 +1305,14 @@ void put()
|
|||
}
|
||||
if (p->mode & 2) {
|
||||
printf("void v%s(const Xmm& xm, const Operand& op%s) { opAVX_X_XM_IMM(xm, op, %s, 0x%02X%s); }\n"
|
||||
, p->name, p->hasIMM ? ", uint8 imm" : "", type.c_str(), p->code, p->hasIMM ? ", imm" : "");
|
||||
, p->name, p->hasIMM ? ", uint8_t imm" : "", type.c_str(), p->code, p->hasIMM ? ", imm" : "");
|
||||
}
|
||||
}
|
||||
}
|
||||
// (m, x), (m, y)
|
||||
{
|
||||
const struct Tbl {
|
||||
uint8 code;
|
||||
uint8_t code;
|
||||
const char *name;
|
||||
int type;
|
||||
} tbl[] = {
|
||||
|
@ -1333,7 +1333,7 @@ void put()
|
|||
// (x, x/m), (y, y/m), (x, x, x/m), (y, y, y/m)
|
||||
{
|
||||
const struct Tbl {
|
||||
uint8 code;
|
||||
uint8_t code;
|
||||
const char *name;
|
||||
int type;
|
||||
int mode; // 1 : sse, 2 : avx, 3 : sse + avx
|
||||
|
@ -1354,7 +1354,7 @@ void put()
|
|||
const Tbl *p = &tbl[i];
|
||||
std::string type = type2String(p->type);
|
||||
if (p->mode & 1) {
|
||||
uint8 pref = p->type & T_66 ? 0x66 : p->type & T_F2 ? 0xF2 : p->type & T_F3 ? 0xF3 : 0;
|
||||
uint8_t pref = p->type & T_66 ? 0x66 : p->type & T_F2 ? 0xF2 : p->type & T_F3 ? 0xF3 : 0;
|
||||
printf("void %s(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x%02X, 0x%02X, isXMM_XMMorMEM%s); }\n", p->name, p->code, pref, p->type & T_0F38 ? ", NONE, 0x38" : "");
|
||||
}
|
||||
if (p->mode & 2) {
|
||||
|
@ -1382,7 +1382,7 @@ void put()
|
|||
// vpermd, vpermps
|
||||
{
|
||||
const struct Tbl {
|
||||
uint8 code;
|
||||
uint8_t code;
|
||||
const char *name;
|
||||
int type;
|
||||
} tbl[] = {
|
||||
|
@ -1400,7 +1400,7 @@ void put()
|
|||
// vpermq, vpermpd
|
||||
{
|
||||
const struct Tbl {
|
||||
uint8 code;
|
||||
uint8_t code;
|
||||
const char *name;
|
||||
int type;
|
||||
} tbl[] = {
|
||||
|
@ -1410,7 +1410,7 @@ void put()
|
|||
for (size_t i = 0; i < NUM_OF_ARRAY(tbl); i++) {
|
||||
const Tbl& p = tbl[i];
|
||||
std::string type = type2String(p.type);
|
||||
printf("void %s(const Ymm& y, const Operand& op, uint8 imm) { opAVX_X_XM_IMM(y, op, %s, 0x%02X, imm); }\n", p.name, type.c_str(), p.code);
|
||||
printf("void %s(const Ymm& y, const Operand& op, uint8_t imm) { opAVX_X_XM_IMM(y, op, %s, 0x%02X, imm); }\n", p.name, type.c_str(), p.code);
|
||||
}
|
||||
}
|
||||
// vcmpeqps
|
||||
|
@ -1437,7 +1437,7 @@ void put()
|
|||
const struct Tbl {
|
||||
bool isH;
|
||||
bool isPd;
|
||||
uint8 code;
|
||||
uint8_t code;
|
||||
} tbl[] = {
|
||||
{ true, true, 0x16 },
|
||||
{ true, false, 0x16 },
|
||||
|
@ -1458,7 +1458,7 @@ void put()
|
|||
// FMA
|
||||
{
|
||||
const struct Tbl {
|
||||
uint8 code;
|
||||
uint8_t code;
|
||||
const char *name;
|
||||
bool supportYMM;
|
||||
} tbl[] = {
|
||||
|
@ -1482,7 +1482,7 @@ void put()
|
|||
for (int k = 0; k < 3; k++) {
|
||||
const struct Ord {
|
||||
const char *str;
|
||||
uint8 code;
|
||||
uint8_t code;
|
||||
} ord[] = {
|
||||
{ "132", 0x90 },
|
||||
{ "213", 0xA0 },
|
||||
|
@ -1515,7 +1515,7 @@ void put()
|
|||
printf("void vbroadcastsd(const Ymm& y, const Operand& op) { if (!op.isMEM() && !(y.isYMM() && op.isXMM()) && !(y.isZMM() && op.isXMM())) XBYAK_THROW(ERR_BAD_COMBINATION) opAVX_X_XM_IMM(y, op, T_0F38 | T_66 | T_W0 | T_YMM | T_EVEX | T_EW1 | T_N8, 0x19); }\n");
|
||||
const struct Tbl {
|
||||
const char *name;
|
||||
uint8 code;
|
||||
uint8_t code;
|
||||
int type;
|
||||
bool ew1;
|
||||
} tbl[] = {
|
||||
|
@ -1531,28 +1531,28 @@ void put()
|
|||
printf("void %s(const Xmm& x, const Operand& op) { if (!(op.isXMM() || op.isMEM())) XBYAK_THROW(ERR_BAD_COMBINATION) opAVX_X_XM_IMM(x, op, %s, 0x%02X); }\n", p.name, type.c_str(), p.code);
|
||||
}
|
||||
|
||||
puts("void vextractf128(const Operand& op, const Ymm& y, uint8 imm) { if (!(op.isXMEM() && y.isYMM())) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(y, 0, op, T_0F3A | T_66 | T_W0 | T_YMM, 0x19, imm); }");
|
||||
puts("void vextracti128(const Operand& op, const Ymm& y, uint8 imm) { if (!(op.isXMEM() && y.isYMM())) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(y, 0, op, T_0F3A | T_66 | T_W0 | T_YMM, 0x39, imm); }");
|
||||
puts("void vextractps(const Operand& op, const Xmm& x, uint8 imm) { if (!((op.isREG(32) || op.isMEM()) && x.isXMM())) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(x, 0, op, T_0F3A | T_66 | T_W0 | T_EVEX | T_N4, 0x17, imm); }");
|
||||
puts("void vinsertf128(const Ymm& y1, const Ymm& y2, const Operand& op, uint8 imm) { if (!(y1.isYMM() && y2.isYMM() && op.isXMEM())) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(y1, &y2, op, T_0F3A | T_66 | T_W0 | T_YMM, 0x18, imm); }");
|
||||
puts("void vinserti128(const Ymm& y1, const Ymm& y2, const Operand& op, uint8 imm) { if (!(y1.isYMM() && y2.isYMM() && op.isXMEM())) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(y1, &y2, op, T_0F3A | T_66 | T_W0 | T_YMM, 0x38, imm); }");
|
||||
puts("void vperm2f128(const Ymm& y1, const Ymm& y2, const Operand& op, uint8 imm) { if (!(y1.isYMM() && y2.isYMM() && op.isYMEM())) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(y1, &y2, op, T_0F3A | T_66 | T_W0 | T_YMM, 0x06, imm); }");
|
||||
puts("void vperm2i128(const Ymm& y1, const Ymm& y2, const Operand& op, uint8 imm) { if (!(y1.isYMM() && y2.isYMM() && op.isYMEM())) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(y1, &y2, op, T_0F3A | T_66 | T_W0 | T_YMM, 0x46, imm); }");
|
||||
puts("void vextractf128(const Operand& op, const Ymm& y, uint8_t imm) { if (!(op.isXMEM() && y.isYMM())) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(y, 0, op, T_0F3A | T_66 | T_W0 | T_YMM, 0x19, imm); }");
|
||||
puts("void vextracti128(const Operand& op, const Ymm& y, uint8_t imm) { if (!(op.isXMEM() && y.isYMM())) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(y, 0, op, T_0F3A | T_66 | T_W0 | T_YMM, 0x39, imm); }");
|
||||
puts("void vextractps(const Operand& op, const Xmm& x, uint8_t imm) { if (!((op.isREG(32) || op.isMEM()) && x.isXMM())) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(x, 0, op, T_0F3A | T_66 | T_W0 | T_EVEX | T_N4, 0x17, imm); }");
|
||||
puts("void vinsertf128(const Ymm& y1, const Ymm& y2, const Operand& op, uint8_t imm) { if (!(y1.isYMM() && y2.isYMM() && op.isXMEM())) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(y1, &y2, op, T_0F3A | T_66 | T_W0 | T_YMM, 0x18, imm); }");
|
||||
puts("void vinserti128(const Ymm& y1, const Ymm& y2, const Operand& op, uint8_t imm) { if (!(y1.isYMM() && y2.isYMM() && op.isXMEM())) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(y1, &y2, op, T_0F3A | T_66 | T_W0 | T_YMM, 0x38, imm); }");
|
||||
puts("void vperm2f128(const Ymm& y1, const Ymm& y2, const Operand& op, uint8_t imm) { if (!(y1.isYMM() && y2.isYMM() && op.isYMEM())) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(y1, &y2, op, T_0F3A | T_66 | T_W0 | T_YMM, 0x06, imm); }");
|
||||
puts("void vperm2i128(const Ymm& y1, const Ymm& y2, const Operand& op, uint8_t imm) { if (!(y1.isYMM() && y2.isYMM() && op.isYMEM())) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(y1, &y2, op, T_0F3A | T_66 | T_W0 | T_YMM, 0x46, imm); }");
|
||||
|
||||
puts("void vlddqu(const Xmm& x, const Address& addr) { opAVX_X_X_XM(x, cvtIdx0(x), addr, T_0F | T_F2 | T_W0 | T_YMM, 0xF0); }");
|
||||
puts("void vldmxcsr(const Address& addr) { opAVX_X_X_XM(xm2, xm0, addr, T_0F, 0xAE); }");
|
||||
puts("void vstmxcsr(const Address& addr) { opAVX_X_X_XM(xm3, xm0, addr, T_0F, 0xAE); }");
|
||||
puts("void vmaskmovdqu(const Xmm& x1, const Xmm& x2) { opAVX_X_X_XM(x1, xm0, x2, T_0F | T_66, 0xF7); }");
|
||||
|
||||
puts("void vpextrb(const Operand& op, const Xmm& x, uint8 imm) { if (!((op.isREG(8|16|i32e) || op.isMEM()) && x.isXMM())) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(x, 0, op, T_0F3A | T_66 | T_EVEX | T_N1, 0x14, imm); }");
|
||||
puts("void vpextrw(const Operand& op, const Xmm& x, uint8 imm) { if (!((op.isREG(16|i32e) || op.isMEM()) && x.isXMM())) XBYAK_THROW(ERR_BAD_COMBINATION) if (op.isREG() && x.getIdx() < 16) { opAVX_X_X_XM(Xmm(op.getIdx()), xm0, x, T_0F | T_66, 0xC5, imm); } else { opVex(x, 0, op, T_0F3A | T_66 | T_EVEX | T_N2, 0x15, imm); } }");
|
||||
puts("void vpextrd(const Operand& op, const Xmm& x, uint8 imm) { if (!((op.isREG(32) || op.isMEM()) && x.isXMM())) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(x, 0, op, T_0F3A | T_66 | T_W0 | T_EVEX | T_EW0 | T_N4, 0x16, imm); }");
|
||||
puts("void vpextrq(const Operand& op, const Xmm& x, uint8 imm) { if (!((op.isREG(64) || op.isMEM()) && x.isXMM())) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(x, 0, op, T_0F3A | T_66 | T_W1 | T_EVEX | T_EW1 | T_N8, 0x16, imm); }");
|
||||
puts("void vpextrb(const Operand& op, const Xmm& x, uint8_t imm) { if (!((op.isREG(8|16|i32e) || op.isMEM()) && x.isXMM())) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(x, 0, op, T_0F3A | T_66 | T_EVEX | T_N1, 0x14, imm); }");
|
||||
puts("void vpextrw(const Operand& op, const Xmm& x, uint8_t imm) { if (!((op.isREG(16|i32e) || op.isMEM()) && x.isXMM())) XBYAK_THROW(ERR_BAD_COMBINATION) if (op.isREG() && x.getIdx() < 16) { opAVX_X_X_XM(Xmm(op.getIdx()), xm0, x, T_0F | T_66, 0xC5, imm); } else { opVex(x, 0, op, T_0F3A | T_66 | T_EVEX | T_N2, 0x15, imm); } }");
|
||||
puts("void vpextrd(const Operand& op, const Xmm& x, uint8_t imm) { if (!((op.isREG(32) || op.isMEM()) && x.isXMM())) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(x, 0, op, T_0F3A | T_66 | T_W0 | T_EVEX | T_EW0 | T_N4, 0x16, imm); }");
|
||||
puts("void vpextrq(const Operand& op, const Xmm& x, uint8_t imm) { if (!((op.isREG(64) || op.isMEM()) && x.isXMM())) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(x, 0, op, T_0F3A | T_66 | T_W1 | T_EVEX | T_EW1 | T_N8, 0x16, imm); }");
|
||||
|
||||
puts("void vpinsrb(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { if (!(x1.isXMM() && x2.isXMM() && (op.isREG(32) || op.isMEM()))) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(x1, &x2, op, T_0F3A | T_66 | T_EVEX | T_N1, 0x20, imm); }");
|
||||
puts("void vpinsrw(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { if (!(x1.isXMM() && x2.isXMM() && (op.isREG(32) || op.isMEM()))) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(x1, &x2, op, T_0F | T_66 | T_EVEX | T_N2, 0xC4, imm); }");
|
||||
puts("void vpinsrd(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { if (!(x1.isXMM() && x2.isXMM() && (op.isREG(32) || op.isMEM()))) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(x1, &x2, op, T_0F3A | T_66 | T_W0 | T_EVEX | T_EW0 | T_N4, 0x22, imm); }");
|
||||
puts("void vpinsrq(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { if (!(x1.isXMM() && x2.isXMM() && (op.isREG(64) || op.isMEM()))) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(x1, &x2, op, T_0F3A | T_66 | T_W1 | T_EVEX | T_EW1 | T_N8, 0x22, imm); }");
|
||||
puts("void vpinsrb(const Xmm& x1, const Xmm& x2, const Operand& op, uint8_t imm) { if (!(x1.isXMM() && x2.isXMM() && (op.isREG(32) || op.isMEM()))) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(x1, &x2, op, T_0F3A | T_66 | T_EVEX | T_N1, 0x20, imm); }");
|
||||
puts("void vpinsrw(const Xmm& x1, const Xmm& x2, const Operand& op, uint8_t imm) { if (!(x1.isXMM() && x2.isXMM() && (op.isREG(32) || op.isMEM()))) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(x1, &x2, op, T_0F | T_66 | T_EVEX | T_N2, 0xC4, imm); }");
|
||||
puts("void vpinsrd(const Xmm& x1, const Xmm& x2, const Operand& op, uint8_t imm) { if (!(x1.isXMM() && x2.isXMM() && (op.isREG(32) || op.isMEM()))) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(x1, &x2, op, T_0F3A | T_66 | T_W0 | T_EVEX | T_EW0 | T_N4, 0x22, imm); }");
|
||||
puts("void vpinsrq(const Xmm& x1, const Xmm& x2, const Operand& op, uint8_t imm) { if (!(x1.isXMM() && x2.isXMM() && (op.isREG(64) || op.isMEM()))) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(x1, &x2, op, T_0F3A | T_66 | T_W1 | T_EVEX | T_EW1 | T_N8, 0x22, imm); }");
|
||||
|
||||
puts("void vpmovmskb(const Reg32e& r, const Xmm& x) { if (!x.is(Operand::XMM | Operand::YMM)) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(x.isYMM() ? Ymm(r.getIdx()) : Xmm(r.getIdx()), 0, x, T_0F | T_66 | T_YMM, 0xD7); }");
|
||||
|
||||
|
@ -1561,7 +1561,7 @@ void put()
|
|||
{
|
||||
const struct Tbl {
|
||||
const char *name;
|
||||
uint8 code;
|
||||
uint8_t code;
|
||||
int idx;
|
||||
int type;
|
||||
} tbl[] = {
|
||||
|
@ -1579,14 +1579,14 @@ void put()
|
|||
for (size_t i = 0; i < NUM_OF_ARRAY(tbl); i++) {
|
||||
const Tbl& p = tbl[i];
|
||||
std::string type = type2String(p.type);
|
||||
printf("void v%s(const Xmm& x, const Operand& op, uint8 imm) { opAVX_X_X_XM(Xmm(x.getKind(), %d), x, op, %s, 0x%02X, imm); }\n", p.name, p.idx, type.c_str(), p.code);
|
||||
printf("void v%s(const Xmm& x, const Operand& op, uint8_t imm) { opAVX_X_X_XM(Xmm(x.getKind(), %d), x, op, %s, 0x%02X, imm); }\n", p.name, p.idx, type.c_str(), p.code);
|
||||
}
|
||||
}
|
||||
// 4-op
|
||||
{
|
||||
const struct Tbl {
|
||||
const char *name;
|
||||
uint8 code;
|
||||
uint8_t code;
|
||||
} tbl[] = {
|
||||
{ "vblendvpd", 0x4B },
|
||||
{ "vblendvps", 0x4A },
|
||||
|
@ -1648,7 +1648,7 @@ void put()
|
|||
puts("void vcvttpd2dq(const Xmm& x, const Operand& op) { opCvt2(x, op, T_66 | T_0F | T_YMM | T_EVEX |T_EW1 | T_B64 | T_ER_Z, 0xE6); }");
|
||||
|
||||
puts("void vcvtph2ps(const Xmm& x, const Operand& op) { checkCvt1(x, op); opVex(x, 0, op, T_0F38 | T_66 | T_W0 | T_EVEX | T_EW0 | T_N8 | T_N_VL | T_SAE_Y, 0x13); }");
|
||||
puts("void vcvtps2ph(const Operand& op, const Xmm& x, uint8 imm) { checkCvt1(x, op); opVex(x, 0, op, T_0F3A | T_66 | T_W0 | T_EVEX | T_EW0 | T_N8 | T_N_VL | T_SAE_Y, 0x1D, imm); }");
|
||||
puts("void vcvtps2ph(const Operand& op, const Xmm& x, uint8_t imm) { checkCvt1(x, op); opVex(x, 0, op, T_0F3A | T_66 | T_W0 | T_EVEX | T_EW0 | T_N8 | T_N_VL | T_SAE_Y, 0x1D, imm); }");
|
||||
|
||||
}
|
||||
// haswell gpr(reg, reg, r/m)
|
||||
|
@ -1656,7 +1656,7 @@ void put()
|
|||
const struct Tbl {
|
||||
const char *name;
|
||||
int type;
|
||||
uint8 code;
|
||||
uint8_t code;
|
||||
} tbl[] = {
|
||||
{ "andn", T_0F38, 0xF2 },
|
||||
{ "mulx", T_F2 | T_0F38, 0xF6 },
|
||||
|
@ -1673,7 +1673,7 @@ void put()
|
|||
const struct Tbl {
|
||||
const char *name;
|
||||
int type;
|
||||
uint8 code;
|
||||
uint8_t code;
|
||||
} tbl[] = {
|
||||
{ "bextr", T_0F38, 0xF7 },
|
||||
{ "bzhi", T_0F38, 0xF5 },
|
||||
|
@ -1685,15 +1685,15 @@ void put()
|
|||
const Tbl& p = tbl[i];
|
||||
printf("void %s(const Reg32e& r1, const Operand& op, const Reg32e& r2) { opGpr(r1, op, r2, %s, 0x%x, false); }\n", p.name, type2String(p.type).c_str(), p.code);
|
||||
}
|
||||
puts("void rorx(const Reg32e& r, const Operand& op, uint8 imm) { opGpr(r, op, Reg32e(0, r.getBit()), T_0F3A | T_F2, 0xF0, false, imm); }");
|
||||
puts("void rorx(const Reg32e& r, const Operand& op, uint8_t imm) { opGpr(r, op, Reg32e(0, r.getBit()), T_0F3A | T_F2, 0xF0, false, imm); }");
|
||||
}
|
||||
// gpr(reg, r/m)
|
||||
{
|
||||
const struct Tbl {
|
||||
const char *name;
|
||||
int type;
|
||||
uint8 code;
|
||||
uint8 idx;
|
||||
uint8_t code;
|
||||
uint8_t idx;
|
||||
} tbl[] = {
|
||||
{ "blsi", T_0F38, 0xF3, 3 },
|
||||
{ "blsmsk", T_0F38, 0xF3, 2 },
|
||||
|
@ -1711,7 +1711,7 @@ void put()
|
|||
const int x_vy_x = 2;
|
||||
const struct Tbl {
|
||||
const char *name;
|
||||
uint8 code;
|
||||
uint8_t code;
|
||||
int w;
|
||||
int mode;
|
||||
} tbl[] = {
|
||||
|
@ -1781,8 +1781,8 @@ void put64()
|
|||
puts("void movq(const Reg64& reg, const Mmx& mmx) { if (mmx.isXMM()) db(0x66); opModR(mmx, reg, 0x0F, 0x7E); }");
|
||||
puts("void movq(const Mmx& mmx, const Reg64& reg) { if (mmx.isXMM()) db(0x66); opModR(mmx, reg, 0x0F, 0x6E); }");
|
||||
puts("void movsxd(const Reg64& reg, const Operand& op) { if (!op.isBit(32)) XBYAK_THROW(ERR_BAD_COMBINATION) opModRM(reg, op, op.isREG(), op.isMEM(), 0x63); }");
|
||||
puts("void pextrq(const Operand& op, const Xmm& xmm, uint8 imm) { if (!op.isREG(64) && !op.isMEM()) XBYAK_THROW(ERR_BAD_COMBINATION) opGen(Reg64(xmm.getIdx()), op, 0x16, 0x66, 0, imm, 0x3A); }");
|
||||
puts("void pinsrq(const Xmm& xmm, const Operand& op, uint8 imm) { if (!op.isREG(64) && !op.isMEM()) XBYAK_THROW(ERR_BAD_COMBINATION) opGen(Reg64(xmm.getIdx()), op, 0x22, 0x66, 0, imm, 0x3A); }");
|
||||
puts("void pextrq(const Operand& op, const Xmm& xmm, uint8_t imm) { if (!op.isREG(64) && !op.isMEM()) XBYAK_THROW(ERR_BAD_COMBINATION) opGen(Reg64(xmm.getIdx()), op, 0x16, 0x66, 0, imm, 0x3A); }");
|
||||
puts("void pinsrq(const Xmm& xmm, const Operand& op, uint8_t imm) { if (!op.isREG(64) && !op.isMEM()) XBYAK_THROW(ERR_BAD_COMBINATION) opGen(Reg64(xmm.getIdx()), op, 0x22, 0x66, 0, imm, 0x3A); }");
|
||||
|
||||
puts("void vcvtss2si(const Reg64& r, const Operand& op) { opAVX_X_X_XM(Xmm(r.getIdx()), xm0, op, T_0F | T_F3 | T_W1 | T_EVEX | T_EW1 | T_ER_X | T_N8, 0x2D); }");
|
||||
puts("void vcvttss2si(const Reg64& r, const Operand& op) { opAVX_X_X_XM(Xmm(r.getIdx()), xm0, op, T_0F | T_F3 | T_W1 | T_EVEX | T_EW1 | T_SAE_X | T_N8, 0x2C); }");
|
||||
|
@ -1832,7 +1832,7 @@ void putFixed()
|
|||
for (size_t i = 0; i < NUM_OF_ARRAY(tbl); i++) {
|
||||
const char *name = tbl[i];
|
||||
printf("void %s(const Operand& op1, const Operand& op2) { %s_(op1, op2); }\n", name, name);
|
||||
printf("void %s(const Operand& op, uint32 imm) { %s_(op, imm); }\n", name, name);
|
||||
printf("void %s(const Operand& op, uint32_t imm) { %s_(op, imm); }\n", name, name);
|
||||
}
|
||||
puts("void not(const Operand& op) { not_(op); }");
|
||||
puts("#endif");
|
||||
|
@ -1840,10 +1840,10 @@ void putFixed()
|
|||
|
||||
void putOmit()
|
||||
{
|
||||
puts("void vpinsrb(const Xmm& x, const Operand& op, uint8 imm) { vpinsrb(x, x, op, imm); }");
|
||||
puts("void vpinsrd(const Xmm& x, const Operand& op, uint8 imm) { vpinsrd(x, x, op, imm); }");
|
||||
puts("void vpinsrq(const Xmm& x, const Operand& op, uint8 imm) { vpinsrq(x, x, op, imm); }");
|
||||
puts("void vpinsrw(const Xmm& x, const Operand& op, uint8 imm) { vpinsrw(x, x, op, imm); }");
|
||||
puts("void vpinsrb(const Xmm& x, const Operand& op, uint8_t imm) { vpinsrb(x, x, op, imm); }");
|
||||
puts("void vpinsrd(const Xmm& x, const Operand& op, uint8_t imm) { vpinsrd(x, x, op, imm); }");
|
||||
puts("void vpinsrq(const Xmm& x, const Operand& op, uint8_t imm) { vpinsrq(x, x, op, imm); }");
|
||||
puts("void vpinsrw(const Xmm& x, const Operand& op, uint8_t imm) { vpinsrw(x, x, op, imm); }");
|
||||
|
||||
puts("void vcvtsi2sd(const Xmm& x, const Operand& op) { vcvtsi2sd(x, x, op); }");
|
||||
puts("void vcvtsi2ss(const Xmm& x, const Operand& op) { vcvtsi2ss(x, x, op); }");
|
||||
|
@ -1877,7 +1877,7 @@ void putOmit()
|
|||
};
|
||||
for (size_t i = 0; i < NUM_OF_ARRAY(tbl); i++) {
|
||||
const char *name = tbl[i];
|
||||
printf("void v%s(const Xmm& x, uint8 imm) { v%s(x, x, imm); }\n", name, name);
|
||||
printf("void v%s(const Xmm& x, uint8_t imm) { v%s(x, x, imm); }\n", name, name);
|
||||
}
|
||||
}
|
||||
{
|
||||
|
|
|
@ -148,7 +148,7 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
void dump(const Xbyak::uint8 *code, size_t size)
|
||||
void dump(const uint8_t *code, size_t size)
|
||||
{
|
||||
puts("#include <stdio.h>\nstatic int stack[128 * 1024];");
|
||||
#ifdef _MSC_VER
|
||||
|
|
|
@ -102,7 +102,7 @@ private:
|
|||
MAX_CONST_NUM = 32
|
||||
};
|
||||
MIE_ALIGN(16) double constTbl_[MAX_CONST_NUM];
|
||||
Xbyak::uint64 negConst_;
|
||||
Xbyak::uint64_t negConst_;
|
||||
size_t constTblPos_;
|
||||
#ifdef XBYAK32
|
||||
const Xbyak::Reg32& varTbl_;
|
||||
|
@ -118,7 +118,7 @@ public:
|
|||
64bit: x [rcx](win), xmm0(gcc), return xmm0
|
||||
*/
|
||||
Jit()
|
||||
: negConst_(Xbyak::uint64(1) << 63)
|
||||
: negConst_(Xbyak::uint64_t(1) << 63)
|
||||
, constTblPos_(0)
|
||||
#ifdef XBYAK32
|
||||
, varTbl_(eax)
|
||||
|
|
|
@ -48,9 +48,6 @@
|
|||
#pragma warning(disable : 4996) // scanf
|
||||
#endif
|
||||
|
||||
typedef Xbyak::uint64 uint64;
|
||||
typedef Xbyak::uint32 uint32;
|
||||
|
||||
const int N = 64;
|
||||
|
||||
class Quantize : public Xbyak::CodeGenerator {
|
||||
|
@ -66,7 +63,7 @@ public:
|
|||
output : eax = [esi+offset] / dividend
|
||||
destroy : edx
|
||||
*/
|
||||
void udiv(uint32 dividend, int offset)
|
||||
void udiv(uint32_t dividend, int offset)
|
||||
{
|
||||
mov(eax, ptr[esi + offset]);
|
||||
|
||||
|
@ -83,11 +80,11 @@ public:
|
|||
return;
|
||||
}
|
||||
|
||||
uint64 mLow, mHigh;
|
||||
uint64_t mLow, mHigh;
|
||||
int len = ilog2(odd) + 1;
|
||||
{
|
||||
uint64 roundUp = uint64(1) << (32 + len);
|
||||
uint64 k = roundUp / (0xFFFFFFFFL - (0xFFFFFFFFL % odd));
|
||||
uint64_t roundUp = uint64_t(1) << (32 + len);
|
||||
uint64_t k = roundUp / (0xFFFFFFFFL - (0xFFFFFFFFL % odd));
|
||||
mLow = roundUp / odd;
|
||||
mHigh = (roundUp + k) / odd;
|
||||
}
|
||||
|
@ -96,12 +93,12 @@ public:
|
|||
mLow >>= 1; mHigh >>= 1; len--;
|
||||
}
|
||||
|
||||
uint64 m; int a;
|
||||
uint64_t m; int a;
|
||||
if ((mHigh >> 32) == 0) {
|
||||
m = mHigh; a = 0;
|
||||
} else {
|
||||
len = ilog2(odd);
|
||||
uint64 roundDown = uint64(1) << (32 + len);
|
||||
uint64_t roundDown = uint64_t(1) << (32 + len);
|
||||
mLow = roundDown / odd;
|
||||
int r = (int)(roundDown % odd);
|
||||
m = (r <= (odd >> 1)) ? mLow : mLow + 1;
|
||||
|
@ -124,9 +121,9 @@ public:
|
|||
mov(eax, edx);
|
||||
}
|
||||
/*
|
||||
quantize(uint32 dest[64], const uint32 src[64]);
|
||||
quantize(uint32_t dest[64], const uint32_t src[64]);
|
||||
*/
|
||||
Quantize(const uint32 qTbl[64])
|
||||
Quantize(const uint32_t qTbl[64])
|
||||
{
|
||||
push(esi);
|
||||
push(edi);
|
||||
|
@ -143,7 +140,7 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
void quantize(uint32 dest[64], const uint32 src[64], const uint32 qTbl[64])
|
||||
void quantize(uint32_t dest[64], const uint32_t src[64], const uint32_t qTbl[64])
|
||||
{
|
||||
for (int i = 0; i < N; i++) {
|
||||
dest[i] = src[i] / qTbl[i];
|
||||
|
@ -170,7 +167,7 @@ int main(int argc, char *argv[])
|
|||
}
|
||||
}
|
||||
printf("q=%d\n", q);
|
||||
uint32 qTbl[] = {
|
||||
uint32_t qTbl[] = {
|
||||
16, 11, 10, 16, 24, 40, 51, 61,
|
||||
12, 12, 14, 19, 26, 58, 60, 55,
|
||||
14, 13, 16, 24, 40, 57, 69, 56,
|
||||
|
@ -187,16 +184,16 @@ int main(int argc, char *argv[])
|
|||
}
|
||||
|
||||
try {
|
||||
uint32 src[N];
|
||||
uint32 dest[N];
|
||||
uint32 dest2[N];
|
||||
uint32_t src[N];
|
||||
uint32_t dest[N];
|
||||
uint32_t dest2[N];
|
||||
for (int i = 0; i < N; i++) {
|
||||
src[i] = rand() % 2048;
|
||||
}
|
||||
|
||||
Quantize jit(qTbl);
|
||||
//printf("jit size=%d, ptr=%p\n", jit.getSize(), jit.getCode());
|
||||
void (*quantize2)(uint32*, const uint32*, const uint32 *) = jit.getCode<void (*)(uint32*, const uint32*, const uint32 *)>();
|
||||
void (*quantize2)(uint32_t*, const uint32_t*, const uint32_t *) = jit.getCode<void (*)(uint32_t*, const uint32_t*, const uint32_t *)>();
|
||||
|
||||
quantize(dest, src, qTbl);
|
||||
quantize2(dest2, src, qTbl);
|
||||
|
|
|
@ -163,15 +163,15 @@ int main()
|
|||
// use memory allocated by user
|
||||
using namespace Xbyak;
|
||||
const size_t codeSize = 4096;
|
||||
uint8 buf[codeSize + 16];
|
||||
uint8 *p = CodeArray::getAlignedAddress(buf);
|
||||
uint8_t buf[codeSize + 16];
|
||||
uint8_t *p = CodeArray::getAlignedAddress(buf);
|
||||
Sample s(p, codeSize);
|
||||
if (!CodeArray::protect(p, codeSize, CodeArray::PROTECT_RWE)) {
|
||||
fprintf(stderr, "can't protect\n");
|
||||
return 1;
|
||||
}
|
||||
int (*func)(int) = s.getCode<int (*)(int)>();
|
||||
const uint8 *funcp = reinterpret_cast<const uint8*>(func);
|
||||
const uint8_t *funcp = reinterpret_cast<const uint8_t*>(func);
|
||||
if (funcp != p) {
|
||||
fprintf(stderr, "internal error %p %p\n", p, funcp);
|
||||
return 1;
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
using namespace Xbyak;
|
||||
|
||||
class ToyVm : public Xbyak::CodeGenerator {
|
||||
typedef std::vector<uint32> Buffer;
|
||||
typedef std::vector<uint32_t> Buffer;
|
||||
public:
|
||||
enum Reg {
|
||||
A, B
|
||||
|
@ -53,14 +53,14 @@ public:
|
|||
{
|
||||
::memset(mem_, 0, sizeof(mem_));
|
||||
}
|
||||
void vldi(Reg r, uint16 imm) { encode(LDI, r, imm); }
|
||||
void vld(Reg r, uint16 idx) { encode(LD, r, idx); }
|
||||
void vst(Reg r, uint16 idx) { encode(ST, r, idx); }
|
||||
void vadd(Reg r, uint16 idx) { encode(ADD, r, idx); }
|
||||
void vaddi(Reg r, uint16 imm) { encode(ADDI, r, imm); }
|
||||
void vsub(Reg r, uint16 idx) { encode(SUB, r, idx); }
|
||||
void vsubi(Reg r, uint16 imm) { encode(SUBI, r, imm); }
|
||||
void vjnz(Reg r, int offset) { encode(JNZ, r, static_cast<uint16>(offset)); }
|
||||
void vldi(Reg r, uint16_t imm) { encode(LDI, r, imm); }
|
||||
void vld(Reg r, uint16_t idx) { encode(LD, r, idx); }
|
||||
void vst(Reg r, uint16_t idx) { encode(ST, r, idx); }
|
||||
void vadd(Reg r, uint16_t idx) { encode(ADD, r, idx); }
|
||||
void vaddi(Reg r, uint16_t imm) { encode(ADDI, r, imm); }
|
||||
void vsub(Reg r, uint16_t idx) { encode(SUB, r, idx); }
|
||||
void vsubi(Reg r, uint16_t imm) { encode(SUBI, r, imm); }
|
||||
void vjnz(Reg r, int offset) { encode(JNZ, r, static_cast<uint16_t>(offset)); }
|
||||
void vput(Reg r) { encode(PUT, r); }
|
||||
void setMark()
|
||||
{
|
||||
|
@ -73,12 +73,12 @@ public:
|
|||
void run()
|
||||
{
|
||||
bool debug = false;//true;
|
||||
uint32 reg[2] = { 0, 0 };
|
||||
uint32_t reg[2] = { 0, 0 };
|
||||
const size_t end = code_.size();
|
||||
uint32 pc = 0;
|
||||
uint32_t pc = 0;
|
||||
for (;;) {
|
||||
uint32 x = code_[pc];
|
||||
uint32 code, r, imm;
|
||||
uint32_t x = code_[pc];
|
||||
uint32_t code, r, imm;
|
||||
decode(code, r, imm, x);
|
||||
if (debug) {
|
||||
printf("---\n");
|
||||
|
@ -149,11 +149,11 @@ public:
|
|||
xor_(edi, edi);
|
||||
mov(mem, (size_t)mem_);
|
||||
const size_t end = code_.size();
|
||||
uint32 pc = 0;
|
||||
uint32 labelNum = 0;
|
||||
uint32_t pc = 0;
|
||||
uint32_t labelNum = 0;
|
||||
for (;;) {
|
||||
uint32 x = code_[pc];
|
||||
uint32 code, r, imm;
|
||||
uint32_t x = code_[pc];
|
||||
uint32_t code, r, imm;
|
||||
decode(code, r, imm, x);
|
||||
L(Label::toStr(labelNum++));
|
||||
switch (code) {
|
||||
|
@ -229,18 +229,18 @@ public:
|
|||
ret();
|
||||
}
|
||||
private:
|
||||
uint32 mem_[65536];
|
||||
uint32_t mem_[65536];
|
||||
Buffer code_;
|
||||
int mark_;
|
||||
void decode(uint32& code, uint32& r, uint32& imm, uint32 x)
|
||||
void decode(uint32_t& code, uint32_t& r, uint32_t& imm, uint32_t x)
|
||||
{
|
||||
code = x >> 24;
|
||||
r = (x >> 16) & 0xff;
|
||||
imm = x & 0xffff;
|
||||
}
|
||||
void encode(Code code, Reg r, uint16 imm = 0)
|
||||
void encode(Code code, Reg r, uint16_t imm = 0)
|
||||
{
|
||||
uint32 x = (code << 24) | (r << 16) | imm;
|
||||
uint32_t x = (code << 24) | (r << 16) | imm;
|
||||
code_.push_back(x);
|
||||
}
|
||||
};
|
||||
|
@ -262,7 +262,7 @@ public:
|
|||
*/
|
||||
vldi(A, 1); // c
|
||||
vst(A, 0); // p(1)
|
||||
vldi(B, static_cast<uint16>(n));
|
||||
vldi(B, static_cast<uint16_t>(n));
|
||||
vst(B, 2); // n
|
||||
// lp
|
||||
setMark();
|
||||
|
@ -283,9 +283,9 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
void fibC(uint32 n)
|
||||
void fibC(uint32_t n)
|
||||
{
|
||||
uint32 p, c, t;
|
||||
uint32_t p, c, t;
|
||||
p = 1;
|
||||
c = 1;
|
||||
lp:
|
||||
|
|
26
test/jmp.cpp
26
test/jmp.cpp
|
@ -117,7 +117,7 @@ CYBOZU_TEST_AUTO(test1)
|
|||
int offset;
|
||||
bool isBack;
|
||||
bool isShort;
|
||||
uint8 result[6];
|
||||
uint8_t result[6];
|
||||
int size;
|
||||
} tbl[] = {
|
||||
{ 0, true, true, { 0xeb, 0xfe }, 2 },
|
||||
|
@ -133,7 +133,7 @@ CYBOZU_TEST_AUTO(test1)
|
|||
const Tbl *p = &tbl[i];
|
||||
for (int k = 0; k < 2; k++) {
|
||||
TestJmp jmp(p->offset, p->isBack, p->isShort, k == 0);
|
||||
const uint8 *q = (const uint8*)jmp.getCode();
|
||||
const uint8_t *q = (const uint8_t*)jmp.getCode();
|
||||
if (p->isBack) q += p->offset; /* skip nop */
|
||||
for (int j = 0; j < p->size; j++) {
|
||||
CYBOZU_TEST_EQUAL(q[j], p->result[j]);
|
||||
|
@ -207,7 +207,7 @@ CYBOZU_TEST_AUTO(testJmpCx)
|
|||
|
||||
CYBOZU_TEST_AUTO(loop)
|
||||
{
|
||||
const uint8 ok[] = {
|
||||
const uint8_t ok[] = {
|
||||
// lp:
|
||||
0x31, 0xC0, // xor eax, eax
|
||||
0xE2, 0xFC, // loop lp
|
||||
|
@ -372,11 +372,11 @@ CYBOZU_TEST_AUTO(test3)
|
|||
}
|
||||
#endif
|
||||
|
||||
Xbyak::uint8 bufL[4096 * 32];
|
||||
Xbyak::uint8 bufS[4096 * 2];
|
||||
uint8_t bufL[4096 * 32];
|
||||
uint8_t bufS[4096 * 2];
|
||||
|
||||
struct MyAllocator : Xbyak::Allocator {
|
||||
Xbyak::uint8 *alloc(size_t size)
|
||||
uint8_t *alloc(size_t size)
|
||||
{
|
||||
if (size < sizeof(bufS)) {
|
||||
printf("test use bufS(%d)\n", (int)size);
|
||||
|
@ -389,7 +389,7 @@ struct MyAllocator : Xbyak::Allocator {
|
|||
fprintf(stderr, "no memory %d\n", (int)size);
|
||||
exit(1);
|
||||
}
|
||||
void free(Xbyak::uint8 *)
|
||||
void free(uint8_t *)
|
||||
{
|
||||
}
|
||||
} myAlloc;
|
||||
|
@ -478,7 +478,7 @@ CYBOZU_TEST_AUTO(test5)
|
|||
}
|
||||
#endif
|
||||
|
||||
size_t getValue(const uint8* p)
|
||||
size_t getValue(const uint8_t* p)
|
||||
{
|
||||
size_t v = 0;
|
||||
for (size_t i = 0; i < sizeof(size_t); i++) {
|
||||
|
@ -487,7 +487,7 @@ size_t getValue(const uint8* p)
|
|||
return v;
|
||||
}
|
||||
|
||||
void checkAddr(const uint8 *p, size_t offset, size_t expect)
|
||||
void checkAddr(const uint8_t *p, size_t offset, size_t expect)
|
||||
{
|
||||
size_t v = getValue(p + offset);
|
||||
CYBOZU_TEST_EQUAL(v, size_t(p) + expect);
|
||||
|
@ -535,7 +535,7 @@ CYBOZU_TEST_AUTO(MovLabel)
|
|||
|
||||
const struct {
|
||||
int pos;
|
||||
uint8 ok;
|
||||
uint8_t ok;
|
||||
} tbl[] = {
|
||||
#ifdef XBYAK32
|
||||
{ 0x00, 0x90 },
|
||||
|
@ -569,11 +569,11 @@ CYBOZU_TEST_AUTO(MovLabel)
|
|||
const bool useNewLabel = k == 0;
|
||||
MovLabelCode code(grow, useNewLabel);
|
||||
if (grow) code.ready();
|
||||
const uint8* const p = code.getCode();
|
||||
const uint8_t* const p = code.getCode();
|
||||
for (size_t i = 0; i < CYBOZU_NUM_OF_ARRAY(tbl); i++) {
|
||||
int pos = tbl[i].pos;
|
||||
uint8 x = p[pos];
|
||||
uint8 ok = tbl[i].ok;
|
||||
uint8_t x = p[pos];
|
||||
uint8_t ok = tbl[i].ok;
|
||||
CYBOZU_TEST_EQUAL(x, ok);
|
||||
}
|
||||
#ifdef XBYAK32
|
||||
|
|
|
@ -9,111 +9,111 @@ using namespace Xbyak;
|
|||
|
||||
const int bitEnd = 64;
|
||||
|
||||
const uint64 YMM_SAE = 1ULL << 0;
|
||||
const uint64 _XMM = 1ULL << 1;
|
||||
const uint64 _MEM = 1ULL << 2;
|
||||
const uint64 _REG32 = 1ULL << 3;
|
||||
const uint64 EAX = 1ULL << 4;
|
||||
const uint64 IMM32 = 1ULL << 5;
|
||||
const uint64 IMM8 = 1ULL << 6;
|
||||
const uint64 _REG8 = 1ULL << 7;
|
||||
const uint64 _REG16 = 1ULL << 8;
|
||||
const uint64 XMM_K = 1ULL << 9;
|
||||
const uint64 YMM_K = 1ULL << 10;
|
||||
const uint64 ZMM_K = 1ULL << 11;
|
||||
const uint64 AX = 1ULL << 12;
|
||||
const uint64 AL = 1ULL << 13;
|
||||
const uint64 IMM_1 = 1ULL << 14;
|
||||
const uint64 MEM8 = 1ULL << 15;
|
||||
const uint64 MEM16 = 1ULL << 16;
|
||||
const uint64 MEM32 = 1ULL << 17;
|
||||
const uint64 VM32Z = 1ULL << 19;
|
||||
const uint64 K_K = 1ULL << 20;
|
||||
const uint64 MEM_ONLY_DISP = 1ULL << 21;
|
||||
const uint64 VM32X_K = 1ULL << 23;
|
||||
const uint64 _YMM = 1ULL << 24;
|
||||
const uint64 VM32X_32 = 1ULL << 39;
|
||||
const uint64 VM32X_64 = 1ULL << 40;
|
||||
const uint64 VM32Y_32 = 1ULL << 41;
|
||||
const uint64 VM32Y_64 = 1ULL << 42;
|
||||
const uint64 VM32Z_K = 1ULL << 32;
|
||||
const uint64_t YMM_SAE = 1ULL << 0;
|
||||
const uint64_t _XMM = 1ULL << 1;
|
||||
const uint64_t _MEM = 1ULL << 2;
|
||||
const uint64_t _REG32 = 1ULL << 3;
|
||||
const uint64_t EAX = 1ULL << 4;
|
||||
const uint64_t IMM32 = 1ULL << 5;
|
||||
const uint64_t IMM8 = 1ULL << 6;
|
||||
const uint64_t _REG8 = 1ULL << 7;
|
||||
const uint64_t _REG16 = 1ULL << 8;
|
||||
const uint64_t XMM_K = 1ULL << 9;
|
||||
const uint64_t YMM_K = 1ULL << 10;
|
||||
const uint64_t ZMM_K = 1ULL << 11;
|
||||
const uint64_t AX = 1ULL << 12;
|
||||
const uint64_t AL = 1ULL << 13;
|
||||
const uint64_t IMM_1 = 1ULL << 14;
|
||||
const uint64_t MEM8 = 1ULL << 15;
|
||||
const uint64_t MEM16 = 1ULL << 16;
|
||||
const uint64_t MEM32 = 1ULL << 17;
|
||||
const uint64_t VM32Z = 1ULL << 19;
|
||||
const uint64_t K_K = 1ULL << 20;
|
||||
const uint64_t MEM_ONLY_DISP = 1ULL << 21;
|
||||
const uint64_t VM32X_K = 1ULL << 23;
|
||||
const uint64_t _YMM = 1ULL << 24;
|
||||
const uint64_t VM32X_32 = 1ULL << 39;
|
||||
const uint64_t VM32X_64 = 1ULL << 40;
|
||||
const uint64_t VM32Y_32 = 1ULL << 41;
|
||||
const uint64_t VM32Y_64 = 1ULL << 42;
|
||||
const uint64_t VM32Z_K = 1ULL << 32;
|
||||
#ifdef XBYAK64
|
||||
const uint64 _MEMe = 1ULL << 25;
|
||||
const uint64 REG32_2 = 1ULL << 26; // r8d, ...
|
||||
const uint64 REG16_2 = 1ULL << 27; // r8w, ...
|
||||
const uint64 REG8_2 = 1ULL << 28; // r8b, ...
|
||||
const uint64 REG8_3 = 1ULL << 29; // spl, ...
|
||||
const uint64 _REG64 = 1ULL << 30; // rax, ...
|
||||
const uint64 _REG64_2 = 1ULL << 31; // r8, ...
|
||||
const uint64 _XMM2 = 1ULL << 33;
|
||||
const uint64 _YMM2 = 1ULL << 34;
|
||||
const uint64 VM32X = VM32X_32 | VM32X_64;
|
||||
const uint64 VM32Y = VM32Y_32 | VM32Y_64;
|
||||
const uint64_t _MEMe = 1ULL << 25;
|
||||
const uint64_t REG32_2 = 1ULL << 26; // r8d, ...
|
||||
const uint64_t REG16_2 = 1ULL << 27; // r8w, ...
|
||||
const uint64_t REG8_2 = 1ULL << 28; // r8b, ...
|
||||
const uint64_t REG8_3 = 1ULL << 29; // spl, ...
|
||||
const uint64_t _REG64 = 1ULL << 30; // rax, ...
|
||||
const uint64_t _REG64_2 = 1ULL << 31; // r8, ...
|
||||
const uint64_t _XMM2 = 1ULL << 33;
|
||||
const uint64_t _YMM2 = 1ULL << 34;
|
||||
const uint64_t VM32X = VM32X_32 | VM32X_64;
|
||||
const uint64_t VM32Y = VM32Y_32 | VM32Y_64;
|
||||
#else
|
||||
const uint64 _MEMe = 0;
|
||||
const uint64 REG32_2 = 0;
|
||||
const uint64 REG16_2 = 0;
|
||||
const uint64 REG8_2 = 0;
|
||||
const uint64 REG8_3 = 0;
|
||||
const uint64 _REG64 = 0;
|
||||
const uint64 _REG64_2 = 0;
|
||||
const uint64 _XMM2 = 0;
|
||||
const uint64 _YMM2 = 0;
|
||||
const uint64 VM32X = VM32X_32;
|
||||
const uint64 VM32Y = VM32Y_32;
|
||||
const uint64_t _MEMe = 0;
|
||||
const uint64_t REG32_2 = 0;
|
||||
const uint64_t REG16_2 = 0;
|
||||
const uint64_t REG8_2 = 0;
|
||||
const uint64_t REG8_3 = 0;
|
||||
const uint64_t _REG64 = 0;
|
||||
const uint64_t _REG64_2 = 0;
|
||||
const uint64_t _XMM2 = 0;
|
||||
const uint64_t _YMM2 = 0;
|
||||
const uint64_t VM32X = VM32X_32;
|
||||
const uint64_t VM32Y = VM32Y_32;
|
||||
#endif
|
||||
const uint64 REG64 = _REG64 | _REG64_2;
|
||||
const uint64 REG32 = _REG32 | REG32_2 | EAX;
|
||||
const uint64 REG16 = _REG16 | REG16_2 | AX;
|
||||
const uint64 REG32e = REG32 | REG64;
|
||||
const uint64 REG8 = _REG8 | REG8_2|AL;
|
||||
const uint64 MEM = _MEM | _MEMe;
|
||||
const uint64 MEM64 = 1ULL << 35;
|
||||
const uint64 YMM_ER = 1ULL << 36;
|
||||
const uint64 VM32Y_K = 1ULL << 37;
|
||||
const uint64 IMM_2 = 1ULL << 38;
|
||||
const uint64 IMM = IMM_1 | IMM_2;
|
||||
const uint64 YMM = _YMM | _YMM2;
|
||||
const uint64 K = 1ULL << 43;
|
||||
const uint64 _ZMM = 1ULL << 44;
|
||||
const uint64 _ZMM2 = 1ULL << 45;
|
||||
const uint64_t REG64 = _REG64 | _REG64_2;
|
||||
const uint64_t REG32 = _REG32 | REG32_2 | EAX;
|
||||
const uint64_t REG16 = _REG16 | REG16_2 | AX;
|
||||
const uint64_t REG32e = REG32 | REG64;
|
||||
const uint64_t REG8 = _REG8 | REG8_2|AL;
|
||||
const uint64_t MEM = _MEM | _MEMe;
|
||||
const uint64_t MEM64 = 1ULL << 35;
|
||||
const uint64_t YMM_ER = 1ULL << 36;
|
||||
const uint64_t VM32Y_K = 1ULL << 37;
|
||||
const uint64_t IMM_2 = 1ULL << 38;
|
||||
const uint64_t IMM = IMM_1 | IMM_2;
|
||||
const uint64_t YMM = _YMM | _YMM2;
|
||||
const uint64_t K = 1ULL << 43;
|
||||
const uint64_t _ZMM = 1ULL << 44;
|
||||
const uint64_t _ZMM2 = 1ULL << 45;
|
||||
#ifdef XBYAK64
|
||||
const uint64 ZMM = _ZMM | _ZMM2;
|
||||
const uint64 _YMM3 = 1ULL << 46;
|
||||
const uint64_t ZMM = _ZMM | _ZMM2;
|
||||
const uint64_t _YMM3 = 1ULL << 46;
|
||||
#else
|
||||
const uint64 ZMM = _ZMM;
|
||||
const uint64 _YMM3 = 0;
|
||||
const uint64_t ZMM = _ZMM;
|
||||
const uint64_t _YMM3 = 0;
|
||||
#endif
|
||||
const uint64 K2 = 1ULL << 47;
|
||||
const uint64 ZMM_SAE = 1ULL << 48;
|
||||
const uint64 ZMM_ER = 1ULL << 49;
|
||||
const uint64_t K2 = 1ULL << 47;
|
||||
const uint64_t ZMM_SAE = 1ULL << 48;
|
||||
const uint64_t ZMM_ER = 1ULL << 49;
|
||||
#ifdef XBYAK64
|
||||
const uint64 _XMM3 = 1ULL << 50;
|
||||
const uint64_t _XMM3 = 1ULL << 50;
|
||||
#else
|
||||
const uint64 _XMM3 = 0;
|
||||
const uint64_t _XMM3 = 0;
|
||||
#endif
|
||||
const uint64 XMM = _XMM | _XMM2 | _XMM3;
|
||||
const uint64 XMM_SAE = 1ULL << 51;
|
||||
const uint64_t XMM = _XMM | _XMM2 | _XMM3;
|
||||
const uint64_t XMM_SAE = 1ULL << 51;
|
||||
#ifdef XBYAK64
|
||||
const uint64 XMM_KZ = 1ULL << 52;
|
||||
const uint64 YMM_KZ = 1ULL << 53;
|
||||
const uint64 ZMM_KZ = 1ULL << 54;
|
||||
const uint64_t XMM_KZ = 1ULL << 52;
|
||||
const uint64_t YMM_KZ = 1ULL << 53;
|
||||
const uint64_t ZMM_KZ = 1ULL << 54;
|
||||
#else
|
||||
const uint64 XMM_KZ = 0;
|
||||
const uint64 YMM_KZ = 0;
|
||||
const uint64 ZMM_KZ = 0;
|
||||
const uint64_t XMM_KZ = 0;
|
||||
const uint64_t YMM_KZ = 0;
|
||||
const uint64_t ZMM_KZ = 0;
|
||||
#endif
|
||||
const uint64 MEM_K = 1ULL << 55;
|
||||
const uint64 M_1to2 = 1ULL << 56;
|
||||
const uint64 M_1to4 = 1ULL << 57;
|
||||
const uint64 M_1to8 = 1ULL << 58;
|
||||
const uint64 M_1to16 = 1ULL << 59;
|
||||
const uint64 XMM_ER = 1ULL << 60;
|
||||
const uint64 M_xword = 1ULL << 61;
|
||||
const uint64 M_yword = 1ULL << 62;
|
||||
const uint64 MY_1to4 = 1ULL << 18;
|
||||
const uint64_t MEM_K = 1ULL << 55;
|
||||
const uint64_t M_1to2 = 1ULL << 56;
|
||||
const uint64_t M_1to4 = 1ULL << 57;
|
||||
const uint64_t M_1to8 = 1ULL << 58;
|
||||
const uint64_t M_1to16 = 1ULL << 59;
|
||||
const uint64_t XMM_ER = 1ULL << 60;
|
||||
const uint64_t M_xword = 1ULL << 61;
|
||||
const uint64_t M_yword = 1ULL << 62;
|
||||
const uint64_t MY_1to4 = 1ULL << 18;
|
||||
|
||||
const uint64 NOPARA = 1ULL << (bitEnd - 1);
|
||||
const uint64_t NOPARA = 1ULL << (bitEnd - 1);
|
||||
|
||||
class Test {
|
||||
Test(const Test&);
|
||||
|
@ -121,7 +121,7 @@ class Test {
|
|||
const bool isXbyak_;
|
||||
int funcNum_;
|
||||
// check all op1, op2, op3
|
||||
void put(const std::string& nm, uint64 op1 = NOPARA, uint64 op2 = NOPARA, uint64 op3 = NOPARA, uint64 op4 = NOPARA) const
|
||||
void put(const std::string& nm, uint64_t op1 = NOPARA, uint64_t op2 = NOPARA, uint64_t op3 = NOPARA, uint64_t op4 = NOPARA) const
|
||||
{
|
||||
for (int i = 0; i < bitEnd; i++) {
|
||||
if ((op1 & (1ULL << i)) == 0) continue;
|
||||
|
@ -144,7 +144,7 @@ class Test {
|
|||
}
|
||||
}
|
||||
}
|
||||
void put(const char *nm, uint64 op, const char *xbyak, const char *nasm) const
|
||||
void put(const char *nm, uint64_t op, const char *xbyak, const char *nasm) const
|
||||
{
|
||||
for (int i = 0; i < bitEnd; i++) {
|
||||
if ((op & (1ULL << i)) == 0) continue;
|
||||
|
@ -156,7 +156,7 @@ class Test {
|
|||
printf("\n");
|
||||
}
|
||||
}
|
||||
void put(const char *nm, const char *xbyak, const char *nasm = 0, uint64 op = NOPARA) const
|
||||
void put(const char *nm, const char *xbyak, const char *nasm = 0, uint64_t op = NOPARA) const
|
||||
{
|
||||
if (nasm == 0) nasm = xbyak;
|
||||
for (int i = 0; i < bitEnd; i++) {
|
||||
|
@ -169,7 +169,7 @@ class Test {
|
|||
printf("\n");
|
||||
}
|
||||
}
|
||||
const char *get(uint64 type) const
|
||||
const char *get(uint64_t type) const
|
||||
{
|
||||
int idx = (rand() / 31) & 7;
|
||||
switch (type) {
|
||||
|
|
206
test/make_nm.cpp
206
test/make_nm.cpp
|
@ -10,111 +10,111 @@ using namespace Xbyak;
|
|||
|
||||
const int bitEnd = 64;
|
||||
|
||||
const uint64 MMX = 1ULL << 0;
|
||||
const uint64 _XMM = 1ULL << 1;
|
||||
const uint64 _MEM = 1ULL << 2;
|
||||
const uint64 _REG32 = 1ULL << 3;
|
||||
const uint64 EAX = 1ULL << 4;
|
||||
const uint64 IMM32 = 1ULL << 5;
|
||||
const uint64 IMM8 = 1ULL << 6;
|
||||
const uint64 _REG8 = 1ULL << 7;
|
||||
const uint64 _REG16 = 1ULL << 8;
|
||||
const uint64 NEG8 = 1ULL << 9;
|
||||
const uint64 IMM16 = 1ULL << 10;
|
||||
const uint64 NEG16 = 1ULL << 11;
|
||||
const uint64 AX = 1ULL << 12;
|
||||
const uint64 AL = 1ULL << 13;
|
||||
const uint64 IMM_1 = 1ULL << 14;
|
||||
const uint64 MEM8 = 1ULL << 15;
|
||||
const uint64 MEM16 = 1ULL << 16;
|
||||
const uint64 MEM32 = 1ULL << 17;
|
||||
const uint64 ONE = 1ULL << 19;
|
||||
const uint64 CL = 1ULL << 20;
|
||||
const uint64 MEM_ONLY_DISP = 1ULL << 21;
|
||||
const uint64 NEG32 = 1ULL << 23;
|
||||
const uint64 _YMM = 1ULL << 24;
|
||||
const uint64 VM32X_32 = 1ULL << 39;
|
||||
const uint64 VM32X_64 = 1ULL << 40;
|
||||
const uint64 VM32Y_32 = 1ULL << 41;
|
||||
const uint64 VM32Y_64 = 1ULL << 42;
|
||||
const uint64_t MMX = 1ULL << 0;
|
||||
const uint64_t _XMM = 1ULL << 1;
|
||||
const uint64_t _MEM = 1ULL << 2;
|
||||
const uint64_t _REG32 = 1ULL << 3;
|
||||
const uint64_t EAX = 1ULL << 4;
|
||||
const uint64_t IMM32 = 1ULL << 5;
|
||||
const uint64_t IMM8 = 1ULL << 6;
|
||||
const uint64_t _REG8 = 1ULL << 7;
|
||||
const uint64_t _REG16 = 1ULL << 8;
|
||||
const uint64_t NEG8 = 1ULL << 9;
|
||||
const uint64_t IMM16 = 1ULL << 10;
|
||||
const uint64_t NEG16 = 1ULL << 11;
|
||||
const uint64_t AX = 1ULL << 12;
|
||||
const uint64_t AL = 1ULL << 13;
|
||||
const uint64_t IMM_1 = 1ULL << 14;
|
||||
const uint64_t MEM8 = 1ULL << 15;
|
||||
const uint64_t MEM16 = 1ULL << 16;
|
||||
const uint64_t MEM32 = 1ULL << 17;
|
||||
const uint64_t ONE = 1ULL << 19;
|
||||
const uint64_t CL = 1ULL << 20;
|
||||
const uint64_t MEM_ONLY_DISP = 1ULL << 21;
|
||||
const uint64_t NEG32 = 1ULL << 23;
|
||||
const uint64_t _YMM = 1ULL << 24;
|
||||
const uint64_t VM32X_32 = 1ULL << 39;
|
||||
const uint64_t VM32X_64 = 1ULL << 40;
|
||||
const uint64_t VM32Y_32 = 1ULL << 41;
|
||||
const uint64_t VM32Y_64 = 1ULL << 42;
|
||||
#ifdef XBYAK64
|
||||
const uint64 _MEMe = 1ULL << 25;
|
||||
const uint64 REG32_2 = 1ULL << 26; // r8d, ...
|
||||
const uint64 REG16_2 = 1ULL << 27; // r8w, ...
|
||||
const uint64 REG8_2 = 1ULL << 28; // r8b, ...
|
||||
const uint64 REG8_3 = 1ULL << 29; // spl, ...
|
||||
const uint64 _REG64 = 1ULL << 30; // rax, ...
|
||||
const uint64 _REG64_2 = 1ULL << 31; // r8, ...
|
||||
const uint64 RAX = 1ULL << 32;
|
||||
const uint64 _XMM2 = 1ULL << 33;
|
||||
const uint64 _YMM2 = 1ULL << 34;
|
||||
const uint64 VM32X = VM32X_32 | VM32X_64;
|
||||
const uint64 VM32Y = VM32Y_32 | VM32Y_64;
|
||||
const uint64_t _MEMe = 1ULL << 25;
|
||||
const uint64_t REG32_2 = 1ULL << 26; // r8d, ...
|
||||
const uint64_t REG16_2 = 1ULL << 27; // r8w, ...
|
||||
const uint64_t REG8_2 = 1ULL << 28; // r8b, ...
|
||||
const uint64_t REG8_3 = 1ULL << 29; // spl, ...
|
||||
const uint64_t _REG64 = 1ULL << 30; // rax, ...
|
||||
const uint64_t _REG64_2 = 1ULL << 31; // r8, ...
|
||||
const uint64_t RAX = 1ULL << 32;
|
||||
const uint64_t _XMM2 = 1ULL << 33;
|
||||
const uint64_t _YMM2 = 1ULL << 34;
|
||||
const uint64_t VM32X = VM32X_32 | VM32X_64;
|
||||
const uint64_t VM32Y = VM32Y_32 | VM32Y_64;
|
||||
#else
|
||||
const uint64 _MEMe = 0;
|
||||
const uint64 REG32_2 = 0;
|
||||
const uint64 REG16_2 = 0;
|
||||
const uint64 REG8_2 = 0;
|
||||
const uint64 REG8_3 = 0;
|
||||
const uint64 _REG64 = 0;
|
||||
const uint64 _REG64_2 = 0;
|
||||
const uint64 RAX = 0;
|
||||
const uint64 _XMM2 = 0;
|
||||
const uint64 _YMM2 = 0;
|
||||
const uint64 VM32X = VM32X_32;
|
||||
const uint64 VM32Y = VM32Y_32;
|
||||
const uint64_t _MEMe = 0;
|
||||
const uint64_t REG32_2 = 0;
|
||||
const uint64_t REG16_2 = 0;
|
||||
const uint64_t REG8_2 = 0;
|
||||
const uint64_t REG8_3 = 0;
|
||||
const uint64_t _REG64 = 0;
|
||||
const uint64_t _REG64_2 = 0;
|
||||
const uint64_t RAX = 0;
|
||||
const uint64_t _XMM2 = 0;
|
||||
const uint64_t _YMM2 = 0;
|
||||
const uint64_t VM32X = VM32X_32;
|
||||
const uint64_t VM32Y = VM32Y_32;
|
||||
#endif
|
||||
const uint64 REG64 = _REG64 | _REG64_2 | RAX;
|
||||
const uint64 REG32 = _REG32 | REG32_2 | EAX;
|
||||
const uint64 REG16 = _REG16 | REG16_2 | AX;
|
||||
const uint64 REG32e = REG32 | REG64;
|
||||
const uint64 REG8 = _REG8 | REG8_2|AL;
|
||||
const uint64 MEM = _MEM | _MEMe;
|
||||
const uint64 MEM64 = 1ULL << 35;
|
||||
const uint64 ST0 = 1ULL << 36;
|
||||
const uint64 STi = 1ULL << 37;
|
||||
const uint64 IMM_2 = 1ULL << 38;
|
||||
const uint64 IMM = IMM_1 | IMM_2;
|
||||
const uint64 XMM = _XMM | _XMM2;
|
||||
const uint64 YMM = _YMM | _YMM2;
|
||||
const uint64 K = 1ULL << 43;
|
||||
const uint64 _ZMM = 1ULL << 44;
|
||||
const uint64 _ZMM2 = 1ULL << 45;
|
||||
const uint64_t REG64 = _REG64 | _REG64_2 | RAX;
|
||||
const uint64_t REG32 = _REG32 | REG32_2 | EAX;
|
||||
const uint64_t REG16 = _REG16 | REG16_2 | AX;
|
||||
const uint64_t REG32e = REG32 | REG64;
|
||||
const uint64_t REG8 = _REG8 | REG8_2|AL;
|
||||
const uint64_t MEM = _MEM | _MEMe;
|
||||
const uint64_t MEM64 = 1ULL << 35;
|
||||
const uint64_t ST0 = 1ULL << 36;
|
||||
const uint64_t STi = 1ULL << 37;
|
||||
const uint64_t IMM_2 = 1ULL << 38;
|
||||
const uint64_t IMM = IMM_1 | IMM_2;
|
||||
const uint64_t XMM = _XMM | _XMM2;
|
||||
const uint64_t YMM = _YMM | _YMM2;
|
||||
const uint64_t K = 1ULL << 43;
|
||||
const uint64_t _ZMM = 1ULL << 44;
|
||||
const uint64_t _ZMM2 = 1ULL << 45;
|
||||
#ifdef XBYAK64
|
||||
const uint64 ZMM = _ZMM | _ZMM2;
|
||||
const uint64 _YMM3 = 1ULL << 46;
|
||||
const uint64_t ZMM = _ZMM | _ZMM2;
|
||||
const uint64_t _YMM3 = 1ULL << 46;
|
||||
#else
|
||||
const uint64 ZMM = _ZMM;
|
||||
const uint64 _YMM3 = 0;
|
||||
const uint64_t ZMM = _ZMM;
|
||||
const uint64_t _YMM3 = 0;
|
||||
#endif
|
||||
const uint64 K2 = 1ULL << 47;
|
||||
const uint64 ZMM_SAE = 1ULL << 48;
|
||||
const uint64 ZMM_ER = 1ULL << 49;
|
||||
const uint64_t K2 = 1ULL << 47;
|
||||
const uint64_t ZMM_SAE = 1ULL << 48;
|
||||
const uint64_t ZMM_ER = 1ULL << 49;
|
||||
#ifdef XBYAK64
|
||||
const uint64 _XMM3 = 1ULL << 50;
|
||||
const uint64_t _XMM3 = 1ULL << 50;
|
||||
#endif
|
||||
const uint64 XMM_SAE = 1ULL << 51;
|
||||
const uint64_t XMM_SAE = 1ULL << 51;
|
||||
#ifdef XBYAK64
|
||||
const uint64 XMM_KZ = 1ULL << 52;
|
||||
const uint64 YMM_KZ = 1ULL << 53;
|
||||
const uint64 ZMM_KZ = 1ULL << 54;
|
||||
const uint64_t XMM_KZ = 1ULL << 52;
|
||||
const uint64_t YMM_KZ = 1ULL << 53;
|
||||
const uint64_t ZMM_KZ = 1ULL << 54;
|
||||
#else
|
||||
const uint64 XMM_KZ = 0;
|
||||
const uint64 YMM_KZ = 0;
|
||||
const uint64 ZMM_KZ = 0;
|
||||
const uint64_t XMM_KZ = 0;
|
||||
const uint64_t YMM_KZ = 0;
|
||||
const uint64_t ZMM_KZ = 0;
|
||||
#endif
|
||||
const uint64 MEM_K = 1ULL << 55;
|
||||
const uint64 M_1to2 = 1ULL << 56;
|
||||
const uint64 M_1to4 = 1ULL << 57;
|
||||
const uint64 M_1to8 = 1ULL << 58;
|
||||
const uint64 M_1to16 = 1ULL << 59;
|
||||
const uint64 XMM_ER = 1ULL << 60;
|
||||
const uint64 M_xword = 1ULL << 61;
|
||||
const uint64 M_yword = 1ULL << 62;
|
||||
const uint64 MY_1to4 = 1ULL << 18;
|
||||
const uint64 BNDREG = 1ULL << 22;
|
||||
const uint64_t MEM_K = 1ULL << 55;
|
||||
const uint64_t M_1to2 = 1ULL << 56;
|
||||
const uint64_t M_1to4 = 1ULL << 57;
|
||||
const uint64_t M_1to8 = 1ULL << 58;
|
||||
const uint64_t M_1to16 = 1ULL << 59;
|
||||
const uint64_t XMM_ER = 1ULL << 60;
|
||||
const uint64_t M_xword = 1ULL << 61;
|
||||
const uint64_t M_yword = 1ULL << 62;
|
||||
const uint64_t MY_1to4 = 1ULL << 18;
|
||||
const uint64_t BNDREG = 1ULL << 22;
|
||||
|
||||
const uint64 NOPARA = 1ULL << (bitEnd - 1);
|
||||
const uint64_t NOPARA = 1ULL << (bitEnd - 1);
|
||||
|
||||
class Test {
|
||||
Test(const Test&);
|
||||
|
@ -131,7 +131,7 @@ class Test {
|
|||
}
|
||||
|
||||
// check all op1, op2, op3
|
||||
void put(const std::string& nm, uint64 op1 = NOPARA, uint64 op2 = NOPARA, uint64 op3 = NOPARA, uint64 op4 = NOPARA) const
|
||||
void put(const std::string& nm, uint64_t op1 = NOPARA, uint64_t op2 = NOPARA, uint64_t op3 = NOPARA, uint64_t op4 = NOPARA) const
|
||||
{
|
||||
for (int i = 0; i < bitEnd; i++) {
|
||||
if ((op1 & (1ULL << i)) == 0) continue;
|
||||
|
@ -154,7 +154,7 @@ class Test {
|
|||
}
|
||||
}
|
||||
}
|
||||
void put(const char *nm, uint64 op, const char *xbyak, const char *nasm) const
|
||||
void put(const char *nm, uint64_t op, const char *xbyak, const char *nasm) const
|
||||
{
|
||||
for (int i = 0; i < bitEnd; i++) {
|
||||
if ((op & (1ULL << i)) == 0) continue;
|
||||
|
@ -166,7 +166,7 @@ class Test {
|
|||
printf("\n");
|
||||
}
|
||||
}
|
||||
void put(const char *nm, const char *xbyak, const char *nasm = 0, uint64 op = NOPARA) const
|
||||
void put(const char *nm, const char *xbyak, const char *nasm = 0, uint64_t op = NOPARA) const
|
||||
{
|
||||
if (nasm == 0) nasm = xbyak;
|
||||
for (int i = 0; i < bitEnd; i++) {
|
||||
|
@ -179,7 +179,7 @@ class Test {
|
|||
printf("\n");
|
||||
}
|
||||
}
|
||||
const char *get(uint64 type) const
|
||||
const char *get(uint64_t type) const
|
||||
{
|
||||
int idx = (rand() / 31) & 7;
|
||||
if (type == ST0) {
|
||||
|
@ -858,7 +858,7 @@ class Test {
|
|||
SD = 1 << 3
|
||||
};
|
||||
const struct {
|
||||
uint8 code;
|
||||
uint8_t code;
|
||||
const char *name;
|
||||
} sufTbl[] = {
|
||||
{ 0, "ps" },
|
||||
|
@ -867,7 +867,7 @@ class Test {
|
|||
{ 0xF2, "sd" },
|
||||
};
|
||||
static const struct XmmTbl1 {
|
||||
uint8 code;
|
||||
uint8_t code;
|
||||
int mode;
|
||||
const char *name;
|
||||
bool hasImm;
|
||||
|
@ -946,8 +946,8 @@ class Test {
|
|||
{
|
||||
static const struct Tbl {
|
||||
const char *name;
|
||||
uint64 op1;
|
||||
uint64 op2;
|
||||
uint64_t op1;
|
||||
uint64_t op2;
|
||||
} tbl[] = {
|
||||
{ "cvtpi2ps", XMM, MMX|MEM },
|
||||
{ "cvtps2pi", MMX, XMM|MEM },
|
||||
|
@ -1493,9 +1493,9 @@ class Test {
|
|||
void putMPX() const
|
||||
{
|
||||
#ifdef XBYAK64
|
||||
const uint64 reg = REG64;
|
||||
const uint64_t reg = REG64;
|
||||
#else
|
||||
const uint64 reg = REG32;
|
||||
const uint64_t reg = REG32;
|
||||
#endif
|
||||
put("bndcl", BNDREG, reg|MEM);
|
||||
put("bndcu", BNDREG, reg|MEM);
|
||||
|
|
|
@ -97,7 +97,7 @@ CYBOZU_TEST_AUTO(align)
|
|||
CYBOZU_TEST_EQUAL(size_t(getCurr()) % alignSize, 0u);
|
||||
}
|
||||
align(alignSize);
|
||||
const uint8 *p = getCurr();
|
||||
const uint8_t *p = getCurr();
|
||||
// do nothing if aligned
|
||||
align(alignSize);
|
||||
CYBOZU_TEST_EQUAL(p, getCurr());
|
||||
|
|
|
@ -56,7 +56,7 @@ void test2()
|
|||
void test3()
|
||||
{
|
||||
static struct EmptyAllocator : Xbyak::Allocator {
|
||||
uint8 *alloc() { return 0; }
|
||||
uint8_t *alloc() { return 0; }
|
||||
} emptyAllocator;
|
||||
struct Code : CodeGenerator {
|
||||
Code() : CodeGenerator(8, 0, &emptyAllocator)
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#include <iostream>
|
||||
#include <memory.h>
|
||||
|
||||
typedef unsigned char uint8;
|
||||
typedef unsigned char uint8_t;
|
||||
|
||||
std::string normalize(const std::string& line)
|
||||
{
|
||||
|
|
|
@ -218,7 +218,7 @@ void check(int x, int y)
|
|||
}
|
||||
}
|
||||
|
||||
void verify(const Xbyak::uint8 *f, int pNum)
|
||||
void verify(const Xbyak::uint8_t *f, int pNum)
|
||||
{
|
||||
switch (pNum) {
|
||||
case 0:
|
||||
|
@ -264,7 +264,7 @@ void testAll()
|
|||
}
|
||||
for (int tNum = 0; tNum < maxNum; tNum++) {
|
||||
// printf("pNum=%d, tNum=%d, stackSize=%d\n", pNum, tNum | opt, stackSize);
|
||||
const Xbyak::uint8 *f = code.getCurr();
|
||||
const Xbyak::uint8_t *f = code.getCurr();
|
||||
code.gen(pNum, tNum | opt, stackSize);
|
||||
verify(f, pNum);
|
||||
/*
|
||||
|
|
246
xbyak/xbyak.h
246
xbyak/xbyak.h
|
@ -135,21 +135,17 @@ namespace Xbyak {
|
|||
|
||||
enum {
|
||||
DEFAULT_MAX_CODE_SIZE = 4096,
|
||||
VERSION = 0x5960 /* 0xABCD = A.BC(D) */
|
||||
VERSION = 0x5970 /* 0xABCD = A.BC(D) */
|
||||
};
|
||||
|
||||
#ifndef MIE_INTEGER_TYPE_DEFINED
|
||||
#define MIE_INTEGER_TYPE_DEFINED
|
||||
#ifdef _MSC_VER
|
||||
typedef unsigned __int64 uint64;
|
||||
typedef __int64 sint64;
|
||||
#else
|
||||
typedef uint64_t uint64;
|
||||
typedef int64_t sint64;
|
||||
#endif
|
||||
typedef unsigned int uint32;
|
||||
typedef unsigned short uint16;
|
||||
typedef unsigned char uint8;
|
||||
// for backward compatibility
|
||||
typedef uint64_t uint64;
|
||||
typedef int64_t sint64;
|
||||
typedef uint32_t uint32;
|
||||
typedef uint16_t uint16;
|
||||
typedef uint8_t uint8;
|
||||
#endif
|
||||
|
||||
#ifndef MIE_ALIGN
|
||||
|
@ -346,15 +342,15 @@ namespace inner {
|
|||
|
||||
static const size_t ALIGN_PAGE_SIZE = 4096;
|
||||
|
||||
inline bool IsInDisp8(uint32 x) { return 0xFFFFFF80 <= x || x <= 0x7F; }
|
||||
inline bool IsInInt32(uint64 x) { return ~uint64(0x7fffffffu) <= x || x <= 0x7FFFFFFFU; }
|
||||
inline bool IsInDisp8(uint32_t x) { return 0xFFFFFF80 <= x || x <= 0x7F; }
|
||||
inline bool IsInInt32(uint64_t x) { return ~uint64_t(0x7fffffffu) <= x || x <= 0x7FFFFFFFU; }
|
||||
|
||||
inline uint32 VerifyInInt32(uint64 x)
|
||||
inline uint32_t VerifyInInt32(uint64_t x)
|
||||
{
|
||||
#ifdef XBYAK64
|
||||
if (!IsInInt32(x)) XBYAK_THROW_RET(ERR_OFFSET_IS_TOO_BIG, 0)
|
||||
#endif
|
||||
return static_cast<uint32>(x);
|
||||
return static_cast<uint32_t>(x);
|
||||
}
|
||||
|
||||
enum LabelMode {
|
||||
|
@ -369,8 +365,8 @@ enum LabelMode {
|
|||
custom allocator
|
||||
*/
|
||||
struct Allocator {
|
||||
virtual uint8 *alloc(size_t size) { return reinterpret_cast<uint8*>(AlignedMalloc(size, inner::ALIGN_PAGE_SIZE)); }
|
||||
virtual void free(uint8 *p) { AlignedFree(p); }
|
||||
virtual uint8_t *alloc(size_t size) { return reinterpret_cast<uint8_t*>(AlignedMalloc(size, inner::ALIGN_PAGE_SIZE)); }
|
||||
virtual void free(uint8_t *p) { AlignedFree(p); }
|
||||
virtual ~Allocator() {}
|
||||
/* override to return false if you call protect() manually */
|
||||
virtual bool useProtect() const { return true; }
|
||||
|
@ -404,7 +400,7 @@ class MmapAllocator : Allocator {
|
|||
typedef XBYAK_STD_UNORDERED_MAP<uintptr_t, size_t> SizeList;
|
||||
SizeList sizeList_;
|
||||
public:
|
||||
uint8 *alloc(size_t size)
|
||||
uint8_t *alloc(size_t size)
|
||||
{
|
||||
const size_t alignedSizeM1 = inner::ALIGN_PAGE_SIZE - 1;
|
||||
size = (size + alignedSizeM1) & ~alignedSizeM1;
|
||||
|
@ -423,9 +419,9 @@ public:
|
|||
if (p == MAP_FAILED) XBYAK_THROW_RET(ERR_CANT_ALLOC, 0)
|
||||
assert(p);
|
||||
sizeList_[(uintptr_t)p] = size;
|
||||
return (uint8*)p;
|
||||
return (uint8_t*)p;
|
||||
}
|
||||
void free(uint8 *p)
|
||||
void free(uint8_t *p)
|
||||
{
|
||||
if (p == 0) return;
|
||||
SizeList::iterator i = sizeList_.find((uintptr_t)p);
|
||||
|
@ -440,7 +436,7 @@ class Address;
|
|||
class Reg;
|
||||
|
||||
class Operand {
|
||||
static const uint8 EXT8BIT = 0x20;
|
||||
static const uint8_t EXT8BIT = 0x20;
|
||||
unsigned int idx_:6; // 0..31 + EXT8BIT = 1 if spl/bpl/sil/dil
|
||||
unsigned int kind_:10;
|
||||
unsigned int bit_:14;
|
||||
|
@ -477,7 +473,7 @@ public:
|
|||
};
|
||||
XBYAK_CONSTEXPR Operand() : idx_(0), kind_(0), bit_(0), zero_(0), mask_(0), rounding_(0) { }
|
||||
XBYAK_CONSTEXPR Operand(int idx, Kind kind, int bit, bool ext8bit = 0)
|
||||
: idx_(static_cast<uint8>(idx | (ext8bit ? EXT8BIT : 0)))
|
||||
: idx_(static_cast<uint8_t>(idx | (ext8bit ? EXT8BIT : 0)))
|
||||
, kind_(kind)
|
||||
, bit_(bit)
|
||||
, zero_(0), mask_(0), rounding_(0)
|
||||
|
@ -536,12 +532,12 @@ public:
|
|||
return AH <= idx && idx <= BH;
|
||||
}
|
||||
// any bit is accetable if bit == 0
|
||||
XBYAK_CONSTEXPR bool is(int kind, uint32 bit = 0) const
|
||||
XBYAK_CONSTEXPR bool is(int kind, uint32_t bit = 0) const
|
||||
{
|
||||
return (kind == 0 || (kind_ & kind)) && (bit == 0 || (bit_ & bit)); // cf. you can set (8|16)
|
||||
}
|
||||
XBYAK_CONSTEXPR bool isBit(uint32 bit) const { return (bit_ & bit) != 0; }
|
||||
XBYAK_CONSTEXPR uint32 getBit() const { return bit_; }
|
||||
XBYAK_CONSTEXPR bool isBit(uint32_t bit) const { return (bit_ & bit) != 0; }
|
||||
XBYAK_CONSTEXPR uint32_t getBit() const { return bit_; }
|
||||
const char *toString() const
|
||||
{
|
||||
const int idx = getIdx();
|
||||
|
@ -660,13 +656,13 @@ public:
|
|||
XBYAK_CONSTEXPR Reg(int idx, Kind kind, int bit = 0, bool ext8bit = false) : Operand(idx, kind, bit, ext8bit) { }
|
||||
// convert to Reg8/Reg16/Reg32/Reg64/XMM/YMM/ZMM
|
||||
Reg changeBit(int bit) const { Reg r(*this); r.setBit(bit); return r; }
|
||||
uint8 getRexW() const { return isREG(64) ? 8 : 0; }
|
||||
uint8 getRexR() const { return isExtIdx() ? 4 : 0; }
|
||||
uint8 getRexX() const { return isExtIdx() ? 2 : 0; }
|
||||
uint8 getRexB() const { return isExtIdx() ? 1 : 0; }
|
||||
uint8 getRex(const Reg& base = Reg()) const
|
||||
uint8_t getRexW() const { return isREG(64) ? 8 : 0; }
|
||||
uint8_t getRexR() const { return isExtIdx() ? 4 : 0; }
|
||||
uint8_t getRexX() const { return isExtIdx() ? 2 : 0; }
|
||||
uint8_t getRexB() const { return isExtIdx() ? 1 : 0; }
|
||||
uint8_t getRex(const Reg& base = Reg()) const
|
||||
{
|
||||
uint8 rex = getRexW() | getRexR() | base.getRexW() | base.getRexB();
|
||||
uint8_t rex = getRexW() | getRexR() | base.getRexW() | base.getRexB();
|
||||
if (rex || isExt8bit() || base.isExt8bit()) rex |= 0x40;
|
||||
return rex;
|
||||
}
|
||||
|
@ -760,20 +756,20 @@ struct Reg64 : public Reg32e {
|
|||
explicit XBYAK_CONSTEXPR Reg64(int idx = 0) : Reg32e(idx, 64) {}
|
||||
};
|
||||
struct RegRip {
|
||||
sint64 disp_;
|
||||
int64_t disp_;
|
||||
const Label* label_;
|
||||
bool isAddr_;
|
||||
explicit XBYAK_CONSTEXPR RegRip(sint64 disp = 0, const Label* label = 0, bool isAddr = false) : disp_(disp), label_(label), isAddr_(isAddr) {}
|
||||
explicit XBYAK_CONSTEXPR RegRip(int64_t disp = 0, const Label* label = 0, bool isAddr = false) : disp_(disp), label_(label), isAddr_(isAddr) {}
|
||||
friend const RegRip operator+(const RegRip& r, int disp) {
|
||||
return RegRip(r.disp_ + disp, r.label_, r.isAddr_);
|
||||
}
|
||||
friend const RegRip operator-(const RegRip& r, int disp) {
|
||||
return RegRip(r.disp_ - disp, r.label_, r.isAddr_);
|
||||
}
|
||||
friend const RegRip operator+(const RegRip& r, sint64 disp) {
|
||||
friend const RegRip operator+(const RegRip& r, int64_t disp) {
|
||||
return RegRip(r.disp_ + disp, r.label_, r.isAddr_);
|
||||
}
|
||||
friend const RegRip operator-(const RegRip& r, sint64 disp) {
|
||||
friend const RegRip operator-(const RegRip& r, int64_t disp) {
|
||||
return RegRip(r.disp_ - disp, r.label_, r.isAddr_);
|
||||
}
|
||||
friend const RegRip operator+(const RegRip& r, const Label& label) {
|
||||
|
@ -782,7 +778,7 @@ struct RegRip {
|
|||
}
|
||||
friend const RegRip operator+(const RegRip& r, const void *addr) {
|
||||
if (r.label_ || r.isAddr_) XBYAK_THROW_RET(ERR_BAD_ADDRESSING, RegRip());
|
||||
return RegRip(r.disp_ + (sint64)addr, 0, true);
|
||||
return RegRip(r.disp_ + (int64_t)addr, 0, true);
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
@ -879,10 +875,10 @@ public:
|
|||
}
|
||||
friend RegExp operator+(const RegExp& a, const RegExp& b);
|
||||
friend RegExp operator-(const RegExp& e, size_t disp);
|
||||
uint8 getRex() const
|
||||
uint8_t getRex() const
|
||||
{
|
||||
uint8 rex = index_.getRexX() | base_.getRexB();
|
||||
return rex ? uint8(rex | 0x40) : 0;
|
||||
uint8_t rex = index_.getRexX() | base_.getRexB();
|
||||
return rex ? uint8_t(rex | 0x40) : 0;
|
||||
}
|
||||
private:
|
||||
/*
|
||||
|
@ -946,9 +942,9 @@ class CodeArray {
|
|||
inner::LabelMode mode;
|
||||
AddrInfo(size_t _codeOffset, size_t _jmpAddr, int _jmpSize, inner::LabelMode _mode)
|
||||
: codeOffset(_codeOffset), jmpAddr(_jmpAddr), jmpSize(_jmpSize), mode(_mode) {}
|
||||
uint64 getVal(const uint8 *top) const
|
||||
uint64_t getVal(const uint8_t *top) const
|
||||
{
|
||||
uint64 disp = (mode == inner::LaddTop) ? jmpAddr + size_t(top) : (mode == inner::LasIs) ? jmpAddr : jmpAddr - size_t(top);
|
||||
uint64_t disp = (mode == inner::LaddTop) ? jmpAddr + size_t(top) : (mode == inner::LasIs) ? jmpAddr : jmpAddr - size_t(top);
|
||||
if (jmpSize == 4) disp = inner::VerifyInInt32(disp);
|
||||
return disp;
|
||||
}
|
||||
|
@ -964,7 +960,7 @@ class CodeArray {
|
|||
Allocator *alloc_;
|
||||
protected:
|
||||
size_t maxSize_;
|
||||
uint8 *top_;
|
||||
uint8_t *top_;
|
||||
size_t size_;
|
||||
bool isCalledCalcJmpAddress_;
|
||||
|
||||
|
@ -975,7 +971,7 @@ protected:
|
|||
void growMemory()
|
||||
{
|
||||
const size_t newSize = (std::max<size_t>)(DEFAULT_MAX_CODE_SIZE, maxSize_ * 2);
|
||||
uint8 *newTop = alloc_->alloc(newSize);
|
||||
uint8_t *newTop = alloc_->alloc(newSize);
|
||||
if (newTop == 0) XBYAK_THROW(ERR_CANT_ALLOC)
|
||||
for (size_t i = 0; i < size_; i++) newTop[i] = top_[i];
|
||||
alloc_->free(top_);
|
||||
|
@ -989,7 +985,7 @@ protected:
|
|||
{
|
||||
if (isCalledCalcJmpAddress_) return;
|
||||
for (AddrInfoList::const_iterator i = addrInfoList_.begin(), ie = addrInfoList_.end(); i != ie; ++i) {
|
||||
uint64 disp = i->getVal(top_);
|
||||
uint64_t disp = i->getVal(top_);
|
||||
rewrite(i->codeOffset, disp, i->jmpSize);
|
||||
}
|
||||
isCalledCalcJmpAddress_ = true;
|
||||
|
@ -1004,7 +1000,7 @@ public:
|
|||
: type_(userPtr == AutoGrow ? AUTO_GROW : (userPtr == 0 || userPtr == DontSetProtectRWE) ? ALLOC_BUF : USER_BUF)
|
||||
, alloc_(allocator ? allocator : (Allocator*)&defaultAllocator_)
|
||||
, maxSize_(maxSize)
|
||||
, top_(type_ == USER_BUF ? reinterpret_cast<uint8*>(userPtr) : alloc_->alloc((std::max<size_t>)(maxSize, 1)))
|
||||
, top_(type_ == USER_BUF ? reinterpret_cast<uint8_t*>(userPtr) : alloc_->alloc((std::max<size_t>)(maxSize, 1)))
|
||||
, size_(0)
|
||||
, isCalledCalcJmpAddress_(false)
|
||||
{
|
||||
|
@ -1045,24 +1041,24 @@ public:
|
|||
XBYAK_THROW(ERR_CODE_IS_TOO_BIG)
|
||||
}
|
||||
}
|
||||
top_[size_++] = static_cast<uint8>(code);
|
||||
top_[size_++] = static_cast<uint8_t>(code);
|
||||
}
|
||||
void db(const uint8 *code, size_t codeSize)
|
||||
void db(const uint8_t *code, size_t codeSize)
|
||||
{
|
||||
for (size_t i = 0; i < codeSize; i++) db(code[i]);
|
||||
}
|
||||
void db(uint64 code, size_t codeSize)
|
||||
void db(uint64_t code, size_t codeSize)
|
||||
{
|
||||
if (codeSize > 8) XBYAK_THROW(ERR_BAD_PARAMETER)
|
||||
for (size_t i = 0; i < codeSize; i++) db(static_cast<uint8>(code >> (i * 8)));
|
||||
for (size_t i = 0; i < codeSize; i++) db(static_cast<uint8_t>(code >> (i * 8)));
|
||||
}
|
||||
void dw(uint32 code) { db(code, 2); }
|
||||
void dd(uint32 code) { db(code, 4); }
|
||||
void dq(uint64 code) { db(code, 8); }
|
||||
const uint8 *getCode() const { return top_; }
|
||||
void dw(uint32_t code) { db(code, 2); }
|
||||
void dd(uint32_t code) { db(code, 4); }
|
||||
void dq(uint64_t code) { db(code, 8); }
|
||||
const uint8_t *getCode() const { return top_; }
|
||||
template<class F>
|
||||
const F getCode() const { return reinterpret_cast<F>(top_); }
|
||||
const uint8 *getCurr() const { return &top_[size_]; }
|
||||
const uint8_t *getCurr() const { return &top_[size_]; }
|
||||
template<class F>
|
||||
const F getCurr() const { return reinterpret_cast<F>(&top_[size_]); }
|
||||
size_t getSize() const { return size_; }
|
||||
|
@ -1073,7 +1069,7 @@ public:
|
|||
}
|
||||
void dump() const
|
||||
{
|
||||
const uint8 *p = getCode();
|
||||
const uint8_t *p = getCode();
|
||||
size_t bufSize = getSize();
|
||||
size_t remain = bufSize;
|
||||
for (int i = 0; i < 4; i++) {
|
||||
|
@ -1098,13 +1094,13 @@ public:
|
|||
@param disp [in] offset from the next of jmp
|
||||
@param size [in] write size(1, 2, 4, 8)
|
||||
*/
|
||||
void rewrite(size_t offset, uint64 disp, size_t size)
|
||||
void rewrite(size_t offset, uint64_t disp, size_t size)
|
||||
{
|
||||
assert(offset < maxSize_);
|
||||
if (size != 1 && size != 2 && size != 4 && size != 8) XBYAK_THROW(ERR_BAD_PARAMETER)
|
||||
uint8 *const data = top_ + offset;
|
||||
uint8_t *const data = top_ + offset;
|
||||
for (size_t i = 0; i < size; i++) {
|
||||
data[i] = static_cast<uint8>(disp >> (i * 8));
|
||||
data[i] = static_cast<uint8_t>(disp >> (i * 8));
|
||||
}
|
||||
}
|
||||
void save(size_t offset, size_t val, int size, inner::LabelMode mode)
|
||||
|
@ -1161,9 +1157,9 @@ public:
|
|||
@param alignedSize [in] power of two
|
||||
@return aligned addr by alingedSize
|
||||
*/
|
||||
static inline uint8 *getAlignedAddress(uint8 *addr, size_t alignedSize = 16)
|
||||
static inline uint8_t *getAlignedAddress(uint8_t *addr, size_t alignedSize = 16)
|
||||
{
|
||||
return reinterpret_cast<uint8*>((reinterpret_cast<size_t>(addr) + alignedSize - 1) & ~(alignedSize - static_cast<size_t>(1)));
|
||||
return reinterpret_cast<uint8_t*>((reinterpret_cast<size_t>(addr) + alignedSize - 1) & ~(alignedSize - static_cast<size_t>(1)));
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -1175,7 +1171,7 @@ public:
|
|||
M_rip,
|
||||
M_ripAddr
|
||||
};
|
||||
XBYAK_CONSTEXPR Address(uint32 sizeBit, bool broadcast, const RegExp& e)
|
||||
XBYAK_CONSTEXPR Address(uint32_t sizeBit, bool broadcast, const RegExp& e)
|
||||
: Operand(0, MEM, sizeBit), e_(e), label_(0), mode_(M_ModRM), broadcast_(broadcast)
|
||||
{
|
||||
e_.verify();
|
||||
|
@ -1183,7 +1179,7 @@ public:
|
|||
#ifdef XBYAK64
|
||||
explicit XBYAK_CONSTEXPR Address(size_t disp)
|
||||
: Operand(0, MEM, 64), e_(disp), label_(0), mode_(M_64bitDisp), broadcast_(false){ }
|
||||
XBYAK_CONSTEXPR Address(uint32 sizeBit, bool broadcast, const RegRip& addr)
|
||||
XBYAK_CONSTEXPR Address(uint32_t sizeBit, bool broadcast, const RegRip& addr)
|
||||
: Operand(0, MEM, sizeBit), e_(addr.disp_), label_(addr.label_), mode_(addr.isAddr_ ? M_ripAddr : M_rip), broadcast_(broadcast) { }
|
||||
#endif
|
||||
RegExp getRegExp(bool optimize = true) const
|
||||
|
@ -1194,7 +1190,7 @@ public:
|
|||
bool is32bit() const { return e_.getBase().getBit() == 32 || e_.getIndex().getBit() == 32; }
|
||||
bool isOnlyDisp() const { return !e_.getBase().getBit() && !e_.getIndex().getBit(); } // for mov eax
|
||||
size_t getDisp() const { return e_.getDisp(); }
|
||||
uint8 getRex() const
|
||||
uint8_t getRex() const
|
||||
{
|
||||
if (mode_ != M_ModRM) return 0;
|
||||
return getRegExp().getRex();
|
||||
|
@ -1231,9 +1227,9 @@ class AddressFrame {
|
|||
void operator=(const AddressFrame&);
|
||||
AddressFrame(const AddressFrame&);
|
||||
public:
|
||||
const uint32 bit_;
|
||||
const uint32_t bit_;
|
||||
const bool broadcast_;
|
||||
explicit XBYAK_CONSTEXPR AddressFrame(uint32 bit, bool broadcast = false) : bit_(bit), broadcast_(broadcast) { }
|
||||
explicit XBYAK_CONSTEXPR AddressFrame(uint32_t bit, bool broadcast = false) : bit_(bit), broadcast_(broadcast) { }
|
||||
Address operator[](const RegExp& e) const
|
||||
{
|
||||
return Address(bit_, broadcast_, e);
|
||||
|
@ -1243,7 +1239,7 @@ public:
|
|||
return Address(bit_, broadcast_, RegExp(reinterpret_cast<size_t>(disp)));
|
||||
}
|
||||
#ifdef XBYAK64
|
||||
Address operator[](uint64 disp) const { return Address(disp); }
|
||||
Address operator[](uint64_t disp) const { return Address(disp); }
|
||||
Address operator[](const RegRip& addr) const { return Address(bit_, broadcast_, addr); }
|
||||
#endif
|
||||
};
|
||||
|
@ -1272,7 +1268,7 @@ public:
|
|||
~Label();
|
||||
void clear() { mgr = 0; id = 0; }
|
||||
int getId() const { return id; }
|
||||
const uint8 *getAddress() const;
|
||||
const uint8_t *getAddress() const;
|
||||
|
||||
// backward compatibility
|
||||
static inline std::string toStr(int num)
|
||||
|
@ -1347,7 +1343,7 @@ class LabelManager {
|
|||
#ifdef XBYAK64
|
||||
if (jmp->jmpSize <= 4 && !inner::IsInInt32(disp)) XBYAK_THROW(ERR_OFFSET_IS_TOO_BIG)
|
||||
#endif
|
||||
if (jmp->jmpSize == 1 && !inner::IsInDisp8((uint32)disp)) XBYAK_THROW(ERR_LABEL_IS_TOO_FAR)
|
||||
if (jmp->jmpSize == 1 && !inner::IsInDisp8((uint32_t)disp)) XBYAK_THROW(ERR_LABEL_IS_TOO_FAR)
|
||||
}
|
||||
if (base_->isAutoGrow()) {
|
||||
base_->save(offset, disp, jmp->jmpSize, jmp->mode);
|
||||
|
@ -1504,7 +1500,7 @@ public:
|
|||
return false;
|
||||
}
|
||||
bool hasUndefClabel() const { return hasUndefinedLabel_inner(clabelUndefList_); }
|
||||
const uint8 *getCode() const { return base_->getCode(); }
|
||||
const uint8_t *getCode() const { return base_->getCode(); }
|
||||
bool isReady() const { return !base_->isAutoGrow() || base_->isCalledCalcJmpAddress(); }
|
||||
};
|
||||
|
||||
|
@ -1526,7 +1522,7 @@ inline Label::~Label()
|
|||
{
|
||||
if (id && mgr) mgr->decRefCount(id, this);
|
||||
}
|
||||
inline const uint8* Label::getAddress() const
|
||||
inline const uint8_t* Label::getAddress() const
|
||||
{
|
||||
if (mgr == 0 || !mgr->isReady()) return 0;
|
||||
size_t offset;
|
||||
|
@ -1545,7 +1541,7 @@ private:
|
|||
CodeGenerator operator=(const CodeGenerator&); // don't call
|
||||
#ifdef XBYAK64
|
||||
enum { i32e = 32 | 64, BIT = 64 };
|
||||
static const uint64 dummyAddr = uint64(0x1122334455667788ull);
|
||||
static const uint64_t dummyAddr = uint64_t(0x1122334455667788ull);
|
||||
typedef Reg64 NativeReg;
|
||||
#else
|
||||
enum { i32e = 32, BIT = 32 };
|
||||
|
@ -1589,7 +1585,7 @@ private:
|
|||
}
|
||||
void rex(const Operand& op1, const Operand& op2 = Operand())
|
||||
{
|
||||
uint8 rex = 0;
|
||||
uint8_t rex = 0;
|
||||
const Operand *p1 = &op1, *p2 = &op2;
|
||||
if (p1->isMEM()) std::swap(p1, p2);
|
||||
if (p1->isMEM()) XBYAK_THROW(ERR_BAD_COMBINATION)
|
||||
|
@ -1653,12 +1649,12 @@ private:
|
|||
bool b = base.isExtIdx();
|
||||
int idx = v ? v->getIdx() : 0;
|
||||
if ((idx | reg.getIdx() | base.getIdx()) >= 16) XBYAK_THROW(ERR_BAD_COMBINATION)
|
||||
uint32 pp = (type & T_66) ? 1 : (type & T_F3) ? 2 : (type & T_F2) ? 3 : 0;
|
||||
uint32 vvvv = (((~idx) & 15) << 3) | (is256 ? 4 : 0) | pp;
|
||||
uint32_t pp = (type & T_66) ? 1 : (type & T_F3) ? 2 : (type & T_F2) ? 3 : 0;
|
||||
uint32_t vvvv = (((~idx) & 15) << 3) | (is256 ? 4 : 0) | pp;
|
||||
if (!b && !x && !w && (type & T_0F)) {
|
||||
db(0xC5); db((r ? 0 : 0x80) | vvvv);
|
||||
} else {
|
||||
uint32 mmmm = (type & T_0F) ? 1 : (type & T_0F38) ? 2 : (type & T_0F3A) ? 3 : 0;
|
||||
uint32_t mmmm = (type & T_0F) ? 1 : (type & T_0F38) ? 2 : (type & T_0F3A) ? 3 : 0;
|
||||
db(0xC4); db((r ? 0 : 0x80) | (x ? 0 : 0x40) | (b ? 0 : 0x20) | mmmm); db((w << 7) | vvvv);
|
||||
}
|
||||
db(code);
|
||||
|
@ -1680,15 +1676,15 @@ private:
|
|||
if ((a > 0 && a != v) + (b > 0 && b != v) + (c > 0 && c != v) > 0) XBYAK_THROW_RET(err, 0)
|
||||
return v;
|
||||
}
|
||||
int evex(const Reg& reg, const Reg& base, const Operand *v, int type, int code, bool x = false, bool b = false, int aaa = 0, uint32 VL = 0, bool Hi16Vidx = false)
|
||||
int evex(const Reg& reg, const Reg& base, const Operand *v, int type, int code, bool x = false, bool b = false, int aaa = 0, uint32_t VL = 0, bool Hi16Vidx = false)
|
||||
{
|
||||
if (!(type & (T_EVEX | T_MUST_EVEX))) XBYAK_THROW_RET(ERR_EVEX_IS_INVALID, 0)
|
||||
int w = (type & T_EW1) ? 1 : 0;
|
||||
uint32 mm = (type & T_0F) ? 1 : (type & T_0F38) ? 2 : (type & T_0F3A) ? 3 : 0;
|
||||
uint32 pp = (type & T_66) ? 1 : (type & T_F3) ? 2 : (type & T_F2) ? 3 : 0;
|
||||
uint32_t mm = (type & T_0F) ? 1 : (type & T_0F38) ? 2 : (type & T_0F3A) ? 3 : 0;
|
||||
uint32_t pp = (type & T_66) ? 1 : (type & T_F3) ? 2 : (type & T_F2) ? 3 : 0;
|
||||
|
||||
int idx = v ? v->getIdx() : 0;
|
||||
uint32 vvvv = ~idx;
|
||||
uint32_t vvvv = ~idx;
|
||||
|
||||
bool R = !reg.isExtIdx();
|
||||
bool X = x ? false : !base.isExtIdx2();
|
||||
|
@ -1736,16 +1732,16 @@ private:
|
|||
}
|
||||
void setModRM(int mod, int r1, int r2)
|
||||
{
|
||||
db(static_cast<uint8>((mod << 6) | ((r1 & 7) << 3) | (r2 & 7)));
|
||||
db(static_cast<uint8_t>((mod << 6) | ((r1 & 7) << 3) | (r2 & 7)));
|
||||
}
|
||||
void setSIB(const RegExp& e, int reg, int disp8N = 0)
|
||||
{
|
||||
uint64 disp64 = e.getDisp();
|
||||
uint64_t disp64 = e.getDisp();
|
||||
#ifdef XBYAK64
|
||||
uint64 high = disp64 >> 32;
|
||||
uint64_t high = disp64 >> 32;
|
||||
if (high != 0 && high != 0xFFFFFFFF) XBYAK_THROW(ERR_OFFSET_IS_TOO_BIG)
|
||||
#endif
|
||||
uint32 disp = static_cast<uint32>(disp64);
|
||||
uint32_t disp = static_cast<uint32_t>(disp64);
|
||||
const Reg& base = e.getBase();
|
||||
const Reg& index = e.getIndex();
|
||||
const int baseIdx = base.getIdx();
|
||||
|
@ -1764,7 +1760,7 @@ private:
|
|||
}
|
||||
} else {
|
||||
// disp must be casted to signed
|
||||
uint32 t = static_cast<uint32>(static_cast<int>(disp) / disp8N);
|
||||
uint32_t t = static_cast<uint32_t>(static_cast<int>(disp) / disp8N);
|
||||
if ((disp % disp8N) == 0 && inner::IsInDisp8(t)) {
|
||||
disp = t;
|
||||
mod = mod01;
|
||||
|
@ -1794,7 +1790,7 @@ private:
|
|||
}
|
||||
}
|
||||
LabelManager labelMgr_;
|
||||
bool isInDisp16(uint32 x) const { return 0xFFFF8000 <= x || x <= 0x7FFF; }
|
||||
bool isInDisp16(uint32_t x) const { return 0xFFFF8000 <= x || x <= 0x7FFF; }
|
||||
void opModR(const Reg& reg1, const Reg& reg2, int code0, int code1 = NONE, int code2 = NONE)
|
||||
{
|
||||
rex(reg2, reg1);
|
||||
|
@ -1822,12 +1818,12 @@ private:
|
|||
if (addr.getMode() != Address::M_ModRM) XBYAK_THROW(ERR_INVALID_MIB_ADDRESS)
|
||||
if (BIT == 64 && addr.is32bit()) db(0x67);
|
||||
const RegExp& regExp = addr.getRegExp(false);
|
||||
uint8 rex = regExp.getRex();
|
||||
uint8_t rex = regExp.getRex();
|
||||
if (rex) db(rex);
|
||||
db(code0); db(code1);
|
||||
setSIB(regExp, reg.getIdx());
|
||||
}
|
||||
void makeJmp(uint32 disp, LabelType type, uint8 shortCode, uint8 longCode, uint8 longPref)
|
||||
void makeJmp(uint32_t disp, LabelType type, uint8_t shortCode, uint8_t longCode, uint8_t longPref)
|
||||
{
|
||||
const int shortJmpSize = 2;
|
||||
const int longHeaderSize = longPref ? 2 : 1;
|
||||
|
@ -1842,7 +1838,7 @@ private:
|
|||
}
|
||||
bool isNEAR(LabelType type) const { return type == T_NEAR || (type == T_AUTO && isDefaultJmpNEAR_); }
|
||||
template<class T>
|
||||
void opJmp(T& label, LabelType type, uint8 shortCode, uint8 longCode, uint8 longPref)
|
||||
void opJmp(T& label, LabelType type, uint8_t shortCode, uint8_t longCode, uint8_t longPref)
|
||||
{
|
||||
if (isAutoGrow() && size_ + 16 >= maxSize_) growMemory(); /* avoid splitting code of jmp */
|
||||
size_t offset = 0;
|
||||
|
@ -1862,7 +1858,7 @@ private:
|
|||
labelMgr_.addUndefinedLabel(label, jmp);
|
||||
}
|
||||
}
|
||||
void opJmpAbs(const void *addr, LabelType type, uint8 shortCode, uint8 longCode, uint8 longPref = 0)
|
||||
void opJmpAbs(const void *addr, LabelType type, uint8_t shortCode, uint8_t longCode, uint8_t longPref = 0)
|
||||
{
|
||||
if (isAutoGrow()) {
|
||||
if (!isNEAR(type)) XBYAK_THROW(ERR_ONLY_T_NEAR_IS_SUPPORTED_IN_AUTO_GROW)
|
||||
|
@ -1872,7 +1868,7 @@ private:
|
|||
dd(0);
|
||||
save(size_ - 4, size_t(addr) - size_, 4, inner::Labs);
|
||||
} else {
|
||||
makeJmp(inner::VerifyInInt32(reinterpret_cast<const uint8*>(addr) - getCurr()), type, shortCode, longCode, longPref);
|
||||
makeJmp(inner::VerifyInInt32(reinterpret_cast<const uint8_t*>(addr) - getCurr()), type, shortCode, longCode, longPref);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1973,7 +1969,7 @@ private:
|
|||
XBYAK_THROW(ERR_BAD_COMBINATION)
|
||||
}
|
||||
}
|
||||
void opShxd(const Operand& op, const Reg& reg, uint8 imm, int code, const Reg8 *_cl = 0)
|
||||
void opShxd(const Operand& op, const Reg& reg, uint8_t imm, int code, const Reg8 *_cl = 0)
|
||||
{
|
||||
if (_cl && _cl->getIdx() != Operand::CL) XBYAK_THROW(ERR_BAD_COMBINATION)
|
||||
opModRM(reg, op, (op.isREG(16 | i32e) && op.getBit() == reg.getBit()), op.isMEM() && (reg.isREG(16 | i32e)), 0x0F, code | (_cl ? 1 : 0), NONE, _cl ? 0 : 1);
|
||||
|
@ -1989,10 +1985,10 @@ private:
|
|||
}
|
||||
}
|
||||
// (REG|MEM, IMM)
|
||||
void opRM_I(const Operand& op, uint32 imm, int code, int ext)
|
||||
void opRM_I(const Operand& op, uint32_t imm, int code, int ext)
|
||||
{
|
||||
verifyMemHasSize(op);
|
||||
uint32 immBit = inner::IsInDisp8(imm) ? 8 : isInDisp16(imm) ? 16 : 32;
|
||||
uint32_t immBit = inner::IsInDisp8(imm) ? 8 : isInDisp16(imm) ? 16 : 32;
|
||||
if (op.isBit(8)) immBit = 8;
|
||||
if (op.getBit() < immBit) XBYAK_THROW(ERR_IMM_IS_TOO_BIG)
|
||||
if (op.isBit(32|64) && immBit == 16) immBit = 32; /* don't use MEM16 if 32/64bit mode */
|
||||
|
@ -2045,12 +2041,12 @@ private:
|
|||
/*
|
||||
mov(r, imm) = db(imm, mov_imm(r, imm))
|
||||
*/
|
||||
int mov_imm(const Reg& reg, uint64 imm)
|
||||
int mov_imm(const Reg& reg, uint64_t imm)
|
||||
{
|
||||
int bit = reg.getBit();
|
||||
const int idx = reg.getIdx();
|
||||
int code = 0xB0 | ((bit == 8 ? 0 : 1) << 3);
|
||||
if (bit == 64 && (imm & ~uint64(0xffffffffu)) == 0) {
|
||||
if (bit == 64 && (imm & ~uint64_t(0xffffffffu)) == 0) {
|
||||
rex(Reg32(idx));
|
||||
bit = 32;
|
||||
} else {
|
||||
|
@ -2074,18 +2070,18 @@ private:
|
|||
if (relative) {
|
||||
db(inner::VerifyInInt32(offset + disp - size_ - jmpSize), jmpSize);
|
||||
} else if (isAutoGrow()) {
|
||||
db(uint64(0), jmpSize);
|
||||
db(uint64_t(0), jmpSize);
|
||||
save(size_ - jmpSize, offset, jmpSize, inner::LaddTop);
|
||||
} else {
|
||||
db(size_t(top_) + offset, jmpSize);
|
||||
}
|
||||
return;
|
||||
}
|
||||
db(uint64(0), jmpSize);
|
||||
db(uint64_t(0), jmpSize);
|
||||
JmpLabel jmp(size_, jmpSize, (relative ? inner::LasIs : isAutoGrow() ? inner::LaddTop : inner::Labs), disp);
|
||||
labelMgr_.addUndefinedLabel(label, jmp);
|
||||
}
|
||||
void opMovxx(const Reg& reg, const Operand& op, uint8 code)
|
||||
void opMovxx(const Reg& reg, const Operand& op, uint8_t code)
|
||||
{
|
||||
if (op.isBit(32)) XBYAK_THROW(ERR_BAD_COMBINATION)
|
||||
int w = op.isBit(16);
|
||||
|
@ -2095,10 +2091,10 @@ private:
|
|||
bool cond = reg.isREG() && (reg.getBit() > op.getBit());
|
||||
opModRM(reg, op, cond && op.isREG(), cond && op.isMEM(), 0x0F, code | w);
|
||||
}
|
||||
void opFpuMem(const Address& addr, uint8 m16, uint8 m32, uint8 m64, uint8 ext, uint8 m64ext)
|
||||
void opFpuMem(const Address& addr, uint8_t m16, uint8_t m32, uint8_t m64, uint8_t ext, uint8_t m64ext)
|
||||
{
|
||||
if (addr.is64bitDisp()) XBYAK_THROW(ERR_CANT_USE_64BIT_DISP)
|
||||
uint8 code = addr.isBit(16) ? m16 : addr.isBit(32) ? m32 : addr.isBit(64) ? m64 : 0;
|
||||
uint8_t code = addr.isBit(16) ? m16 : addr.isBit(32) ? m32 : addr.isBit(64) ? m64 : 0;
|
||||
if (!code) XBYAK_THROW(ERR_BAD_MEM_SIZE)
|
||||
if (m64ext && addr.isBit(64)) ext = m64ext;
|
||||
|
||||
|
@ -2108,14 +2104,14 @@ private:
|
|||
}
|
||||
// use code1 if reg1 == st0
|
||||
// use code2 if reg1 != st0 && reg2 == st0
|
||||
void opFpuFpu(const Fpu& reg1, const Fpu& reg2, uint32 code1, uint32 code2)
|
||||
void opFpuFpu(const Fpu& reg1, const Fpu& reg2, uint32_t code1, uint32_t code2)
|
||||
{
|
||||
uint32 code = reg1.getIdx() == 0 ? code1 : reg2.getIdx() == 0 ? code2 : 0;
|
||||
uint32_t code = reg1.getIdx() == 0 ? code1 : reg2.getIdx() == 0 ? code2 : 0;
|
||||
if (!code) XBYAK_THROW(ERR_BAD_ST_COMBINATION)
|
||||
db(uint8(code >> 8));
|
||||
db(uint8(code | (reg1.getIdx() | reg2.getIdx())));
|
||||
db(uint8_t(code >> 8));
|
||||
db(uint8_t(code | (reg1.getIdx() | reg2.getIdx())));
|
||||
}
|
||||
void opFpu(const Fpu& reg, uint8 code1, uint8 code2)
|
||||
void opFpu(const Fpu& reg, uint8_t code1, uint8_t code2)
|
||||
{
|
||||
db(code1); db(code2 | reg.getIdx());
|
||||
}
|
||||
|
@ -2156,7 +2152,7 @@ private:
|
|||
}
|
||||
// (r, r, r/m) if isR_R_RM
|
||||
// (r, r/m, r)
|
||||
void opGpr(const Reg32e& r, const Operand& op1, const Operand& op2, int type, uint8 code, bool isR_R_RM, int imm8 = NONE)
|
||||
void opGpr(const Reg32e& r, const Operand& op1, const Operand& op2, int type, uint8_t code, bool isR_R_RM, int imm8 = NONE)
|
||||
{
|
||||
const Operand *p1 = &op1;
|
||||
const Operand *p2 = &op2;
|
||||
|
@ -2199,7 +2195,7 @@ private:
|
|||
Operand::Kind kind = x.isXMM() ? (op.isBit(256) ? Operand::YMM : Operand::XMM) : Operand::ZMM;
|
||||
opVex(x.copyAndSetKind(kind), &xm0, op, type, code);
|
||||
}
|
||||
void opCvt3(const Xmm& x1, const Xmm& x2, const Operand& op, int type, int type64, int type32, uint8 code)
|
||||
void opCvt3(const Xmm& x1, const Xmm& x2, const Operand& op, int type, int type64, int type32, uint8_t code)
|
||||
{
|
||||
if (!(x1.isXMM() && x2.isXMM() && (op.isREG(i32e) || op.isMEM()))) XBYAK_THROW(ERR_BAD_SIZE_OF_REGISTER)
|
||||
Xmm x(op.getIdx());
|
||||
|
@ -2216,7 +2212,7 @@ private:
|
|||
opAVX_X_X_XM(x, cvtIdx0(x), op, type, code, imm8);
|
||||
}
|
||||
// QQQ:need to refactor
|
||||
void opSp1(const Reg& reg, const Operand& op, uint8 pref, uint8 code0, uint8 code1)
|
||||
void opSp1(const Reg& reg, const Operand& op, uint8_t pref, uint8_t code0, uint8_t code1)
|
||||
{
|
||||
if (reg.isBit(8)) XBYAK_THROW(ERR_BAD_SIZE_OF_REGISTER)
|
||||
bool is16bit = reg.isREG(16) && (op.isREG(16) || op.isMEM());
|
||||
|
@ -2224,7 +2220,7 @@ private:
|
|||
if (is16bit) db(0x66);
|
||||
db(pref); opModRM(reg.changeBit(i32e == 32 ? 32 : reg.getBit()), op, op.isREG(), true, code0, code1);
|
||||
}
|
||||
void opGather(const Xmm& x1, const Address& addr, const Xmm& x2, int type, uint8 code, int mode)
|
||||
void opGather(const Xmm& x1, const Address& addr, const Xmm& x2, int type, uint8_t code, int mode)
|
||||
{
|
||||
const RegExp& regExp = addr.getRegExp();
|
||||
if (!regExp.isVsib(128 | 256)) XBYAK_THROW(ERR_BAD_VSIB_ADDRESSING)
|
||||
|
@ -2263,7 +2259,7 @@ private:
|
|||
}
|
||||
XBYAK_THROW(ERR_BAD_VSIB_ADDRESSING)
|
||||
}
|
||||
void opGather2(const Xmm& x, const Address& addr, int type, uint8 code, int mode)
|
||||
void opGather2(const Xmm& x, const Address& addr, int type, uint8_t code, int mode)
|
||||
{
|
||||
if (x.hasZero()) XBYAK_THROW(ERR_INVALID_ZERO)
|
||||
checkGather2(x, addr.getRegExp().getIndex(), mode);
|
||||
|
@ -2273,7 +2269,7 @@ private:
|
|||
xx_xy_yz ; mode = true
|
||||
xx_xy_xz ; mode = false
|
||||
*/
|
||||
void opVmov(const Operand& op, const Xmm& x, int type, uint8 code, bool mode)
|
||||
void opVmov(const Operand& op, const Xmm& x, int type, uint8_t code, bool mode)
|
||||
{
|
||||
if (mode) {
|
||||
if (!op.isMEM() && !((op.isXMM() && x.isXMM()) || (op.isXMM() && x.isYMM()) || (op.isYMM() && x.isZMM()))) XBYAK_THROW(ERR_BAD_COMBINATION)
|
||||
|
@ -2282,13 +2278,13 @@ private:
|
|||
}
|
||||
opVex(x, 0, op, type, code);
|
||||
}
|
||||
void opGatherFetch(const Address& addr, const Xmm& x, int type, uint8 code, Operand::Kind kind)
|
||||
void opGatherFetch(const Address& addr, const Xmm& x, int type, uint8_t code, Operand::Kind kind)
|
||||
{
|
||||
if (addr.hasZero()) XBYAK_THROW(ERR_INVALID_ZERO)
|
||||
if (addr.getRegExp().getIndex().getKind() != kind) XBYAK_THROW(ERR_BAD_VSIB_ADDRESSING)
|
||||
opVex(x, 0, addr, type, code);
|
||||
}
|
||||
void opInOut(const Reg& a, const Reg& d, uint8 code)
|
||||
void opInOut(const Reg& a, const Reg& d, uint8_t code)
|
||||
{
|
||||
if (a.getIdx() == Operand::AL && d.getIdx() == Operand::DX && d.getBit() == 16) {
|
||||
switch (a.getBit()) {
|
||||
|
@ -2299,7 +2295,7 @@ private:
|
|||
}
|
||||
XBYAK_THROW(ERR_BAD_COMBINATION)
|
||||
}
|
||||
void opInOut(const Reg& a, uint8 code, uint8 v)
|
||||
void opInOut(const Reg& a, uint8_t code, uint8_t v)
|
||||
{
|
||||
if (a.getIdx() == Operand::AL) {
|
||||
switch (a.getBit()) {
|
||||
|
@ -2415,7 +2411,7 @@ public:
|
|||
{
|
||||
opModRM(reg, op, op.isREG() && (op.getKind() == reg.getKind()), op.isMEM(), 0x84);
|
||||
}
|
||||
void test(const Operand& op, uint32 imm)
|
||||
void test(const Operand& op, uint32_t imm)
|
||||
{
|
||||
verifyMemHasSize(op);
|
||||
int immSize = (std::min)(op.getBit() / 8, 4U);
|
||||
|
@ -2440,7 +2436,7 @@ public:
|
|||
}
|
||||
void push(const Operand& op) { opPushPop(op, 0xFF, 6, 0x50); }
|
||||
void pop(const Operand& op) { opPushPop(op, 0x8F, 0, 0x58); }
|
||||
void push(const AddressFrame& af, uint32 imm)
|
||||
void push(const AddressFrame& af, uint32_t imm)
|
||||
{
|
||||
if (af.bit_ == 8) {
|
||||
db(0x6A); db(imm);
|
||||
|
@ -2451,7 +2447,7 @@ public:
|
|||
}
|
||||
}
|
||||
/* use "push(word, 4)" if you want "push word 4" */
|
||||
void push(uint32 imm)
|
||||
void push(uint32_t imm)
|
||||
{
|
||||
if (inner::IsInDisp8(imm)) {
|
||||
push(byte, imm);
|
||||
|
@ -2463,7 +2459,7 @@ public:
|
|||
{
|
||||
const Reg *reg = 0;
|
||||
const Address *addr = 0;
|
||||
uint8 code = 0;
|
||||
uint8_t code = 0;
|
||||
if (reg1.isREG() && reg1.getIdx() == 0 && reg2.isMEM()) { // mov eax|ax|al, [disp]
|
||||
reg = ®1.getReg();
|
||||
addr= ®2.getAddress();
|
||||
|
@ -2488,14 +2484,14 @@ public:
|
|||
if (code && addr->isOnlyDisp()) {
|
||||
rex(*reg, *addr);
|
||||
db(code | (reg->isBit(8) ? 0 : 1));
|
||||
dd(static_cast<uint32>(addr->getDisp()));
|
||||
dd(static_cast<uint32_t>(addr->getDisp()));
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
opRM_RM(reg1, reg2, 0x88);
|
||||
}
|
||||
}
|
||||
void mov(const Operand& op, uint64 imm)
|
||||
void mov(const Operand& op, uint64_t imm)
|
||||
{
|
||||
if (op.isREG()) {
|
||||
const int size = mov_imm(op.getReg(), imm);
|
||||
|
@ -2504,14 +2500,14 @@ public:
|
|||
verifyMemHasSize(op);
|
||||
int immSize = op.getBit() / 8;
|
||||
if (immSize <= 4) {
|
||||
sint64 s = sint64(imm) >> (immSize * 8);
|
||||
int64_t s = int64_t(imm) >> (immSize * 8);
|
||||
if (s != 0 && s != -1) XBYAK_THROW(ERR_IMM_IS_TOO_BIG)
|
||||
} else {
|
||||
if (!inner::IsInInt32(imm)) XBYAK_THROW(ERR_IMM_IS_TOO_BIG)
|
||||
immSize = 4;
|
||||
}
|
||||
opModM(op.getAddress(), Reg(0, Operand::REG, op.getBit()), 0xC6, NONE, NONE, immSize);
|
||||
db(static_cast<uint32>(imm), immSize);
|
||||
db(static_cast<uint32_t>(imm), immSize);
|
||||
} else {
|
||||
XBYAK_THROW(ERR_BAD_COMBINATION)
|
||||
}
|
||||
|
@ -2519,7 +2515,7 @@ public:
|
|||
|
||||
// The template is used to avoid ambiguity when the 2nd argument is 0.
|
||||
// When the 2nd argument is 0 the call goes to
|
||||
// `void mov(const Operand& op, uint64 imm)`.
|
||||
// `void mov(const Operand& op, uint64_t imm)`.
|
||||
template <typename T1, typename T2>
|
||||
void mov(const T1&, const T2 *) { T1::unexpected; }
|
||||
void mov(const NativeReg& reg, const Label& label)
|
||||
|
@ -2703,7 +2699,7 @@ public:
|
|||
AMD and Intel seem to agree on the same sequences for up to 9 bytes:
|
||||
https://support.amd.com/TechDocs/55723_SOG_Fam_17h_Processors_3.00.pdf
|
||||
*/
|
||||
static const uint8 nopTbl[9][9] = {
|
||||
static const uint8_t nopTbl[9][9] = {
|
||||
{0x90},
|
||||
{0x66, 0x90},
|
||||
{0x0F, 0x1F, 0x00},
|
||||
|
@ -2717,7 +2713,7 @@ public:
|
|||
const size_t n = sizeof(nopTbl) / sizeof(nopTbl[0]);
|
||||
while (size > 0) {
|
||||
size_t len = (std::min)(n, size);
|
||||
const uint8 *seq = nopTbl[len - 1];
|
||||
const uint8_t *seq = nopTbl[len - 1];
|
||||
db(seq, len);
|
||||
size -= len;
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
const char *getVersionString() const { return "5.96"; }
|
||||
void adc(const Operand& op, uint32 imm) { opRM_I(op, imm, 0x10, 2); }
|
||||
const char *getVersionString() const { return "5.97"; }
|
||||
void adc(const Operand& op, uint32_t imm) { opRM_I(op, imm, 0x10, 2); }
|
||||
void adc(const Operand& op1, const Operand& op2) { opRM_RM(op1, op2, 0x10); }
|
||||
void adcx(const Reg32e& reg, const Operand& op) { opGen(reg, op, 0xF6, 0x66, isREG32_REG32orMEM, NONE, 0x38); }
|
||||
void add(const Operand& op, uint32 imm) { opRM_I(op, imm, 0x00, 0); }
|
||||
void add(const Operand& op, uint32_t imm) { opRM_I(op, imm, 0x00, 0); }
|
||||
void add(const Operand& op1, const Operand& op2) { opRM_RM(op1, op2, 0x00); }
|
||||
void addpd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x58, 0x66, isXMM_XMMorMEM); }
|
||||
void addps(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x58, 0x100, isXMM_XMMorMEM); }
|
||||
|
@ -16,8 +16,8 @@ void aesdeclast(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0xDF, 0x66,
|
|||
void aesenc(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0xDC, 0x66, isXMM_XMMorMEM, NONE, 0x38); }
|
||||
void aesenclast(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0xDD, 0x66, isXMM_XMMorMEM, NONE, 0x38); }
|
||||
void aesimc(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0xDB, 0x66, isXMM_XMMorMEM, NONE, 0x38); }
|
||||
void aeskeygenassist(const Xmm& xmm, const Operand& op, uint8 imm) { opGen(xmm, op, 0xDF, 0x66, isXMM_XMMorMEM, imm, 0x3A); }
|
||||
void and_(const Operand& op, uint32 imm) { opRM_I(op, imm, 0x20, 4); }
|
||||
void aeskeygenassist(const Xmm& xmm, const Operand& op, uint8_t imm) { opGen(xmm, op, 0xDF, 0x66, isXMM_XMMorMEM, imm, 0x3A); }
|
||||
void and_(const Operand& op, uint32_t imm) { opRM_I(op, imm, 0x20, 4); }
|
||||
void and_(const Operand& op1, const Operand& op2) { opRM_RM(op1, op2, 0x20); }
|
||||
void andn(const Reg32e& r1, const Reg32e& r2, const Operand& op) { opGpr(r1, r2, op, T_0F38, 0xf2, true); }
|
||||
void andnpd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x55, 0x66, isXMM_XMMorMEM); }
|
||||
|
@ -25,8 +25,8 @@ void andnps(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x55, 0x100, isX
|
|||
void andpd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x54, 0x66, isXMM_XMMorMEM); }
|
||||
void andps(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x54, 0x100, isXMM_XMMorMEM); }
|
||||
void bextr(const Reg32e& r1, const Operand& op, const Reg32e& r2) { opGpr(r1, op, r2, T_0F38, 0xf7, false); }
|
||||
void blendpd(const Xmm& xmm, const Operand& op, int imm) { opGen(xmm, op, 0x0D, 0x66, isXMM_XMMorMEM, static_cast<uint8>(imm), 0x3A); }
|
||||
void blendps(const Xmm& xmm, const Operand& op, int imm) { opGen(xmm, op, 0x0C, 0x66, isXMM_XMMorMEM, static_cast<uint8>(imm), 0x3A); }
|
||||
void blendpd(const Xmm& xmm, const Operand& op, int imm) { opGen(xmm, op, 0x0D, 0x66, isXMM_XMMorMEM, static_cast<uint8_t>(imm), 0x3A); }
|
||||
void blendps(const Xmm& xmm, const Operand& op, int imm) { opGen(xmm, op, 0x0C, 0x66, isXMM_XMMorMEM, static_cast<uint8_t>(imm), 0x3A); }
|
||||
void blendvpd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x15, 0x66, isXMM_XMMorMEM, NONE, 0x38); }
|
||||
void blendvps(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x14, 0x66, isXMM_XMMorMEM, NONE, 0x38); }
|
||||
void blsi(const Reg32e& r, const Operand& op) { opGpr(Reg32e(3, r.getBit()), op, r, T_0F38, 0xf3, false); }
|
||||
|
@ -45,13 +45,13 @@ void bsf(const Reg®, const Operand& op) { opModRM(reg, op, op.isREG(16 | i32e
|
|||
void bsr(const Reg®, const Operand& op) { opModRM(reg, op, op.isREG(16 | i32e), op.isMEM(), 0x0F, 0xBD); }
|
||||
void bswap(const Reg32e& reg) { opModR(Reg32(1), reg, 0x0F); }
|
||||
void bt(const Operand& op, const Reg& reg) { opModRM(reg, op, op.isREG(16|32|64) && op.getBit() == reg.getBit(), op.isMEM(), 0x0f, 0xA3); }
|
||||
void bt(const Operand& op, uint8 imm) { opR_ModM(op, 16|32|64, 4, 0x0f, 0xba, NONE, false, 1); db(imm); }
|
||||
void bt(const Operand& op, uint8_t imm) { opR_ModM(op, 16|32|64, 4, 0x0f, 0xba, NONE, false, 1); db(imm); }
|
||||
void btc(const Operand& op, const Reg& reg) { opModRM(reg, op, op.isREG(16|32|64) && op.getBit() == reg.getBit(), op.isMEM(), 0x0f, 0xBB); }
|
||||
void btc(const Operand& op, uint8 imm) { opR_ModM(op, 16|32|64, 7, 0x0f, 0xba, NONE, false, 1); db(imm); }
|
||||
void btc(const Operand& op, uint8_t imm) { opR_ModM(op, 16|32|64, 7, 0x0f, 0xba, NONE, false, 1); db(imm); }
|
||||
void btr(const Operand& op, const Reg& reg) { opModRM(reg, op, op.isREG(16|32|64) && op.getBit() == reg.getBit(), op.isMEM(), 0x0f, 0xB3); }
|
||||
void btr(const Operand& op, uint8 imm) { opR_ModM(op, 16|32|64, 6, 0x0f, 0xba, NONE, false, 1); db(imm); }
|
||||
void btr(const Operand& op, uint8_t imm) { opR_ModM(op, 16|32|64, 6, 0x0f, 0xba, NONE, false, 1); db(imm); }
|
||||
void bts(const Operand& op, const Reg& reg) { opModRM(reg, op, op.isREG(16|32|64) && op.getBit() == reg.getBit(), op.isMEM(), 0x0f, 0xAB); }
|
||||
void bts(const Operand& op, uint8 imm) { opR_ModM(op, 16|32|64, 5, 0x0f, 0xba, NONE, false, 1); db(imm); }
|
||||
void bts(const Operand& op, uint8_t imm) { opR_ModM(op, 16|32|64, 5, 0x0f, 0xba, NONE, false, 1); db(imm); }
|
||||
void bzhi(const Reg32e& r1, const Operand& op, const Reg32e& r2) { opGpr(r1, op, r2, T_0F38, 0xf5, false); }
|
||||
void cbw() { db(0x66); db(0x98); }
|
||||
void cdq() { db(0x99); }
|
||||
|
@ -92,7 +92,7 @@ void cmovpe(const Reg& reg, const Operand& op) { opModRM(reg, op, op.isREG(16 |
|
|||
void cmovpo(const Reg& reg, const Operand& op) { opModRM(reg, op, op.isREG(16 | i32e), op.isMEM(), 0x0F, 0x40 | 11); }//-V524
|
||||
void cmovs(const Reg& reg, const Operand& op) { opModRM(reg, op, op.isREG(16 | i32e), op.isMEM(), 0x0F, 0x40 | 8); }//-V524
|
||||
void cmovz(const Reg& reg, const Operand& op) { opModRM(reg, op, op.isREG(16 | i32e), op.isMEM(), 0x0F, 0x40 | 4); }//-V524
|
||||
void cmp(const Operand& op, uint32 imm) { opRM_I(op, imm, 0x38, 7); }
|
||||
void cmp(const Operand& op, uint32_t imm) { opRM_I(op, imm, 0x38, 7); }
|
||||
void cmp(const Operand& op1, const Operand& op2) { opRM_RM(op1, op2, 0x38); }
|
||||
void cmpeqpd(const Xmm& x, const Operand& op) { cmppd(x, op, 0); }
|
||||
void cmpeqps(const Xmm& x, const Operand& op) { cmpps(x, op, 0); }
|
||||
|
@ -122,12 +122,12 @@ void cmpordpd(const Xmm& x, const Operand& op) { cmppd(x, op, 7); }
|
|||
void cmpordps(const Xmm& x, const Operand& op) { cmpps(x, op, 7); }
|
||||
void cmpordsd(const Xmm& x, const Operand& op) { cmpsd(x, op, 7); }
|
||||
void cmpordss(const Xmm& x, const Operand& op) { cmpss(x, op, 7); }
|
||||
void cmppd(const Xmm& xmm, const Operand& op, uint8 imm8) { opGen(xmm, op, 0xC2, 0x66, isXMM_XMMorMEM, imm8); }
|
||||
void cmpps(const Xmm& xmm, const Operand& op, uint8 imm8) { opGen(xmm, op, 0xC2, 0x100, isXMM_XMMorMEM, imm8); }
|
||||
void cmppd(const Xmm& xmm, const Operand& op, uint8_t imm8) { opGen(xmm, op, 0xC2, 0x66, isXMM_XMMorMEM, imm8); }
|
||||
void cmpps(const Xmm& xmm, const Operand& op, uint8_t imm8) { opGen(xmm, op, 0xC2, 0x100, isXMM_XMMorMEM, imm8); }
|
||||
void cmpsb() { db(0xA6); }
|
||||
void cmpsd() { db(0xA7); }
|
||||
void cmpsd(const Xmm& xmm, const Operand& op, uint8 imm8) { opGen(xmm, op, 0xC2, 0xF2, isXMM_XMMorMEM, imm8); }
|
||||
void cmpss(const Xmm& xmm, const Operand& op, uint8 imm8) { opGen(xmm, op, 0xC2, 0xF3, isXMM_XMMorMEM, imm8); }
|
||||
void cmpsd(const Xmm& xmm, const Operand& op, uint8_t imm8) { opGen(xmm, op, 0xC2, 0xF2, isXMM_XMMorMEM, imm8); }
|
||||
void cmpss(const Xmm& xmm, const Operand& op, uint8_t imm8) { opGen(xmm, op, 0xC2, 0xF3, isXMM_XMMorMEM, imm8); }
|
||||
void cmpsw() { db(0x66); db(0xA7); }
|
||||
void cmpunordpd(const Xmm& x, const Operand& op) { cmppd(x, op, 3); }
|
||||
void cmpunordps(const Xmm& x, const Operand& op) { cmpps(x, op, 3); }
|
||||
|
@ -169,11 +169,11 @@ void divpd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x5E, 0x66, isXMM
|
|||
void divps(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x5E, 0x100, isXMM_XMMorMEM); }
|
||||
void divsd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x5E, 0xF2, isXMM_XMMorMEM); }
|
||||
void divss(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x5E, 0xF3, isXMM_XMMorMEM); }
|
||||
void dppd(const Xmm& xmm, const Operand& op, int imm) { opGen(xmm, op, 0x41, 0x66, isXMM_XMMorMEM, static_cast<uint8>(imm), 0x3A); }
|
||||
void dpps(const Xmm& xmm, const Operand& op, int imm) { opGen(xmm, op, 0x40, 0x66, isXMM_XMMorMEM, static_cast<uint8>(imm), 0x3A); }
|
||||
void dppd(const Xmm& xmm, const Operand& op, int imm) { opGen(xmm, op, 0x41, 0x66, isXMM_XMMorMEM, static_cast<uint8_t>(imm), 0x3A); }
|
||||
void dpps(const Xmm& xmm, const Operand& op, int imm) { opGen(xmm, op, 0x40, 0x66, isXMM_XMMorMEM, static_cast<uint8_t>(imm), 0x3A); }
|
||||
void emms() { db(0x0F); db(0x77); }
|
||||
void enter(uint16 x, uint8 y) { db(0xC8); dw(x); db(y); }
|
||||
void extractps(const Operand& op, const Xmm& xmm, uint8 imm) { opExt(op, xmm, 0x17, imm); }
|
||||
void enter(uint16_t x, uint8_t y) { db(0xC8); dw(x); db(y); }
|
||||
void extractps(const Operand& op, const Xmm& xmm, uint8_t imm) { opExt(op, xmm, 0x17, imm); }
|
||||
void f2xm1() { db(0xD9); db(0xF0); }
|
||||
void fabs() { db(0xD9); db(0xE1); }
|
||||
void fadd(const Address& addr) { opFpuMem(addr, 0x00, 0xD8, 0xDC, 0, 0); }
|
||||
|
@ -316,8 +316,8 @@ void fxrstor(const Address& addr) { opModM(addr, Reg32(1), 0x0F, 0xAE); }
|
|||
void fxtract() { db(0xD9); db(0xF4); }
|
||||
void fyl2x() { db(0xD9); db(0xF1); }
|
||||
void fyl2xp1() { db(0xD9); db(0xF9); }
|
||||
void gf2p8affineinvqb(const Xmm& xmm, const Operand& op, int imm) { opGen(xmm, op, 0xCF, 0x66, isXMM_XMMorMEM, static_cast<uint8>(imm), 0x3A); }
|
||||
void gf2p8affineqb(const Xmm& xmm, const Operand& op, int imm) { opGen(xmm, op, 0xCE, 0x66, isXMM_XMMorMEM, static_cast<uint8>(imm), 0x3A); }
|
||||
void gf2p8affineinvqb(const Xmm& xmm, const Operand& op, int imm) { opGen(xmm, op, 0xCF, 0x66, isXMM_XMMorMEM, static_cast<uint8_t>(imm), 0x3A); }
|
||||
void gf2p8affineqb(const Xmm& xmm, const Operand& op, int imm) { opGen(xmm, op, 0xCE, 0x66, isXMM_XMMorMEM, static_cast<uint8_t>(imm), 0x3A); }
|
||||
void gf2p8mulb(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0xCF, 0x66, isXMM_XMMorMEM, NONE, 0x38); }
|
||||
void haddpd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x7C, 0x66, isXMM_XMMorMEM); }
|
||||
void haddps(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x7C, 0xF2, isXMM_XMMorMEM); }
|
||||
|
@ -326,11 +326,11 @@ void hsubps(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x7D, 0xF2, isXM
|
|||
void idiv(const Operand& op) { opR_ModM(op, 0, 7, 0xF6); }
|
||||
void imul(const Operand& op) { opR_ModM(op, 0, 5, 0xF6); }
|
||||
void in_(const Reg& a, const Reg& d) { opInOut(a, d, 0xEC); }
|
||||
void in_(const Reg& a, uint8 v) { opInOut(a, 0xE4, v); }
|
||||
void in_(const Reg& a, uint8_t v) { opInOut(a, 0xE4, v); }
|
||||
void inc(const Operand& op) { opIncDec(op, 0x40, 0); }
|
||||
void insertps(const Xmm& xmm, const Operand& op, uint8 imm) { opGen(xmm, op, 0x21, 0x66, isXMM_XMMorMEM, imm, 0x3A); }
|
||||
void insertps(const Xmm& xmm, const Operand& op, uint8_t imm) { opGen(xmm, op, 0x21, 0x66, isXMM_XMMorMEM, imm, 0x3A); }
|
||||
void int3() { db(0xCC); }
|
||||
void int_(uint8 x) { db(0xCD); db(x); }
|
||||
void int_(uint8_t x) { db(0xCD); db(x); }
|
||||
void ja(const Label& label, LabelType type = T_AUTO) { opJmp(label, type, 0x77, 0x87, 0x0F); }//-V524
|
||||
void ja(const char *label, LabelType type = T_AUTO) { ja(std::string(label), type); }//-V524
|
||||
void ja(const void *addr) { opJmpAbs(addr, T_NEAR, 0x77, 0x87, 0x0F); }//-V524
|
||||
|
@ -535,7 +535,7 @@ void movupd(const Xmm& xmm, const Operand& op) { opMMX(xmm, op, 0x10, 0x66); }
|
|||
void movups(const Address& addr, const Xmm& xmm) { opModM(addr, xmm, 0x0F, 0x11); }
|
||||
void movups(const Xmm& xmm, const Operand& op) { opMMX(xmm, op, 0x10, 0x100); }
|
||||
void movzx(const Reg& reg, const Operand& op) { opMovxx(reg, op, 0xB6); }
|
||||
void mpsadbw(const Xmm& xmm, const Operand& op, int imm) { opGen(xmm, op, 0x42, 0x66, isXMM_XMMorMEM, static_cast<uint8>(imm), 0x3A); }
|
||||
void mpsadbw(const Xmm& xmm, const Operand& op, int imm) { opGen(xmm, op, 0x42, 0x66, isXMM_XMMorMEM, static_cast<uint8_t>(imm), 0x3A); }
|
||||
void mul(const Operand& op) { opR_ModM(op, 0, 4, 0xF6); }
|
||||
void mulpd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x59, 0x66, isXMM_XMMorMEM); }
|
||||
void mulps(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x59, 0x100, isXMM_XMMorMEM); }
|
||||
|
@ -546,12 +546,12 @@ void mwait() { db(0x0F); db(0x01); db(0xC9); }
|
|||
void mwaitx() { db(0x0F); db(0x01); db(0xFB); }
|
||||
void neg(const Operand& op) { opR_ModM(op, 0, 3, 0xF6); }
|
||||
void not_(const Operand& op) { opR_ModM(op, 0, 2, 0xF6); }
|
||||
void or_(const Operand& op, uint32 imm) { opRM_I(op, imm, 0x08, 1); }
|
||||
void or_(const Operand& op, uint32_t imm) { opRM_I(op, imm, 0x08, 1); }
|
||||
void or_(const Operand& op1, const Operand& op2) { opRM_RM(op1, op2, 0x08); }
|
||||
void orpd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x56, 0x66, isXMM_XMMorMEM); }
|
||||
void orps(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x56, 0x100, isXMM_XMMorMEM); }
|
||||
void out_(const Reg& d, const Reg& a) { opInOut(a, d, 0xEE); }
|
||||
void out_(uint8 v, const Reg& a) { opInOut(a, 0xE6, v); }
|
||||
void out_(uint8_t v, const Reg& a) { opInOut(a, 0xE6, v); }
|
||||
void outsb() { db(0x6E); }
|
||||
void outsd() { db(0x6F); }
|
||||
void outsw() { db(0x66); db(0x6F); }
|
||||
|
@ -570,36 +570,36 @@ void paddsw(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xED); }
|
|||
void paddusb(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xDC); }
|
||||
void paddusw(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xDD); }
|
||||
void paddw(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xFD); }
|
||||
void palignr(const Mmx& mmx, const Operand& op, int imm) { opMMX(mmx, op, 0x0f, 0x66, static_cast<uint8>(imm), 0x3a); }
|
||||
void palignr(const Mmx& mmx, const Operand& op, int imm) { opMMX(mmx, op, 0x0f, 0x66, static_cast<uint8_t>(imm), 0x3a); }
|
||||
void pand(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xDB); }
|
||||
void pandn(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xDF); }
|
||||
void pause() { db(0xF3); db(0x90); }
|
||||
void pavgb(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xE0); }
|
||||
void pavgw(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xE3); }
|
||||
void pblendvb(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x10, 0x66, isXMM_XMMorMEM, NONE, 0x38); }
|
||||
void pblendw(const Xmm& xmm, const Operand& op, int imm) { opGen(xmm, op, 0x0E, 0x66, isXMM_XMMorMEM, static_cast<uint8>(imm), 0x3A); }
|
||||
void pblendw(const Xmm& xmm, const Operand& op, int imm) { opGen(xmm, op, 0x0E, 0x66, isXMM_XMMorMEM, static_cast<uint8_t>(imm), 0x3A); }
|
||||
void pclmulhqhdq(const Xmm& xmm, const Operand& op) { pclmulqdq(xmm, op, 0x11); }
|
||||
void pclmulhqlqdq(const Xmm& xmm, const Operand& op) { pclmulqdq(xmm, op, 0x01); }
|
||||
void pclmullqhdq(const Xmm& xmm, const Operand& op) { pclmulqdq(xmm, op, 0x10); }
|
||||
void pclmullqlqdq(const Xmm& xmm, const Operand& op) { pclmulqdq(xmm, op, 0x00); }
|
||||
void pclmulqdq(const Xmm& xmm, const Operand& op, int imm) { opGen(xmm, op, 0x44, 0x66, isXMM_XMMorMEM, static_cast<uint8>(imm), 0x3A); }
|
||||
void pclmulqdq(const Xmm& xmm, const Operand& op, int imm) { opGen(xmm, op, 0x44, 0x66, isXMM_XMMorMEM, static_cast<uint8_t>(imm), 0x3A); }
|
||||
void pcmpeqb(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x74); }
|
||||
void pcmpeqd(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x76); }
|
||||
void pcmpeqq(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x29, 0x66, isXMM_XMMorMEM, NONE, 0x38); }
|
||||
void pcmpeqw(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x75); }
|
||||
void pcmpestri(const Xmm& xmm, const Operand& op, uint8 imm) { opGen(xmm, op, 0x61, 0x66, isXMM_XMMorMEM, imm, 0x3A); }
|
||||
void pcmpestrm(const Xmm& xmm, const Operand& op, uint8 imm) { opGen(xmm, op, 0x60, 0x66, isXMM_XMMorMEM, imm, 0x3A); }
|
||||
void pcmpestri(const Xmm& xmm, const Operand& op, uint8_t imm) { opGen(xmm, op, 0x61, 0x66, isXMM_XMMorMEM, imm, 0x3A); }
|
||||
void pcmpestrm(const Xmm& xmm, const Operand& op, uint8_t imm) { opGen(xmm, op, 0x60, 0x66, isXMM_XMMorMEM, imm, 0x3A); }
|
||||
void pcmpgtb(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x64); }
|
||||
void pcmpgtd(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x66); }
|
||||
void pcmpgtq(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x37, 0x66, isXMM_XMMorMEM, NONE, 0x38); }
|
||||
void pcmpgtw(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x65); }
|
||||
void pcmpistri(const Xmm& xmm, const Operand& op, uint8 imm) { opGen(xmm, op, 0x63, 0x66, isXMM_XMMorMEM, imm, 0x3A); }
|
||||
void pcmpistrm(const Xmm& xmm, const Operand& op, uint8 imm) { opGen(xmm, op, 0x62, 0x66, isXMM_XMMorMEM, imm, 0x3A); }
|
||||
void pcmpistri(const Xmm& xmm, const Operand& op, uint8_t imm) { opGen(xmm, op, 0x63, 0x66, isXMM_XMMorMEM, imm, 0x3A); }
|
||||
void pcmpistrm(const Xmm& xmm, const Operand& op, uint8_t imm) { opGen(xmm, op, 0x62, 0x66, isXMM_XMMorMEM, imm, 0x3A); }
|
||||
void pdep(const Reg32e& r1, const Reg32e& r2, const Operand& op) { opGpr(r1, r2, op, T_F2 | T_0F38, 0xf5, true); }
|
||||
void pext(const Reg32e& r1, const Reg32e& r2, const Operand& op) { opGpr(r1, r2, op, T_F3 | T_0F38, 0xf5, true); }
|
||||
void pextrb(const Operand& op, const Xmm& xmm, uint8 imm) { opExt(op, xmm, 0x14, imm); }
|
||||
void pextrd(const Operand& op, const Xmm& xmm, uint8 imm) { opExt(op, xmm, 0x16, imm); }
|
||||
void pextrw(const Operand& op, const Mmx& xmm, uint8 imm) { opExt(op, xmm, 0x15, imm, true); }
|
||||
void pextrb(const Operand& op, const Xmm& xmm, uint8_t imm) { opExt(op, xmm, 0x14, imm); }
|
||||
void pextrd(const Operand& op, const Xmm& xmm, uint8_t imm) { opExt(op, xmm, 0x16, imm); }
|
||||
void pextrw(const Operand& op, const Mmx& xmm, uint8_t imm) { opExt(op, xmm, 0x15, imm, true); }
|
||||
void phaddd(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x02, 0x66, NONE, 0x38); }
|
||||
void phaddsw(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x03, 0x66, NONE, 0x38); }
|
||||
void phaddw(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x01, 0x66, NONE, 0x38); }
|
||||
|
@ -607,8 +607,8 @@ void phminposuw(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x41, 0x66,
|
|||
void phsubd(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x06, 0x66, NONE, 0x38); }
|
||||
void phsubsw(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x07, 0x66, NONE, 0x38); }
|
||||
void phsubw(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x05, 0x66, NONE, 0x38); }
|
||||
void pinsrb(const Xmm& xmm, const Operand& op, uint8 imm) { opGen(xmm, op, 0x20, 0x66, isXMM_REG32orMEM, imm, 0x3A); }
|
||||
void pinsrd(const Xmm& xmm, const Operand& op, uint8 imm) { opGen(xmm, op, 0x22, 0x66, isXMM_REG32orMEM, imm, 0x3A); }
|
||||
void pinsrb(const Xmm& xmm, const Operand& op, uint8_t imm) { opGen(xmm, op, 0x20, 0x66, isXMM_REG32orMEM, imm, 0x3A); }
|
||||
void pinsrd(const Xmm& xmm, const Operand& op, uint8_t imm) { opGen(xmm, op, 0x22, 0x66, isXMM_REG32orMEM, imm, 0x3A); }
|
||||
void pinsrw(const Mmx& mmx, const Operand& op, int imm) { if (!op.isREG(32) && !op.isMEM()) XBYAK_THROW(ERR_BAD_COMBINATION) opGen(mmx, op, 0xC4, mmx.isXMM() ? 0x66 : NONE, 0, imm); }
|
||||
void pmaddubsw(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x04, 0x66, NONE, 0x38); }
|
||||
void pmaddwd(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xF5); }
|
||||
|
@ -655,10 +655,10 @@ void prefetchw(const Address& addr) { opModM(addr, Reg32(1), 0x0F, 0x0D); }
|
|||
void prefetchwt1(const Address& addr) { opModM(addr, Reg32(2), 0x0F, 0x0D); }
|
||||
void psadbw(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0xF6); }
|
||||
void pshufb(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x00, 0x66, NONE, 0x38); }
|
||||
void pshufd(const Mmx& mmx, const Operand& op, uint8 imm8) { opMMX(mmx, op, 0x70, 0x66, imm8); }
|
||||
void pshufhw(const Mmx& mmx, const Operand& op, uint8 imm8) { opMMX(mmx, op, 0x70, 0xF3, imm8); }
|
||||
void pshuflw(const Mmx& mmx, const Operand& op, uint8 imm8) { opMMX(mmx, op, 0x70, 0xF2, imm8); }
|
||||
void pshufw(const Mmx& mmx, const Operand& op, uint8 imm8) { opMMX(mmx, op, 0x70, 0x00, imm8); }
|
||||
void pshufd(const Mmx& mmx, const Operand& op, uint8_t imm8) { opMMX(mmx, op, 0x70, 0x66, imm8); }
|
||||
void pshufhw(const Mmx& mmx, const Operand& op, uint8_t imm8) { opMMX(mmx, op, 0x70, 0xF3, imm8); }
|
||||
void pshuflw(const Mmx& mmx, const Operand& op, uint8_t imm8) { opMMX(mmx, op, 0x70, 0xF2, imm8); }
|
||||
void pshufw(const Mmx& mmx, const Operand& op, uint8_t imm8) { opMMX(mmx, op, 0x70, 0x00, imm8); }
|
||||
void psignb(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x08, 0x66, NONE, 0x38); }
|
||||
void psignd(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x0A, 0x66, NONE, 0x38); }
|
||||
void psignw(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x09, 0x66, NONE, 0x38); }
|
||||
|
@ -721,11 +721,11 @@ void rol(const Operand& op, const Reg8& _cl) { opShift(op, _cl, 0); }
|
|||
void rol(const Operand& op, int imm) { opShift(op, imm, 0); }
|
||||
void ror(const Operand& op, const Reg8& _cl) { opShift(op, _cl, 1); }
|
||||
void ror(const Operand& op, int imm) { opShift(op, imm, 1); }
|
||||
void rorx(const Reg32e& r, const Operand& op, uint8 imm) { opGpr(r, op, Reg32e(0, r.getBit()), T_0F3A | T_F2, 0xF0, false, imm); }
|
||||
void roundpd(const Xmm& xmm, const Operand& op, uint8 imm) { opGen(xmm, op, 0x09, 0x66, isXMM_XMMorMEM, imm, 0x3A); }
|
||||
void roundps(const Xmm& xmm, const Operand& op, uint8 imm) { opGen(xmm, op, 0x08, 0x66, isXMM_XMMorMEM, imm, 0x3A); }
|
||||
void roundsd(const Xmm& xmm, const Operand& op, int imm) { opGen(xmm, op, 0x0B, 0x66, isXMM_XMMorMEM, static_cast<uint8>(imm), 0x3A); }
|
||||
void roundss(const Xmm& xmm, const Operand& op, int imm) { opGen(xmm, op, 0x0A, 0x66, isXMM_XMMorMEM, static_cast<uint8>(imm), 0x3A); }
|
||||
void rorx(const Reg32e& r, const Operand& op, uint8_t imm) { opGpr(r, op, Reg32e(0, r.getBit()), T_0F3A | T_F2, 0xF0, false, imm); }
|
||||
void roundpd(const Xmm& xmm, const Operand& op, uint8_t imm) { opGen(xmm, op, 0x09, 0x66, isXMM_XMMorMEM, imm, 0x3A); }
|
||||
void roundps(const Xmm& xmm, const Operand& op, uint8_t imm) { opGen(xmm, op, 0x08, 0x66, isXMM_XMMorMEM, imm, 0x3A); }
|
||||
void roundsd(const Xmm& xmm, const Operand& op, int imm) { opGen(xmm, op, 0x0B, 0x66, isXMM_XMMorMEM, static_cast<uint8_t>(imm), 0x3A); }
|
||||
void roundss(const Xmm& xmm, const Operand& op, int imm) { opGen(xmm, op, 0x0A, 0x66, isXMM_XMMorMEM, static_cast<uint8_t>(imm), 0x3A); }
|
||||
void rsqrtps(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x52, 0x100, isXMM_XMMorMEM); }
|
||||
void rsqrtss(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x52, 0xF3, isXMM_XMMorMEM); }
|
||||
void sahf() { db(0x9E); }
|
||||
|
@ -734,7 +734,7 @@ void sal(const Operand& op, int imm) { opShift(op, imm, 4); }
|
|||
void sar(const Operand& op, const Reg8& _cl) { opShift(op, _cl, 7); }
|
||||
void sar(const Operand& op, int imm) { opShift(op, imm, 7); }
|
||||
void sarx(const Reg32e& r1, const Operand& op, const Reg32e& r2) { opGpr(r1, op, r2, T_F3 | T_0F38, 0xf7, false); }
|
||||
void sbb(const Operand& op, uint32 imm) { opRM_I(op, imm, 0x18, 3); }
|
||||
void sbb(const Operand& op, uint32_t imm) { opRM_I(op, imm, 0x18, 3); }
|
||||
void sbb(const Operand& op1, const Operand& op2) { opRM_RM(op1, op2, 0x18); }
|
||||
void scasb() { db(0xAE); }
|
||||
void scasd() { db(0xAF); }
|
||||
|
@ -773,22 +773,22 @@ void sfence() { db(0x0F); db(0xAE); db(0xF8); }
|
|||
void sha1msg1(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0xC9, NONE, isXMM_XMMorMEM, NONE, 0x38); }
|
||||
void sha1msg2(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0xCA, NONE, isXMM_XMMorMEM, NONE, 0x38); }
|
||||
void sha1nexte(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0xC8, NONE, isXMM_XMMorMEM, NONE, 0x38); }
|
||||
void sha1rnds4(const Xmm& xmm, const Operand& op, uint8 imm) { opGen(xmm, op, 0xCC, NONE, isXMM_XMMorMEM, imm, 0x3A); }
|
||||
void sha1rnds4(const Xmm& xmm, const Operand& op, uint8_t imm) { opGen(xmm, op, 0xCC, NONE, isXMM_XMMorMEM, imm, 0x3A); }
|
||||
void sha256msg1(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0xCC, NONE, isXMM_XMMorMEM, NONE, 0x38); }
|
||||
void sha256msg2(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0xCD, NONE, isXMM_XMMorMEM, NONE, 0x38); }
|
||||
void sha256rnds2(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0xCB, NONE, isXMM_XMMorMEM, NONE, 0x38); }
|
||||
void shl(const Operand& op, const Reg8& _cl) { opShift(op, _cl, 4); }
|
||||
void shl(const Operand& op, int imm) { opShift(op, imm, 4); }
|
||||
void shld(const Operand& op, const Reg& reg, const Reg8& _cl) { opShxd(op, reg, 0, 0xA4, &_cl); }
|
||||
void shld(const Operand& op, const Reg& reg, uint8 imm) { opShxd(op, reg, imm, 0xA4); }
|
||||
void shld(const Operand& op, const Reg& reg, uint8_t imm) { opShxd(op, reg, imm, 0xA4); }
|
||||
void shlx(const Reg32e& r1, const Operand& op, const Reg32e& r2) { opGpr(r1, op, r2, T_66 | T_0F38, 0xf7, false); }
|
||||
void shr(const Operand& op, const Reg8& _cl) { opShift(op, _cl, 5); }
|
||||
void shr(const Operand& op, int imm) { opShift(op, imm, 5); }
|
||||
void shrd(const Operand& op, const Reg& reg, const Reg8& _cl) { opShxd(op, reg, 0, 0xAC, &_cl); }
|
||||
void shrd(const Operand& op, const Reg& reg, uint8 imm) { opShxd(op, reg, imm, 0xAC); }
|
||||
void shrd(const Operand& op, const Reg& reg, uint8_t imm) { opShxd(op, reg, imm, 0xAC); }
|
||||
void shrx(const Reg32e& r1, const Operand& op, const Reg32e& r2) { opGpr(r1, op, r2, T_F2 | T_0F38, 0xf7, false); }
|
||||
void shufpd(const Xmm& xmm, const Operand& op, uint8 imm8) { opGen(xmm, op, 0xC6, 0x66, isXMM_XMMorMEM, imm8); }
|
||||
void shufps(const Xmm& xmm, const Operand& op, uint8 imm8) { opGen(xmm, op, 0xC6, 0x100, isXMM_XMMorMEM, imm8); }
|
||||
void shufpd(const Xmm& xmm, const Operand& op, uint8_t imm8) { opGen(xmm, op, 0xC6, 0x66, isXMM_XMMorMEM, imm8); }
|
||||
void shufps(const Xmm& xmm, const Operand& op, uint8_t imm8) { opGen(xmm, op, 0xC6, 0x100, isXMM_XMMorMEM, imm8); }
|
||||
void sqrtpd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x51, 0x66, isXMM_XMMorMEM); }
|
||||
void sqrtps(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x51, 0x100, isXMM_XMMorMEM); }
|
||||
void sqrtsd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x51, 0xF2, isXMM_XMMorMEM); }
|
||||
|
@ -801,7 +801,7 @@ void stmxcsr(const Address& addr) { opModM(addr, Reg32(3), 0x0F, 0xAE); }
|
|||
void stosb() { db(0xAA); }
|
||||
void stosd() { db(0xAB); }
|
||||
void stosw() { db(0x66); db(0xAB); }
|
||||
void sub(const Operand& op, uint32 imm) { opRM_I(op, imm, 0x28, 5); }
|
||||
void sub(const Operand& op, uint32_t imm) { opRM_I(op, imm, 0x28, 5); }
|
||||
void sub(const Operand& op1, const Operand& op2) { opRM_RM(op1, op2, 0x28); }
|
||||
void subpd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x5C, 0x66, isXMM_XMMorMEM); }
|
||||
void subps(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x5C, 0x100, isXMM_XMMorMEM); }
|
||||
|
@ -828,13 +828,13 @@ void vaesdeclast(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operan
|
|||
void vaesenc(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, T_66 | T_0F38 | T_YMM | T_EVEX, 0xDC); }
|
||||
void vaesenclast(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, T_66 | T_0F38 | T_YMM | T_EVEX, 0xDD); }
|
||||
void vaesimc(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, T_66 | T_0F38 | T_W0, 0xDB); }
|
||||
void vaeskeygenassist(const Xmm& xm, const Operand& op, uint8 imm) { opAVX_X_XM_IMM(xm, op, T_66 | T_0F3A, 0xDF, imm); }
|
||||
void vaeskeygenassist(const Xmm& xm, const Operand& op, uint8_t imm) { opAVX_X_XM_IMM(xm, op, T_66 | T_0F3A, 0xDF, imm); }
|
||||
void vandnpd(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, T_0F | T_66 | T_EW1 | T_YMM | T_EVEX | T_ER_Z | T_B64, 0x55); }
|
||||
void vandnps(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, T_0F | T_EW0 | T_YMM | T_EVEX | T_ER_Z | T_B32, 0x55); }
|
||||
void vandpd(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, T_0F | T_66 | T_EW1 | T_YMM | T_EVEX | T_ER_Z | T_B64, 0x54); }
|
||||
void vandps(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, T_0F | T_EW0 | T_YMM | T_EVEX | T_ER_Z | T_B32, 0x54); }
|
||||
void vblendpd(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F3A | T_W0 | T_YMM, 0x0D, imm); }
|
||||
void vblendps(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F3A | T_W0 | T_YMM, 0x0C, imm); }
|
||||
void vblendpd(const Xmm& x1, const Xmm& x2, const Operand& op, uint8_t imm) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F3A | T_W0 | T_YMM, 0x0D, imm); }
|
||||
void vblendps(const Xmm& x1, const Xmm& x2, const Operand& op, uint8_t imm) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F3A | T_W0 | T_YMM, 0x0C, imm); }
|
||||
void vblendvpd(const Xmm& x1, const Xmm& x2, const Operand& op, const Xmm& x4) { opAVX_X_X_XM(x1, x2, op, T_0F3A | T_66 | T_YMM, 0x4B, x4.getIdx() << 4); }
|
||||
void vblendvps(const Xmm& x1, const Xmm& x2, const Operand& op, const Xmm& x4) { opAVX_X_X_XM(x1, x2, op, T_0F3A | T_66 | T_YMM, 0x4A, x4.getIdx() << 4); }
|
||||
void vbroadcastf128(const Ymm& y, const Address& addr) { opAVX_X_XM_IMM(y, addr, T_0F38 | T_66 | T_W0 | T_YMM, 0x1A); }
|
||||
|
@ -953,10 +953,10 @@ void vcmpordpd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmppd(x1, x2,
|
|||
void vcmpordps(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpps(x1, x2, op, 7); }
|
||||
void vcmpordsd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpsd(x1, x2, op, 7); }
|
||||
void vcmpordss(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpss(x1, x2, op, 7); }
|
||||
void vcmppd(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F | T_YMM, 0xC2, imm); }
|
||||
void vcmpps(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, T_0F | T_YMM, 0xC2, imm); }
|
||||
void vcmpsd(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, T_F2 | T_0F, 0xC2, imm); }
|
||||
void vcmpss(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, T_F3 | T_0F, 0xC2, imm); }
|
||||
void vcmppd(const Xmm& x1, const Xmm& x2, const Operand& op, uint8_t imm) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F | T_YMM, 0xC2, imm); }
|
||||
void vcmpps(const Xmm& x1, const Xmm& x2, const Operand& op, uint8_t imm) { opAVX_X_X_XM(x1, x2, op, T_0F | T_YMM, 0xC2, imm); }
|
||||
void vcmpsd(const Xmm& x1, const Xmm& x2, const Operand& op, uint8_t imm) { opAVX_X_X_XM(x1, x2, op, T_F2 | T_0F, 0xC2, imm); }
|
||||
void vcmpss(const Xmm& x1, const Xmm& x2, const Operand& op, uint8_t imm) { opAVX_X_X_XM(x1, x2, op, T_F3 | T_0F, 0xC2, imm); }
|
||||
void vcmptrue_uspd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmppd(x1, x2, op, 31); }
|
||||
void vcmptrue_usps(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpps(x1, x2, op, 31); }
|
||||
void vcmptrue_ussd(const Xmm& x1, const Xmm& x2, const Operand& op) { vcmpsd(x1, x2, op, 31); }
|
||||
|
@ -982,7 +982,7 @@ void vcvtpd2ps(const Xmm& x, const Operand& op) { opCvt2(x, op, T_0F | T_66 | T_
|
|||
void vcvtph2ps(const Xmm& x, const Operand& op) { checkCvt1(x, op); opVex(x, 0, op, T_0F38 | T_66 | T_W0 | T_EVEX | T_EW0 | T_N8 | T_N_VL | T_SAE_Y, 0x13); }
|
||||
void vcvtps2dq(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, T_66 | T_0F | T_EW0 | T_YMM | T_EVEX | T_ER_Z | T_B32, 0x5B); }
|
||||
void vcvtps2pd(const Xmm& x, const Operand& op) { checkCvt1(x, op); opVex(x, 0, op, T_0F | T_YMM | T_EVEX | T_EW0 | T_B32 | T_N8 | T_N_VL | T_SAE_Y, 0x5A); }
|
||||
void vcvtps2ph(const Operand& op, const Xmm& x, uint8 imm) { checkCvt1(x, op); opVex(x, 0, op, T_0F3A | T_66 | T_W0 | T_EVEX | T_EW0 | T_N8 | T_N_VL | T_SAE_Y, 0x1D, imm); }
|
||||
void vcvtps2ph(const Operand& op, const Xmm& x, uint8_t imm) { checkCvt1(x, op); opVex(x, 0, op, T_0F3A | T_66 | T_W0 | T_EVEX | T_EW0 | T_N8 | T_N_VL | T_SAE_Y, 0x1D, imm); }
|
||||
void vcvtsd2si(const Reg32& r, const Operand& op) { opAVX_X_X_XM(Xmm(r.getIdx()), xm0, op, T_0F | T_F2 | T_W0 | T_EVEX | T_EW0 | T_N4 | T_ER_X, 0x2D); }
|
||||
void vcvtsd2ss(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_N8 | T_F2 | T_0F | T_EW1 | T_EVEX | T_ER_X, 0x5A); }
|
||||
void vcvtsi2sd(const Xmm& x1, const Xmm& x2, const Operand& op) { opCvt3(x1, x2, op, T_0F | T_F2 | T_EVEX, T_W1 | T_EW1 | T_ER_X | T_N8, T_W0 | T_EW0 | T_N4, 0x2A); }
|
||||
|
@ -997,11 +997,11 @@ void vdivpd(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand())
|
|||
void vdivps(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, T_0F | T_EW0 | T_YMM | T_EVEX | T_ER_Z | T_B32, 0x5E); }
|
||||
void vdivsd(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, T_0F | T_F2 | T_EW1 | T_EVEX | T_ER_Z | T_N8, 0x5E); }
|
||||
void vdivss(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, T_0F | T_F3 | T_EW0 | T_EVEX | T_ER_Z | T_N4, 0x5E); }
|
||||
void vdppd(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F3A | T_W0, 0x41, imm); }
|
||||
void vdpps(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F3A | T_W0 | T_YMM, 0x40, imm); }
|
||||
void vextractf128(const Operand& op, const Ymm& y, uint8 imm) { if (!(op.isXMEM() && y.isYMM())) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(y, 0, op, T_0F3A | T_66 | T_W0 | T_YMM, 0x19, imm); }
|
||||
void vextracti128(const Operand& op, const Ymm& y, uint8 imm) { if (!(op.isXMEM() && y.isYMM())) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(y, 0, op, T_0F3A | T_66 | T_W0 | T_YMM, 0x39, imm); }
|
||||
void vextractps(const Operand& op, const Xmm& x, uint8 imm) { if (!((op.isREG(32) || op.isMEM()) && x.isXMM())) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(x, 0, op, T_0F3A | T_66 | T_W0 | T_EVEX | T_N4, 0x17, imm); }
|
||||
void vdppd(const Xmm& x1, const Xmm& x2, const Operand& op, uint8_t imm) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F3A | T_W0, 0x41, imm); }
|
||||
void vdpps(const Xmm& x1, const Xmm& x2, const Operand& op, uint8_t imm) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F3A | T_W0 | T_YMM, 0x40, imm); }
|
||||
void vextractf128(const Operand& op, const Ymm& y, uint8_t imm) { if (!(op.isXMEM() && y.isYMM())) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(y, 0, op, T_0F3A | T_66 | T_W0 | T_YMM, 0x19, imm); }
|
||||
void vextracti128(const Operand& op, const Ymm& y, uint8_t imm) { if (!(op.isXMEM() && y.isYMM())) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(y, 0, op, T_0F3A | T_66 | T_W0 | T_YMM, 0x39, imm); }
|
||||
void vextractps(const Operand& op, const Xmm& x, uint8_t imm) { if (!((op.isREG(32) || op.isMEM()) && x.isXMM())) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(x, 0, op, T_0F3A | T_66 | T_W0 | T_EVEX | T_N4, 0x17, imm); }
|
||||
void vfmadd132pd(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F38 | T_W1 | T_EW1 | T_YMM | T_EVEX | T_B64, 0x98); }
|
||||
void vfmadd132ps(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F38 | T_W0 | T_EW0 | T_YMM | T_EVEX | T_B32, 0x98); }
|
||||
void vfmadd132sd(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_N8 | T_66 | T_0F38 | T_W1 | T_EW1 | T_EVEX | T_ER_X, 0x99); }
|
||||
|
@ -1066,16 +1066,16 @@ void vgatherdpd(const Xmm& x1, const Address& addr, const Xmm& x2) { opGather(x1
|
|||
void vgatherdps(const Xmm& x1, const Address& addr, const Xmm& x2) { opGather(x1, addr, x2, T_0F38 | T_66 | T_YMM | T_VSIB | T_W0, 0x92, 1); }
|
||||
void vgatherqpd(const Xmm& x1, const Address& addr, const Xmm& x2) { opGather(x1, addr, x2, T_0F38 | T_66 | T_YMM | T_VSIB | T_W1, 0x93, 1); }
|
||||
void vgatherqps(const Xmm& x1, const Address& addr, const Xmm& x2) { opGather(x1, addr, x2, T_0F38 | T_66 | T_YMM | T_VSIB | T_W0, 0x93, 2); }
|
||||
void vgf2p8affineinvqb(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F3A | T_W1 | T_EW1 | T_YMM | T_EVEX | T_SAE_Z | T_B64, 0xCF, imm); }
|
||||
void vgf2p8affineqb(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F3A | T_W1 | T_EW1 | T_YMM | T_EVEX | T_SAE_Z | T_B64, 0xCE, imm); }
|
||||
void vgf2p8affineinvqb(const Xmm& x1, const Xmm& x2, const Operand& op, uint8_t imm) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F3A | T_W1 | T_EW1 | T_YMM | T_EVEX | T_SAE_Z | T_B64, 0xCF, imm); }
|
||||
void vgf2p8affineqb(const Xmm& x1, const Xmm& x2, const Operand& op, uint8_t imm) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F3A | T_W1 | T_EW1 | T_YMM | T_EVEX | T_SAE_Z | T_B64, 0xCE, imm); }
|
||||
void vgf2p8mulb(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F38 | T_W0 | T_EW0 | T_YMM | T_EVEX | T_SAE_Z, 0xCF); }
|
||||
void vhaddpd(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, T_66 | T_0F | T_YMM, 0x7C); }
|
||||
void vhaddps(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, T_F2 | T_0F | T_YMM, 0x7C); }
|
||||
void vhsubpd(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, T_66 | T_0F | T_YMM, 0x7D); }
|
||||
void vhsubps(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, T_F2 | T_0F | T_YMM, 0x7D); }
|
||||
void vinsertf128(const Ymm& y1, const Ymm& y2, const Operand& op, uint8 imm) { if (!(y1.isYMM() && y2.isYMM() && op.isXMEM())) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(y1, &y2, op, T_0F3A | T_66 | T_W0 | T_YMM, 0x18, imm); }
|
||||
void vinserti128(const Ymm& y1, const Ymm& y2, const Operand& op, uint8 imm) { if (!(y1.isYMM() && y2.isYMM() && op.isXMEM())) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(y1, &y2, op, T_0F3A | T_66 | T_W0 | T_YMM, 0x38, imm); }
|
||||
void vinsertps(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, T_N4 | T_66 | T_0F3A | T_W0 | T_EW0 | T_EVEX, 0x21, imm); }
|
||||
void vinsertf128(const Ymm& y1, const Ymm& y2, const Operand& op, uint8_t imm) { if (!(y1.isYMM() && y2.isYMM() && op.isXMEM())) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(y1, &y2, op, T_0F3A | T_66 | T_W0 | T_YMM, 0x18, imm); }
|
||||
void vinserti128(const Ymm& y1, const Ymm& y2, const Operand& op, uint8_t imm) { if (!(y1.isYMM() && y2.isYMM() && op.isXMEM())) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(y1, &y2, op, T_0F3A | T_66 | T_W0 | T_YMM, 0x38, imm); }
|
||||
void vinsertps(const Xmm& x1, const Xmm& x2, const Operand& op, uint8_t imm) { opAVX_X_X_XM(x1, x2, op, T_N4 | T_66 | T_0F3A | T_W0 | T_EW0 | T_EVEX, 0x21, imm); }
|
||||
void vlddqu(const Xmm& x, const Address& addr) { opAVX_X_X_XM(x, cvtIdx0(x), addr, T_0F | T_F2 | T_W0 | T_YMM, 0xF0); }
|
||||
void vldmxcsr(const Address& addr) { opAVX_X_X_XM(xm2, xm0, addr, T_0F, 0xAE); }
|
||||
void vmaskmovdqu(const Xmm& x1, const Xmm& x2) { opAVX_X_X_XM(x1, xm0, x2, T_0F | T_66, 0xF7); }
|
||||
|
@ -1133,7 +1133,7 @@ void vmovupd(const Address& addr, const Xmm& xmm) { opAVX_X_XM_IMM(xmm, addr, T_
|
|||
void vmovupd(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, T_66 | T_0F | T_EW1 | T_YMM | T_EVEX, 0x10); }
|
||||
void vmovups(const Address& addr, const Xmm& xmm) { opAVX_X_XM_IMM(xmm, addr, T_0F | T_EW0 | T_YMM | T_EVEX | T_M_K, 0x11); }
|
||||
void vmovups(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, T_0F | T_EW0 | T_YMM | T_EVEX, 0x10); }
|
||||
void vmpsadbw(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F3A | T_W0 | T_YMM, 0x42, imm); }
|
||||
void vmpsadbw(const Xmm& x1, const Xmm& x2, const Operand& op, uint8_t imm) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F3A | T_W0 | T_YMM, 0x42, imm); }
|
||||
void vmulpd(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, T_0F | T_66 | T_EW1 | T_YMM | T_EVEX | T_ER_Z | T_B64, 0x59); }
|
||||
void vmulps(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, T_0F | T_EW0 | T_YMM | T_EVEX | T_ER_Z | T_B32, 0x59); }
|
||||
void vmulsd(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, T_0F | T_F2 | T_EW1 | T_EVEX | T_ER_Z | T_N8, 0x59); }
|
||||
|
@ -1155,47 +1155,47 @@ void vpaddsw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1,
|
|||
void vpaddusb(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F | T_YMM | T_EVEX, 0xDC); }
|
||||
void vpaddusw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F | T_YMM | T_EVEX, 0xDD); }
|
||||
void vpaddw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F | T_YMM | T_EVEX, 0xFD); }
|
||||
void vpalignr(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F3A | T_YMM | T_EVEX, 0x0F, imm); }
|
||||
void vpalignr(const Xmm& x1, const Xmm& x2, const Operand& op, uint8_t imm) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F3A | T_YMM | T_EVEX, 0x0F, imm); }
|
||||
void vpand(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F | T_YMM, 0xDB); }
|
||||
void vpandn(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F | T_YMM, 0xDF); }
|
||||
void vpavgb(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F | T_YMM | T_EVEX, 0xE0); }
|
||||
void vpavgw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F | T_YMM | T_EVEX, 0xE3); }
|
||||
void vpblendd(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F3A | T_W0 | T_YMM, 0x02, imm); }
|
||||
void vpblendd(const Xmm& x1, const Xmm& x2, const Operand& op, uint8_t imm) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F3A | T_W0 | T_YMM, 0x02, imm); }
|
||||
void vpblendvb(const Xmm& x1, const Xmm& x2, const Operand& op, const Xmm& x4) { opAVX_X_X_XM(x1, x2, op, T_0F3A | T_66 | T_YMM, 0x4C, x4.getIdx() << 4); }
|
||||
void vpblendw(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F3A | T_W0 | T_YMM, 0x0E, imm); }
|
||||
void vpblendw(const Xmm& x1, const Xmm& x2, const Operand& op, uint8_t imm) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F3A | T_W0 | T_YMM, 0x0E, imm); }
|
||||
void vpbroadcastb(const Xmm& x, const Operand& op) { if (!(op.isXMM() || op.isMEM())) XBYAK_THROW(ERR_BAD_COMBINATION) opAVX_X_XM_IMM(x, op, T_N1 | T_66 | T_0F38 | T_W0 | T_YMM | T_EVEX, 0x78); }
|
||||
void vpbroadcastd(const Xmm& x, const Operand& op) { if (!(op.isXMM() || op.isMEM())) XBYAK_THROW(ERR_BAD_COMBINATION) opAVX_X_XM_IMM(x, op, T_N4 | T_66 | T_0F38 | T_W0 | T_YMM | T_EVEX, 0x58); }
|
||||
void vpbroadcastq(const Xmm& x, const Operand& op) { if (!(op.isXMM() || op.isMEM())) XBYAK_THROW(ERR_BAD_COMBINATION) opAVX_X_XM_IMM(x, op, T_N8 | T_66 | T_0F38 | T_W0 | T_EW1 | T_YMM | T_EVEX, 0x59); }
|
||||
void vpbroadcastw(const Xmm& x, const Operand& op) { if (!(op.isXMM() || op.isMEM())) XBYAK_THROW(ERR_BAD_COMBINATION) opAVX_X_XM_IMM(x, op, T_N2 | T_66 | T_0F38 | T_W0 | T_YMM | T_EVEX, 0x79); }
|
||||
void vpclmulqdq(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F3A | T_W0 | T_YMM | T_EVEX, 0x44, imm); }
|
||||
void vpclmulqdq(const Xmm& x1, const Xmm& x2, const Operand& op, uint8_t imm) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F3A | T_W0 | T_YMM | T_EVEX, 0x44, imm); }
|
||||
void vpcmpeqb(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F | T_YMM, 0x74); }
|
||||
void vpcmpeqd(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F | T_YMM, 0x76); }
|
||||
void vpcmpeqq(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F38 | T_YMM, 0x29); }
|
||||
void vpcmpeqw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F | T_YMM, 0x75); }
|
||||
void vpcmpestri(const Xmm& xm, const Operand& op, uint8 imm) { opAVX_X_XM_IMM(xm, op, T_66 | T_0F3A, 0x61, imm); }
|
||||
void vpcmpestrm(const Xmm& xm, const Operand& op, uint8 imm) { opAVX_X_XM_IMM(xm, op, T_66 | T_0F3A, 0x60, imm); }
|
||||
void vpcmpestri(const Xmm& xm, const Operand& op, uint8_t imm) { opAVX_X_XM_IMM(xm, op, T_66 | T_0F3A, 0x61, imm); }
|
||||
void vpcmpestrm(const Xmm& xm, const Operand& op, uint8_t imm) { opAVX_X_XM_IMM(xm, op, T_66 | T_0F3A, 0x60, imm); }
|
||||
void vpcmpgtb(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F | T_YMM, 0x64); }
|
||||
void vpcmpgtd(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F | T_YMM, 0x66); }
|
||||
void vpcmpgtq(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F38 | T_YMM, 0x37); }
|
||||
void vpcmpgtw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F | T_YMM, 0x65); }
|
||||
void vpcmpistri(const Xmm& xm, const Operand& op, uint8 imm) { opAVX_X_XM_IMM(xm, op, T_66 | T_0F3A, 0x63, imm); }
|
||||
void vpcmpistrm(const Xmm& xm, const Operand& op, uint8 imm) { opAVX_X_XM_IMM(xm, op, T_66 | T_0F3A, 0x62, imm); }
|
||||
void vperm2f128(const Ymm& y1, const Ymm& y2, const Operand& op, uint8 imm) { if (!(y1.isYMM() && y2.isYMM() && op.isYMEM())) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(y1, &y2, op, T_0F3A | T_66 | T_W0 | T_YMM, 0x06, imm); }
|
||||
void vperm2i128(const Ymm& y1, const Ymm& y2, const Operand& op, uint8 imm) { if (!(y1.isYMM() && y2.isYMM() && op.isYMEM())) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(y1, &y2, op, T_0F3A | T_66 | T_W0 | T_YMM, 0x46, imm); }
|
||||
void vpcmpistri(const Xmm& xm, const Operand& op, uint8_t imm) { opAVX_X_XM_IMM(xm, op, T_66 | T_0F3A, 0x63, imm); }
|
||||
void vpcmpistrm(const Xmm& xm, const Operand& op, uint8_t imm) { opAVX_X_XM_IMM(xm, op, T_66 | T_0F3A, 0x62, imm); }
|
||||
void vperm2f128(const Ymm& y1, const Ymm& y2, const Operand& op, uint8_t imm) { if (!(y1.isYMM() && y2.isYMM() && op.isYMEM())) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(y1, &y2, op, T_0F3A | T_66 | T_W0 | T_YMM, 0x06, imm); }
|
||||
void vperm2i128(const Ymm& y1, const Ymm& y2, const Operand& op, uint8_t imm) { if (!(y1.isYMM() && y2.isYMM() && op.isYMEM())) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(y1, &y2, op, T_0F3A | T_66 | T_W0 | T_YMM, 0x46, imm); }
|
||||
void vpermd(const Ymm& y1, const Ymm& y2, const Operand& op) { opAVX_X_X_XM(y1, y2, op, T_66 | T_0F38 | T_W0 | T_EW0 | T_YMM | T_EVEX | T_B32, 0x36); }
|
||||
void vpermilpd(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F38 | T_W0 | T_EW1 | T_YMM | T_EVEX | T_B64, 0x0D); }
|
||||
void vpermilpd(const Xmm& xm, const Operand& op, uint8 imm) { opAVX_X_XM_IMM(xm, op, T_66 | T_0F3A | T_EW1 | T_YMM | T_EVEX | T_B64, 0x05, imm); }
|
||||
void vpermilpd(const Xmm& xm, const Operand& op, uint8_t imm) { opAVX_X_XM_IMM(xm, op, T_66 | T_0F3A | T_EW1 | T_YMM | T_EVEX | T_B64, 0x05, imm); }
|
||||
void vpermilps(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F38 | T_W0 | T_EW0 | T_YMM | T_EVEX | T_B32, 0x0C); }
|
||||
void vpermilps(const Xmm& xm, const Operand& op, uint8 imm) { opAVX_X_XM_IMM(xm, op, T_66 | T_0F3A | T_EW0 | T_YMM | T_EVEX | T_B32, 0x04, imm); }
|
||||
void vpermpd(const Ymm& y, const Operand& op, uint8 imm) { opAVX_X_XM_IMM(y, op, T_66 | T_0F3A | T_W1 | T_EW1 | T_YMM | T_EVEX | T_B64, 0x01, imm); }
|
||||
void vpermilps(const Xmm& xm, const Operand& op, uint8_t imm) { opAVX_X_XM_IMM(xm, op, T_66 | T_0F3A | T_EW0 | T_YMM | T_EVEX | T_B32, 0x04, imm); }
|
||||
void vpermpd(const Ymm& y, const Operand& op, uint8_t imm) { opAVX_X_XM_IMM(y, op, T_66 | T_0F3A | T_W1 | T_EW1 | T_YMM | T_EVEX | T_B64, 0x01, imm); }
|
||||
void vpermpd(const Ymm& y1, const Ymm& y2, const Operand& op) { opAVX_X_X_XM(y1, y2, op, T_66 | T_0F38 | T_EW1 | T_YMM | T_MUST_EVEX | T_B64, 0x16); }
|
||||
void vpermps(const Ymm& y1, const Ymm& y2, const Operand& op) { opAVX_X_X_XM(y1, y2, op, T_66 | T_0F38 | T_W0 | T_EW0 | T_YMM | T_EVEX | T_B32, 0x16); }
|
||||
void vpermq(const Ymm& y, const Operand& op, uint8 imm) { opAVX_X_XM_IMM(y, op, T_66 | T_0F3A | T_W1 | T_EW1 | T_YMM | T_EVEX | T_B64, 0x00, imm); }
|
||||
void vpermq(const Ymm& y, const Operand& op, uint8_t imm) { opAVX_X_XM_IMM(y, op, T_66 | T_0F3A | T_W1 | T_EW1 | T_YMM | T_EVEX | T_B64, 0x00, imm); }
|
||||
void vpermq(const Ymm& y1, const Ymm& y2, const Operand& op) { opAVX_X_X_XM(y1, y2, op, T_66 | T_0F38 | T_W0 | T_EW1 | T_YMM | T_EVEX | T_B64, 0x36); }
|
||||
void vpextrb(const Operand& op, const Xmm& x, uint8 imm) { if (!((op.isREG(8|16|i32e) || op.isMEM()) && x.isXMM())) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(x, 0, op, T_0F3A | T_66 | T_EVEX | T_N1, 0x14, imm); }
|
||||
void vpextrd(const Operand& op, const Xmm& x, uint8 imm) { if (!((op.isREG(32) || op.isMEM()) && x.isXMM())) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(x, 0, op, T_0F3A | T_66 | T_W0 | T_EVEX | T_EW0 | T_N4, 0x16, imm); }
|
||||
void vpextrq(const Operand& op, const Xmm& x, uint8 imm) { if (!((op.isREG(64) || op.isMEM()) && x.isXMM())) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(x, 0, op, T_0F3A | T_66 | T_W1 | T_EVEX | T_EW1 | T_N8, 0x16, imm); }
|
||||
void vpextrw(const Operand& op, const Xmm& x, uint8 imm) { if (!((op.isREG(16|i32e) || op.isMEM()) && x.isXMM())) XBYAK_THROW(ERR_BAD_COMBINATION) if (op.isREG() && x.getIdx() < 16) { opAVX_X_X_XM(Xmm(op.getIdx()), xm0, x, T_0F | T_66, 0xC5, imm); } else { opVex(x, 0, op, T_0F3A | T_66 | T_EVEX | T_N2, 0x15, imm); } }
|
||||
void vpextrb(const Operand& op, const Xmm& x, uint8_t imm) { if (!((op.isREG(8|16|i32e) || op.isMEM()) && x.isXMM())) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(x, 0, op, T_0F3A | T_66 | T_EVEX | T_N1, 0x14, imm); }
|
||||
void vpextrd(const Operand& op, const Xmm& x, uint8_t imm) { if (!((op.isREG(32) || op.isMEM()) && x.isXMM())) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(x, 0, op, T_0F3A | T_66 | T_W0 | T_EVEX | T_EW0 | T_N4, 0x16, imm); }
|
||||
void vpextrq(const Operand& op, const Xmm& x, uint8_t imm) { if (!((op.isREG(64) || op.isMEM()) && x.isXMM())) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(x, 0, op, T_0F3A | T_66 | T_W1 | T_EVEX | T_EW1 | T_N8, 0x16, imm); }
|
||||
void vpextrw(const Operand& op, const Xmm& x, uint8_t imm) { if (!((op.isREG(16|i32e) || op.isMEM()) && x.isXMM())) XBYAK_THROW(ERR_BAD_COMBINATION) if (op.isREG() && x.getIdx() < 16) { opAVX_X_X_XM(Xmm(op.getIdx()), xm0, x, T_0F | T_66, 0xC5, imm); } else { opVex(x, 0, op, T_0F3A | T_66 | T_EVEX | T_N2, 0x15, imm); } }
|
||||
void vpgatherdd(const Xmm& x1, const Address& addr, const Xmm& x2) { opGather(x1, addr, x2, T_0F38 | T_66 | T_YMM | T_VSIB | T_W0, 0x90, 1); }
|
||||
void vpgatherdq(const Xmm& x1, const Address& addr, const Xmm& x2) { opGather(x1, addr, x2, T_0F38 | T_66 | T_YMM | T_VSIB | T_W1, 0x90, 0); }
|
||||
void vpgatherqd(const Xmm& x1, const Address& addr, const Xmm& x2) { opGather(x1, addr, x2, T_0F38 | T_66 | T_YMM | T_VSIB | T_W0, 0x91, 2); }
|
||||
|
@ -1207,10 +1207,10 @@ void vphminposuw(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, T_66
|
|||
void vphsubd(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F38 | T_YMM, 0x06); }
|
||||
void vphsubsw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F38 | T_YMM, 0x07); }
|
||||
void vphsubw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F38 | T_YMM, 0x05); }
|
||||
void vpinsrb(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { if (!(x1.isXMM() && x2.isXMM() && (op.isREG(32) || op.isMEM()))) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(x1, &x2, op, T_0F3A | T_66 | T_EVEX | T_N1, 0x20, imm); }
|
||||
void vpinsrd(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { if (!(x1.isXMM() && x2.isXMM() && (op.isREG(32) || op.isMEM()))) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(x1, &x2, op, T_0F3A | T_66 | T_W0 | T_EVEX | T_EW0 | T_N4, 0x22, imm); }
|
||||
void vpinsrq(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { if (!(x1.isXMM() && x2.isXMM() && (op.isREG(64) || op.isMEM()))) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(x1, &x2, op, T_0F3A | T_66 | T_W1 | T_EVEX | T_EW1 | T_N8, 0x22, imm); }
|
||||
void vpinsrw(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { if (!(x1.isXMM() && x2.isXMM() && (op.isREG(32) || op.isMEM()))) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(x1, &x2, op, T_0F | T_66 | T_EVEX | T_N2, 0xC4, imm); }
|
||||
void vpinsrb(const Xmm& x1, const Xmm& x2, const Operand& op, uint8_t imm) { if (!(x1.isXMM() && x2.isXMM() && (op.isREG(32) || op.isMEM()))) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(x1, &x2, op, T_0F3A | T_66 | T_EVEX | T_N1, 0x20, imm); }
|
||||
void vpinsrd(const Xmm& x1, const Xmm& x2, const Operand& op, uint8_t imm) { if (!(x1.isXMM() && x2.isXMM() && (op.isREG(32) || op.isMEM()))) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(x1, &x2, op, T_0F3A | T_66 | T_W0 | T_EVEX | T_EW0 | T_N4, 0x22, imm); }
|
||||
void vpinsrq(const Xmm& x1, const Xmm& x2, const Operand& op, uint8_t imm) { if (!(x1.isXMM() && x2.isXMM() && (op.isREG(64) || op.isMEM()))) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(x1, &x2, op, T_0F3A | T_66 | T_W1 | T_EVEX | T_EW1 | T_N8, 0x22, imm); }
|
||||
void vpinsrw(const Xmm& x1, const Xmm& x2, const Operand& op, uint8_t imm) { if (!(x1.isXMM() && x2.isXMM() && (op.isREG(32) || op.isMEM()))) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(x1, &x2, op, T_0F | T_66 | T_EVEX | T_N2, 0xC4, imm); }
|
||||
void vpmaddubsw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F38 | T_YMM | T_EVEX, 0x04); }
|
||||
void vpmaddwd(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F | T_YMM | T_EVEX, 0xF5); }
|
||||
void vpmaskmovd(const Address& addr, const Xmm& x1, const Xmm& x2) { opAVX_X_X_XM(x2, x1, addr, T_0F38 | T_66 | T_W0 | T_YMM, 0x8E); }
|
||||
|
@ -1252,34 +1252,34 @@ void vpmuludq(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1
|
|||
void vpor(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F | T_YMM, 0xEB); }
|
||||
void vpsadbw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F | T_YMM | T_EVEX, 0xF6); }
|
||||
void vpshufb(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F38 | T_YMM | T_EVEX, 0x00); }
|
||||
void vpshufd(const Xmm& xm, const Operand& op, uint8 imm) { opAVX_X_XM_IMM(xm, op, T_66 | T_0F | T_EW0 | T_YMM | T_EVEX | T_B32, 0x70, imm); }
|
||||
void vpshufhw(const Xmm& xm, const Operand& op, uint8 imm) { opAVX_X_XM_IMM(xm, op, T_F3 | T_0F | T_YMM | T_EVEX, 0x70, imm); }
|
||||
void vpshuflw(const Xmm& xm, const Operand& op, uint8 imm) { opAVX_X_XM_IMM(xm, op, T_F2 | T_0F | T_YMM | T_EVEX, 0x70, imm); }
|
||||
void vpshufd(const Xmm& xm, const Operand& op, uint8_t imm) { opAVX_X_XM_IMM(xm, op, T_66 | T_0F | T_EW0 | T_YMM | T_EVEX | T_B32, 0x70, imm); }
|
||||
void vpshufhw(const Xmm& xm, const Operand& op, uint8_t imm) { opAVX_X_XM_IMM(xm, op, T_F3 | T_0F | T_YMM | T_EVEX, 0x70, imm); }
|
||||
void vpshuflw(const Xmm& xm, const Operand& op, uint8_t imm) { opAVX_X_XM_IMM(xm, op, T_F2 | T_0F | T_YMM | T_EVEX, 0x70, imm); }
|
||||
void vpsignb(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F38 | T_YMM, 0x08); }
|
||||
void vpsignd(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F38 | T_YMM, 0x0A); }
|
||||
void vpsignw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F38 | T_YMM, 0x09); }
|
||||
void vpslld(const Xmm& x, const Operand& op, uint8 imm) { opAVX_X_X_XM(Xmm(x.getKind(), 6), x, op, T_66 | T_0F | T_EW0 | T_YMM | T_EVEX | T_B32 | T_MEM_EVEX, 0x72, imm); }
|
||||
void vpslld(const Xmm& x, const Operand& op, uint8_t imm) { opAVX_X_X_XM(Xmm(x.getKind(), 6), x, op, T_66 | T_0F | T_EW0 | T_YMM | T_EVEX | T_B32 | T_MEM_EVEX, 0x72, imm); }
|
||||
void vpslld(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_N16 | T_66 | T_0F | T_EW0 | T_YMM | T_EVEX, 0xF2); }
|
||||
void vpslldq(const Xmm& x, const Operand& op, uint8 imm) { opAVX_X_X_XM(Xmm(x.getKind(), 7), x, op, T_66 | T_0F | T_YMM | T_EVEX | T_MEM_EVEX, 0x73, imm); }
|
||||
void vpsllq(const Xmm& x, const Operand& op, uint8 imm) { opAVX_X_X_XM(Xmm(x.getKind(), 6), x, op, T_66 | T_0F | T_EW1 | T_YMM | T_EVEX | T_B64 | T_MEM_EVEX, 0x73, imm); }
|
||||
void vpslldq(const Xmm& x, const Operand& op, uint8_t imm) { opAVX_X_X_XM(Xmm(x.getKind(), 7), x, op, T_66 | T_0F | T_YMM | T_EVEX | T_MEM_EVEX, 0x73, imm); }
|
||||
void vpsllq(const Xmm& x, const Operand& op, uint8_t imm) { opAVX_X_X_XM(Xmm(x.getKind(), 6), x, op, T_66 | T_0F | T_EW1 | T_YMM | T_EVEX | T_B64 | T_MEM_EVEX, 0x73, imm); }
|
||||
void vpsllq(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_N16 | T_66 | T_0F | T_EW1 | T_YMM | T_EVEX, 0xF3); }
|
||||
void vpsllvd(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F38 | T_W0 | T_EW0 | T_YMM | T_EVEX | T_B32, 0x47); }
|
||||
void vpsllvq(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F38 | T_W1 | T_EW1 | T_YMM | T_EVEX | T_B64, 0x47); }
|
||||
void vpsllw(const Xmm& x, const Operand& op, uint8 imm) { opAVX_X_X_XM(Xmm(x.getKind(), 6), x, op, T_66 | T_0F | T_YMM | T_EVEX | T_MEM_EVEX, 0x71, imm); }
|
||||
void vpsllw(const Xmm& x, const Operand& op, uint8_t imm) { opAVX_X_X_XM(Xmm(x.getKind(), 6), x, op, T_66 | T_0F | T_YMM | T_EVEX | T_MEM_EVEX, 0x71, imm); }
|
||||
void vpsllw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_N16 | T_66 | T_0F | T_YMM | T_EVEX, 0xF1); }
|
||||
void vpsrad(const Xmm& x, const Operand& op, uint8 imm) { opAVX_X_X_XM(Xmm(x.getKind(), 4), x, op, T_66 | T_0F | T_EW0 | T_YMM | T_EVEX | T_B32 | T_MEM_EVEX, 0x72, imm); }
|
||||
void vpsrad(const Xmm& x, const Operand& op, uint8_t imm) { opAVX_X_X_XM(Xmm(x.getKind(), 4), x, op, T_66 | T_0F | T_EW0 | T_YMM | T_EVEX | T_B32 | T_MEM_EVEX, 0x72, imm); }
|
||||
void vpsrad(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_N16 | T_66 | T_0F | T_EW0 | T_YMM | T_EVEX, 0xE2); }
|
||||
void vpsravd(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F38 | T_W0 | T_EW0 | T_YMM | T_EVEX | T_B32, 0x46); }
|
||||
void vpsraw(const Xmm& x, const Operand& op, uint8 imm) { opAVX_X_X_XM(Xmm(x.getKind(), 4), x, op, T_66 | T_0F | T_YMM | T_EVEX | T_MEM_EVEX, 0x71, imm); }
|
||||
void vpsraw(const Xmm& x, const Operand& op, uint8_t imm) { opAVX_X_X_XM(Xmm(x.getKind(), 4), x, op, T_66 | T_0F | T_YMM | T_EVEX | T_MEM_EVEX, 0x71, imm); }
|
||||
void vpsraw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_N16 | T_66 | T_0F | T_YMM | T_EVEX, 0xE1); }
|
||||
void vpsrld(const Xmm& x, const Operand& op, uint8 imm) { opAVX_X_X_XM(Xmm(x.getKind(), 2), x, op, T_66 | T_0F | T_EW0 | T_YMM | T_EVEX | T_B32 | T_MEM_EVEX, 0x72, imm); }
|
||||
void vpsrld(const Xmm& x, const Operand& op, uint8_t imm) { opAVX_X_X_XM(Xmm(x.getKind(), 2), x, op, T_66 | T_0F | T_EW0 | T_YMM | T_EVEX | T_B32 | T_MEM_EVEX, 0x72, imm); }
|
||||
void vpsrld(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_N16 | T_66 | T_0F | T_EW0 | T_YMM | T_EVEX, 0xD2); }
|
||||
void vpsrldq(const Xmm& x, const Operand& op, uint8 imm) { opAVX_X_X_XM(Xmm(x.getKind(), 3), x, op, T_66 | T_0F | T_YMM | T_EVEX | T_MEM_EVEX, 0x73, imm); }
|
||||
void vpsrlq(const Xmm& x, const Operand& op, uint8 imm) { opAVX_X_X_XM(Xmm(x.getKind(), 2), x, op, T_66 | T_0F | T_EW1 | T_YMM | T_EVEX | T_B64 | T_MEM_EVEX, 0x73, imm); }
|
||||
void vpsrldq(const Xmm& x, const Operand& op, uint8_t imm) { opAVX_X_X_XM(Xmm(x.getKind(), 3), x, op, T_66 | T_0F | T_YMM | T_EVEX | T_MEM_EVEX, 0x73, imm); }
|
||||
void vpsrlq(const Xmm& x, const Operand& op, uint8_t imm) { opAVX_X_X_XM(Xmm(x.getKind(), 2), x, op, T_66 | T_0F | T_EW1 | T_YMM | T_EVEX | T_B64 | T_MEM_EVEX, 0x73, imm); }
|
||||
void vpsrlq(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_N16 | T_66 | T_0F | T_EW1 | T_YMM | T_EVEX, 0xD3); }
|
||||
void vpsrlvd(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F38 | T_W0 | T_EW0 | T_YMM | T_EVEX | T_B32, 0x45); }
|
||||
void vpsrlvq(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F38 | T_W1 | T_EW1 | T_YMM | T_EVEX | T_B64, 0x45); }
|
||||
void vpsrlw(const Xmm& x, const Operand& op, uint8 imm) { opAVX_X_X_XM(Xmm(x.getKind(), 2), x, op, T_66 | T_0F | T_YMM | T_EVEX | T_MEM_EVEX, 0x71, imm); }
|
||||
void vpsrlw(const Xmm& x, const Operand& op, uint8_t imm) { opAVX_X_X_XM(Xmm(x.getKind(), 2), x, op, T_66 | T_0F | T_YMM | T_EVEX | T_MEM_EVEX, 0x71, imm); }
|
||||
void vpsrlw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_N16 | T_66 | T_0F | T_YMM | T_EVEX, 0xD1); }
|
||||
void vpsubb(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F | T_YMM | T_EVEX, 0xF8); }
|
||||
void vpsubd(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F | T_EW0 | T_YMM | T_EVEX | T_B32, 0xFA); }
|
||||
|
@ -1301,14 +1301,14 @@ void vpunpcklwd(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(
|
|||
void vpxor(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F | T_YMM, 0xEF); }
|
||||
void vrcpps(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, T_0F | T_YMM, 0x53); }
|
||||
void vrcpss(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_F3 | T_0F, 0x53); }
|
||||
void vroundpd(const Xmm& xm, const Operand& op, uint8 imm) { opAVX_X_XM_IMM(xm, op, T_66 | T_0F3A | T_YMM, 0x09, imm); }
|
||||
void vroundps(const Xmm& xm, const Operand& op, uint8 imm) { opAVX_X_XM_IMM(xm, op, T_66 | T_0F3A | T_YMM, 0x08, imm); }
|
||||
void vroundsd(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F3A | T_W0, 0x0B, imm); }
|
||||
void vroundss(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F3A | T_W0, 0x0A, imm); }
|
||||
void vroundpd(const Xmm& xm, const Operand& op, uint8_t imm) { opAVX_X_XM_IMM(xm, op, T_66 | T_0F3A | T_YMM, 0x09, imm); }
|
||||
void vroundps(const Xmm& xm, const Operand& op, uint8_t imm) { opAVX_X_XM_IMM(xm, op, T_66 | T_0F3A | T_YMM, 0x08, imm); }
|
||||
void vroundsd(const Xmm& x1, const Xmm& x2, const Operand& op, uint8_t imm) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F3A | T_W0, 0x0B, imm); }
|
||||
void vroundss(const Xmm& x1, const Xmm& x2, const Operand& op, uint8_t imm) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F3A | T_W0, 0x0A, imm); }
|
||||
void vrsqrtps(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, T_0F | T_YMM, 0x52); }
|
||||
void vrsqrtss(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_F3 | T_0F, 0x52); }
|
||||
void vshufpd(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F | T_EW1 | T_YMM | T_EVEX | T_B64, 0xC6, imm); }
|
||||
void vshufps(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, T_0F | T_EW0 | T_YMM | T_EVEX | T_B32, 0xC6, imm); }
|
||||
void vshufpd(const Xmm& x1, const Xmm& x2, const Operand& op, uint8_t imm) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F | T_EW1 | T_YMM | T_EVEX | T_B64, 0xC6, imm); }
|
||||
void vshufps(const Xmm& x1, const Xmm& x2, const Operand& op, uint8_t imm) { opAVX_X_X_XM(x1, x2, op, T_0F | T_EW0 | T_YMM | T_EVEX | T_B32, 0xC6, imm); }
|
||||
void vsqrtpd(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, T_66 | T_0F | T_EW1 | T_YMM | T_EVEX | T_ER_Z | T_B64, 0x51); }
|
||||
void vsqrtps(const Xmm& xm, const Operand& op) { opAVX_X_XM_IMM(xm, op, T_0F | T_EW0 | T_YMM | T_EVEX | T_ER_Z | T_B32, 0x51); }
|
||||
void vsqrtsd(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_N8 | T_F2 | T_0F | T_EW1 | T_EVEX | T_ER_X, 0x51); }
|
||||
|
@ -1336,13 +1336,13 @@ void wrmsr() { db(0x0F); db(0x30); }
|
|||
void xadd(const Operand& op, const Reg& reg) { opModRM(reg, op, (op.isREG() && reg.isREG() && op.getBit() == reg.getBit()), op.isMEM(), 0x0F, 0xC0 | (reg.isBit(8) ? 0 : 1)); }
|
||||
void xgetbv() { db(0x0F); db(0x01); db(0xD0); }
|
||||
void xlatb() { db(0xD7); }
|
||||
void xor_(const Operand& op, uint32 imm) { opRM_I(op, imm, 0x30, 6); }
|
||||
void xor_(const Operand& op, uint32_t imm) { opRM_I(op, imm, 0x30, 6); }
|
||||
void xor_(const Operand& op1, const Operand& op2) { opRM_RM(op1, op2, 0x30); }
|
||||
void xorpd(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x57, 0x66, isXMM_XMMorMEM); }
|
||||
void xorps(const Xmm& xmm, const Operand& op) { opGen(xmm, op, 0x57, 0x100, isXMM_XMMorMEM); }
|
||||
#ifdef XBYAK_ENABLE_OMITTED_OPERAND
|
||||
void vblendpd(const Xmm& x, const Operand& op, uint8 imm) { vblendpd(x, x, op, imm); }
|
||||
void vblendps(const Xmm& x, const Operand& op, uint8 imm) { vblendps(x, x, op, imm); }
|
||||
void vblendpd(const Xmm& x, const Operand& op, uint8_t imm) { vblendpd(x, x, op, imm); }
|
||||
void vblendps(const Xmm& x, const Operand& op, uint8_t imm) { vblendps(x, x, op, imm); }
|
||||
void vblendvpd(const Xmm& x1, const Operand& op, const Xmm& x4) { vblendvpd(x1, x1, op, x4); }
|
||||
void vblendvps(const Xmm& x1, const Operand& op, const Xmm& x4) { vblendvps(x1, x1, op, x4); }
|
||||
void vcmpeq_ospd(const Xmm& x, const Operand& op) { vcmpeq_ospd(x, x, op); }
|
||||
|
@ -1457,10 +1457,10 @@ void vcmpordpd(const Xmm& x, const Operand& op) { vcmpordpd(x, x, op); }
|
|||
void vcmpordps(const Xmm& x, const Operand& op) { vcmpordps(x, x, op); }
|
||||
void vcmpordsd(const Xmm& x, const Operand& op) { vcmpordsd(x, x, op); }
|
||||
void vcmpordss(const Xmm& x, const Operand& op) { vcmpordss(x, x, op); }
|
||||
void vcmppd(const Xmm& x, const Operand& op, uint8 imm) { vcmppd(x, x, op, imm); }
|
||||
void vcmpps(const Xmm& x, const Operand& op, uint8 imm) { vcmpps(x, x, op, imm); }
|
||||
void vcmpsd(const Xmm& x, const Operand& op, uint8 imm) { vcmpsd(x, x, op, imm); }
|
||||
void vcmpss(const Xmm& x, const Operand& op, uint8 imm) { vcmpss(x, x, op, imm); }
|
||||
void vcmppd(const Xmm& x, const Operand& op, uint8_t imm) { vcmppd(x, x, op, imm); }
|
||||
void vcmpps(const Xmm& x, const Operand& op, uint8_t imm) { vcmpps(x, x, op, imm); }
|
||||
void vcmpsd(const Xmm& x, const Operand& op, uint8_t imm) { vcmpsd(x, x, op, imm); }
|
||||
void vcmpss(const Xmm& x, const Operand& op, uint8_t imm) { vcmpss(x, x, op, imm); }
|
||||
void vcmptrue_uspd(const Xmm& x, const Operand& op) { vcmptrue_uspd(x, x, op); }
|
||||
void vcmptrue_usps(const Xmm& x, const Operand& op) { vcmptrue_usps(x, x, op); }
|
||||
void vcmptrue_ussd(const Xmm& x, const Operand& op) { vcmptrue_ussd(x, x, op); }
|
||||
|
@ -1481,10 +1481,10 @@ void vcvtsd2ss(const Xmm& x, const Operand& op) { vcvtsd2ss(x, x, op); }
|
|||
void vcvtsi2sd(const Xmm& x, const Operand& op) { vcvtsi2sd(x, x, op); }
|
||||
void vcvtsi2ss(const Xmm& x, const Operand& op) { vcvtsi2ss(x, x, op); }
|
||||
void vcvtss2sd(const Xmm& x, const Operand& op) { vcvtss2sd(x, x, op); }
|
||||
void vdppd(const Xmm& x, const Operand& op, uint8 imm) { vdppd(x, x, op, imm); }
|
||||
void vdpps(const Xmm& x, const Operand& op, uint8 imm) { vdpps(x, x, op, imm); }
|
||||
void vinsertps(const Xmm& x, const Operand& op, uint8 imm) { vinsertps(x, x, op, imm); }
|
||||
void vmpsadbw(const Xmm& x, const Operand& op, uint8 imm) { vmpsadbw(x, x, op, imm); }
|
||||
void vdppd(const Xmm& x, const Operand& op, uint8_t imm) { vdppd(x, x, op, imm); }
|
||||
void vdpps(const Xmm& x, const Operand& op, uint8_t imm) { vdpps(x, x, op, imm); }
|
||||
void vinsertps(const Xmm& x, const Operand& op, uint8_t imm) { vinsertps(x, x, op, imm); }
|
||||
void vmpsadbw(const Xmm& x, const Operand& op, uint8_t imm) { vmpsadbw(x, x, op, imm); }
|
||||
void vpackssdw(const Xmm& x, const Operand& op) { vpackssdw(x, x, op); }
|
||||
void vpacksswb(const Xmm& x, const Operand& op) { vpacksswb(x, x, op); }
|
||||
void vpackusdw(const Xmm& x, const Operand& op) { vpackusdw(x, x, op); }
|
||||
|
@ -1497,15 +1497,15 @@ void vpaddsw(const Xmm& x, const Operand& op) { vpaddsw(x, x, op); }
|
|||
void vpaddusb(const Xmm& x, const Operand& op) { vpaddusb(x, x, op); }
|
||||
void vpaddusw(const Xmm& x, const Operand& op) { vpaddusw(x, x, op); }
|
||||
void vpaddw(const Xmm& x, const Operand& op) { vpaddw(x, x, op); }
|
||||
void vpalignr(const Xmm& x, const Operand& op, uint8 imm) { vpalignr(x, x, op, imm); }
|
||||
void vpalignr(const Xmm& x, const Operand& op, uint8_t imm) { vpalignr(x, x, op, imm); }
|
||||
void vpand(const Xmm& x, const Operand& op) { vpand(x, x, op); }
|
||||
void vpandn(const Xmm& x, const Operand& op) { vpandn(x, x, op); }
|
||||
void vpavgb(const Xmm& x, const Operand& op) { vpavgb(x, x, op); }
|
||||
void vpavgw(const Xmm& x, const Operand& op) { vpavgw(x, x, op); }
|
||||
void vpblendd(const Xmm& x, const Operand& op, uint8 imm) { vpblendd(x, x, op, imm); }
|
||||
void vpblendd(const Xmm& x, const Operand& op, uint8_t imm) { vpblendd(x, x, op, imm); }
|
||||
void vpblendvb(const Xmm& x1, const Operand& op, const Xmm& x4) { vpblendvb(x1, x1, op, x4); }
|
||||
void vpblendw(const Xmm& x, const Operand& op, uint8 imm) { vpblendw(x, x, op, imm); }
|
||||
void vpclmulqdq(const Xmm& x, const Operand& op, uint8 imm) { vpclmulqdq(x, x, op, imm); }
|
||||
void vpblendw(const Xmm& x, const Operand& op, uint8_t imm) { vpblendw(x, x, op, imm); }
|
||||
void vpclmulqdq(const Xmm& x, const Operand& op, uint8_t imm) { vpclmulqdq(x, x, op, imm); }
|
||||
void vpcmpeqb(const Xmm& x, const Operand& op) { vpcmpeqb(x, x, op); }
|
||||
void vpcmpeqd(const Xmm& x, const Operand& op) { vpcmpeqd(x, x, op); }
|
||||
void vpcmpeqq(const Xmm& x, const Operand& op) { vpcmpeqq(x, x, op); }
|
||||
|
@ -1520,10 +1520,10 @@ void vphaddw(const Xmm& x, const Operand& op) { vphaddw(x, x, op); }
|
|||
void vphsubd(const Xmm& x, const Operand& op) { vphsubd(x, x, op); }
|
||||
void vphsubsw(const Xmm& x, const Operand& op) { vphsubsw(x, x, op); }
|
||||
void vphsubw(const Xmm& x, const Operand& op) { vphsubw(x, x, op); }
|
||||
void vpinsrb(const Xmm& x, const Operand& op, uint8 imm) { vpinsrb(x, x, op, imm); }
|
||||
void vpinsrd(const Xmm& x, const Operand& op, uint8 imm) { vpinsrd(x, x, op, imm); }
|
||||
void vpinsrq(const Xmm& x, const Operand& op, uint8 imm) { vpinsrq(x, x, op, imm); }
|
||||
void vpinsrw(const Xmm& x, const Operand& op, uint8 imm) { vpinsrw(x, x, op, imm); }
|
||||
void vpinsrb(const Xmm& x, const Operand& op, uint8_t imm) { vpinsrb(x, x, op, imm); }
|
||||
void vpinsrd(const Xmm& x, const Operand& op, uint8_t imm) { vpinsrd(x, x, op, imm); }
|
||||
void vpinsrq(const Xmm& x, const Operand& op, uint8_t imm) { vpinsrq(x, x, op, imm); }
|
||||
void vpinsrw(const Xmm& x, const Operand& op, uint8_t imm) { vpinsrw(x, x, op, imm); }
|
||||
void vpmaddubsw(const Xmm& x, const Operand& op) { vpmaddubsw(x, x, op); }
|
||||
void vpmaddwd(const Xmm& x, const Operand& op) { vpmaddwd(x, x, op); }
|
||||
void vpmaxsb(const Xmm& x, const Operand& op) { vpmaxsb(x, x, op); }
|
||||
|
@ -1551,23 +1551,23 @@ void vpsignb(const Xmm& x, const Operand& op) { vpsignb(x, x, op); }
|
|||
void vpsignd(const Xmm& x, const Operand& op) { vpsignd(x, x, op); }
|
||||
void vpsignw(const Xmm& x, const Operand& op) { vpsignw(x, x, op); }
|
||||
void vpslld(const Xmm& x, const Operand& op) { vpslld(x, x, op); }
|
||||
void vpslld(const Xmm& x, uint8 imm) { vpslld(x, x, imm); }
|
||||
void vpslldq(const Xmm& x, uint8 imm) { vpslldq(x, x, imm); }
|
||||
void vpslld(const Xmm& x, uint8_t imm) { vpslld(x, x, imm); }
|
||||
void vpslldq(const Xmm& x, uint8_t imm) { vpslldq(x, x, imm); }
|
||||
void vpsllq(const Xmm& x, const Operand& op) { vpsllq(x, x, op); }
|
||||
void vpsllq(const Xmm& x, uint8 imm) { vpsllq(x, x, imm); }
|
||||
void vpsllq(const Xmm& x, uint8_t imm) { vpsllq(x, x, imm); }
|
||||
void vpsllw(const Xmm& x, const Operand& op) { vpsllw(x, x, op); }
|
||||
void vpsllw(const Xmm& x, uint8 imm) { vpsllw(x, x, imm); }
|
||||
void vpsllw(const Xmm& x, uint8_t imm) { vpsllw(x, x, imm); }
|
||||
void vpsrad(const Xmm& x, const Operand& op) { vpsrad(x, x, op); }
|
||||
void vpsrad(const Xmm& x, uint8 imm) { vpsrad(x, x, imm); }
|
||||
void vpsrad(const Xmm& x, uint8_t imm) { vpsrad(x, x, imm); }
|
||||
void vpsraw(const Xmm& x, const Operand& op) { vpsraw(x, x, op); }
|
||||
void vpsraw(const Xmm& x, uint8 imm) { vpsraw(x, x, imm); }
|
||||
void vpsraw(const Xmm& x, uint8_t imm) { vpsraw(x, x, imm); }
|
||||
void vpsrld(const Xmm& x, const Operand& op) { vpsrld(x, x, op); }
|
||||
void vpsrld(const Xmm& x, uint8 imm) { vpsrld(x, x, imm); }
|
||||
void vpsrldq(const Xmm& x, uint8 imm) { vpsrldq(x, x, imm); }
|
||||
void vpsrld(const Xmm& x, uint8_t imm) { vpsrld(x, x, imm); }
|
||||
void vpsrldq(const Xmm& x, uint8_t imm) { vpsrldq(x, x, imm); }
|
||||
void vpsrlq(const Xmm& x, const Operand& op) { vpsrlq(x, x, op); }
|
||||
void vpsrlq(const Xmm& x, uint8 imm) { vpsrlq(x, x, imm); }
|
||||
void vpsrlq(const Xmm& x, uint8_t imm) { vpsrlq(x, x, imm); }
|
||||
void vpsrlw(const Xmm& x, const Operand& op) { vpsrlw(x, x, op); }
|
||||
void vpsrlw(const Xmm& x, uint8 imm) { vpsrlw(x, x, imm); }
|
||||
void vpsrlw(const Xmm& x, uint8_t imm) { vpsrlw(x, x, imm); }
|
||||
void vpsubb(const Xmm& x, const Operand& op) { vpsubb(x, x, op); }
|
||||
void vpsubd(const Xmm& x, const Operand& op) { vpsubd(x, x, op); }
|
||||
void vpsubq(const Xmm& x, const Operand& op) { vpsubq(x, x, op); }
|
||||
|
@ -1586,11 +1586,11 @@ void vpunpcklqdq(const Xmm& x, const Operand& op) { vpunpcklqdq(x, x, op); }
|
|||
void vpunpcklwd(const Xmm& x, const Operand& op) { vpunpcklwd(x, x, op); }
|
||||
void vpxor(const Xmm& x, const Operand& op) { vpxor(x, x, op); }
|
||||
void vrcpss(const Xmm& x, const Operand& op) { vrcpss(x, x, op); }
|
||||
void vroundsd(const Xmm& x, const Operand& op, uint8 imm) { vroundsd(x, x, op, imm); }
|
||||
void vroundss(const Xmm& x, const Operand& op, uint8 imm) { vroundss(x, x, op, imm); }
|
||||
void vroundsd(const Xmm& x, const Operand& op, uint8_t imm) { vroundsd(x, x, op, imm); }
|
||||
void vroundss(const Xmm& x, const Operand& op, uint8_t imm) { vroundss(x, x, op, imm); }
|
||||
void vrsqrtss(const Xmm& x, const Operand& op) { vrsqrtss(x, x, op); }
|
||||
void vshufpd(const Xmm& x, const Operand& op, uint8 imm) { vshufpd(x, x, op, imm); }
|
||||
void vshufps(const Xmm& x, const Operand& op, uint8 imm) { vshufps(x, x, op, imm); }
|
||||
void vshufpd(const Xmm& x, const Operand& op, uint8_t imm) { vshufpd(x, x, op, imm); }
|
||||
void vshufps(const Xmm& x, const Operand& op, uint8_t imm) { vshufps(x, x, op, imm); }
|
||||
void vsqrtsd(const Xmm& x, const Operand& op) { vsqrtsd(x, x, op); }
|
||||
void vsqrtss(const Xmm& x, const Operand& op) { vsqrtss(x, x, op); }
|
||||
void vunpckhpd(const Xmm& x, const Operand& op) { vunpckhpd(x, x, op); }
|
||||
|
@ -1619,8 +1619,8 @@ void fxrstor64(const Address& addr) { opModM(addr, Reg64(1), 0x0F, 0xAE); }
|
|||
void movq(const Reg64& reg, const Mmx& mmx) { if (mmx.isXMM()) db(0x66); opModR(mmx, reg, 0x0F, 0x7E); }
|
||||
void movq(const Mmx& mmx, const Reg64& reg) { if (mmx.isXMM()) db(0x66); opModR(mmx, reg, 0x0F, 0x6E); }
|
||||
void movsxd(const Reg64& reg, const Operand& op) { if (!op.isBit(32)) XBYAK_THROW(ERR_BAD_COMBINATION) opModRM(reg, op, op.isREG(), op.isMEM(), 0x63); }
|
||||
void pextrq(const Operand& op, const Xmm& xmm, uint8 imm) { if (!op.isREG(64) && !op.isMEM()) XBYAK_THROW(ERR_BAD_COMBINATION) opGen(Reg64(xmm.getIdx()), op, 0x16, 0x66, 0, imm, 0x3A); }
|
||||
void pinsrq(const Xmm& xmm, const Operand& op, uint8 imm) { if (!op.isREG(64) && !op.isMEM()) XBYAK_THROW(ERR_BAD_COMBINATION) opGen(Reg64(xmm.getIdx()), op, 0x22, 0x66, 0, imm, 0x3A); }
|
||||
void pextrq(const Operand& op, const Xmm& xmm, uint8_t imm) { if (!op.isREG(64) && !op.isMEM()) XBYAK_THROW(ERR_BAD_COMBINATION) opGen(Reg64(xmm.getIdx()), op, 0x16, 0x66, 0, imm, 0x3A); }
|
||||
void pinsrq(const Xmm& xmm, const Operand& op, uint8_t imm) { if (!op.isREG(64) && !op.isMEM()) XBYAK_THROW(ERR_BAD_COMBINATION) opGen(Reg64(xmm.getIdx()), op, 0x22, 0x66, 0, imm, 0x3A); }
|
||||
void vcvtss2si(const Reg64& r, const Operand& op) { opAVX_X_X_XM(Xmm(r.getIdx()), xm0, op, T_0F | T_F3 | T_W1 | T_EVEX | T_EW1 | T_ER_X | T_N8, 0x2D); }
|
||||
void vcvttss2si(const Reg64& r, const Operand& op) { opAVX_X_X_XM(Xmm(r.getIdx()), xm0, op, T_0F | T_F3 | T_W1 | T_EVEX | T_EW1 | T_SAE_X | T_N8, 0x2C); }
|
||||
void vcvtsd2si(const Reg64& r, const Operand& op) { opAVX_X_X_XM(Xmm(r.getIdx()), xm0, op, T_0F | T_F2 | T_W1 | T_EVEX | T_EW1 | T_N4 | T_ER_X, 0x2D); }
|
||||
|
@ -1662,11 +1662,11 @@ void les(const Reg& reg, const Address& addr) { opLoadSeg(addr, reg, 0xC4, 0x100
|
|||
#endif
|
||||
#ifndef XBYAK_NO_OP_NAMES
|
||||
void and(const Operand& op1, const Operand& op2) { and_(op1, op2); }
|
||||
void and(const Operand& op, uint32 imm) { and_(op, imm); }
|
||||
void and(const Operand& op, uint32_t imm) { and_(op, imm); }
|
||||
void or(const Operand& op1, const Operand& op2) { or_(op1, op2); }
|
||||
void or(const Operand& op, uint32 imm) { or_(op, imm); }
|
||||
void or(const Operand& op, uint32_t imm) { or_(op, imm); }
|
||||
void xor(const Operand& op1, const Operand& op2) { xor_(op1, op2); }
|
||||
void xor(const Operand& op, uint32 imm) { xor_(op, imm); }
|
||||
void xor(const Operand& op, uint32_t imm) { xor_(op, imm); }
|
||||
void not(const Operand& op) { not_(op); }
|
||||
#endif
|
||||
#ifndef XBYAK_DISABLE_AVX512
|
||||
|
@ -1708,14 +1708,14 @@ void kortestd(const Opmask& r1, const Opmask& r2) { opVex(r1, 0, r2, T_0F | T_66
|
|||
void kortestq(const Opmask& r1, const Opmask& r2) { opVex(r1, 0, r2, T_0F | T_W1, 0x98); }
|
||||
void kortestw(const Opmask& r1, const Opmask& r2) { opVex(r1, 0, r2, T_0F | T_W0, 0x98); }
|
||||
void korw(const Opmask& r1, const Opmask& r2, const Opmask& r3) { opVex(r1, &r2, r3, T_L1 | T_0F | T_W0, 0x45); }
|
||||
void kshiftlb(const Opmask& r1, const Opmask& r2, uint8 imm) { opVex(r1, 0, r2, T_66 | T_0F3A | T_W0, 0x32, imm); }
|
||||
void kshiftld(const Opmask& r1, const Opmask& r2, uint8 imm) { opVex(r1, 0, r2, T_66 | T_0F3A | T_W0, 0x33, imm); }
|
||||
void kshiftlq(const Opmask& r1, const Opmask& r2, uint8 imm) { opVex(r1, 0, r2, T_66 | T_0F3A | T_W1, 0x33, imm); }
|
||||
void kshiftlw(const Opmask& r1, const Opmask& r2, uint8 imm) { opVex(r1, 0, r2, T_66 | T_0F3A | T_W1, 0x32, imm); }
|
||||
void kshiftrb(const Opmask& r1, const Opmask& r2, uint8 imm) { opVex(r1, 0, r2, T_66 | T_0F3A | T_W0, 0x30, imm); }
|
||||
void kshiftrd(const Opmask& r1, const Opmask& r2, uint8 imm) { opVex(r1, 0, r2, T_66 | T_0F3A | T_W0, 0x31, imm); }
|
||||
void kshiftrq(const Opmask& r1, const Opmask& r2, uint8 imm) { opVex(r1, 0, r2, T_66 | T_0F3A | T_W1, 0x31, imm); }
|
||||
void kshiftrw(const Opmask& r1, const Opmask& r2, uint8 imm) { opVex(r1, 0, r2, T_66 | T_0F3A | T_W1, 0x30, imm); }
|
||||
void kshiftlb(const Opmask& r1, const Opmask& r2, uint8_t imm) { opVex(r1, 0, r2, T_66 | T_0F3A | T_W0, 0x32, imm); }
|
||||
void kshiftld(const Opmask& r1, const Opmask& r2, uint8_t imm) { opVex(r1, 0, r2, T_66 | T_0F3A | T_W0, 0x33, imm); }
|
||||
void kshiftlq(const Opmask& r1, const Opmask& r2, uint8_t imm) { opVex(r1, 0, r2, T_66 | T_0F3A | T_W1, 0x33, imm); }
|
||||
void kshiftlw(const Opmask& r1, const Opmask& r2, uint8_t imm) { opVex(r1, 0, r2, T_66 | T_0F3A | T_W1, 0x32, imm); }
|
||||
void kshiftrb(const Opmask& r1, const Opmask& r2, uint8_t imm) { opVex(r1, 0, r2, T_66 | T_0F3A | T_W0, 0x30, imm); }
|
||||
void kshiftrd(const Opmask& r1, const Opmask& r2, uint8_t imm) { opVex(r1, 0, r2, T_66 | T_0F3A | T_W0, 0x31, imm); }
|
||||
void kshiftrq(const Opmask& r1, const Opmask& r2, uint8_t imm) { opVex(r1, 0, r2, T_66 | T_0F3A | T_W1, 0x31, imm); }
|
||||
void kshiftrw(const Opmask& r1, const Opmask& r2, uint8_t imm) { opVex(r1, 0, r2, T_66 | T_0F3A | T_W1, 0x30, imm); }
|
||||
void ktestb(const Opmask& r1, const Opmask& r2) { opVex(r1, 0, r2, T_0F | T_66 | T_W0, 0x99); }
|
||||
void ktestd(const Opmask& r1, const Opmask& r2) { opVex(r1, 0, r2, T_0F | T_66 | T_W1, 0x99); }
|
||||
void ktestq(const Opmask& r1, const Opmask& r2) { opVex(r1, 0, r2, T_0F | T_W1, 0x99); }
|
||||
|
@ -1735,8 +1735,8 @@ void v4fmaddps(const Zmm& z1, const Zmm& z2, const Address& addr) { opAVX_X_X_XM
|
|||
void v4fmaddss(const Xmm& x1, const Xmm& x2, const Address& addr) { opAVX_X_X_XM(x1, x2, addr, T_0F38 | T_F2 | T_EW0 | T_MUST_EVEX | T_N16, 0x9B); }
|
||||
void v4fnmaddps(const Zmm& z1, const Zmm& z2, const Address& addr) { opAVX_X_X_XM(z1, z2, addr, T_0F38 | T_F2 | T_EW0 | T_YMM | T_MUST_EVEX | T_N16, 0xAA); }
|
||||
void v4fnmaddss(const Xmm& x1, const Xmm& x2, const Address& addr) { opAVX_X_X_XM(x1, x2, addr, T_0F38 | T_F2 | T_EW0 | T_MUST_EVEX | T_N16, 0xAB); }
|
||||
void valignd(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F3A | T_EW0 | T_YMM | T_MUST_EVEX, 0x03, imm); }
|
||||
void valignq(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F3A | T_EW1 | T_YMM | T_MUST_EVEX, 0x03, imm); }
|
||||
void valignd(const Xmm& x1, const Xmm& x2, const Operand& op, uint8_t imm) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F3A | T_EW0 | T_YMM | T_MUST_EVEX, 0x03, imm); }
|
||||
void valignq(const Xmm& x1, const Xmm& x2, const Operand& op, uint8_t imm) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F3A | T_EW1 | T_YMM | T_MUST_EVEX, 0x03, imm); }
|
||||
void vblendmpd(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F38 | T_EW1 | T_YMM | T_MUST_EVEX | T_B64, 0x65); }
|
||||
void vblendmps(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F38 | T_EW0 | T_YMM | T_MUST_EVEX | T_B32, 0x65); }
|
||||
void vbroadcastf32x2(const Ymm& y, const Operand& op) { opAVX_X_XM_IMM(y, op, T_66 | T_0F38 | T_YMM | T_MUST_EVEX | T_EW0 | T_N8, 0x19); }
|
||||
|
@ -1749,10 +1749,10 @@ void vbroadcasti32x4(const Ymm& y, const Operand& op) { opAVX_X_XM_IMM(y, op, T_
|
|||
void vbroadcasti32x8(const Zmm& z, const Operand& op) { opAVX_X_XM_IMM(z, op, T_66 | T_0F38 | T_YMM | T_MUST_EVEX | T_EW0 | T_N32, 0x5B); }
|
||||
void vbroadcasti64x2(const Ymm& y, const Operand& op) { opAVX_X_XM_IMM(y, op, T_66 | T_0F38 | T_YMM | T_MUST_EVEX | T_EW1 | T_N16, 0x5A); }
|
||||
void vbroadcasti64x4(const Zmm& z, const Operand& op) { opAVX_X_XM_IMM(z, op, T_66 | T_0F38 | T_YMM | T_MUST_EVEX | T_EW1 | T_N32, 0x5B); }
|
||||
void vcmppd(const Opmask& k, const Xmm& x, const Operand& op, uint8 imm) { opAVX_K_X_XM(k, x, op, T_66 | T_0F | T_EW1 | T_YMM | T_SAE_Z | T_MUST_EVEX | T_B64, 0xC2, imm); }
|
||||
void vcmpps(const Opmask& k, const Xmm& x, const Operand& op, uint8 imm) { opAVX_K_X_XM(k, x, op, T_0F | T_EW0 | T_YMM | T_SAE_Z | T_MUST_EVEX | T_B32, 0xC2, imm); }
|
||||
void vcmpsd(const Opmask& k, const Xmm& x, const Operand& op, uint8 imm) { opAVX_K_X_XM(k, x, op, T_N8 | T_F2 | T_0F | T_EW1 | T_SAE_Z | T_MUST_EVEX, 0xC2, imm); }
|
||||
void vcmpss(const Opmask& k, const Xmm& x, const Operand& op, uint8 imm) { opAVX_K_X_XM(k, x, op, T_N4 | T_F3 | T_0F | T_EW0 | T_SAE_Z | T_MUST_EVEX, 0xC2, imm); }
|
||||
void vcmppd(const Opmask& k, const Xmm& x, const Operand& op, uint8_t imm) { opAVX_K_X_XM(k, x, op, T_66 | T_0F | T_EW1 | T_YMM | T_SAE_Z | T_MUST_EVEX | T_B64, 0xC2, imm); }
|
||||
void vcmpps(const Opmask& k, const Xmm& x, const Operand& op, uint8_t imm) { opAVX_K_X_XM(k, x, op, T_0F | T_EW0 | T_YMM | T_SAE_Z | T_MUST_EVEX | T_B32, 0xC2, imm); }
|
||||
void vcmpsd(const Opmask& k, const Xmm& x, const Operand& op, uint8_t imm) { opAVX_K_X_XM(k, x, op, T_N8 | T_F2 | T_0F | T_EW1 | T_SAE_Z | T_MUST_EVEX, 0xC2, imm); }
|
||||
void vcmpss(const Opmask& k, const Xmm& x, const Operand& op, uint8_t imm) { opAVX_K_X_XM(k, x, op, T_N4 | T_F3 | T_0F | T_EW0 | T_SAE_Z | T_MUST_EVEX, 0xC2, imm); }
|
||||
void vcompressb(const Operand& op, const Xmm& x) { opAVX_X_XM_IMM(x, op, T_N1 | T_66 | T_0F38 | T_EW0 | T_YMM | T_MUST_EVEX, 0x63); }
|
||||
void vcompresspd(const Operand& op, const Xmm& x) { opAVX_X_XM_IMM(x, op, T_N8 | T_66 | T_0F38 | T_EW1 | T_YMM | T_MUST_EVEX, 0x8A); }
|
||||
void vcompressps(const Operand& op, const Xmm& x) { opAVX_X_XM_IMM(x, op, T_N4 | T_66 | T_0F38 | T_EW0 | T_YMM | T_MUST_EVEX, 0x8A); }
|
||||
|
@ -1783,28 +1783,28 @@ void vcvtuqq2pd(const Xmm& x, const Operand& op) { opAVX_X_XM_IMM(x, op, T_F3 |
|
|||
void vcvtuqq2ps(const Xmm& x, const Operand& op) { opCvt2(x, op, T_F2 | T_0F | T_YMM | T_MUST_EVEX | T_EW1 | T_B64 | T_ER_Z, 0x7A); }
|
||||
void vcvtusi2sd(const Xmm& x1, const Xmm& x2, const Operand& op) { opCvt3(x1, x2, op, T_F2 | T_0F | T_MUST_EVEX, T_W1 | T_EW1 | T_ER_X | T_N8, T_W0 | T_EW0 | T_N4, 0x7B); }
|
||||
void vcvtusi2ss(const Xmm& x1, const Xmm& x2, const Operand& op) { opCvt3(x1, x2, op, T_F3 | T_0F | T_MUST_EVEX | T_ER_X, T_W1 | T_EW1 | T_N8, T_W0 | T_EW0 | T_N4, 0x7B); }
|
||||
void vdbpsadbw(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F3A | T_EW0 | T_YMM | T_MUST_EVEX, 0x42, imm); }
|
||||
void vdbpsadbw(const Xmm& x1, const Xmm& x2, const Operand& op, uint8_t imm) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F3A | T_EW0 | T_YMM | T_MUST_EVEX, 0x42, imm); }
|
||||
void vdpbf16ps(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_F3 | T_0F38 | T_EW0 | T_YMM | T_SAE_Z | T_MUST_EVEX | T_B32, 0x52); }
|
||||
void vexp2pd(const Zmm& z, const Operand& op) { opAVX_X_XM_IMM(z, op, T_66 | T_0F38 | T_MUST_EVEX | T_YMM | T_EW1 | T_B64 | T_SAE_Z, 0xC8); }
|
||||
void vexp2ps(const Zmm& z, const Operand& op) { opAVX_X_XM_IMM(z, op, T_66 | T_0F38 | T_MUST_EVEX | T_YMM | T_EW0 | T_B32 | T_SAE_Z, 0xC8); }
|
||||
void vexpandpd(const Xmm& x, const Operand& op) { opAVX_X_XM_IMM(x, op, T_N8 | T_66 | T_0F38 | T_EW1 | T_YMM | T_MUST_EVEX, 0x88); }
|
||||
void vexpandps(const Xmm& x, const Operand& op) { opAVX_X_XM_IMM(x, op, T_N4 | T_66 | T_0F38 | T_EW0 | T_YMM | T_MUST_EVEX, 0x88); }
|
||||
void vextractf32x4(const Operand& op, const Ymm& r, uint8 imm) { if (!op.is(Operand::MEM | Operand::XMM)) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(r, 0, op, T_N16 | T_66 | T_0F3A | T_EW0 | T_YMM | T_MUST_EVEX, 0x19, imm); }
|
||||
void vextractf32x8(const Operand& op, const Zmm& r, uint8 imm) { if (!op.is(Operand::MEM | Operand::YMM)) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(r, 0, op, T_N32 | T_66 | T_0F3A | T_EW0 | T_YMM | T_MUST_EVEX, 0x1B, imm); }
|
||||
void vextractf64x2(const Operand& op, const Ymm& r, uint8 imm) { if (!op.is(Operand::MEM | Operand::XMM)) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(r, 0, op, T_N16 | T_66 | T_0F3A | T_EW1 | T_YMM | T_MUST_EVEX, 0x19, imm); }
|
||||
void vextractf64x4(const Operand& op, const Zmm& r, uint8 imm) { if (!op.is(Operand::MEM | Operand::YMM)) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(r, 0, op, T_N32 | T_66 | T_0F3A | T_EW1 | T_YMM | T_MUST_EVEX, 0x1B, imm); }
|
||||
void vextracti32x4(const Operand& op, const Ymm& r, uint8 imm) { if (!op.is(Operand::MEM | Operand::XMM)) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(r, 0, op, T_N16 | T_66 | T_0F3A | T_EW0 | T_YMM | T_MUST_EVEX, 0x39, imm); }
|
||||
void vextracti32x8(const Operand& op, const Zmm& r, uint8 imm) { if (!op.is(Operand::MEM | Operand::YMM)) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(r, 0, op, T_N32 | T_66 | T_0F3A | T_EW0 | T_YMM | T_MUST_EVEX, 0x3B, imm); }
|
||||
void vextracti64x2(const Operand& op, const Ymm& r, uint8 imm) { if (!op.is(Operand::MEM | Operand::XMM)) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(r, 0, op, T_N16 | T_66 | T_0F3A | T_EW1 | T_YMM | T_MUST_EVEX, 0x39, imm); }
|
||||
void vextracti64x4(const Operand& op, const Zmm& r, uint8 imm) { if (!op.is(Operand::MEM | Operand::YMM)) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(r, 0, op, T_N32 | T_66 | T_0F3A | T_EW1 | T_YMM | T_MUST_EVEX, 0x3B, imm); }
|
||||
void vfixupimmpd(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F3A | T_EW1 | T_YMM | T_SAE_Z | T_MUST_EVEX | T_B64, 0x54, imm); }
|
||||
void vfixupimmps(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F3A | T_EW0 | T_YMM | T_SAE_Z | T_MUST_EVEX | T_B32, 0x54, imm); }
|
||||
void vfixupimmsd(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, T_N8 | T_66 | T_0F3A | T_EW1 | T_SAE_Z | T_MUST_EVEX, 0x55, imm); }
|
||||
void vfixupimmss(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, T_N4 | T_66 | T_0F3A | T_EW0 | T_SAE_Z | T_MUST_EVEX, 0x55, imm); }
|
||||
void vfpclasspd(const Opmask& k, const Operand& op, uint8 imm) { if (!op.isBit(128|256|512)) XBYAK_THROW(ERR_BAD_MEM_SIZE) opVex(k.changeBit(op.getBit()), 0, op, T_66 | T_0F3A | T_MUST_EVEX | T_YMM | T_EW1 | T_B64, 0x66, imm); }
|
||||
void vfpclassps(const Opmask& k, const Operand& op, uint8 imm) { if (!op.isBit(128|256|512)) XBYAK_THROW(ERR_BAD_MEM_SIZE) opVex(k.changeBit(op.getBit()), 0, op, T_66 | T_0F3A | T_MUST_EVEX | T_YMM | T_EW0 | T_B32, 0x66, imm); }
|
||||
void vfpclasssd(const Opmask& k, const Operand& op, uint8 imm) { if (!op.isXMEM()) XBYAK_THROW(ERR_BAD_MEM_SIZE) opVex(k, 0, op, T_66 | T_0F3A | T_MUST_EVEX | T_EW1 | T_N8, 0x67, imm); }
|
||||
void vfpclassss(const Opmask& k, const Operand& op, uint8 imm) { if (!op.isXMEM()) XBYAK_THROW(ERR_BAD_MEM_SIZE) opVex(k, 0, op, T_66 | T_0F3A | T_MUST_EVEX | T_EW0 | T_N4, 0x67, imm); }
|
||||
void vextractf32x4(const Operand& op, const Ymm& r, uint8_t imm) { if (!op.is(Operand::MEM | Operand::XMM)) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(r, 0, op, T_N16 | T_66 | T_0F3A | T_EW0 | T_YMM | T_MUST_EVEX, 0x19, imm); }
|
||||
void vextractf32x8(const Operand& op, const Zmm& r, uint8_t imm) { if (!op.is(Operand::MEM | Operand::YMM)) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(r, 0, op, T_N32 | T_66 | T_0F3A | T_EW0 | T_YMM | T_MUST_EVEX, 0x1B, imm); }
|
||||
void vextractf64x2(const Operand& op, const Ymm& r, uint8_t imm) { if (!op.is(Operand::MEM | Operand::XMM)) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(r, 0, op, T_N16 | T_66 | T_0F3A | T_EW1 | T_YMM | T_MUST_EVEX, 0x19, imm); }
|
||||
void vextractf64x4(const Operand& op, const Zmm& r, uint8_t imm) { if (!op.is(Operand::MEM | Operand::YMM)) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(r, 0, op, T_N32 | T_66 | T_0F3A | T_EW1 | T_YMM | T_MUST_EVEX, 0x1B, imm); }
|
||||
void vextracti32x4(const Operand& op, const Ymm& r, uint8_t imm) { if (!op.is(Operand::MEM | Operand::XMM)) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(r, 0, op, T_N16 | T_66 | T_0F3A | T_EW0 | T_YMM | T_MUST_EVEX, 0x39, imm); }
|
||||
void vextracti32x8(const Operand& op, const Zmm& r, uint8_t imm) { if (!op.is(Operand::MEM | Operand::YMM)) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(r, 0, op, T_N32 | T_66 | T_0F3A | T_EW0 | T_YMM | T_MUST_EVEX, 0x3B, imm); }
|
||||
void vextracti64x2(const Operand& op, const Ymm& r, uint8_t imm) { if (!op.is(Operand::MEM | Operand::XMM)) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(r, 0, op, T_N16 | T_66 | T_0F3A | T_EW1 | T_YMM | T_MUST_EVEX, 0x39, imm); }
|
||||
void vextracti64x4(const Operand& op, const Zmm& r, uint8_t imm) { if (!op.is(Operand::MEM | Operand::YMM)) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(r, 0, op, T_N32 | T_66 | T_0F3A | T_EW1 | T_YMM | T_MUST_EVEX, 0x3B, imm); }
|
||||
void vfixupimmpd(const Xmm& x1, const Xmm& x2, const Operand& op, uint8_t imm) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F3A | T_EW1 | T_YMM | T_SAE_Z | T_MUST_EVEX | T_B64, 0x54, imm); }
|
||||
void vfixupimmps(const Xmm& x1, const Xmm& x2, const Operand& op, uint8_t imm) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F3A | T_EW0 | T_YMM | T_SAE_Z | T_MUST_EVEX | T_B32, 0x54, imm); }
|
||||
void vfixupimmsd(const Xmm& x1, const Xmm& x2, const Operand& op, uint8_t imm) { opAVX_X_X_XM(x1, x2, op, T_N8 | T_66 | T_0F3A | T_EW1 | T_SAE_Z | T_MUST_EVEX, 0x55, imm); }
|
||||
void vfixupimmss(const Xmm& x1, const Xmm& x2, const Operand& op, uint8_t imm) { opAVX_X_X_XM(x1, x2, op, T_N4 | T_66 | T_0F3A | T_EW0 | T_SAE_Z | T_MUST_EVEX, 0x55, imm); }
|
||||
void vfpclasspd(const Opmask& k, const Operand& op, uint8_t imm) { if (!op.isBit(128|256|512)) XBYAK_THROW(ERR_BAD_MEM_SIZE) opVex(k.changeBit(op.getBit()), 0, op, T_66 | T_0F3A | T_MUST_EVEX | T_YMM | T_EW1 | T_B64, 0x66, imm); }
|
||||
void vfpclassps(const Opmask& k, const Operand& op, uint8_t imm) { if (!op.isBit(128|256|512)) XBYAK_THROW(ERR_BAD_MEM_SIZE) opVex(k.changeBit(op.getBit()), 0, op, T_66 | T_0F3A | T_MUST_EVEX | T_YMM | T_EW0 | T_B32, 0x66, imm); }
|
||||
void vfpclasssd(const Opmask& k, const Operand& op, uint8_t imm) { if (!op.isXMEM()) XBYAK_THROW(ERR_BAD_MEM_SIZE) opVex(k, 0, op, T_66 | T_0F3A | T_MUST_EVEX | T_EW1 | T_N8, 0x67, imm); }
|
||||
void vfpclassss(const Opmask& k, const Operand& op, uint8_t imm) { if (!op.isXMEM()) XBYAK_THROW(ERR_BAD_MEM_SIZE) opVex(k, 0, op, T_66 | T_0F3A | T_MUST_EVEX | T_EW0 | T_N4, 0x67, imm); }
|
||||
void vgatherdpd(const Xmm& x, const Address& addr) { opGather2(x, addr, T_N8 | T_66 | T_0F38 | T_EW1 | T_YMM | T_MUST_EVEX | T_VSIB, 0x92, 1); }
|
||||
void vgatherdps(const Xmm& x, const Address& addr) { opGather2(x, addr, T_N4 | T_66 | T_0F38 | T_EW0 | T_YMM | T_MUST_EVEX | T_VSIB, 0x92, 0); }
|
||||
void vgatherpf0dpd(const Address& addr) { opGatherFetch(addr, zm1, T_N8 | T_66 | T_0F38 | T_EW1 | T_MUST_EVEX | T_M_K | T_VSIB, 0xC6, Operand::YMM); }
|
||||
|
@ -1821,18 +1821,18 @@ void vgetexppd(const Xmm& x, const Operand& op) { opAVX_X_XM_IMM(x, op, T_66 | T
|
|||
void vgetexpps(const Xmm& x, const Operand& op) { opAVX_X_XM_IMM(x, op, T_66 | T_0F38 | T_EW0 | T_YMM | T_SAE_Z | T_MUST_EVEX | T_B32, 0x42); }
|
||||
void vgetexpsd(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_N8 | T_66 | T_0F38 | T_EW1 | T_SAE_X | T_MUST_EVEX, 0x43); }
|
||||
void vgetexpss(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_N4 | T_66 | T_0F38 | T_EW0 | T_SAE_X | T_MUST_EVEX, 0x43); }
|
||||
void vgetmantpd(const Xmm& x, const Operand& op, uint8 imm) { opAVX_X_XM_IMM(x, op, T_66 | T_0F3A | T_EW1 | T_YMM | T_SAE_Z | T_MUST_EVEX | T_B64, 0x26, imm); }
|
||||
void vgetmantps(const Xmm& x, const Operand& op, uint8 imm) { opAVX_X_XM_IMM(x, op, T_66 | T_0F3A | T_EW0 | T_YMM | T_SAE_Z | T_MUST_EVEX | T_B32, 0x26, imm); }
|
||||
void vgetmantsd(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, T_N8 | T_66 | T_0F3A | T_EW1 | T_SAE_X | T_MUST_EVEX, 0x27, imm); }
|
||||
void vgetmantss(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, T_N4 | T_66 | T_0F3A | T_EW0 | T_SAE_X | T_MUST_EVEX, 0x27, imm); }
|
||||
void vinsertf32x4(const Ymm& r1, const Ymm& r2, const Operand& op, uint8 imm) {if (!(r1.getKind() == r2.getKind() && op.is(Operand::MEM | Operand::XMM))) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(r1, &r2, op, T_N16 | T_66 | T_0F3A | T_EW0 | T_YMM | T_MUST_EVEX, 0x18, imm); }
|
||||
void vinsertf32x8(const Zmm& r1, const Zmm& r2, const Operand& op, uint8 imm) {if (!op.is(Operand::MEM | Operand::YMM)) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(r1, &r2, op, T_N32 | T_66 | T_0F3A | T_EW0 | T_YMM | T_MUST_EVEX, 0x1A, imm); }
|
||||
void vinsertf64x2(const Ymm& r1, const Ymm& r2, const Operand& op, uint8 imm) {if (!(r1.getKind() == r2.getKind() && op.is(Operand::MEM | Operand::XMM))) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(r1, &r2, op, T_N16 | T_66 | T_0F3A | T_EW1 | T_YMM | T_MUST_EVEX, 0x18, imm); }
|
||||
void vinsertf64x4(const Zmm& r1, const Zmm& r2, const Operand& op, uint8 imm) {if (!op.is(Operand::MEM | Operand::YMM)) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(r1, &r2, op, T_N32 | T_66 | T_0F3A | T_EW1 | T_YMM | T_MUST_EVEX, 0x1A, imm); }
|
||||
void vinserti32x4(const Ymm& r1, const Ymm& r2, const Operand& op, uint8 imm) {if (!(r1.getKind() == r2.getKind() && op.is(Operand::MEM | Operand::XMM))) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(r1, &r2, op, T_N16 | T_66 | T_0F3A | T_EW0 | T_YMM | T_MUST_EVEX, 0x38, imm); }
|
||||
void vinserti32x8(const Zmm& r1, const Zmm& r2, const Operand& op, uint8 imm) {if (!op.is(Operand::MEM | Operand::YMM)) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(r1, &r2, op, T_N32 | T_66 | T_0F3A | T_EW0 | T_YMM | T_MUST_EVEX, 0x3A, imm); }
|
||||
void vinserti64x2(const Ymm& r1, const Ymm& r2, const Operand& op, uint8 imm) {if (!(r1.getKind() == r2.getKind() && op.is(Operand::MEM | Operand::XMM))) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(r1, &r2, op, T_N16 | T_66 | T_0F3A | T_EW1 | T_YMM | T_MUST_EVEX, 0x38, imm); }
|
||||
void vinserti64x4(const Zmm& r1, const Zmm& r2, const Operand& op, uint8 imm) {if (!op.is(Operand::MEM | Operand::YMM)) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(r1, &r2, op, T_N32 | T_66 | T_0F3A | T_EW1 | T_YMM | T_MUST_EVEX, 0x3A, imm); }
|
||||
void vgetmantpd(const Xmm& x, const Operand& op, uint8_t imm) { opAVX_X_XM_IMM(x, op, T_66 | T_0F3A | T_EW1 | T_YMM | T_SAE_Z | T_MUST_EVEX | T_B64, 0x26, imm); }
|
||||
void vgetmantps(const Xmm& x, const Operand& op, uint8_t imm) { opAVX_X_XM_IMM(x, op, T_66 | T_0F3A | T_EW0 | T_YMM | T_SAE_Z | T_MUST_EVEX | T_B32, 0x26, imm); }
|
||||
void vgetmantsd(const Xmm& x1, const Xmm& x2, const Operand& op, uint8_t imm) { opAVX_X_X_XM(x1, x2, op, T_N8 | T_66 | T_0F3A | T_EW1 | T_SAE_X | T_MUST_EVEX, 0x27, imm); }
|
||||
void vgetmantss(const Xmm& x1, const Xmm& x2, const Operand& op, uint8_t imm) { opAVX_X_X_XM(x1, x2, op, T_N4 | T_66 | T_0F3A | T_EW0 | T_SAE_X | T_MUST_EVEX, 0x27, imm); }
|
||||
void vinsertf32x4(const Ymm& r1, const Ymm& r2, const Operand& op, uint8_t imm) {if (!(r1.getKind() == r2.getKind() && op.is(Operand::MEM | Operand::XMM))) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(r1, &r2, op, T_N16 | T_66 | T_0F3A | T_EW0 | T_YMM | T_MUST_EVEX, 0x18, imm); }
|
||||
void vinsertf32x8(const Zmm& r1, const Zmm& r2, const Operand& op, uint8_t imm) {if (!op.is(Operand::MEM | Operand::YMM)) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(r1, &r2, op, T_N32 | T_66 | T_0F3A | T_EW0 | T_YMM | T_MUST_EVEX, 0x1A, imm); }
|
||||
void vinsertf64x2(const Ymm& r1, const Ymm& r2, const Operand& op, uint8_t imm) {if (!(r1.getKind() == r2.getKind() && op.is(Operand::MEM | Operand::XMM))) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(r1, &r2, op, T_N16 | T_66 | T_0F3A | T_EW1 | T_YMM | T_MUST_EVEX, 0x18, imm); }
|
||||
void vinsertf64x4(const Zmm& r1, const Zmm& r2, const Operand& op, uint8_t imm) {if (!op.is(Operand::MEM | Operand::YMM)) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(r1, &r2, op, T_N32 | T_66 | T_0F3A | T_EW1 | T_YMM | T_MUST_EVEX, 0x1A, imm); }
|
||||
void vinserti32x4(const Ymm& r1, const Ymm& r2, const Operand& op, uint8_t imm) {if (!(r1.getKind() == r2.getKind() && op.is(Operand::MEM | Operand::XMM))) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(r1, &r2, op, T_N16 | T_66 | T_0F3A | T_EW0 | T_YMM | T_MUST_EVEX, 0x38, imm); }
|
||||
void vinserti32x8(const Zmm& r1, const Zmm& r2, const Operand& op, uint8_t imm) {if (!op.is(Operand::MEM | Operand::YMM)) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(r1, &r2, op, T_N32 | T_66 | T_0F3A | T_EW0 | T_YMM | T_MUST_EVEX, 0x3A, imm); }
|
||||
void vinserti64x2(const Ymm& r1, const Ymm& r2, const Operand& op, uint8_t imm) {if (!(r1.getKind() == r2.getKind() && op.is(Operand::MEM | Operand::XMM))) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(r1, &r2, op, T_N16 | T_66 | T_0F3A | T_EW1 | T_YMM | T_MUST_EVEX, 0x38, imm); }
|
||||
void vinserti64x4(const Zmm& r1, const Zmm& r2, const Operand& op, uint8_t imm) {if (!op.is(Operand::MEM | Operand::YMM)) XBYAK_THROW(ERR_BAD_COMBINATION) opVex(r1, &r2, op, T_N32 | T_66 | T_0F3A | T_EW1 | T_YMM | T_MUST_EVEX, 0x3A, imm); }
|
||||
void vmovdqa32(const Address& addr, const Xmm& x) { opAVX_X_XM_IMM(x, addr, T_66 | T_0F | T_EW0 | T_YMM | T_ER_X | T_ER_Y | T_ER_Z | T_MUST_EVEX | T_M_K, 0x7F); }
|
||||
void vmovdqa32(const Xmm& x, const Operand& op) { opAVX_X_XM_IMM(x, op, T_66 | T_0F | T_EW0 | T_YMM | T_ER_X | T_ER_Y | T_ER_Z | T_MUST_EVEX, 0x6F); }
|
||||
void vmovdqa64(const Address& addr, const Xmm& x) { opAVX_X_XM_IMM(x, addr, T_66 | T_0F | T_EW1 | T_YMM | T_ER_X | T_ER_Y | T_ER_Z | T_MUST_EVEX | T_M_K, 0x7F); }
|
||||
|
@ -1863,8 +1863,8 @@ void vpbroadcastd(const Xmm& x, const Reg32& r) { opVex(x, 0, r, T_66 | T_0F38 |
|
|||
void vpbroadcastmb2q(const Xmm& x, const Opmask& k) { opVex(x, 0, k, T_F3 | T_0F38 | T_YMM | T_MUST_EVEX | T_EW1, 0x2A); }
|
||||
void vpbroadcastmw2d(const Xmm& x, const Opmask& k) { opVex(x, 0, k, T_F3 | T_0F38 | T_YMM | T_MUST_EVEX | T_EW0, 0x3A); }
|
||||
void vpbroadcastw(const Xmm& x, const Reg16& r) { opVex(x, 0, r, T_66 | T_0F38 | T_EW0 | T_YMM | T_MUST_EVEX, 0x7B); }
|
||||
void vpcmpb(const Opmask& k, const Xmm& x, const Operand& op, uint8 imm) { opAVX_K_X_XM(k, x, op, T_66 | T_0F3A | T_EW0 | T_YMM | T_MUST_EVEX, 0x3F, imm); }
|
||||
void vpcmpd(const Opmask& k, const Xmm& x, const Operand& op, uint8 imm) { opAVX_K_X_XM(k, x, op, T_66 | T_0F3A | T_EW0 | T_YMM | T_MUST_EVEX | T_B32, 0x1F, imm); }
|
||||
void vpcmpb(const Opmask& k, const Xmm& x, const Operand& op, uint8_t imm) { opAVX_K_X_XM(k, x, op, T_66 | T_0F3A | T_EW0 | T_YMM | T_MUST_EVEX, 0x3F, imm); }
|
||||
void vpcmpd(const Opmask& k, const Xmm& x, const Operand& op, uint8_t imm) { opAVX_K_X_XM(k, x, op, T_66 | T_0F3A | T_EW0 | T_YMM | T_MUST_EVEX | T_B32, 0x1F, imm); }
|
||||
void vpcmpeqb(const Opmask& k, const Xmm& x, const Operand& op) { opAVX_K_X_XM(k, x, op, T_66 | T_0F | T_YMM | T_MUST_EVEX, 0x74); }
|
||||
void vpcmpeqd(const Opmask& k, const Xmm& x, const Operand& op) { opAVX_K_X_XM(k, x, op, T_66 | T_0F | T_YMM | T_MUST_EVEX | T_B32, 0x76); }
|
||||
void vpcmpeqq(const Opmask& k, const Xmm& x, const Operand& op) { opAVX_K_X_XM(k, x, op, T_66 | T_0F38 | T_EW1 | T_YMM | T_MUST_EVEX | T_B64, 0x29); }
|
||||
|
@ -1873,12 +1873,12 @@ void vpcmpgtb(const Opmask& k, const Xmm& x, const Operand& op) { opAVX_K_X_XM(k
|
|||
void vpcmpgtd(const Opmask& k, const Xmm& x, const Operand& op) { opAVX_K_X_XM(k, x, op, T_66 | T_0F | T_EW0 | T_YMM | T_MUST_EVEX | T_B32, 0x66); }
|
||||
void vpcmpgtq(const Opmask& k, const Xmm& x, const Operand& op) { opAVX_K_X_XM(k, x, op, T_66 | T_0F38 | T_EW1 | T_YMM | T_MUST_EVEX | T_B64, 0x37); }
|
||||
void vpcmpgtw(const Opmask& k, const Xmm& x, const Operand& op) { opAVX_K_X_XM(k, x, op, T_66 | T_0F | T_YMM | T_MUST_EVEX, 0x65); }
|
||||
void vpcmpq(const Opmask& k, const Xmm& x, const Operand& op, uint8 imm) { opAVX_K_X_XM(k, x, op, T_66 | T_0F3A | T_EW1 | T_YMM | T_MUST_EVEX | T_B64, 0x1F, imm); }
|
||||
void vpcmpub(const Opmask& k, const Xmm& x, const Operand& op, uint8 imm) { opAVX_K_X_XM(k, x, op, T_66 | T_0F3A | T_EW0 | T_YMM | T_MUST_EVEX, 0x3E, imm); }
|
||||
void vpcmpud(const Opmask& k, const Xmm& x, const Operand& op, uint8 imm) { opAVX_K_X_XM(k, x, op, T_66 | T_0F3A | T_EW0 | T_YMM | T_MUST_EVEX | T_B32, 0x1E, imm); }
|
||||
void vpcmpuq(const Opmask& k, const Xmm& x, const Operand& op, uint8 imm) { opAVX_K_X_XM(k, x, op, T_66 | T_0F3A | T_EW1 | T_YMM | T_MUST_EVEX | T_B64, 0x1E, imm); }
|
||||
void vpcmpuw(const Opmask& k, const Xmm& x, const Operand& op, uint8 imm) { opAVX_K_X_XM(k, x, op, T_66 | T_0F3A | T_EW1 | T_YMM | T_MUST_EVEX, 0x3E, imm); }
|
||||
void vpcmpw(const Opmask& k, const Xmm& x, const Operand& op, uint8 imm) { opAVX_K_X_XM(k, x, op, T_66 | T_0F3A | T_EW1 | T_YMM | T_MUST_EVEX, 0x3F, imm); }
|
||||
void vpcmpq(const Opmask& k, const Xmm& x, const Operand& op, uint8_t imm) { opAVX_K_X_XM(k, x, op, T_66 | T_0F3A | T_EW1 | T_YMM | T_MUST_EVEX | T_B64, 0x1F, imm); }
|
||||
void vpcmpub(const Opmask& k, const Xmm& x, const Operand& op, uint8_t imm) { opAVX_K_X_XM(k, x, op, T_66 | T_0F3A | T_EW0 | T_YMM | T_MUST_EVEX, 0x3E, imm); }
|
||||
void vpcmpud(const Opmask& k, const Xmm& x, const Operand& op, uint8_t imm) { opAVX_K_X_XM(k, x, op, T_66 | T_0F3A | T_EW0 | T_YMM | T_MUST_EVEX | T_B32, 0x1E, imm); }
|
||||
void vpcmpuq(const Opmask& k, const Xmm& x, const Operand& op, uint8_t imm) { opAVX_K_X_XM(k, x, op, T_66 | T_0F3A | T_EW1 | T_YMM | T_MUST_EVEX | T_B64, 0x1E, imm); }
|
||||
void vpcmpuw(const Opmask& k, const Xmm& x, const Operand& op, uint8_t imm) { opAVX_K_X_XM(k, x, op, T_66 | T_0F3A | T_EW1 | T_YMM | T_MUST_EVEX, 0x3E, imm); }
|
||||
void vpcmpw(const Opmask& k, const Xmm& x, const Operand& op, uint8_t imm) { opAVX_K_X_XM(k, x, op, T_66 | T_0F3A | T_EW1 | T_YMM | T_MUST_EVEX, 0x3F, imm); }
|
||||
void vpcompressd(const Operand& op, const Xmm& x) { opAVX_X_XM_IMM(x, op, T_N4 | T_66 | T_0F38 | T_EW0 | T_YMM | T_MUST_EVEX, 0x8B); }
|
||||
void vpcompressq(const Operand& op, const Xmm& x) { opAVX_X_XM_IMM(x, op, T_N8 | T_66 | T_0F38 | T_EW1 | T_YMM | T_MUST_EVEX, 0x8B); }
|
||||
void vpconflictd(const Xmm& x, const Operand& op) { opAVX_X_XM_IMM(x, op, T_66 | T_0F38 | T_EW0 | T_YMM | T_MUST_EVEX | T_B32, 0xC4); }
|
||||
|
@ -1951,39 +1951,39 @@ void vpopcntq(const Xmm& x, const Operand& op) { opAVX_X_XM_IMM(x, op, T_66 | T_
|
|||
void vpopcntw(const Xmm& x, const Operand& op) { opAVX_X_XM_IMM(x, op, T_66 | T_0F38 | T_EW1 | T_YMM | T_SAE_Z | T_MUST_EVEX, 0x54); }
|
||||
void vpord(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F | T_EW0 | T_YMM | T_MUST_EVEX | T_B32, 0xEB); }
|
||||
void vporq(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F | T_EW1 | T_YMM | T_MUST_EVEX | T_B64, 0xEB); }
|
||||
void vprold(const Xmm& x, const Operand& op, uint8 imm) { opAVX_X_X_XM(Xmm(x.getKind(), 1), x, op, T_66 | T_0F | T_EW0 | T_YMM | T_MUST_EVEX | T_B32, 0x72, imm); }
|
||||
void vprolq(const Xmm& x, const Operand& op, uint8 imm) { opAVX_X_X_XM(Xmm(x.getKind(), 1), x, op, T_66 | T_0F | T_EW1 | T_YMM | T_MUST_EVEX | T_B64, 0x72, imm); }
|
||||
void vprold(const Xmm& x, const Operand& op, uint8_t imm) { opAVX_X_X_XM(Xmm(x.getKind(), 1), x, op, T_66 | T_0F | T_EW0 | T_YMM | T_MUST_EVEX | T_B32, 0x72, imm); }
|
||||
void vprolq(const Xmm& x, const Operand& op, uint8_t imm) { opAVX_X_X_XM(Xmm(x.getKind(), 1), x, op, T_66 | T_0F | T_EW1 | T_YMM | T_MUST_EVEX | T_B64, 0x72, imm); }
|
||||
void vprolvd(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F38 | T_EW0 | T_YMM | T_MUST_EVEX | T_B32, 0x15); }
|
||||
void vprolvq(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F38 | T_EW1 | T_YMM | T_MUST_EVEX | T_B64, 0x15); }
|
||||
void vprord(const Xmm& x, const Operand& op, uint8 imm) { opAVX_X_X_XM(Xmm(x.getKind(), 0), x, op, T_66 | T_0F | T_EW0 | T_YMM | T_MUST_EVEX | T_B32, 0x72, imm); }
|
||||
void vprorq(const Xmm& x, const Operand& op, uint8 imm) { opAVX_X_X_XM(Xmm(x.getKind(), 0), x, op, T_66 | T_0F | T_EW1 | T_YMM | T_MUST_EVEX | T_B64, 0x72, imm); }
|
||||
void vprord(const Xmm& x, const Operand& op, uint8_t imm) { opAVX_X_X_XM(Xmm(x.getKind(), 0), x, op, T_66 | T_0F | T_EW0 | T_YMM | T_MUST_EVEX | T_B32, 0x72, imm); }
|
||||
void vprorq(const Xmm& x, const Operand& op, uint8_t imm) { opAVX_X_X_XM(Xmm(x.getKind(), 0), x, op, T_66 | T_0F | T_EW1 | T_YMM | T_MUST_EVEX | T_B64, 0x72, imm); }
|
||||
void vprorvd(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F38 | T_EW0 | T_YMM | T_MUST_EVEX | T_B32, 0x14); }
|
||||
void vprorvq(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F38 | T_EW1 | T_YMM | T_MUST_EVEX | T_B64, 0x14); }
|
||||
void vpscatterdd(const Address& addr, const Xmm& x) { opGather2(x, addr, T_N4 | T_66 | T_0F38 | T_EW0 | T_YMM | T_MUST_EVEX | T_M_K | T_VSIB, 0xA0, 0); }
|
||||
void vpscatterdq(const Address& addr, const Xmm& x) { opGather2(x, addr, T_N8 | T_66 | T_0F38 | T_EW1 | T_YMM | T_MUST_EVEX | T_M_K | T_VSIB, 0xA0, 1); }
|
||||
void vpscatterqd(const Address& addr, const Xmm& x) { opGather2(x, addr, T_N4 | T_66 | T_0F38 | T_EW0 | T_YMM | T_MUST_EVEX | T_M_K | T_VSIB, 0xA1, 2); }
|
||||
void vpscatterqq(const Address& addr, const Xmm& x) { opGather2(x, addr, T_N8 | T_66 | T_0F38 | T_EW1 | T_YMM | T_MUST_EVEX | T_M_K | T_VSIB, 0xA1, 0); }
|
||||
void vpshldd(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F3A | T_EW0 | T_YMM | T_SAE_Z | T_MUST_EVEX | T_B32, 0x71, imm); }
|
||||
void vpshldq(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F3A | T_EW1 | T_YMM | T_SAE_Z | T_MUST_EVEX | T_B64, 0x71, imm); }
|
||||
void vpshldd(const Xmm& x1, const Xmm& x2, const Operand& op, uint8_t imm) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F3A | T_EW0 | T_YMM | T_SAE_Z | T_MUST_EVEX | T_B32, 0x71, imm); }
|
||||
void vpshldq(const Xmm& x1, const Xmm& x2, const Operand& op, uint8_t imm) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F3A | T_EW1 | T_YMM | T_SAE_Z | T_MUST_EVEX | T_B64, 0x71, imm); }
|
||||
void vpshldvd(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F38 | T_EW0 | T_YMM | T_SAE_Z | T_MUST_EVEX | T_B32, 0x71); }
|
||||
void vpshldvq(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F38 | T_EW1 | T_YMM | T_SAE_Z | T_MUST_EVEX | T_B64, 0x71); }
|
||||
void vpshldvw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F38 | T_EW1 | T_YMM | T_SAE_Z | T_MUST_EVEX, 0x70); }
|
||||
void vpshldw(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F3A | T_EW1 | T_YMM | T_SAE_Z | T_MUST_EVEX, 0x70, imm); }
|
||||
void vpshrdd(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F3A | T_EW0 | T_YMM | T_SAE_Z | T_MUST_EVEX | T_B32, 0x73, imm); }
|
||||
void vpshrdq(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F3A | T_EW1 | T_YMM | T_SAE_Z | T_MUST_EVEX | T_B64, 0x73, imm); }
|
||||
void vpshldw(const Xmm& x1, const Xmm& x2, const Operand& op, uint8_t imm) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F3A | T_EW1 | T_YMM | T_SAE_Z | T_MUST_EVEX, 0x70, imm); }
|
||||
void vpshrdd(const Xmm& x1, const Xmm& x2, const Operand& op, uint8_t imm) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F3A | T_EW0 | T_YMM | T_SAE_Z | T_MUST_EVEX | T_B32, 0x73, imm); }
|
||||
void vpshrdq(const Xmm& x1, const Xmm& x2, const Operand& op, uint8_t imm) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F3A | T_EW1 | T_YMM | T_SAE_Z | T_MUST_EVEX | T_B64, 0x73, imm); }
|
||||
void vpshrdvd(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F38 | T_EW0 | T_YMM | T_SAE_Z | T_MUST_EVEX | T_B32, 0x73); }
|
||||
void vpshrdvq(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F38 | T_EW1 | T_YMM | T_SAE_Z | T_MUST_EVEX | T_B64, 0x73); }
|
||||
void vpshrdvw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F38 | T_EW1 | T_YMM | T_SAE_Z | T_MUST_EVEX, 0x72); }
|
||||
void vpshrdw(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F3A | T_EW1 | T_YMM | T_SAE_Z | T_MUST_EVEX, 0x72, imm); }
|
||||
void vpshrdw(const Xmm& x1, const Xmm& x2, const Operand& op, uint8_t imm) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F3A | T_EW1 | T_YMM | T_SAE_Z | T_MUST_EVEX, 0x72, imm); }
|
||||
void vpshufbitqmb(const Opmask& k, const Xmm& x, const Operand& op) { opVex(k, &x, op, T_66 | T_0F38 | T_EW0 | T_YMM | T_MUST_EVEX, 0x8F); }
|
||||
void vpsllvw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F38 | T_EW1 | T_YMM | T_MUST_EVEX, 0x12); }
|
||||
void vpsraq(const Xmm& x, const Operand& op, uint8 imm) { opAVX_X_X_XM(Xmm(x.getKind(), 4), x, op, T_66 | T_0F | T_EW1 | T_YMM | T_MUST_EVEX | T_B64, 0x72, imm); }
|
||||
void vpsraq(const Xmm& x, const Operand& op, uint8_t imm) { opAVX_X_X_XM(Xmm(x.getKind(), 4), x, op, T_66 | T_0F | T_EW1 | T_YMM | T_MUST_EVEX | T_B64, 0x72, imm); }
|
||||
void vpsraq(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_N16 | T_66 | T_0F | T_EW1 | T_YMM | T_MUST_EVEX, 0xE2); }
|
||||
void vpsravq(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F38 | T_EW1 | T_YMM | T_MUST_EVEX | T_B64, 0x46); }
|
||||
void vpsravw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F38 | T_EW1 | T_YMM | T_MUST_EVEX, 0x11); }
|
||||
void vpsrlvw(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F38 | T_EW1 | T_YMM | T_MUST_EVEX, 0x10); }
|
||||
void vpternlogd(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F3A | T_EW0 | T_YMM | T_MUST_EVEX | T_B32, 0x25, imm); }
|
||||
void vpternlogq(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F3A | T_EW1 | T_YMM | T_MUST_EVEX | T_B64, 0x25, imm); }
|
||||
void vpternlogd(const Xmm& x1, const Xmm& x2, const Operand& op, uint8_t imm) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F3A | T_EW0 | T_YMM | T_MUST_EVEX | T_B32, 0x25, imm); }
|
||||
void vpternlogq(const Xmm& x1, const Xmm& x2, const Operand& op, uint8_t imm) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F3A | T_EW1 | T_YMM | T_MUST_EVEX | T_B64, 0x25, imm); }
|
||||
void vptestmb(const Opmask& k, const Xmm& x, const Operand& op) { opAVX_K_X_XM(k, x, op, T_66 | T_0F38 | T_EW0 | T_YMM | T_MUST_EVEX, 0x26); }
|
||||
void vptestmd(const Opmask& k, const Xmm& x, const Operand& op) { opAVX_K_X_XM(k, x, op, T_66 | T_0F38 | T_EW0 | T_YMM | T_MUST_EVEX | T_B32, 0x27); }
|
||||
void vptestmq(const Opmask& k, const Xmm& x, const Operand& op) { opAVX_K_X_XM(k, x, op, T_66 | T_0F38 | T_EW1 | T_YMM | T_MUST_EVEX | T_B64, 0x27); }
|
||||
|
@ -1994,10 +1994,10 @@ void vptestnmq(const Opmask& k, const Xmm& x, const Operand& op) { opAVX_K_X_XM(
|
|||
void vptestnmw(const Opmask& k, const Xmm& x, const Operand& op) { opAVX_K_X_XM(k, x, op, T_F3 | T_0F38 | T_EW1 | T_YMM | T_MUST_EVEX, 0x26); }
|
||||
void vpxord(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F | T_EW0 | T_YMM | T_MUST_EVEX | T_B32, 0xEF); }
|
||||
void vpxorq(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F | T_EW1 | T_YMM | T_MUST_EVEX | T_B64, 0xEF); }
|
||||
void vrangepd(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F3A | T_EW1 | T_YMM | T_SAE_Z | T_MUST_EVEX | T_B64, 0x50, imm); }
|
||||
void vrangeps(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F3A | T_EW0 | T_YMM | T_SAE_Z | T_MUST_EVEX | T_B32, 0x50, imm); }
|
||||
void vrangesd(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, T_N8 | T_66 | T_0F3A | T_EW1 | T_SAE_X | T_MUST_EVEX, 0x51, imm); }
|
||||
void vrangess(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, T_N4 | T_66 | T_0F3A | T_EW0 | T_SAE_X | T_MUST_EVEX, 0x51, imm); }
|
||||
void vrangepd(const Xmm& x1, const Xmm& x2, const Operand& op, uint8_t imm) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F3A | T_EW1 | T_YMM | T_SAE_Z | T_MUST_EVEX | T_B64, 0x50, imm); }
|
||||
void vrangeps(const Xmm& x1, const Xmm& x2, const Operand& op, uint8_t imm) { opAVX_X_X_XM(x1, x2, op, T_66 | T_0F3A | T_EW0 | T_YMM | T_SAE_Z | T_MUST_EVEX | T_B32, 0x50, imm); }
|
||||
void vrangesd(const Xmm& x1, const Xmm& x2, const Operand& op, uint8_t imm) { opAVX_X_X_XM(x1, x2, op, T_N8 | T_66 | T_0F3A | T_EW1 | T_SAE_X | T_MUST_EVEX, 0x51, imm); }
|
||||
void vrangess(const Xmm& x1, const Xmm& x2, const Operand& op, uint8_t imm) { opAVX_X_X_XM(x1, x2, op, T_N4 | T_66 | T_0F3A | T_EW0 | T_SAE_X | T_MUST_EVEX, 0x51, imm); }
|
||||
void vrcp14pd(const Xmm& x, const Operand& op) { opAVX_X_XM_IMM(x, op, T_66 | T_0F38 | T_EW1 | T_YMM | T_MUST_EVEX | T_B64, 0x4C); }
|
||||
void vrcp14ps(const Xmm& x, const Operand& op) { opAVX_X_XM_IMM(x, op, T_66 | T_0F38 | T_EW0 | T_YMM | T_MUST_EVEX | T_B32, 0x4C); }
|
||||
void vrcp14sd(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_N8 | T_66 | T_0F38 | T_EW1 | T_MUST_EVEX, 0x4D); }
|
||||
|
@ -2006,14 +2006,14 @@ void vrcp28pd(const Zmm& z, const Operand& op) { opAVX_X_XM_IMM(z, op, T_66 | T_
|
|||
void vrcp28ps(const Zmm& z, const Operand& op) { opAVX_X_XM_IMM(z, op, T_66 | T_0F38 | T_MUST_EVEX | T_YMM | T_EW0 | T_B32 | T_SAE_Z, 0xCA); }
|
||||
void vrcp28sd(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_N8 | T_66 | T_0F38 | T_EW1 | T_SAE_X | T_MUST_EVEX, 0xCB); }
|
||||
void vrcp28ss(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_N4 | T_66 | T_0F38 | T_EW0 | T_SAE_X | T_MUST_EVEX, 0xCB); }
|
||||
void vreducepd(const Xmm& x, const Operand& op, uint8 imm) { opAVX_X_XM_IMM(x, op, T_66 | T_0F3A | T_EW1 | T_YMM | T_SAE_Z | T_MUST_EVEX | T_B64, 0x56, imm); }
|
||||
void vreduceps(const Xmm& x, const Operand& op, uint8 imm) { opAVX_X_XM_IMM(x, op, T_66 | T_0F3A | T_EW0 | T_YMM | T_SAE_Z | T_MUST_EVEX | T_B32, 0x56, imm); }
|
||||
void vreducesd(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, T_N8 | T_66 | T_0F3A | T_EW1 | T_SAE_X | T_MUST_EVEX, 0x57, imm); }
|
||||
void vreducess(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, T_N4 | T_66 | T_0F3A | T_EW0 | T_SAE_X | T_MUST_EVEX, 0x57, imm); }
|
||||
void vrndscalepd(const Xmm& x, const Operand& op, uint8 imm) { opAVX_X_XM_IMM(x, op, T_66 | T_0F3A | T_EW1 | T_YMM | T_MUST_EVEX | T_B64, 0x09, imm); }
|
||||
void vrndscaleps(const Xmm& x, const Operand& op, uint8 imm) { opAVX_X_XM_IMM(x, op, T_66 | T_0F3A | T_EW0 | T_YMM | T_MUST_EVEX | T_B32, 0x08, imm); }
|
||||
void vrndscalesd(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, T_N8 | T_66 | T_0F3A | T_EW1 | T_MUST_EVEX, 0x0B, imm); }
|
||||
void vrndscaless(const Xmm& x1, const Xmm& x2, const Operand& op, uint8 imm) { opAVX_X_X_XM(x1, x2, op, T_N4 | T_66 | T_0F3A | T_EW0 | T_MUST_EVEX, 0x0A, imm); }
|
||||
void vreducepd(const Xmm& x, const Operand& op, uint8_t imm) { opAVX_X_XM_IMM(x, op, T_66 | T_0F3A | T_EW1 | T_YMM | T_SAE_Z | T_MUST_EVEX | T_B64, 0x56, imm); }
|
||||
void vreduceps(const Xmm& x, const Operand& op, uint8_t imm) { opAVX_X_XM_IMM(x, op, T_66 | T_0F3A | T_EW0 | T_YMM | T_SAE_Z | T_MUST_EVEX | T_B32, 0x56, imm); }
|
||||
void vreducesd(const Xmm& x1, const Xmm& x2, const Operand& op, uint8_t imm) { opAVX_X_X_XM(x1, x2, op, T_N8 | T_66 | T_0F3A | T_EW1 | T_SAE_X | T_MUST_EVEX, 0x57, imm); }
|
||||
void vreducess(const Xmm& x1, const Xmm& x2, const Operand& op, uint8_t imm) { opAVX_X_X_XM(x1, x2, op, T_N4 | T_66 | T_0F3A | T_EW0 | T_SAE_X | T_MUST_EVEX, 0x57, imm); }
|
||||
void vrndscalepd(const Xmm& x, const Operand& op, uint8_t imm) { opAVX_X_XM_IMM(x, op, T_66 | T_0F3A | T_EW1 | T_YMM | T_MUST_EVEX | T_B64, 0x09, imm); }
|
||||
void vrndscaleps(const Xmm& x, const Operand& op, uint8_t imm) { opAVX_X_XM_IMM(x, op, T_66 | T_0F3A | T_EW0 | T_YMM | T_MUST_EVEX | T_B32, 0x08, imm); }
|
||||
void vrndscalesd(const Xmm& x1, const Xmm& x2, const Operand& op, uint8_t imm) { opAVX_X_X_XM(x1, x2, op, T_N8 | T_66 | T_0F3A | T_EW1 | T_MUST_EVEX, 0x0B, imm); }
|
||||
void vrndscaless(const Xmm& x1, const Xmm& x2, const Operand& op, uint8_t imm) { opAVX_X_X_XM(x1, x2, op, T_N4 | T_66 | T_0F3A | T_EW0 | T_MUST_EVEX, 0x0A, imm); }
|
||||
void vrsqrt14pd(const Xmm& x, const Operand& op) { opAVX_X_XM_IMM(x, op, T_66 | T_0F38 | T_EW1 | T_YMM | T_MUST_EVEX | T_B64, 0x4E); }
|
||||
void vrsqrt14ps(const Xmm& x, const Operand& op) { opAVX_X_XM_IMM(x, op, T_66 | T_0F38 | T_EW0 | T_YMM | T_MUST_EVEX | T_B32, 0x4E); }
|
||||
void vrsqrt14sd(const Xmm& x1, const Xmm& x2, const Operand& op) { opAVX_X_X_XM(x1, x2, op, T_N8 | T_66 | T_0F38 | T_EW1 | T_YMM | T_MUST_EVEX, 0x4F); }
|
||||
|
@ -2038,10 +2038,10 @@ void vscatterpf1qpd(const Address& addr) { opGatherFetch(addr, zm6, T_N8 | T_66
|
|||
void vscatterpf1qps(const Address& addr) { opGatherFetch(addr, zm6, T_N4 | T_66 | T_0F38 | T_EW0 | T_MUST_EVEX | T_M_K | T_VSIB, 0xC7, Operand::ZMM); }
|
||||
void vscatterqpd(const Address& addr, const Xmm& x) { opGather2(x, addr, T_N8 | T_66 | T_0F38 | T_EW1 | T_YMM | T_MUST_EVEX | T_M_K | T_VSIB, 0xA3, 0); }
|
||||
void vscatterqps(const Address& addr, const Xmm& x) { opGather2(x, addr, T_N4 | T_66 | T_0F38 | T_EW0 | T_YMM | T_MUST_EVEX | T_M_K | T_VSIB, 0xA3, 2); }
|
||||
void vshuff32x4(const Ymm& y1, const Ymm& y2, const Operand& op, uint8 imm) { opAVX_X_X_XM(y1, y2, op, T_66 | T_0F3A | T_YMM | T_MUST_EVEX | T_EW0 | T_B32, 0x23, imm); }
|
||||
void vshuff64x2(const Ymm& y1, const Ymm& y2, const Operand& op, uint8 imm) { opAVX_X_X_XM(y1, y2, op, T_66 | T_0F3A | T_YMM | T_MUST_EVEX | T_EW1 | T_B64, 0x23, imm); }
|
||||
void vshufi32x4(const Ymm& y1, const Ymm& y2, const Operand& op, uint8 imm) { opAVX_X_X_XM(y1, y2, op, T_66 | T_0F3A | T_YMM | T_MUST_EVEX | T_EW0 | T_B32, 0x43, imm); }
|
||||
void vshufi64x2(const Ymm& y1, const Ymm& y2, const Operand& op, uint8 imm) { opAVX_X_X_XM(y1, y2, op, T_66 | T_0F3A | T_YMM | T_MUST_EVEX | T_EW1 | T_B64, 0x43, imm); }
|
||||
void vshuff32x4(const Ymm& y1, const Ymm& y2, const Operand& op, uint8_t imm) { opAVX_X_X_XM(y1, y2, op, T_66 | T_0F3A | T_YMM | T_MUST_EVEX | T_EW0 | T_B32, 0x23, imm); }
|
||||
void vshuff64x2(const Ymm& y1, const Ymm& y2, const Operand& op, uint8_t imm) { opAVX_X_X_XM(y1, y2, op, T_66 | T_0F3A | T_YMM | T_MUST_EVEX | T_EW1 | T_B64, 0x23, imm); }
|
||||
void vshufi32x4(const Ymm& y1, const Ymm& y2, const Operand& op, uint8_t imm) { opAVX_X_X_XM(y1, y2, op, T_66 | T_0F3A | T_YMM | T_MUST_EVEX | T_EW0 | T_B32, 0x43, imm); }
|
||||
void vshufi64x2(const Ymm& y1, const Ymm& y2, const Operand& op, uint8_t imm) { opAVX_X_X_XM(y1, y2, op, T_66 | T_0F3A | T_YMM | T_MUST_EVEX | T_EW1 | T_B64, 0x43, imm); }
|
||||
#ifdef XBYAK64
|
||||
void kmovq(const Opmask& k, const Reg64& r) { opVex(k, 0, r, T_L0 | T_0F | T_F2 | T_W1, 0x92); }
|
||||
void kmovq(const Reg64& r, const Opmask& k) { opVex(r, 0, k, T_L0 | T_0F | T_F2 | T_W1, 0x93); }
|
||||
|
|
|
@ -80,7 +80,7 @@ typedef enum {
|
|||
CPU detection class
|
||||
*/
|
||||
class Cpu {
|
||||
uint64 type_;
|
||||
uint64_t type_;
|
||||
//system topology
|
||||
bool x2APIC_supported_;
|
||||
static const size_t maxTopologyLevels = 2;
|
||||
|
@ -270,7 +270,7 @@ public:
|
|||
(void)data;
|
||||
#endif
|
||||
}
|
||||
static inline uint64 getXfeature()
|
||||
static inline uint64_t getXfeature()
|
||||
{
|
||||
#ifdef XBYAK_INTEL_CPU_SPECIFIC
|
||||
#ifdef _MSC_VER
|
||||
|
@ -280,13 +280,13 @@ public:
|
|||
// xgetvb is not support on gcc 4.2
|
||||
// __asm__ volatile("xgetbv" : "=a"(eax), "=d"(edx) : "c"(0));
|
||||
__asm__ volatile(".byte 0x0f, 0x01, 0xd0" : "=a"(eax), "=d"(edx) : "c"(0));
|
||||
return ((uint64)edx << 32) | eax;
|
||||
return ((uint64_t)edx << 32) | eax;
|
||||
#endif
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
typedef uint64 Type;
|
||||
typedef uint64_t Type;
|
||||
|
||||
static const Type NONE = 0;
|
||||
static const Type tMMX = 1 << 0;
|
||||
|
@ -323,39 +323,39 @@ public:
|
|||
static const Type tADX = 1 << 28; // adcx, adox
|
||||
static const Type tRDSEED = 1 << 29; // rdseed
|
||||
static const Type tSMAP = 1 << 30; // stac
|
||||
static const Type tHLE = uint64(1) << 31; // xacquire, xrelease, xtest
|
||||
static const Type tRTM = uint64(1) << 32; // xbegin, xend, xabort
|
||||
static const Type tF16C = uint64(1) << 33; // vcvtph2ps, vcvtps2ph
|
||||
static const Type tMOVBE = uint64(1) << 34; // mobve
|
||||
static const Type tAVX512F = uint64(1) << 35;
|
||||
static const Type tAVX512DQ = uint64(1) << 36;
|
||||
static const Type tAVX512_IFMA = uint64(1) << 37;
|
||||
static const Type tHLE = uint64_t(1) << 31; // xacquire, xrelease, xtest
|
||||
static const Type tRTM = uint64_t(1) << 32; // xbegin, xend, xabort
|
||||
static const Type tF16C = uint64_t(1) << 33; // vcvtph2ps, vcvtps2ph
|
||||
static const Type tMOVBE = uint64_t(1) << 34; // mobve
|
||||
static const Type tAVX512F = uint64_t(1) << 35;
|
||||
static const Type tAVX512DQ = uint64_t(1) << 36;
|
||||
static const Type tAVX512_IFMA = uint64_t(1) << 37;
|
||||
static const Type tAVX512IFMA = tAVX512_IFMA;
|
||||
static const Type tAVX512PF = uint64(1) << 38;
|
||||
static const Type tAVX512ER = uint64(1) << 39;
|
||||
static const Type tAVX512CD = uint64(1) << 40;
|
||||
static const Type tAVX512BW = uint64(1) << 41;
|
||||
static const Type tAVX512VL = uint64(1) << 42;
|
||||
static const Type tAVX512_VBMI = uint64(1) << 43;
|
||||
static const Type tAVX512PF = uint64_t(1) << 38;
|
||||
static const Type tAVX512ER = uint64_t(1) << 39;
|
||||
static const Type tAVX512CD = uint64_t(1) << 40;
|
||||
static const Type tAVX512BW = uint64_t(1) << 41;
|
||||
static const Type tAVX512VL = uint64_t(1) << 42;
|
||||
static const Type tAVX512_VBMI = uint64_t(1) << 43;
|
||||
static const Type tAVX512VBMI = tAVX512_VBMI; // changed by Intel's manual
|
||||
static const Type tAVX512_4VNNIW = uint64(1) << 44;
|
||||
static const Type tAVX512_4FMAPS = uint64(1) << 45;
|
||||
static const Type tPREFETCHWT1 = uint64(1) << 46;
|
||||
static const Type tPREFETCHW = uint64(1) << 47;
|
||||
static const Type tSHA = uint64(1) << 48;
|
||||
static const Type tMPX = uint64(1) << 49;
|
||||
static const Type tAVX512_VBMI2 = uint64(1) << 50;
|
||||
static const Type tGFNI = uint64(1) << 51;
|
||||
static const Type tVAES = uint64(1) << 52;
|
||||
static const Type tVPCLMULQDQ = uint64(1) << 53;
|
||||
static const Type tAVX512_VNNI = uint64(1) << 54;
|
||||
static const Type tAVX512_BITALG = uint64(1) << 55;
|
||||
static const Type tAVX512_VPOPCNTDQ = uint64(1) << 56;
|
||||
static const Type tAVX512_BF16 = uint64(1) << 57;
|
||||
static const Type tAVX512_VP2INTERSECT = uint64(1) << 58;
|
||||
static const Type tAMX_TILE = uint64(1) << 59;
|
||||
static const Type tAMX_INT8 = uint64(1) << 60;
|
||||
static const Type tAMX_BF16 = uint64(1) << 61;
|
||||
static const Type tAVX512_4VNNIW = uint64_t(1) << 44;
|
||||
static const Type tAVX512_4FMAPS = uint64_t(1) << 45;
|
||||
static const Type tPREFETCHWT1 = uint64_t(1) << 46;
|
||||
static const Type tPREFETCHW = uint64_t(1) << 47;
|
||||
static const Type tSHA = uint64_t(1) << 48;
|
||||
static const Type tMPX = uint64_t(1) << 49;
|
||||
static const Type tAVX512_VBMI2 = uint64_t(1) << 50;
|
||||
static const Type tGFNI = uint64_t(1) << 51;
|
||||
static const Type tVAES = uint64_t(1) << 52;
|
||||
static const Type tVPCLMULQDQ = uint64_t(1) << 53;
|
||||
static const Type tAVX512_VNNI = uint64_t(1) << 54;
|
||||
static const Type tAVX512_BITALG = uint64_t(1) << 55;
|
||||
static const Type tAVX512_VPOPCNTDQ = uint64_t(1) << 56;
|
||||
static const Type tAVX512_BF16 = uint64_t(1) << 57;
|
||||
static const Type tAVX512_VP2INTERSECT = uint64_t(1) << 58;
|
||||
static const Type tAMX_TILE = uint64_t(1) << 59;
|
||||
static const Type tAMX_INT8 = uint64_t(1) << 60;
|
||||
static const Type tAMX_BF16 = uint64_t(1) << 61;
|
||||
|
||||
Cpu()
|
||||
: type_(NONE)
|
||||
|
@ -410,7 +410,7 @@ public:
|
|||
|
||||
if (type_ & tOSXSAVE) {
|
||||
// check XFEATURE_ENABLED_MASK[2:1] = '11b'
|
||||
uint64 bv = getXfeature();
|
||||
uint64_t bv = getXfeature();
|
||||
if ((bv & 6) == 6) {
|
||||
if (ECX & (1U << 28)) type_ |= tAVX;
|
||||
if (ECX & (1U << 12)) type_ |= tFMA;
|
||||
|
@ -481,7 +481,7 @@ public:
|
|||
|
||||
class Clock {
|
||||
public:
|
||||
static inline uint64 getRdtsc()
|
||||
static inline uint64_t getRdtsc()
|
||||
{
|
||||
#ifdef XBYAK_INTEL_CPU_SPECIFIC
|
||||
#ifdef _MSC_VER
|
||||
|
@ -489,7 +489,7 @@ public:
|
|||
#else
|
||||
unsigned int eax, edx;
|
||||
__asm__ volatile("rdtsc" : "=a"(eax), "=d"(edx));
|
||||
return ((uint64)edx << 32) | eax;
|
||||
return ((uint64_t)edx << 32) | eax;
|
||||
#endif
|
||||
#else
|
||||
// TODO: Need another impl of Clock or rdtsc-equivalent for non-x86 cpu
|
||||
|
@ -511,10 +511,10 @@ public:
|
|||
count_++;
|
||||
}
|
||||
int getCount() const { return count_; }
|
||||
uint64 getClock() const { return clock_; }
|
||||
uint64_t getClock() const { return clock_; }
|
||||
void clear() { count_ = 0; clock_ = 0; }
|
||||
private:
|
||||
uint64 clock_;
|
||||
uint64_t clock_;
|
||||
int count_;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue