mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-22 20:20:03 +00:00
add support for the commuted form of the test instruction, rdar://8018260.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113352 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
ba8e81cca2
commit
c8ae35a8e8
@ -856,6 +856,16 @@ ParseInstruction(StringRef Name, SMLoc NameLoc,
|
||||
std::swap(Operands[1], Operands[2]);
|
||||
}
|
||||
|
||||
// The assembler accepts "testX <reg>, <mem>" and "testX <mem>, <reg>" as
|
||||
// synonyms. Our tables only have the "<mem>, <reg>" form, so if we see the
|
||||
// other operand order, swap them.
|
||||
if (Name == "testb" || Name == "testw" || Name == "testl" || Name == "testq")
|
||||
if (Operands.size() == 3 &&
|
||||
static_cast<X86Operand*>(Operands[1])->isReg() &&
|
||||
static_cast<X86Operand*>(Operands[2])->isMem()) {
|
||||
std::swap(Operands[1], Operands[2]);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -452,3 +452,10 @@ sysret
|
||||
sysretl
|
||||
// CHECK: sysretl
|
||||
// CHECK: encoding: [0x0f,0x07]
|
||||
|
||||
// rdar://8018260
|
||||
testl %ecx, -24(%ebp)
|
||||
// CHECK: testl -24(%ebp), %ecx
|
||||
testl -24(%ebp), %ecx
|
||||
// CHECK: testl -24(%ebp), %ecx
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user