[llvm-branch-commits] [llvm-branch] r119196 - in /llvm/branches/Apple/whitney: lib/Target/X86/AsmParser/X86AsmParser.cpp test/MC/X86/x86-32.s

Daniel Dunbar daniel at zuster.org
Mon Nov 15 13:43:05 PST 2010


Author: ddunbar
Date: Mon Nov 15 15:43:05 2010
New Revision: 119196

URL: http://llvm.org/viewvc/llvm-project?rev=119196&view=rev
Log:
Merge r117820:
--
Author: Chris Lattner <clattner at apple.com>
Date:   Sat Oct 30 18:13:10 2010 +0000

    fix an encoding mismatch where "sal %eax, 1" was not using the short encoding
    for shl.  Caught by inspection.

Modified:
    llvm/branches/Apple/whitney/lib/Target/X86/AsmParser/X86AsmParser.cpp
    llvm/branches/Apple/whitney/test/MC/X86/x86-32.s

Modified: llvm/branches/Apple/whitney/lib/Target/X86/AsmParser/X86AsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/whitney/lib/Target/X86/AsmParser/X86AsmParser.cpp?rev=119196&r1=119195&r2=119196&view=diff
==============================================================================
--- llvm/branches/Apple/whitney/lib/Target/X86/AsmParser/X86AsmParser.cpp (original)
+++ llvm/branches/Apple/whitney/lib/Target/X86/AsmParser/X86AsmParser.cpp Mon Nov 15 15:43:05 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/branches/Apple/whitney/test/MC/X86/x86-32.s
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/whitney/test/MC/X86/x86-32.s?rev=119196&r1=119195&r2=119196&view=diff
==============================================================================
--- llvm/branches/Apple/whitney/test/MC/X86/x86-32.s (original)
+++ llvm/branches/Apple/whitney/test/MC/X86/x86-32.s Mon Nov 15 15:43:05 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-branch-commits mailing list