[PATCH] Sparc assembler should accept parenthesized constant expressions.
Douglas Katzman
dougk at google.com
Wed Apr 29 11:51:48 PDT 2015
REPOSITORY
rL LLVM
http://reviews.llvm.org/D9087
Files:
llvm/trunk/lib/Target/Sparc/AsmParser/SparcAsmParser.cpp
llvm/trunk/test/MC/Sparc/sparc-assembly-exprs.s
Index: llvm/trunk/lib/Target/Sparc/AsmParser/SparcAsmParser.cpp
===================================================================
--- llvm/trunk/lib/Target/Sparc/AsmParser/SparcAsmParser.cpp
+++ llvm/trunk/lib/Target/Sparc/AsmParser/SparcAsmParser.cpp
@@ -682,6 +682,7 @@
case AsmToken::Minus:
case AsmToken::Integer:
+ case AsmToken::LParen:
if (!getParser().parseExpression(EVal, E))
Op = SparcOperand::CreateImm(EVal, S, E);
break;
Index: llvm/trunk/test/MC/Sparc/sparc-assembly-exprs.s
===================================================================
--- llvm/trunk/test/MC/Sparc/sparc-assembly-exprs.s
+++ llvm/trunk/test/MC/Sparc/sparc-assembly-exprs.s
@@ -0,0 +1,6 @@
+! RUN: llvm-mc %s -arch=sparc -show-encoding | FileCheck %s
+
+ ! CHECK: mov 1033, %o1 ! encoding: [0x92,0x10,0x24,0x09]
+ mov (0x400|9), %o1
+ ! CHECK: mov 60, %o2 ! encoding: [0x94,0x10,0x20,0x3c]
+ mov (12+3<<2), %o2
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D9087.24649.patch
Type: text/x-patch
Size: 971 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150429/b1aada0c/attachment.bin>
More information about the llvm-commits
mailing list