mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-06 06:33:24 +00:00
Intel syntax: Robustify parsing of memory operand's displacement experssion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148737 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c1bddefc56
commit
f2d213745e
@ -655,8 +655,13 @@ X86Operand *X86AsmParser::ParseIntelBracExpression(unsigned SegReg,
|
||||
Disp = isPlus ? ValExpr : MCConstantExpr::Create(0-Val, getContext());
|
||||
} else
|
||||
return ErrorOperand(PlusLoc, "unexpected token after +");
|
||||
} else if (getLexer().is(AsmToken::Identifier))
|
||||
ParseRegister(IndexReg, Start, End);
|
||||
} else if (getLexer().is(AsmToken::Identifier)) {
|
||||
// This could be an index registor or a displacement expression.
|
||||
End = Parser.getTok().getLoc();
|
||||
if (!IndexReg)
|
||||
ParseRegister(IndexReg, Start, End);
|
||||
else if (getParser().ParseExpression(Disp, End)) return 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (getLexer().isNot(AsmToken::RBrac))
|
||||
|
@ -56,7 +56,9 @@ _main:
|
||||
// CHECK: fld %st(0)
|
||||
fld ST(0)
|
||||
// CHECK: movl %fs:(%rdi), %eax
|
||||
mov EAX, DWORD PTR FS:[RDI]
|
||||
mov EAX, DWORD PTR FS:[RDI]
|
||||
// CHECK: leal (,%rdi,4), %r8d
|
||||
lea R8D, DWORD PTR [4*RDI]
|
||||
lea R8D, DWORD PTR [4*RDI]
|
||||
// CHECK: movl _fnan(,%ecx,4), %ecx
|
||||
mov ECX, DWORD PTR [4*ECX + _fnan]
|
||||
ret
|
||||
|
Loading…
x
Reference in New Issue
Block a user