llvm.org GIT mirror llvm / aa08c8b
Fix pattern for MKMSK instruction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158409 91177308-0d34-0410-b5e6-96231b3b80d8 Richard Osborne 8 years ago
2 changed file(s) with 12 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
795795
796796 def MKMSK_2r : _FRUS<(outs GRRegs:$dst), (ins GRRegs:$size),
797797 "mkmsk $dst, $size",
798 [(set GRRegs:$dst, (add (shl 1, GRRegs:$size), 0xffffffff))]>;
798 [(set GRRegs:$dst, (add (shl 1, GRRegs:$size), -1))]>;
799799
800800 def GETR_rus : _FRUS<(outs GRRegs:$dst), (ins i32imm:$type),
801801 "getr $dst, $type",
0 ; RUN: llc < %s -march=xcore | FileCheck %s
1
2 define i32 @f(i32) nounwind {
3 ; CHECK: f:
4 ; CHECK: mkmsk r0, r0
5 ; CHECK-NEXT: retsp 0
6 entry:
7 %1 = shl i32 1, %0
8 %2 = add i32 %1, -1
9 ret i32 %2
10 }