diff --git a/gen/gen_code.cpp b/gen/gen_code.cpp index 92c0ae95..7fbb9af1 100644 --- a/gen/gen_code.cpp +++ b/gen/gen_code.cpp @@ -799,20 +799,22 @@ void put() uint8_t code; // (reg, reg) uint8_t ext; // (reg, imm) const char *name; + bool support3op; } tbl[] = { - { 0x10, 2, "adc" }, - { 0x00, 0, "add" }, - { 0x20, 4, "and_" }, - { 0x38, 7, "cmp" }, - { 0x08, 1, "or_" }, - { 0x18, 3, "sbb" }, - { 0x28, 5, "sub" }, - { 0x30, 6, "xor_" }, + { 0x10, 2, "adc", true }, + { 0x00, 0, "add", true }, + { 0x20, 4, "and_", true }, + { 0x38, 7, "cmp", false }, + { 0x08, 1, "or_", true }, + { 0x18, 3, "sbb", true }, + { 0x28, 5, "sub", true }, + { 0x30, 6, "xor_", true }, }; 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_t imm) { opRM_I(op, imm, 0x%02X, %d); }\n", p->name, p->code, p->ext); + if (!p->support3op) continue; printf("void %s(const Reg& d, const Operand& op1, const Operand& op2) { opROO(d, op1, op2, 0x%02X); }\n", p->name, p->code); printf("void %s(const Reg& d, const Operand& op, uint32_t imm) { opROI(d, op, imm, %d); }\n", p->name, p->ext); } diff --git a/xbyak/xbyak_mnemonic.h b/xbyak/xbyak_mnemonic.h index fdb0f771..42872c7f 100644 --- a/xbyak/xbyak_mnemonic.h +++ b/xbyak/xbyak_mnemonic.h @@ -106,8 +106,6 @@ void cmovs(const Reg& reg, const Operand& op) { opModRM(reg, op, op.isREG(16 | i 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_t imm) { opRM_I(op, imm, 0x38, 7); } void cmp(const Operand& op1, const Operand& op2) { opRM_RM(op1, op2, 0x38); } -void cmp(const Reg& d, const Operand& op, uint32_t imm) { opROI(d, op, imm, 7); } -void cmp(const Reg& d, const Operand& op1, const Operand& op2) { opROO(d, 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); } void cmpeqsd(const Xmm& x, const Operand& op) { cmpsd(x, op, 0); }