1 ; RUN: llc -verify-machineinstrs -mcpu=pwr7 < %s | FileCheck %s
2 ; RUN: llc -verify-machineinstrs -mcpu=pwr7 -ppc-gen-isel=false < %s | FileCheck --check-prefix=CHECK-NO-ISEL %s
3 target datalayout = "E-m:e-i64:64-n32:64"
4 target triple = "powerpc64-unknown-linux-gnu"
6 ; Function Attrs: nounwind readnone
7 define signext i32 @foo(i32 signext %a, i32 signext %b) #0 {
9 %cmp = icmp slt i32 %a, %b
10 %conv = zext i1 %cmp to i32
11 %shl = shl nuw nsw i32 %conv, 4
15 ; CHECK-NO-ISEL-LABEL: @foo
17 ; CHECK-DAG: li [[REG1:[0-9]+]], 0
18 ; CHECK-DAG: li [[REG2:[0-9]+]], 16
19 ; CHECK: isel 3, [[REG2]], [[REG1]],
22 ; CHECK-NO-ISEL: bclr 12, 0, 0
23 ; CHECK-NO-ISEL: ori 3, 5, 0
24 ; CHECK-NO-ISEL-NEXT: blr
27 ; Function Attrs: nounwind readnone
28 define signext i32 @foo2(i32 signext %a, i32 signext %b) #0 {
30 %cmp = icmp slt i32 %a, %b
31 %conv = zext i1 %cmp to i32
32 %shl = shl nuw nsw i32 %conv, 4
33 %add1 = or i32 %shl, 5
37 ; CHECK-NO-ISEL-LABEL: @foo2
39 ; CHECK-DAG: li [[REG1:[0-9]+]], 5
40 ; CHECK-DAG: li [[REG2:[0-9]+]], 21
41 ; CHECK: isel 3, [[REG2]], [[REG1]],
44 ; CHECK-NO-ISEL: bclr 12, 0, 0
45 ; CHECK-NO-ISEL: ori 3, 5, 0
46 ; CHECK-NO-ISEL-NEXT: blr
49 ; Function Attrs: nounwind readnone
50 define signext i32 @foo3(i32 signext %a, i32 signext %b) #0 {
52 %cmp = icmp sle i32 %a, %b
53 %conv = zext i1 %cmp to i32
54 %shl = shl nuw nsw i32 %conv, 4
58 ; CHECK-NO-ISEL-LABEL: @foo3
60 ; CHECK-DAG: li [[REG1:[0-9]+]], 16
61 ; CHECK: isel 3, 0, [[REG1]],
64 ; CHECK-NO-ISEL: bc 12, 1, [[TRUE:.LBB[0-9]+]]
65 ; CHECK-NO-ISEL: ori 3, 5, 0
66 ; CHECK-NO-ISEL-NEXT: blr
67 ; CHECK-NO-ISEL-NEXT: [[TRUE]]
68 ; CHECK-NO-ISEL-NEXT: addi 3, 0, 0
69 ; CHECK-NO-ISEL-NEXT: blr
72 attributes #0 = { nounwind readnone }