PowerPC: CTR shouldn't fire if a TLS call is in the loop
[oota-llvm.git] / test / CodeGen / PowerPC / bperm.ll
1 ; RUN: llc -mcpu=pwr7 < %s | FileCheck %s
2 target datalayout = "E-m:e-i64:64-n32:64"
3 target triple = "powerpc64-unknown-linux-gnu"
4
5 ; Function Attrs: nounwind readnone
6 define zeroext i32 @bs4(i32 zeroext %a) #0 {
7 entry:
8   %0 = tail call i32 @llvm.bswap.i32(i32 %a)
9   ret i32 %0
10
11 ; CHECK-LABEL: @bs4
12 ; CHECK: rlwinm [[REG1:[0-9]+]], 3, 8, 0, 31
13 ; CHECK: rlwimi [[REG1]], 3, 24, 16, 23
14 ; CHECK: rlwimi [[REG1]], 3, 24, 0, 7
15 ; CHECK: mr 3, [[REG1]]
16 ; CHECK: blr
17 }
18
19 ; Function Attrs: nounwind readnone
20 define zeroext i32 @test6(i32 zeroext %x) #0 {
21 entry:
22   %and = lshr i32 %x, 16
23   %shr = and i32 %and, 255
24   %and1 = shl i32 %x, 16
25   %shl = and i32 %and1, 16711680
26   %or = or i32 %shr, %shl
27   ret i32 %or
28
29 ; CHECK-LABEL: @test6
30 ; CHECK: rlwinm [[REG1:[0-9]+]], 3, 16, 24, 31
31 ; CHECK: rlwimi [[REG1]], 3, 16, 8, 15
32 ; CHECK: mr 3, [[REG1]]
33 ; CHECK: blr
34 }
35
36 ; Function Attrs: nounwind readnone
37 declare i32 @llvm.bswap.i32(i32) #0
38
39 attributes #0 = { nounwind readnone }
40