From fdd3b30151bc391efce74f4592a9a3bb595565a2 Mon Sep 17 00:00:00 2001 From: Devang Patel Date: Fri, 20 Jan 2012 21:21:01 +0000 Subject: [PATCH] Intel syntax: Parse ... PTR [-8] git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148570 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/X86/AsmParser/X86AsmParser.cpp | 5 +++++ test/MC/X86/intel-syntax-encoding.s | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/Target/X86/AsmParser/X86AsmParser.cpp b/lib/Target/X86/AsmParser/X86AsmParser.cpp index 67c4a647e55..83ab6a604cf 100644 --- a/lib/Target/X86/AsmParser/X86AsmParser.cpp +++ b/lib/Target/X86/AsmParser/X86AsmParser.cpp @@ -669,6 +669,11 @@ X86Operand *X86AsmParser::ParseIntelBracExpression(unsigned Size) { return ErrorOperand(End, "expected ']' token!"); Parser.Lex(); End = Parser.getTok().getLoc(); + + // handle [-42] + if (!BaseReg && !IndexReg) + return X86Operand::CreateMem(Disp, Start, End, Size); + return X86Operand::CreateMem(SegReg, Disp, BaseReg, IndexReg, Scale, Start, End, Size); } diff --git a/test/MC/X86/intel-syntax-encoding.s b/test/MC/X86/intel-syntax-encoding.s index 32e77506029..efd7b6b6669 100644 --- a/test/MC/X86/intel-syntax-encoding.s +++ b/test/MC/X86/intel-syntax-encoding.s @@ -34,4 +34,5 @@ LBB0_3: // CHECK: encoding: [0xeb,A] jmp LBB0_3 - +// CHECK: encoding: [0xf2,0x0f,0x10,0x2c,0x25,0xf8,0xff,0xff,0xff] + movsd XMM5, QWORD PTR [-8]