[llvm-commits] [llvm] r117820 - in /llvm/trunk: lib/Target/X86/AsmParser/X86AsmParser.cpp test/MC/X86/x86-32.s
Chris Lattner
sabre at nondot.org
Sat Oct 30 11:13:10 PDT 2010
Author: lattner
Date: Sat Oct 30 13:13:10 2010
New Revision: 117820
URL: http://llvm.org/viewvc/llvm-project?rev=117820&view=rev
Log:
fix an encoding mismatch where "sal %eax, 1" was not using the short encoding
for shl. Caught by inspection.
Modified:
llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp
llvm/trunk/test/MC/X86/x86-32.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=117820&r1=117819&r2=117820&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp (original)
+++ llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp Sat Oct 30 13:13:10 2010
@@ -783,7 +783,7 @@
// FIXME: Hack to handle recognize s{hr,ar,hl} $1, <op>. Canonicalize to
// "shift <op>".
if ((Name.startswith("shr") || Name.startswith("sar") ||
- Name.startswith("shl")) &&
+ Name.startswith("shl") || Name.startswith("sal")) &&
Operands.size() == 3) {
X86Operand *Op1 = static_cast<X86Operand*>(Operands[1]);
if (Op1->isImm() && isa<MCConstantExpr>(Op1->getImm()) &&
Modified: llvm/trunk/test/MC/X86/x86-32.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/X86/x86-32.s?rev=117820&r1=117819&r2=117820&view=diff
==============================================================================
--- llvm/trunk/test/MC/X86/x86-32.s (original)
+++ llvm/trunk/test/MC/X86/x86-32.s Sat Oct 30 13:13:10 2010
@@ -57,6 +57,11 @@
// CHECK: shrl %eax # encoding: [0xd1,0xe8]
shrl $1, %eax
+// CHECK: shll %eax # encoding: [0xd1,0xe0]
+ sall $1, %eax
+// CHECK: shll %eax # encoding: [0xd1,0xe0]
+ sal $1, %eax
+
// moffset forms of moves, rdar://7947184
movb 0, %al // CHECK: movb 0, %al # encoding: [0xa0,A,A,A,A]
movw 0, %ax // CHECK: movw 0, %ax # encoding: [0x66,0xa1,A,A,A,A]
More information about the llvm-commits
mailing list