1 ; RUN: llc -march=mipsel -relocation-model=pic -O0 -fast-isel-abort=3 -mcpu=mips32r2 \
2 ; RUN: -verify-machineinstrs < %s | FileCheck %s
3 ; RUN: llc -march=mipsel -relocation-model=pic -O0 -fast-isel-abort=3 -mcpu=mips32 \
4 ; RUN: -verify-machineinstrs < %s | FileCheck %s
6 @f1 = common global float 0.000000e+00, align 4
7 @f2 = common global float 0.000000e+00, align 4
8 @b1 = common global i32 0, align 4
9 @d1 = common global double 0.000000e+00, align 8
10 @d2 = common global double 0.000000e+00, align 8
12 ; Function Attrs: nounwind
15 %0 = load float, float* @f1, align 4
16 %1 = load float, float* @f2, align 4
17 %cmp = fcmp oeq float %0, %1
19 ; CHECK: lw $[[REG_F1_GOT:[0-9]+]], %got(f1)(${{[0-9]+}})
20 ; CHECK: lwc1 $f[[REG_F1:[0-9]+]], 0($[[REG_F1_GOT]])
21 ; CHECK: lw $[[REG_F2_GOT:[0-9]+]], %got(f2)(${{[0-9]+}})
22 ; CHECK: lwc1 $f[[REG_F2:[0-9]+]], 0($[[REG_F2_GOT]])
23 ; CHECK-DAG: addiu $[[REG_ZERO:[0-9]+]], $zero, 0
24 ; CHECK-DAG: addiu $[[REG_ONE:[0-9]+]], $zero, 1
25 ; CHECK: c.eq.s $f[[REG_F1]], $f[[REG_F2]]
26 ; CHECK: movt $[[REG_ZERO]], $[[REG_ONE]], $fcc0
28 %conv = zext i1 %cmp to i32
29 store i32 %conv, i32* @b1, align 4
33 ; Function Attrs: nounwind
36 %0 = load float, float* @f1, align 4
37 %1 = load float, float* @f2, align 4
38 %cmp = fcmp une float %0, %1
40 ; CHECK: lw $[[REG_F1_GOT:[0-9]+]], %got(f1)(${{[0-9]+}})
41 ; CHECK: lwc1 $f[[REG_F1:[0-9]+]], 0($[[REG_F1_GOT]])
42 ; CHECK: lw $[[REG_F2_GOT:[0-9]+]], %got(f2)(${{[0-9]+}})
43 ; CHECK: lwc1 $f[[REG_F2:[0-9]+]], 0($[[REG_F2_GOT]])
44 ; CHECK-DAG: addiu $[[REG_ZERO:[0-9]+]], $zero, 0
45 ; CHECK-DAG: addiu $[[REG_ONE:[0-9]+]], $zero, 1
46 ; CHECK: c.eq.s $f[[REG_F1]], $f[[REG_F2]]
47 ; CHECK: movf $[[REG_ZERO]], $[[REG_ONE]], $fcc0
48 %conv = zext i1 %cmp to i32
49 store i32 %conv, i32* @b1, align 4
53 ; Function Attrs: nounwind
56 %0 = load float, float* @f1, align 4
57 %1 = load float, float* @f2, align 4
58 %cmp = fcmp olt float %0, %1
60 ; CHECK: lw $[[REG_F1_GOT:[0-9]+]], %got(f1)(${{[0-9]+}})
61 ; CHECK: lwc1 $f[[REG_F1:[0-9]+]], 0($[[REG_F1_GOT]])
62 ; CHECK: lw $[[REG_F2_GOT:[0-9]+]], %got(f2)(${{[0-9]+}})
63 ; CHECK: lwc1 $f[[REG_F2:[0-9]+]], 0($[[REG_F2_GOT]])
64 ; CHECK-DAG: addiu $[[REG_ZERO:[0-9]+]], $zero, 0
65 ; CHECK-DAG: addiu $[[REG_ONE:[0-9]+]], $zero, 1
66 ; CHECK: c.olt.s $f[[REG_F1]], $f[[REG_F2]]
67 ; CHECK: movt $[[REG_ZERO]], $[[REG_ONE]], $fcc0
69 %conv = zext i1 %cmp to i32
70 store i32 %conv, i32* @b1, align 4
74 ; Function Attrs: nounwind
77 %0 = load float, float* @f1, align 4
78 %1 = load float, float* @f2, align 4
79 %cmp = fcmp ogt float %0, %1
81 ; CHECK: lw $[[REG_F1_GOT:[0-9]+]], %got(f1)(${{[0-9]+}})
82 ; CHECK: lwc1 $f[[REG_F1:[0-9]+]], 0($[[REG_F1_GOT]])
83 ; CHECK: lw $[[REG_F2_GOT:[0-9]+]], %got(f2)(${{[0-9]+}})
84 ; CHECK: lwc1 $f[[REG_F2:[0-9]+]], 0($[[REG_F2_GOT]])
85 ; CHECK-DAG: addiu $[[REG_ZERO:[0-9]+]], $zero, 0
86 ; CHECK-DAG: addiu $[[REG_ONE:[0-9]+]], $zero, 1
87 ; CHECK: c.ule.s $f[[REG_F1]], $f[[REG_F2]]
88 ; CHECK: movf $[[REG_ZERO]], $[[REG_ONE]], $fcc0
89 %conv = zext i1 %cmp to i32
90 store i32 %conv, i32* @b1, align 4
94 ; Function Attrs: nounwind
97 %0 = load float, float* @f1, align 4
98 %1 = load float, float* @f2, align 4
99 %cmp = fcmp ole float %0, %1
101 ; CHECK: lw $[[REG_F1_GOT:[0-9]+]], %got(f1)(${{[0-9]+}})
102 ; CHECK: lwc1 $f[[REG_F1:[0-9]+]], 0($[[REG_F1_GOT]])
103 ; CHECK: lw $[[REG_F2_GOT:[0-9]+]], %got(f2)(${{[0-9]+}})
104 ; CHECK: lwc1 $f[[REG_F2:[0-9]+]], 0($[[REG_F2_GOT]])
105 ; CHECK-DAG: addiu $[[REG_ZERO:[0-9]+]], $zero, 0
106 ; CHECK-DAG: addiu $[[REG_ONE:[0-9]+]], $zero, 1
107 ; CHECK: c.ole.s $f[[REG_F1]], $f[[REG_F2]]
108 ; CHECK: movt $[[REG_ZERO]], $[[REG_ONE]], $fcc0
109 %conv = zext i1 %cmp to i32
110 store i32 %conv, i32* @b1, align 4
114 ; Function Attrs: nounwind
115 define void @fge1() {
117 %0 = load float, float* @f1, align 4
118 %1 = load float, float* @f2, align 4
119 %cmp = fcmp oge float %0, %1
121 ; CHECK: lw $[[REG_F1_GOT:[0-9]+]], %got(f1)(${{[0-9]+}})
122 ; CHECK: lwc1 $f[[REG_F1:[0-9]+]], 0($[[REG_F1_GOT]])
123 ; CHECK: lw $[[REG_F2_GOT:[0-9]+]], %got(f2)(${{[0-9]+}})
124 ; CHECK: lwc1 $f[[REG_F2:[0-9]+]], 0($[[REG_F2_GOT]])
125 ; CHECK-DAG: addiu $[[REG_ZERO:[0-9]+]], $zero, 0
126 ; CHECK-DAG: addiu $[[REG_ONE:[0-9]+]], $zero, 1
127 ; CHECK: c.ult.s $f[[REG_F1]], $f[[REG_F2]]
128 ; CHECK: movf $[[REG_ZERO]], $[[REG_ONE]], $fcc0
129 %conv = zext i1 %cmp to i32
130 store i32 %conv, i32* @b1, align 4
134 ; Function Attrs: nounwind
135 define void @deq1() {
137 %0 = load double, double* @d1, align 8
138 %1 = load double, double* @d2, align 8
139 %cmp = fcmp oeq double %0, %1
141 ; CHECK: lw $[[REG_D1_GOT:[0-9]+]], %got(d1)(${{[0-9]+}})
142 ; CHECK: ldc1 $f[[REG_D1:[0-9]+]], 0($[[REG_D1_GOT]])
143 ; CHECK: lw $[[REG_D2_GOT:[0-9]+]], %got(d2)(${{[0-9]+}})
144 ; CHECK: ldc1 $f[[REG_D2:[0-9]+]], 0($[[REG_D2_GOT]])
145 ; CHECK-DAG: addiu $[[REG_ZERO:[0-9]+]], $zero, 0
146 ; CHECK-DAG: addiu $[[REG_ONE:[0-9]+]], $zero, 1
147 ; CHECK: c.eq.d $f[[REG_D1]], $f[[REG_D2]]
148 ; CHECK: movt $[[REG_ZERO]], $[[REG_ONE]], $fcc0
149 %conv = zext i1 %cmp to i32
150 store i32 %conv, i32* @b1, align 4
154 ; Function Attrs: nounwind
155 define void @dne1() {
157 %0 = load double, double* @d1, align 8
158 %1 = load double, double* @d2, align 8
159 %cmp = fcmp une double %0, %1
161 ; CHECK: lw $[[REG_D1_GOT:[0-9]+]], %got(d1)(${{[0-9]+}})
162 ; CHECK: ldc1 $f[[REG_D1:[0-9]+]], 0($[[REG_D1_GOT]])
163 ; CHECK: lw $[[REG_D2_GOT:[0-9]+]], %got(d2)(${{[0-9]+}})
164 ; CHECK: ldc1 $f[[REG_D2:[0-9]+]], 0($[[REG_D2_GOT]])
165 ; CHECK-DAG: addiu $[[REG_ZERO:[0-9]+]], $zero, 0
166 ; CHECK-DAG: addiu $[[REG_ONE:[0-9]+]], $zero, 1
167 ; CHECK: c.eq.d $f[[REG_D1]], $f[[REG_D2]]
168 ; CHECK: movf $[[REG_ZERO]], $[[REG_ONE]], $fcc0
169 %conv = zext i1 %cmp to i32
170 store i32 %conv, i32* @b1, align 4
174 ; Function Attrs: nounwind
175 define void @dlt1() {
177 %0 = load double, double* @d1, align 8
178 %1 = load double, double* @d2, align 8
179 %cmp = fcmp olt double %0, %1
181 ; CHECK: lw $[[REG_D1_GOT:[0-9]+]], %got(d1)(${{[0-9]+}})
182 ; CHECK: ldc1 $f[[REG_D1:[0-9]+]], 0($[[REG_D1_GOT]])
183 ; CHECK: lw $[[REG_D2_GOT:[0-9]+]], %got(d2)(${{[0-9]+}})
184 ; CHECK: ldc1 $f[[REG_D2:[0-9]+]], 0($[[REG_D2_GOT]])
185 ; CHECK: addiu $[[REG_ZERO:[0-9]+]], $zero, 0
186 ; CHECK: addiu $[[REG_ONE:[0-9]+]], $zero, 1
187 ; CHECK: c.olt.d $f[[REG_D1]], $f[[REG_D2]]
188 ; CHECK: movt $[[REG_ZERO]], $[[REG_ONE]], $fcc0
189 %conv = zext i1 %cmp to i32
190 store i32 %conv, i32* @b1, align 4
194 ; Function Attrs: nounwind
195 define void @dgt1() {
197 %0 = load double, double* @d1, align 8
198 %1 = load double, double* @d2, align 8
199 %cmp = fcmp ogt double %0, %1
201 ; CHECK: lw $[[REG_D1_GOT:[0-9]+]], %got(d1)(${{[0-9]+}})
202 ; CHECK: ldc1 $f[[REG_D1:[0-9]+]], 0($[[REG_D1_GOT]])
203 ; CHECK: lw $[[REG_D2_GOT:[0-9]+]], %got(d2)(${{[0-9]+}})
204 ; CHECK: ldc1 $f[[REG_D2:[0-9]+]], 0($[[REG_D2_GOT]])
205 ; CHECK-DAG: addiu $[[REG_ZERO:[0-9]+]], $zero, 0
206 ; CHECK-DAG: addiu $[[REG_ONE:[0-9]+]], $zero, 1
207 ; CHECK: c.ule.d $f[[REG_D1]], $f[[REG_D2]]
208 ; CHECK: movf $[[REG_ZERO]], $[[REG_ONE]], $fcc0
209 %conv = zext i1 %cmp to i32
210 store i32 %conv, i32* @b1, align 4
214 ; Function Attrs: nounwind
215 define void @dle1() {
217 %0 = load double, double* @d1, align 8
218 %1 = load double, double* @d2, align 8
219 %cmp = fcmp ole double %0, %1
221 ; CHECK: lw $[[REG_D1_GOT:[0-9]+]], %got(d1)(${{[0-9]+}})
222 ; CHECK: ldc1 $f[[REG_D1:[0-9]+]], 0($[[REG_D1_GOT]])
223 ; CHECK: lw $[[REG_D2_GOT:[0-9]+]], %got(d2)(${{[0-9]+}})
224 ; CHECK: ldc1 $f[[REG_D2:[0-9]+]], 0($[[REG_D2_GOT]])
225 ; CHECK-DAG: addiu $[[REG_ZERO:[0-9]+]], $zero, 0
226 ; CHECK-DAG: addiu $[[REG_ONE:[0-9]+]], $zero, 1
227 ; CHECK: c.ole.d $f[[REG_D1]], $f[[REG_D2]]
228 ; CHECK: movt $[[REG_ZERO]], $[[REG_ONE]], $fcc0
229 %conv = zext i1 %cmp to i32
230 store i32 %conv, i32* @b1, align 4
234 ; Function Attrs: nounwind
235 define void @dge1() {
237 %0 = load double, double* @d1, align 8
238 %1 = load double, double* @d2, align 8
239 %cmp = fcmp oge double %0, %1
241 ; CHECK: lw $[[REG_D1_GOT:[0-9]+]], %got(d1)(${{[0-9]+}})
242 ; CHECK: ldc1 $f[[REG_D1:[0-9]+]], 0($[[REG_D1_GOT]])
243 ; CHECK: lw $[[REG_D2_GOT:[0-9]+]], %got(d2)(${{[0-9]+}})
244 ; CHECK: ldc1 $f[[REG_D2:[0-9]+]], 0($[[REG_D2_GOT]])
245 ; CHECK-DAG: addiu $[[REG_ZERO:[0-9]+]], $zero, 0
246 ; CHECK-DAG: addiu $[[REG_ONE:[0-9]+]], $zero, 1
247 ; CHECK: c.ult.d $f[[REG_D1]], $f[[REG_D2]]
248 ; CHECK: movf $[[REG_ZERO]], $[[REG_ONE]], $fcc0
249 %conv = zext i1 %cmp to i32
250 store i32 %conv, i32* @b1, align 4