mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-05 13:26:55 +00:00
Various x86 disassembler fixes.
Add VEX_LIG to scalar FMA4 instructions. Use VEX_LIG in some of the inheriting checks in disassembler table generator. Make use of VEX_L_W, VEX_L_W_XS, VEX_L_W_XD contexts. Don't let VEX_L_W, VEX_L_W_XS, VEX_L_W_XD, VEX_L_W_OPSIZE inherit from their non-L forms unless VEX_LIG is set. Let VEX_L_W, VEX_L_W_XS, VEX_L_W_XD, VEX_L_W_OPSIZE inherit from all of their non-L or non-W cases. Increase ranking on VEX_L_W, VEX_L_W_XS, VEX_L_W_XD, VEX_L_W_OPSIZE so they get chosen over non-L/non-W forms. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191649 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -828,42 +828,6 @@ static int getID(struct InternalInstruction* insn, const void *miiArg) {
|
||||
|
||||
/* The following clauses compensate for limitations of the tables. */
|
||||
|
||||
if ((attrMask & ATTR_VEXL) && (attrMask & ATTR_REXW) &&
|
||||
!(attrMask & ATTR_OPSIZE)) {
|
||||
/*
|
||||
* Some VEX instructions ignore the L-bit, but use the W-bit. Normally L-bit
|
||||
* has precedence since there are no L-bit with W-bit entries in the tables.
|
||||
* So if the L-bit isn't significant we should use the W-bit instead.
|
||||
* We only need to do this if the instruction doesn't specify OpSize since
|
||||
* there is a VEX_L_W_OPSIZE table.
|
||||
*/
|
||||
|
||||
const struct InstructionSpecifier *spec;
|
||||
uint16_t instructionIDWithWBit;
|
||||
const struct InstructionSpecifier *specWithWBit;
|
||||
|
||||
spec = specifierForUID(instructionID);
|
||||
|
||||
if (getIDWithAttrMask(&instructionIDWithWBit,
|
||||
insn,
|
||||
(attrMask & (~ATTR_VEXL)) | ATTR_REXW)) {
|
||||
insn->instructionID = instructionID;
|
||||
insn->spec = spec;
|
||||
return 0;
|
||||
}
|
||||
|
||||
specWithWBit = specifierForUID(instructionIDWithWBit);
|
||||
|
||||
if (instructionID != instructionIDWithWBit) {
|
||||
insn->instructionID = instructionIDWithWBit;
|
||||
insn->spec = specWithWBit;
|
||||
} else {
|
||||
insn->instructionID = instructionID;
|
||||
insn->spec = spec;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (insn->prefixPresent[0x66] && !(attrMask & ATTR_OPSIZE)) {
|
||||
/*
|
||||
* The instruction tables make no distinction between instructions that
|
||||
|
@@ -116,10 +116,10 @@ enum attributeBits {
|
||||
ENUM_ENTRY(IC_VEX_L_XS, 4, "requires VEX and the L and XS prefix")\
|
||||
ENUM_ENTRY(IC_VEX_L_XD, 4, "requires VEX and the L and XD prefix")\
|
||||
ENUM_ENTRY(IC_VEX_L_OPSIZE, 4, "requires VEX, L, and OpSize") \
|
||||
ENUM_ENTRY(IC_VEX_L_W, 3, "requires VEX, L and W") \
|
||||
ENUM_ENTRY(IC_VEX_L_W_XS, 4, "requires VEX, L, W and XS prefix") \
|
||||
ENUM_ENTRY(IC_VEX_L_W_XD, 4, "requires VEX, L, W and XD prefix") \
|
||||
ENUM_ENTRY(IC_VEX_L_W_OPSIZE, 4, "requires VEX, L, W and OpSize") \
|
||||
ENUM_ENTRY(IC_VEX_L_W, 4, "requires VEX, L and W") \
|
||||
ENUM_ENTRY(IC_VEX_L_W_XS, 5, "requires VEX, L, W and XS prefix") \
|
||||
ENUM_ENTRY(IC_VEX_L_W_XD, 5, "requires VEX, L, W and XD prefix") \
|
||||
ENUM_ENTRY(IC_VEX_L_W_OPSIZE, 5, "requires VEX, L, W and OpSize") \
|
||||
ENUM_ENTRY(IC_EVEX, 1, "requires an EVEX prefix") \
|
||||
ENUM_ENTRY(IC_EVEX_XS, 2, "requires EVEX and the XS prefix") \
|
||||
ENUM_ENTRY(IC_EVEX_XD, 2, "requires EVEX and the XD prefix") \
|
||||
|
Reference in New Issue
Block a user