mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-19 06:31:18 +00:00
fix rdar://8456371 - Handle commutable instructions written backward.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114536 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
1eb1b68e3a
commit
2c5291b563
@ -911,6 +911,16 @@ ParseInstruction(StringRef Name, SMLoc NameLoc,
|
|||||||
Operands.erase(Operands.begin() + 2);
|
Operands.erase(Operands.begin() + 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FIXME: Hack to handle "f{mul*,add*} st(0), $op" the same as
|
||||||
|
// "f{mul*,add*} $op", since they commute.
|
||||||
|
if ((Name.startswith("fmul") || Name.startswith("fadd")) &&
|
||||||
|
Operands.size() == 3 &&
|
||||||
|
static_cast<X86Operand*>(Operands[1])->isReg() &&
|
||||||
|
static_cast<X86Operand*>(Operands[1])->getReg() == X86::ST0) {
|
||||||
|
delete Operands[1];
|
||||||
|
Operands.erase(Operands.begin() + 1);
|
||||||
|
}
|
||||||
|
|
||||||
// FIXME: Hack to handle "imul <imm>, B" which is an alias for "imul <imm>, B,
|
// FIXME: Hack to handle "imul <imm>, B" which is an alias for "imul <imm>, B,
|
||||||
// B".
|
// B".
|
||||||
if (Name.startswith("imul") && Operands.size() == 3 &&
|
if (Name.startswith("imul") && Operands.size() == 3 &&
|
||||||
|
@ -353,3 +353,11 @@ mov %rdx, %cr8
|
|||||||
mov %rdx, %cr15
|
mov %rdx, %cr15
|
||||||
// CHECK: movq %rdx, %cr15
|
// CHECK: movq %rdx, %cr15
|
||||||
// CHECK: encoding: [0x44,0x0f,0x22,0xfa]
|
// CHECK: encoding: [0x44,0x0f,0x22,0xfa]
|
||||||
|
|
||||||
|
// rdar://8456371 - Handle commutable instructions written backward.
|
||||||
|
// CHECK: faddp %st(1)
|
||||||
|
// CHECK: fmulp %st(2)
|
||||||
|
faddp %st, %st(1)
|
||||||
|
fmulp %st, %st(2)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user