1; RUN: llc -mcpu=pwr7 < %s | FileCheck %s 2target datalayout = "E-m:e-i64:64-n32:64" 3target triple = "powerpc64-unknown-linux-gnu" 4 5; Function Attrs: nounwind readnone 6define signext i32 @foo(i32 signext %a, i32 signext %b) #0 { 7entry: 8 %cmp = icmp slt i32 %a, %b 9 %conv = zext i1 %cmp to i32 10 %shl = shl nuw nsw i32 %conv, 4 11 ret i32 %shl 12 13; CHECK-LABEL: @foo 14; CHECK-DAG: cmpw 15; CHECK-DAG: li [[REG1:[0-9]+]], 0 16; CHECK-DAG: li [[REG2:[0-9]+]], 16 17; CHECK: isel 3, [[REG2]], [[REG1]], 18; CHECK: blr 19} 20 21; Function Attrs: nounwind readnone 22define signext i32 @foo2(i32 signext %a, i32 signext %b) #0 { 23entry: 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 28 ret i32 %add1 29 30; CHECK-LABEL: @foo2 31; CHECK-DAG: cmpw 32; CHECK-DAG: li [[REG1:[0-9]+]], 5 33; CHECK-DAG: li [[REG2:[0-9]+]], 21 34; CHECK: isel 3, [[REG2]], [[REG1]], 35; CHECK: blr 36} 37 38; Function Attrs: nounwind readnone 39define signext i32 @foo3(i32 signext %a, i32 signext %b) #0 { 40entry: 41 %cmp = icmp sle i32 %a, %b 42 %conv = zext i1 %cmp to i32 43 %shl = shl nuw nsw i32 %conv, 4 44 ret i32 %shl 45 46; CHECK-LABEL: @foo3 47; CHECK-DAG: cmpw 48; CHECK-DAG: li [[REG1:[0-9]+]], 16 49; CHECK: isel 3, 0, [[REG1]], 50; CHECK: blr 51} 52 53attributes #0 = { nounwind readnone } 54 55