1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=powerpc64le-unknown-linux-gnu -global-isel -o - \
3 ; RUN: -ppc-vsr-nums-as-vr -ppc-asm-full-reg-names < %s | FileCheck %s
5 ;; Note that SETUEQ, SETOGE, SETOLE, SETONE, SETULT and SETUGT should be
6 ;; expanded by DAG legalizer for floating-point types f32 and f64, so there are
7 ;; no patterns defined in PPCInstrInfo.td file for these setcc patterns for now.
9 define i1 @fcmp_false(float %a, float %b) {
10 ; CHECK-LABEL: fcmp_false:
12 ; CHECK-NEXT: li r3, 0
14 %cmp = fcmp false float %a, %b
18 define i1 @fcmp_oeq(float %a, float %b) {
19 ; CHECK-LABEL: fcmp_oeq:
21 ; CHECK-NEXT: fcmpu cr0, f1, f2
22 ; CHECK-NEXT: li r3, 0
23 ; CHECK-NEXT: li r4, 1
24 ; CHECK-NEXT: iseleq r3, r4, r3
26 %cmp = fcmp oeq float %a, %b
30 define i1 @fcmp_ogt(float %a, float %b) {
31 ; CHECK-LABEL: fcmp_ogt:
33 ; CHECK-NEXT: fcmpu cr0, f1, f2
34 ; CHECK-NEXT: li r3, 0
35 ; CHECK-NEXT: li r4, 1
36 ; CHECK-NEXT: iselgt r3, r4, r3
38 %cmp = fcmp ogt float %a, %b
42 define i1 @fcmp_olt(float %a, float %b) {
43 ; CHECK-LABEL: fcmp_olt:
45 ; CHECK-NEXT: fcmpu cr0, f1, f2
46 ; CHECK-NEXT: li r3, 0
47 ; CHECK-NEXT: li r4, 1
48 ; CHECK-NEXT: isellt r3, r4, r3
50 %cmp = fcmp olt float %a, %b
54 define i1 @fcmp_ord(float %a, float %b) {
55 ; CHECK-LABEL: fcmp_ord:
57 ; CHECK-NEXT: fcmpu cr0, f1, f2
58 ; CHECK-NEXT: li r3, 0
59 ; CHECK-NEXT: li r4, 1
60 ; CHECK-NEXT: crnot 4*cr5+lt, un
61 ; CHECK-NEXT: isel r3, r4, r3, 4*cr5+lt
63 %cmp = fcmp ord float %a, %b
67 define i1 @fcmp_uge(float %a, float %b) {
68 ; CHECK-LABEL: fcmp_uge:
70 ; CHECK-NEXT: fcmpu cr0, f1, f2
71 ; CHECK-NEXT: li r3, 0
72 ; CHECK-NEXT: li r4, 1
73 ; CHECK-NEXT: crnot 4*cr5+lt, lt
74 ; CHECK-NEXT: isel r3, r4, r3, 4*cr5+lt
76 %cmp = fcmp uge float %a, %b
80 define i1 @fcmp_ule(float %a, float %b) {
81 ; CHECK-LABEL: fcmp_ule:
83 ; CHECK-NEXT: fcmpu cr0, f1, f2
84 ; CHECK-NEXT: li r3, 0
85 ; CHECK-NEXT: li r4, 1
86 ; CHECK-NEXT: crnot 4*cr5+lt, gt
87 ; CHECK-NEXT: isel r3, r4, r3, 4*cr5+lt
89 %cmp = fcmp ule float %a, %b
93 define i1 @fcmp_une(float %a, float %b) {
94 ; CHECK-LABEL: fcmp_une:
96 ; CHECK-NEXT: fcmpu cr0, f1, f2
97 ; CHECK-NEXT: li r3, 0
98 ; CHECK-NEXT: li r4, 1
99 ; CHECK-NEXT: crnot 4*cr5+lt, eq
100 ; CHECK-NEXT: isel r3, r4, r3, 4*cr5+lt
102 %cmp = fcmp une float %a, %b
106 define i1 @fcmp_uno(float %a, float %b) {
107 ; CHECK-LABEL: fcmp_uno:
109 ; CHECK-NEXT: fcmpu cr0, f1, f2
110 ; CHECK-NEXT: li r3, 0
111 ; CHECK-NEXT: li r4, 1
112 ; CHECK-NEXT: isel r3, r4, r3, un
114 %cmp = fcmp uno float %a, %b
118 define i1 @fcmp_true(float %a, float %b) {
119 ; CHECK-LABEL: fcmp_true:
121 ; CHECK-NEXT: li r3, 1
123 %cmp = fcmp true float %a, %b
127 define i1 @fcmp_false_double(double %a, double %b) {
128 ; CHECK-LABEL: fcmp_false_double:
130 ; CHECK-NEXT: li r3, 0
132 %cmp = fcmp false double %a, %b
136 define i1 @fcmp_oeq_double(double %a, double %b) {
137 ; CHECK-LABEL: fcmp_oeq_double:
139 ; CHECK-NEXT: fcmpu cr0, f1, f2
140 ; CHECK-NEXT: li r3, 0
141 ; CHECK-NEXT: li r4, 1
142 ; CHECK-NEXT: iseleq r3, r4, r3
144 %cmp = fcmp oeq double %a, %b
148 define i1 @fcmp_ogt_double(double %a, double %b) {
149 ; CHECK-LABEL: fcmp_ogt_double:
151 ; CHECK-NEXT: fcmpu cr0, f1, f2
152 ; CHECK-NEXT: li r3, 0
153 ; CHECK-NEXT: li r4, 1
154 ; CHECK-NEXT: iselgt r3, r4, r3
156 %cmp = fcmp ogt double %a, %b
160 define i1 @fcmp_olt_double(double %a, double %b) {
161 ; CHECK-LABEL: fcmp_olt_double:
163 ; CHECK-NEXT: fcmpu cr0, f1, f2
164 ; CHECK-NEXT: li r3, 0
165 ; CHECK-NEXT: li r4, 1
166 ; CHECK-NEXT: isellt r3, r4, r3
168 %cmp = fcmp olt double %a, %b
172 define i1 @fcmp_ord_double(double %a, double %b) {
173 ; CHECK-LABEL: fcmp_ord_double:
175 ; CHECK-NEXT: fcmpu cr0, f1, f2
176 ; CHECK-NEXT: li r3, 0
177 ; CHECK-NEXT: li r4, 1
178 ; CHECK-NEXT: crnot 4*cr5+lt, un
179 ; CHECK-NEXT: isel r3, r4, r3, 4*cr5+lt
181 %cmp = fcmp ord double %a, %b
185 define i1 @fcmp_uge_double(double %a, double %b) {
186 ; CHECK-LABEL: fcmp_uge_double:
188 ; CHECK-NEXT: fcmpu cr0, f1, f2
189 ; CHECK-NEXT: li r3, 0
190 ; CHECK-NEXT: li r4, 1
191 ; CHECK-NEXT: crnot 4*cr5+lt, lt
192 ; CHECK-NEXT: isel r3, r4, r3, 4*cr5+lt
194 %cmp = fcmp uge double %a, %b
198 define i1 @fcmp_ule_double(double %a, double %b) {
199 ; CHECK-LABEL: fcmp_ule_double:
201 ; CHECK-NEXT: fcmpu cr0, f1, f2
202 ; CHECK-NEXT: li r3, 0
203 ; CHECK-NEXT: li r4, 1
204 ; CHECK-NEXT: crnot 4*cr5+lt, gt
205 ; CHECK-NEXT: isel r3, r4, r3, 4*cr5+lt
207 %cmp = fcmp ule double %a, %b
211 define i1 @fcmp_une_double(double %a, double %b) {
212 ; CHECK-LABEL: fcmp_une_double:
214 ; CHECK-NEXT: fcmpu cr0, f1, f2
215 ; CHECK-NEXT: li r3, 0
216 ; CHECK-NEXT: li r4, 1
217 ; CHECK-NEXT: crnot 4*cr5+lt, eq
218 ; CHECK-NEXT: isel r3, r4, r3, 4*cr5+lt
220 %cmp = fcmp une double %a, %b
224 define i1 @fcmp_uno_double(double %a, double %b) {
225 ; CHECK-LABEL: fcmp_uno_double:
227 ; CHECK-NEXT: fcmpu cr0, f1, f2
228 ; CHECK-NEXT: li r3, 0
229 ; CHECK-NEXT: li r4, 1
230 ; CHECK-NEXT: isel r3, r4, r3, un
232 %cmp = fcmp uno double %a, %b
236 define i1 @fcmp_true_double(double %a, double %b) {
237 ; CHECK-LABEL: fcmp_true_double:
239 ; CHECK-NEXT: li r3, 1
241 %cmp = fcmp true double %a, %b