1 ; RUN: llc -mcpu=pwr9 -mtriple=powerpc64le-unknown-unknown \
2 ; RUN: -enable-ppc-quad-precision -verify-machineinstrs \
3 ; RUN: -ppc-asm-full-reg-names -ppc-vsr-nums-as-vr < %s | FileCheck %s
5 @a_qp = common global fp128 0xL00000000000000000000000000000000, align 16
6 @b_qp = common global fp128 0xL00000000000000000000000000000000, align 16
8 ; Function Attrs: noinline nounwind optnone
9 define signext i32 @greater_qp() {
11 %0 = load fp128, fp128* @a_qp, align 16
12 %1 = load fp128, fp128* @b_qp, align 16
13 %cmp = fcmp ogt fp128 %0, %1
14 %conv = zext i1 %cmp to i32
16 ; CHECK-LABEL: greater_qp
18 ; CHECK: isel r{{[0-9]+}}, r{{[0-9]+}}, r{{[0-9]+}}, gt
22 ; Function Attrs: noinline nounwind optnone
23 define signext i32 @less_qp() {
25 %0 = load fp128, fp128* @a_qp, align 16
26 %1 = load fp128, fp128* @b_qp, align 16
27 %cmp = fcmp olt fp128 %0, %1
28 %conv = zext i1 %cmp to i32
30 ; CHECK-LABEL: less_qp
32 ; CHECK: isel r{{[0-9]+}}, r{{[0-9]+}}, r{{[0-9]+}}, lt
36 ; Function Attrs: noinline nounwind optnone
37 define signext i32 @greater_eq_qp() {
39 %0 = load fp128, fp128* @a_qp, align 16
40 %1 = load fp128, fp128* @b_qp, align 16
41 %cmp = fcmp oge fp128 %0, %1
42 %conv = zext i1 %cmp to i32
44 ; CHECK-LABEL: greater_eq_qp
46 ; CHECK: cror 4*cr[[REG:[0-9]+]]+lt, un, lt
47 ; CHECK: isel r{{[0-9]+}}, 0, r{{[0-9]+}}, 4*cr[[REG]]+lt
51 ; Function Attrs: noinline nounwind optnone
52 define signext i32 @less_eq_qp() {
54 %0 = load fp128, fp128* @a_qp, align 16
55 %1 = load fp128, fp128* @b_qp, align 16
56 %cmp = fcmp ole fp128 %0, %1
57 %conv = zext i1 %cmp to i32
59 ; CHECK-LABEL: less_eq_qp
61 ; CHECK: cror 4*cr[[REG:[0-9]+]]+lt, un, gt
62 ; CHECK: isel r{{[0-9]+}}, 0, r{{[0-9]+}}, 4*cr[[REG]]+lt
66 ; Function Attrs: noinline nounwind optnone
67 define signext i32 @equal_qp() {
69 %0 = load fp128, fp128* @a_qp, align 16
70 %1 = load fp128, fp128* @b_qp, align 16
71 %cmp = fcmp oeq fp128 %0, %1
72 %conv = zext i1 %cmp to i32
74 ; CHECK-LABEL: equal_qp
76 ; CHECK: isel r{{[0-9]+}}, r{{[0-9]+}}, r{{[0-9]+}}, eq
80 ; Function Attrs: noinline nounwind optnone
81 define signext i32 @not_greater_qp() {
83 %0 = load fp128, fp128* @a_qp, align 16
84 %1 = load fp128, fp128* @b_qp, align 16
85 %cmp = fcmp ogt fp128 %0, %1
86 %lnot = xor i1 %cmp, true
87 %lnot.ext = zext i1 %lnot to i32
89 ; CHECK-LABEL: not_greater_qp
91 ; CHECK: isel r{{[0-9]+}}, 0, r{{[0-9]+}}, gt
95 ; Function Attrs: noinline nounwind optnone
96 define signext i32 @not_less_qp() {
98 %0 = load fp128, fp128* @a_qp, align 16
99 %1 = load fp128, fp128* @b_qp, align 16
100 %cmp = fcmp olt fp128 %0, %1
101 %lnot = xor i1 %cmp, true
102 %lnot.ext = zext i1 %lnot to i32
104 ; CHECK-LABEL: not_less_qp
106 ; CHECK: isel r{{[0-9]+}}, 0, r{{[0-9]+}}, lt
110 ; Function Attrs: noinline nounwind optnone
111 define signext i32 @not_greater_eq_qp() {
113 %0 = load fp128, fp128* @a_qp, align 16
114 %1 = load fp128, fp128* @b_qp, align 16
115 %cmp = fcmp oge fp128 %0, %1
116 %lnot = xor i1 %cmp, true
117 %lnot.ext = zext i1 %lnot to i32
119 ; CHECK-LABEL: not_greater_eq_qp
121 ; CHECK: crnor 4*cr[[REG:[0-9]+]]+lt, lt, un
122 ; CHECK: isel r{{[0-9]+}}, 0, r{{[0-9]+}}, 4*cr[[REG]]+lt
126 ; Function Attrs: noinline nounwind optnone
127 define signext i32 @not_less_eq_qp() {
129 %0 = load fp128, fp128* @a_qp, align 16
130 %1 = load fp128, fp128* @b_qp, align 16
131 %cmp = fcmp ole fp128 %0, %1
132 %lnot = xor i1 %cmp, true
133 %lnot.ext = zext i1 %lnot to i32
135 ; CHECK-LABEL: not_less_eq_qp
137 ; CHECK: crnor 4*cr[[REG:[0-9]+]]+lt, gt, un
138 ; CHECK: isel r{{[0-9]+}}, 0, r{{[0-9]+}}, 4*cr[[REG]]+lt
142 ; Function Attrs: noinline nounwind optnone
143 define signext i32 @not_equal_qp() {
145 %0 = load fp128, fp128* @a_qp, align 16
146 %1 = load fp128, fp128* @b_qp, align 16
147 %cmp = fcmp une fp128 %0, %1
148 %conv = zext i1 %cmp to i32
150 ; CHECK-LABEL: not_equal_qp
152 ; CHECK: isel r{{[0-9]+}}, 0, r{{[0-9]+}}, eq
156 ; Function Attrs: norecurse nounwind readonly
157 define fp128 @greater_sel_qp() {
159 %0 = load fp128, fp128* @a_qp, align 16
160 %1 = load fp128, fp128* @b_qp, align 16
161 %cmp = fcmp ogt fp128 %0, %1
162 %cond = select i1 %cmp, fp128 %0, fp128 %1
164 ; CHECK-LABEL: greater_sel_qp
165 ; CHECK: xscmpuqp cr[[REG:[0-9]+]]
166 ; CHECK: bgtlr cr[[REG]]
170 ; Function Attrs: noinline nounwind optnone
171 define fp128 @less_sel_qp() {
173 %0 = load fp128, fp128* @a_qp, align 16
174 %1 = load fp128, fp128* @b_qp, align 16
175 %cmp = fcmp olt fp128 %0, %1
176 %cond = select i1 %cmp, fp128 %0, fp128 %1
178 ; CHECK-LABEL: less_sel_qp
179 ; CHECK: xscmpuqp cr[[REG:[0-9]+]]
180 ; CHECK: bltlr cr[[REG]]
184 ; Function Attrs: noinline nounwind optnone
185 define fp128 @greater_eq_sel_qp() {
187 %0 = load fp128, fp128* @a_qp, align 16
188 %1 = load fp128, fp128* @b_qp, align 16
189 %cmp = fcmp oge fp128 %0, %1
190 %cond = select i1 %cmp, fp128 %0, fp128 %1
192 ; CHECK-LABEL: greater_eq_sel_qp
194 ; CHECK: crnor 4*cr[[REG:[0-9]+]]+lt, un, lt
195 ; CHECK: bclr {{[0-9]+}}, 4*cr[[REG]]+lt, 0
199 ; Function Attrs: noinline nounwind optnone
200 define fp128 @less_eq_sel_qp() {
202 %0 = load fp128, fp128* @a_qp, align 16
203 %1 = load fp128, fp128* @b_qp, align 16
204 %cmp = fcmp ole fp128 %0, %1
205 %cond = select i1 %cmp, fp128 %0, fp128 %1
207 ; CHECK-LABEL: less_eq_sel_qp
209 ; CHECK: crnor 4*cr[[REG:[0-9]+]]+lt, un, gt
210 ; CHECK: bclr {{[0-9]+}}, 4*cr[[REG]]+lt, 0
214 ; Function Attrs: noinline nounwind optnone
215 define fp128 @equal_sel_qp() {
217 %0 = load fp128, fp128* @a_qp, align 16
218 %1 = load fp128, fp128* @b_qp, align 16
219 %cmp = fcmp oeq fp128 %0, %1
220 %cond = select i1 %cmp, fp128 %0, fp128 %1
222 ; CHECK-LABEL: equal_sel_qp
223 ; CHECK: xscmpuqp cr[[REG:[0-9]+]]
224 ; CHECK: beqlr cr[[REG]]