1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 3
2 ; RUN: llc -verify-machineinstrs -mcpu=pwr7 < %s | FileCheck %s
3 ; RUN: llc -verify-machineinstrs -O1 -mcpu=pwr7 < %s | FileCheck %s
4 ; RUN: llc -verify-machineinstrs -mcpu=pwr7 -ppc-gen-isel=false < %s | FileCheck --check-prefix=CHECK-NO-ISEL %s
5 ; RUN: llc -verify-machineinstrs -O1 -mcpu=pwr7 -ppc-gen-isel=false < %s | FileCheck --check-prefix=CHECK-NO-ISEL %s
7 target datalayout = "E-m:e-i64:64-n32:64"
8 target triple = "powerpc64-unknown-linux-gnu"
10 define zeroext i1 @testi1(i1 zeroext %b1, i1 zeroext %b2) #0 {
11 ; CHECK-LABEL: testi1:
12 ; CHECK: # %bb.0: # %entry
13 ; CHECK-NEXT: andi. 3, 3, 1
14 ; CHECK-NEXT: crmove 20, 1
15 ; CHECK-NEXT: andi. 3, 4, 1
19 ; CHECK-NEXT: crand 20, 20, 1
21 ; CHECK-NEXT: isel 3, 4, 3, 20
24 ; CHECK-NO-ISEL-LABEL: testi1:
25 ; CHECK-NO-ISEL: # %bb.0: # %entry
26 ; CHECK-NO-ISEL-NEXT: andi. 3, 3, 1
27 ; CHECK-NO-ISEL-NEXT: crmove 20, 1
28 ; CHECK-NO-ISEL-NEXT: andi. 3, 4, 1
29 ; CHECK-NO-ISEL-NEXT: li 3, 0
30 ; CHECK-NO-ISEL-NEXT: li 4, 1
31 ; CHECK-NO-ISEL-NEXT: #APP
32 ; CHECK-NO-ISEL-NEXT: crand 20, 20, 1
33 ; CHECK-NO-ISEL-NEXT: #NO_APP
34 ; CHECK-NO-ISEL-NEXT: bc 12, 20, .LBB0_1
35 ; CHECK-NO-ISEL-NEXT: blr
36 ; CHECK-NO-ISEL-NEXT: .LBB0_1: # %entry
37 ; CHECK-NO-ISEL-NEXT: addi 3, 4, 0
38 ; CHECK-NO-ISEL-NEXT: blr
40 %0 = tail call i8 asm "crand $0, $1, $2", "=^wc,^wc,^wc"(i1 %b1, i1 %b2) #0
42 %tobool3 = icmp ne i8 %1, 0
47 define signext i32 @testi32(i32 signext %b1, i32 signext %b2) #0 {
48 ; CHECK-LABEL: testi32:
49 ; CHECK: # %bb.0: # %entry
50 ; CHECK-NEXT: andi. 3, 3, 1
51 ; CHECK-NEXT: crmove 20, 1
52 ; CHECK-NEXT: andi. 3, 4, 1
54 ; CHECK-NEXT: li 4, -1
56 ; CHECK-NEXT: crand 20, 20, 1
58 ; CHECK-NEXT: isel 3, 4, 3, 20
61 ; CHECK-NO-ISEL-LABEL: testi32:
62 ; CHECK-NO-ISEL: # %bb.0: # %entry
63 ; CHECK-NO-ISEL-NEXT: andi. 3, 3, 1
64 ; CHECK-NO-ISEL-NEXT: crmove 20, 1
65 ; CHECK-NO-ISEL-NEXT: andi. 3, 4, 1
66 ; CHECK-NO-ISEL-NEXT: li 3, 0
67 ; CHECK-NO-ISEL-NEXT: li 4, -1
68 ; CHECK-NO-ISEL-NEXT: #APP
69 ; CHECK-NO-ISEL-NEXT: crand 20, 20, 1
70 ; CHECK-NO-ISEL-NEXT: #NO_APP
71 ; CHECK-NO-ISEL-NEXT: bc 12, 20, .LBB1_1
72 ; CHECK-NO-ISEL-NEXT: blr
73 ; CHECK-NO-ISEL-NEXT: .LBB1_1: # %entry
74 ; CHECK-NO-ISEL-NEXT: addi 3, 4, 0
75 ; CHECK-NO-ISEL-NEXT: blr
77 %0 = tail call i32 asm "crand $0, $1, $2", "=^wc,^wc,^wc"(i32 %b1, i32 %b2) #0
80 ; The ABI sign_extend should combine with the any_extend from the asm result,
81 ; and the result will be 0 or -1. This highlights the fact that only the first
85 define zeroext i8 @testi8(i8 zeroext %b1, i8 zeroext %b2) #0 {
86 ; CHECK-LABEL: testi8:
87 ; CHECK: # %bb.0: # %entry
88 ; CHECK-NEXT: andi. 3, 3, 1
89 ; CHECK-NEXT: crmove 20, 1
90 ; CHECK-NEXT: andi. 3, 4, 1
94 ; CHECK-NEXT: crand 20, 20, 1
96 ; CHECK-NEXT: isel 3, 4, 3, 20
99 ; CHECK-NO-ISEL-LABEL: testi8:
100 ; CHECK-NO-ISEL: # %bb.0: # %entry
101 ; CHECK-NO-ISEL-NEXT: andi. 3, 3, 1
102 ; CHECK-NO-ISEL-NEXT: crmove 20, 1
103 ; CHECK-NO-ISEL-NEXT: andi. 3, 4, 1
104 ; CHECK-NO-ISEL-NEXT: li 3, 0
105 ; CHECK-NO-ISEL-NEXT: li 4, 1
106 ; CHECK-NO-ISEL-NEXT: #APP
107 ; CHECK-NO-ISEL-NEXT: crand 20, 20, 1
108 ; CHECK-NO-ISEL-NEXT: #NO_APP
109 ; CHECK-NO-ISEL-NEXT: bc 12, 20, .LBB2_1
110 ; CHECK-NO-ISEL-NEXT: blr
111 ; CHECK-NO-ISEL-NEXT: .LBB2_1: # %entry
112 ; CHECK-NO-ISEL-NEXT: addi 3, 4, 0
113 ; CHECK-NO-ISEL-NEXT: blr
115 %0 = tail call i8 asm "crand $0, $1, $2", "=^wc,^wc,^wc"(i8 %b1, i8 %b2) #0
120 attributes #0 = { nounwind "target-features"="+crbits" }