mirror of
https://github.com/RPCS3/llvm.git
synced 2025-05-13 17:06:15 +00:00
Intel syntax: There is no need to create unary expr for simple negative displacement.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148486 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
ac0f048602
commit
e60540f380
@ -651,7 +651,7 @@ X86Operand *X86AsmParser::ParseIntelBracExpression(unsigned Size) {
|
|||||||
Scale = Val;
|
Scale = Val;
|
||||||
} else if (getLexer().is(AsmToken::RBrac)) {
|
} else if (getLexer().is(AsmToken::RBrac)) {
|
||||||
const MCExpr *ValExpr = MCConstantExpr::Create(Val, getContext());
|
const MCExpr *ValExpr = MCConstantExpr::Create(Val, getContext());
|
||||||
Disp = isPlus ? ValExpr : MCUnaryExpr::CreateMinus(ValExpr, getContext());
|
Disp = isPlus ? ValExpr : MCConstantExpr::Create(0-Val, getContext());
|
||||||
} else
|
} else
|
||||||
return ErrorOperand(PlusLoc, "unexpected token after +");
|
return ErrorOperand(PlusLoc, "unexpected token after +");
|
||||||
} else if (getLexer().is(AsmToken::Identifier)) {
|
} else if (getLexer().is(AsmToken::Identifier)) {
|
||||||
|
@ -20,3 +20,7 @@
|
|||||||
cmp eax, 12
|
cmp eax, 12
|
||||||
// CHECK: encoding: [0x48,0x83,0xf8,0x0c]
|
// CHECK: encoding: [0x48,0x83,0xf8,0x0c]
|
||||||
cmp rax, 12
|
cmp rax, 12
|
||||||
|
|
||||||
|
// CHECK: encoding: [0x48,0x89,0x44,0x24,0xf0]
|
||||||
|
mov QWORD PTR [RSP - 16], RAX
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user