Skip to content

Commit

Permalink
remove cmp of 3-op
Browse files Browse the repository at this point in the history
  • Loading branch information
herumi committed Oct 27, 2023
1 parent e331034 commit 8f49739
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 10 additions & 8 deletions gen/gen_code.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
2 changes: 0 additions & 2 deletions xbyak/xbyak_mnemonic.h
Original file line number Diff line number Diff line change
Expand Up @@ -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); }
Expand Down

0 comments on commit 8f49739

Please sign in to comment.