[llvm-commits] [llvm] r148321 - in /llvm/trunk: lib/Target/X86/AsmParser/X86AsmParser.cpp test/MC/X86/intel-syntax.s

Devang Patel dpatel at apple.com
Tue Jan 17 11:08:08 PST 2012


Author: dpatel
Date: Tue Jan 17 13:08:07 2012
New Revision: 148321

URL: http://llvm.org/viewvc/llvm-project?rev=148321&view=rev
Log:
Intel syntax: Do not unncessarily create plus expression for memory operand displacement.

Modified:
    llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp
    llvm/trunk/test/MC/X86/intel-syntax.s

Modified: llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp?rev=148321&r1=148320&r2=148321&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp (original)
+++ llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp Tue Jan 17 13:08:07 2012
@@ -634,8 +634,7 @@
 	Scale = Val;
       } else if (getLexer().is(AsmToken::RBrac)) {
 	const MCExpr *ValExpr = MCConstantExpr::Create(Val, getContext());
-	Disp = isPlus ? MCUnaryExpr::CreatePlus(ValExpr, getContext()) :
-	  MCUnaryExpr::CreateMinus(ValExpr, getContext());
+	Disp = isPlus ? ValExpr : MCUnaryExpr::CreateMinus(ValExpr, getContext());
       } else
 	return ErrorOperand(PlusLoc, "unexpected token after +");
     }

Modified: llvm/trunk/test/MC/X86/intel-syntax.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/X86/intel-syntax.s?rev=148321&r1=148320&r2=148321&view=diff
==============================================================================
--- llvm/trunk/test/MC/X86/intel-syntax.s (original)
+++ llvm/trunk/test/MC/X86/intel-syntax.s Tue Jan 17 13:08:07 2012
@@ -7,6 +7,8 @@
 _main:
 // CHECK:	movl	$257, -4(%rsp)
 	mov	DWORD PTR [RSP - 4], 257
+// CHECK:	movl	$258, 4(%rsp)
+	mov	DWORD PTR [RSP + 4], 258
 // CHECK:	movq	$123, -16(%rsp)
 	mov	QWORD PTR [RSP - 16], 123
 // CHECK:	movb	$97, -17(%rsp)





More information about the llvm-commits mailing list