forked from OSchip/llvm-project
[x86] Simplify detection of jcxz/jecxz/jrcxz in disassembler.
llvm-svn: 225035
This commit is contained in:
parent
f89dc3edc9
commit
6e518776e3
|
@ -975,27 +975,16 @@ static int getID(struct InternalInstruction* insn, const void *miiArg) {
|
||||||
if (insn->rexPrefix & 0x08)
|
if (insn->rexPrefix & 0x08)
|
||||||
attrMask |= ATTR_REXW;
|
attrMask |= ATTR_REXW;
|
||||||
|
|
||||||
if (getIDWithAttrMask(&instructionID, insn, attrMask))
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* JCXZ/JECXZ need special handling for 16-bit mode because the meaning
|
* JCXZ/JECXZ need special handling for 16-bit mode because the meaning
|
||||||
* of the AdSize prefix is inverted w.r.t. 32-bit mode.
|
* of the AdSize prefix is inverted w.r.t. 32-bit mode.
|
||||||
*/
|
*/
|
||||||
if (insn->mode == MODE_16BIT && insn->opcode == 0xE3) {
|
if (insn->mode == MODE_16BIT && insn->opcodeType == ONEBYTE &&
|
||||||
const struct InstructionSpecifier *spec;
|
insn->opcode == 0xE3)
|
||||||
spec = specifierForUID(instructionID);
|
attrMask ^= ATTR_ADSIZE;
|
||||||
|
|
||||||
/*
|
if (getIDWithAttrMask(&instructionID, insn, attrMask))
|
||||||
* Check for Ii8PCRel instructions. We could alternatively do a
|
return -1;
|
||||||
* string-compare on the names, but this is probably cheaper.
|
|
||||||
*/
|
|
||||||
if (x86OperandSets[spec->operands][0].type == TYPE_REL8) {
|
|
||||||
attrMask ^= ATTR_ADSIZE;
|
|
||||||
if (getIDWithAttrMask(&instructionID, insn, attrMask))
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* The following clauses compensate for limitations of the tables. */
|
/* The following clauses compensate for limitations of the tables. */
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue