Fix pattern for MKMSK instruction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158409 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Richard Osborne 2012-06-13 17:59:12 +00:00
parent e91f926f3b
commit aa08c8b2ba
2 changed files with 12 additions and 1 deletions

View File

@ -796,7 +796,7 @@ def MKMSK_rus : _FRUS<(outs GRRegs:$dst), (ins i32imm:$size),
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",

View File

@ -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
}