llvm.org GIT mirror llvm / 9363f73
Handle lshr for i128 correctly on SPU also when shiftamount > 7. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120288 91177308-0d34-0410-b5e6-96231b3b80d8 Kalle Raiskila 9 years ago
2 changed file(s) with 19 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
27262726 def v8i16: ROTQMBYBIVecInst;
27272727 def v4i32: ROTQMBYBIVecInst;
27282728 def v2i64: ROTQMBYBIVecInst;
2729 def r128: ROTQMBYBIInst<(outs GPRC:$rT), (ins GPRC:$rA, R32C:$rB),
2730 [/*no pattern*/]>;
27292731 }
27302732
27312733 defm ROTQMBYBI: RotateMaskQuadByBitCount;
27612763 defm ROTQMBI: RotateMaskQuadByBits;
27622764
27632765 def : Pat<(srl GPRC:$rA, R32C:$rB),
2764 (ROTQMBIr128 GPRC:$rA,
2765 (SFIr32 R32C:$rB, 0))>;
2766 (ROTQMBYBIr128 (ROTQMBIr128 GPRC:$rA,
2767 (SFIr32 R32C:$rB, 0)),
2768 (SFIr32 R32C:$rB, 0))>;
27662769
27672770
27682771 //-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
99 ; RUN: grep {rotqmbyi } %t1.s | count 1
1010 ; RUN: grep {rotqmbii } %t1.s | count 2
1111 ; RUN: grep {rotqmby } %t1.s | count 1
12 ; RUN: grep {rotqmbi } %t1.s | count 1
12 ; RUN: grep {rotqmbi } %t1.s | count 2
1313 ; RUN: grep {rotqbyi } %t1.s | count 1
1414 ; RUN: grep {rotqbii } %t1.s | count 2
1515 ; RUN: grep {rotqbybi } %t1.s | count 1
16 ; RUN: grep {sfi } %t1.s | count 3
16 ; RUN: grep {sfi } %t1.s | count 4
17 ; RUN: cat %t1.s | FileCheck %s
1718
1819 target datalayout = "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128-i32:32:128-i16:16:128-i8:8:128-i1:8:128-a0:0:128-v128:128:128-s0:128:128"
1920 target triple = "spu"
280281 %2 = trunc i64 %1 to i32
281282 ret i32 %2
282283 }
284
285 ; some random tests
286 define i128 @test_lshr_i128( i128 %val ) {
287 ;CHECK: test_lshr_i128
288 ;CHECK: sfi
289 ;CHECK: rotqmbi
290 ;CHECK: rotqmbybi
291 ;CHECK: bi $lr
292 %rv = lshr i128 %val, 64
293 ret i128 %rv
294 }