1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 4
2 ; RUN: llc -verify-machineinstrs -mcpu=pwr7 < %s | FileCheck %s
3 ; RUN: llc -verify-machineinstrs -mcpu=pwr7 -mattr=-isel < %s | FileCheck --check-prefix=CHECK-NO-ISEL %s
4 target datalayout = "E-m:e-i64:64-n32:64"
5 target triple = "powerpc64-unknown-linux-gnu"
7 ; Function Attrs: nounwind readnone
8 define signext i32 @foo(i32 signext %a, i32 signext %b) #0 {
10 ; CHECK: # %bb.0: # %entry
11 ; CHECK-NEXT: cmpw 3, 4
13 ; CHECK-NEXT: li 4, 16
14 ; CHECK-NEXT: isellt 3, 4, 3
17 ; CHECK-NO-ISEL-LABEL: foo:
18 ; CHECK-NO-ISEL: # %bb.0: # %entry
19 ; CHECK-NO-ISEL-NEXT: cmpw 3, 4
20 ; CHECK-NO-ISEL-NEXT: li 3, 16
21 ; CHECK-NO-ISEL-NEXT: bclr 12, 0, 0
22 ; CHECK-NO-ISEL-NEXT: # %bb.1: # %entry
23 ; CHECK-NO-ISEL-NEXT: li 3, 0
24 ; CHECK-NO-ISEL-NEXT: blr
26 %cmp = icmp slt i32 %a, %b
27 %conv = zext i1 %cmp to i32
28 %shl = shl nuw nsw i32 %conv, 4
34 ; Function Attrs: nounwind readnone
35 define signext i32 @foo2(i32 signext %a, i32 signext %b) #0 {
37 ; CHECK: # %bb.0: # %entry
38 ; CHECK-NEXT: cmpw 3, 4
40 ; CHECK-NEXT: li 4, 21
41 ; CHECK-NEXT: isellt 3, 4, 3
44 ; CHECK-NO-ISEL-LABEL: foo2:
45 ; CHECK-NO-ISEL: # %bb.0: # %entry
46 ; CHECK-NO-ISEL-NEXT: cmpw 3, 4
47 ; CHECK-NO-ISEL-NEXT: li 3, 21
48 ; CHECK-NO-ISEL-NEXT: bclr 12, 0, 0
49 ; CHECK-NO-ISEL-NEXT: # %bb.1: # %entry
50 ; CHECK-NO-ISEL-NEXT: li 3, 5
51 ; CHECK-NO-ISEL-NEXT: blr
53 %cmp = icmp slt i32 %a, %b
54 %conv = zext i1 %cmp to i32
55 %shl = shl nuw nsw i32 %conv, 4
56 %add1 = or i32 %shl, 5
62 ; Function Attrs: nounwind readnone
63 define signext i32 @foo3(i32 signext %a, i32 signext %b) #0 {
65 ; CHECK: # %bb.0: # %entry
66 ; CHECK-NEXT: cmpw 3, 4
67 ; CHECK-NEXT: li 3, 16
68 ; CHECK-NEXT: iselgt 3, 0, 3
71 ; CHECK-NO-ISEL-LABEL: foo3:
72 ; CHECK-NO-ISEL: # %bb.0: # %entry
73 ; CHECK-NO-ISEL-NEXT: cmpw 3, 4
74 ; CHECK-NO-ISEL-NEXT: li 3, 0
75 ; CHECK-NO-ISEL-NEXT: bclr 12, 1, 0
76 ; CHECK-NO-ISEL-NEXT: # %bb.1: # %entry
77 ; CHECK-NO-ISEL-NEXT: li 3, 16
78 ; CHECK-NO-ISEL-NEXT: blr
80 %cmp = icmp sle i32 %a, %b
81 %conv = zext i1 %cmp to i32
82 %shl = shl nuw nsw i32 %conv, 4
88 attributes #0 = { nounwind readnone }