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"
5 ; Function Attrs: nounwind readnone
6 define signext i32 @crbitsoff(i32 signext %v1, i32 signext %v2) #0 {
8 %tobool = icmp ne i32 %v1, 0
9 %lnot = icmp eq i32 %v2, 0
10 %and3 = and i1 %tobool, %lnot
11 %and = zext i1 %and3 to i32
14 ; CHECK-LABEL: @crbitsoff
15 ; CHECK-DAG: cmplwi {{[0-9]+}}, 3, 0
16 ; CHECK-DAG: li [[REG2:[0-9]+]], 1
17 ; CHECK-DAG: cntlzw [[REG3:[0-9]+]],
18 ; CHECK: isel 3, 0, [[REG2]]
19 ; CHECK: and 3, 3, [[REG3]]
23 define signext i32 @crbitson(i32 signext %v1, i32 signext %v2) #1 {
25 %tobool = icmp ne i32 %v1, 0
26 %lnot = icmp eq i32 %v2, 0
27 %and3 = and i1 %tobool, %lnot
28 %and = zext i1 %and3 to i32
31 ; CHECK-LABEL: @crbitson
32 ; CHECK-DAG: cmpwi {{[0-9]+}}, 3, 0
33 ; CHECK-DAG: cmpwi {{[0-9]+}}, 4, 0
34 ; CHECK-DAG: li [[REG2:[0-9]+]], 1
35 ; CHECK-DAG: crorc [[REG3:[0-9]+]],
36 ; CHECK: isel 3, 0, [[REG2]], [[REG3]]
41 attributes #0 = { nounwind readnone "target-features"="-crbits" }
42 attributes #1 = { nounwind readnone }