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 @foo(i32 signext %a, i32 signext %b) #0 {
8 %cmp = icmp slt i32 %a, %b
9 %conv = zext i1 %cmp to i32
10 %shl = shl nuw nsw i32 %conv, 4
15 ; CHECK-DAG: li [[REG1:[0-9]+]], 0
16 ; CHECK-DAG: li [[REG2:[0-9]+]], 16
17 ; CHECK: isel 3, [[REG2]], [[REG1]],
21 ; Function Attrs: nounwind readnone
22 define signext i32 @foo2(i32 signext %a, i32 signext %b) #0 {
24 %cmp = icmp slt i32 %a, %b
25 %conv = zext i1 %cmp to i32
26 %shl = shl nuw nsw i32 %conv, 4
27 %add1 = or i32 %shl, 5
32 ; CHECK-DAG: li [[REG1:[0-9]+]], 5
33 ; CHECK-DAG: li [[REG2:[0-9]+]], 21
34 ; CHECK: isel 3, [[REG2]], [[REG1]],
38 ; Function Attrs: nounwind readnone
39 define signext i32 @foo3(i32 signext %a, i32 signext %b) #0 {
41 %cmp = icmp sle i32 %a, %b
42 %conv = zext i1 %cmp to i32
43 %shl = shl nuw nsw i32 %conv, 4
48 ; CHECK-DAG: li [[REG1:[0-9]+]], 16
49 ; CHECK: isel 3, 0, [[REG1]],
53 attributes #0 = { nounwind readnone }