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: isellt 3, [[REG2]], [[REG1]]
22 ; CHECK-NO-ISEL: bc 12, 0,
24 ; CHECK-NO-ISEL: addi 3, 4, 0
25 ; CHECK-NO-ISEL-NEXT: blr
28 ; Function Attrs: nounwind readnone
29 define signext i32 @foo2(i32 signext %a, i32 signext %b) #0 {
31 %cmp = icmp slt i32 %a, %b
32 %conv = zext i1 %cmp to i32
33 %shl = shl nuw nsw i32 %conv, 4
34 %add1 = or i32 %shl, 5
38 ; CHECK-NO-ISEL-LABEL: @foo2
40 ; CHECK-DAG: li [[REG1:[0-9]+]], 5
41 ; CHECK-DAG: li [[REG2:[0-9]+]], 21
42 ; CHECK: isellt 3, [[REG2]], [[REG1]]
45 ; CHECK-NO-ISEL: bc 12, 0,
47 ; CHECK-NO-ISEL: addi 3, 4, 0
48 ; CHECK-NO-ISEL-NEXT: blr
51 ; Function Attrs: nounwind readnone
52 define signext i32 @foo3(i32 signext %a, i32 signext %b) #0 {
54 %cmp = icmp sle i32 %a, %b
55 %conv = zext i1 %cmp to i32
56 %shl = shl nuw nsw i32 %conv, 4
60 ; CHECK-NO-ISEL-LABEL: @foo3
62 ; CHECK-DAG: li [[REG1:[0-9]+]], 16
63 ; CHECK: iselgt 3, 0, [[REG1]]
66 ; CHECK-NO-ISEL: bc 12, 1, [[TRUE:.LBB[0-9]+]]
67 ; CHECK-NO-ISEL-NEXT: blr
68 ; CHECK-NO-ISEL-NEXT: [[TRUE]]
69 ; CHECK-NO-ISEL-NEXT: li 3, 0
70 ; CHECK-NO-ISEL-NEXT: blr
73 attributes #0 = { nounwind readnone }