[llvm-commits] [llvm] r158409 - in /llvm/trunk: lib/Target/XCore/XCoreInstrInfo.td test/CodeGen/XCore/mkmsk.ll

Richard Osborne richard at xmos.com
Wed Jun 13 10:59:12 PDT 2012


Author: friedgold
Date: Wed Jun 13 12:59:12 2012
New Revision: 158409

URL: http://llvm.org/viewvc/llvm-project?rev=158409&view=rev
Log:
Fix pattern for MKMSK instruction.

Added:
    llvm/trunk/test/CodeGen/XCore/mkmsk.ll
Modified:
    llvm/trunk/lib/Target/XCore/XCoreInstrInfo.td

Modified: llvm/trunk/lib/Target/XCore/XCoreInstrInfo.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/XCore/XCoreInstrInfo.td?rev=158409&r1=158408&r2=158409&view=diff
==============================================================================
--- llvm/trunk/lib/Target/XCore/XCoreInstrInfo.td (original)
+++ llvm/trunk/lib/Target/XCore/XCoreInstrInfo.td Wed Jun 13 12:59:12 2012
@@ -796,7 +796,7 @@
 
 def MKMSK_2r : _FRUS<(outs GRRegs:$dst), (ins GRRegs:$size),
                  "mkmsk $dst, $size",
-                 [(set GRRegs:$dst, (add (shl 1, GRRegs:$size), 0xffffffff))]>;
+                 [(set GRRegs:$dst, (add (shl 1, GRRegs:$size), -1))]>;
 
 def GETR_rus : _FRUS<(outs GRRegs:$dst), (ins i32imm:$type),
                  "getr $dst, $type",

Added: llvm/trunk/test/CodeGen/XCore/mkmsk.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/XCore/mkmsk.ll?rev=158409&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/XCore/mkmsk.ll (added)
+++ llvm/trunk/test/CodeGen/XCore/mkmsk.ll Wed Jun 13 12:59:12 2012
@@ -0,0 +1,11 @@
+; RUN: llc < %s -march=xcore | FileCheck %s
+
+define i32 @f(i32) nounwind {
+; CHECK: f:
+; CHECK: mkmsk r0, r0
+; CHECK-NEXT: retsp 0
+entry:
+  %1 = shl i32 1, %0
+  %2 = add i32 %1, -1
+  ret i32 %2
+}





More information about the llvm-commits mailing list