1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc --mtriple=loongarch32 --mattr=+f,-d < %s | FileCheck %s --check-prefix=LA32F
3 ; RUN: llc --mtriple=loongarch32 --mattr=+d < %s | FileCheck %s --check-prefix=LA32D
4 ; RUN: llc --mtriple=loongarch64 --mattr=+f,-d < %s | FileCheck %s --check-prefix=LA64F
5 ; RUN: llc --mtriple=loongarch64 --mattr=+d < %s | FileCheck %s --check-prefix=LA64D
7 ;; TODO: Merge the offset of address calculation into the offset field of instructions.
10 %f4 = type <4 x float>
11 %f8 = type <8 x float>
12 %d2 = type <2 x double>
13 %d4 = type <4 x double>
14 %d8 = type <8 x double>
16 define void @test_zero(ptr %P, ptr %S) nounwind {
17 ; LA32F-LABEL: test_zero:
19 ; LA32F-NEXT: fld.s $fa0, $a0, 12
20 ; LA32F-NEXT: fld.s $fa1, $a0, 0
21 ; LA32F-NEXT: fld.s $fa2, $a0, 4
22 ; LA32F-NEXT: fld.s $fa3, $a0, 8
23 ; LA32F-NEXT: movgr2fr.w $fa4, $zero
24 ; LA32F-NEXT: fadd.s $fa1, $fa1, $fa4
25 ; LA32F-NEXT: fadd.s $fa2, $fa2, $fa4
26 ; LA32F-NEXT: fadd.s $fa3, $fa3, $fa4
27 ; LA32F-NEXT: fadd.s $fa0, $fa0, $fa4
28 ; LA32F-NEXT: fst.s $fa0, $a1, 12
29 ; LA32F-NEXT: fst.s $fa3, $a1, 8
30 ; LA32F-NEXT: fst.s $fa2, $a1, 4
31 ; LA32F-NEXT: fst.s $fa1, $a1, 0
34 ; LA32D-LABEL: test_zero:
36 ; LA32D-NEXT: fld.s $fa0, $a0, 12
37 ; LA32D-NEXT: fld.s $fa1, $a0, 0
38 ; LA32D-NEXT: fld.s $fa2, $a0, 4
39 ; LA32D-NEXT: fld.s $fa3, $a0, 8
40 ; LA32D-NEXT: movgr2fr.w $fa4, $zero
41 ; LA32D-NEXT: fadd.s $fa1, $fa1, $fa4
42 ; LA32D-NEXT: fadd.s $fa2, $fa2, $fa4
43 ; LA32D-NEXT: fadd.s $fa3, $fa3, $fa4
44 ; LA32D-NEXT: fadd.s $fa0, $fa0, $fa4
45 ; LA32D-NEXT: fst.s $fa0, $a1, 12
46 ; LA32D-NEXT: fst.s $fa3, $a1, 8
47 ; LA32D-NEXT: fst.s $fa2, $a1, 4
48 ; LA32D-NEXT: fst.s $fa1, $a1, 0
51 ; LA64F-LABEL: test_zero:
53 ; LA64F-NEXT: fld.s $fa0, $a0, 12
54 ; LA64F-NEXT: fld.s $fa1, $a0, 0
55 ; LA64F-NEXT: fld.s $fa2, $a0, 4
56 ; LA64F-NEXT: fld.s $fa3, $a0, 8
57 ; LA64F-NEXT: movgr2fr.w $fa4, $zero
58 ; LA64F-NEXT: fadd.s $fa1, $fa1, $fa4
59 ; LA64F-NEXT: fadd.s $fa2, $fa2, $fa4
60 ; LA64F-NEXT: fadd.s $fa3, $fa3, $fa4
61 ; LA64F-NEXT: fadd.s $fa0, $fa0, $fa4
62 ; LA64F-NEXT: fst.s $fa0, $a1, 12
63 ; LA64F-NEXT: fst.s $fa3, $a1, 8
64 ; LA64F-NEXT: fst.s $fa2, $a1, 4
65 ; LA64F-NEXT: fst.s $fa1, $a1, 0
68 ; LA64D-LABEL: test_zero:
70 ; LA64D-NEXT: fld.s $fa0, $a0, 12
71 ; LA64D-NEXT: fld.s $fa1, $a0, 0
72 ; LA64D-NEXT: fld.s $fa2, $a0, 4
73 ; LA64D-NEXT: fld.s $fa3, $a0, 8
74 ; LA64D-NEXT: movgr2fr.w $fa4, $zero
75 ; LA64D-NEXT: fadd.s $fa1, $fa1, $fa4
76 ; LA64D-NEXT: fadd.s $fa2, $fa2, $fa4
77 ; LA64D-NEXT: fadd.s $fa3, $fa3, $fa4
78 ; LA64D-NEXT: fadd.s $fa0, $fa0, $fa4
79 ; LA64D-NEXT: fst.s $fa0, $a1, 12
80 ; LA64D-NEXT: fst.s $fa3, $a1, 8
81 ; LA64D-NEXT: fst.s $fa2, $a1, 4
82 ; LA64D-NEXT: fst.s $fa1, $a1, 0
85 %R = fadd %f4 %p, zeroinitializer
90 define void @test_f2(ptr %P, ptr %S) nounwind {
91 ; LA32F-LABEL: test_f2:
93 ; LA32F-NEXT: fld.s $fa0, $a0, 4
94 ; LA32F-NEXT: fld.s $fa1, $a0, 0
95 ; LA32F-NEXT: addi.w $a0, $zero, 1
96 ; LA32F-NEXT: pcalau12i $a2, %pc_hi20(.LCPI1_0)
97 ; LA32F-NEXT: addi.w $a2, $a2, %pc_lo12(.LCPI1_0)
98 ; LA32F-NEXT: fld.s $fa2, $a2, 0
99 ; LA32F-NEXT: movgr2fr.w $fa3, $a0
100 ; LA32F-NEXT: ffint.s.w $fa3, $fa3
101 ; LA32F-NEXT: fadd.s $fa1, $fa1, $fa3
102 ; LA32F-NEXT: fadd.s $fa0, $fa0, $fa2
103 ; LA32F-NEXT: fst.s $fa0, $a1, 4
104 ; LA32F-NEXT: fst.s $fa1, $a1, 0
107 ; LA32D-LABEL: test_f2:
109 ; LA32D-NEXT: fld.s $fa0, $a0, 4
110 ; LA32D-NEXT: fld.s $fa1, $a0, 0
111 ; LA32D-NEXT: addi.w $a0, $zero, 1
112 ; LA32D-NEXT: pcalau12i $a2, %pc_hi20(.LCPI1_0)
113 ; LA32D-NEXT: addi.w $a2, $a2, %pc_lo12(.LCPI1_0)
114 ; LA32D-NEXT: fld.s $fa2, $a2, 0
115 ; LA32D-NEXT: movgr2fr.w $fa3, $a0
116 ; LA32D-NEXT: ffint.s.w $fa3, $fa3
117 ; LA32D-NEXT: fadd.s $fa1, $fa1, $fa3
118 ; LA32D-NEXT: fadd.s $fa0, $fa0, $fa2
119 ; LA32D-NEXT: fst.s $fa0, $a1, 4
120 ; LA32D-NEXT: fst.s $fa1, $a1, 0
123 ; LA64F-LABEL: test_f2:
125 ; LA64F-NEXT: fld.s $fa0, $a0, 4
126 ; LA64F-NEXT: fld.s $fa1, $a0, 0
127 ; LA64F-NEXT: addi.w $a0, $zero, 1
128 ; LA64F-NEXT: pcalau12i $a2, %pc_hi20(.LCPI1_0)
129 ; LA64F-NEXT: addi.d $a2, $a2, %pc_lo12(.LCPI1_0)
130 ; LA64F-NEXT: fld.s $fa2, $a2, 0
131 ; LA64F-NEXT: movgr2fr.w $fa3, $a0
132 ; LA64F-NEXT: ffint.s.w $fa3, $fa3
133 ; LA64F-NEXT: fadd.s $fa1, $fa1, $fa3
134 ; LA64F-NEXT: fadd.s $fa0, $fa0, $fa2
135 ; LA64F-NEXT: fst.s $fa0, $a1, 4
136 ; LA64F-NEXT: fst.s $fa1, $a1, 0
139 ; LA64D-LABEL: test_f2:
141 ; LA64D-NEXT: fld.s $fa0, $a0, 4
142 ; LA64D-NEXT: fld.s $fa1, $a0, 0
143 ; LA64D-NEXT: addi.w $a0, $zero, 1
144 ; LA64D-NEXT: pcalau12i $a2, %pc_hi20(.LCPI1_0)
145 ; LA64D-NEXT: addi.d $a2, $a2, %pc_lo12(.LCPI1_0)
146 ; LA64D-NEXT: fld.s $fa2, $a2, 0
147 ; LA64D-NEXT: movgr2fr.w $fa3, $a0
148 ; LA64D-NEXT: ffint.s.w $fa3, $fa3
149 ; LA64D-NEXT: fadd.s $fa1, $fa1, $fa3
150 ; LA64D-NEXT: fadd.s $fa0, $fa0, $fa2
151 ; LA64D-NEXT: fst.s $fa0, $a1, 4
152 ; LA64D-NEXT: fst.s $fa1, $a1, 0
154 %p = load %f2, ptr %P
155 %R = fadd %f2 %p, < float 1.000000e+00, float 2.000000e+00 >
160 define void @test_f4(ptr %P, ptr %S) nounwind {
161 ; LA32F-LABEL: test_f4:
163 ; LA32F-NEXT: fld.s $fa0, $a0, 12
164 ; LA32F-NEXT: fld.s $fa1, $a0, 8
165 ; LA32F-NEXT: fld.s $fa2, $a0, 4
166 ; LA32F-NEXT: fld.s $fa3, $a0, 0
167 ; LA32F-NEXT: addi.w $a0, $zero, 1
168 ; LA32F-NEXT: movgr2fr.w $fa4, $a0
169 ; LA32F-NEXT: ffint.s.w $fa4, $fa4
170 ; LA32F-NEXT: pcalau12i $a0, %pc_hi20(.LCPI2_0)
171 ; LA32F-NEXT: addi.w $a0, $a0, %pc_lo12(.LCPI2_0)
172 ; LA32F-NEXT: fld.s $fa5, $a0, 0
173 ; LA32F-NEXT: pcalau12i $a0, %pc_hi20(.LCPI2_1)
174 ; LA32F-NEXT: addi.w $a0, $a0, %pc_lo12(.LCPI2_1)
175 ; LA32F-NEXT: fld.s $fa6, $a0, 0
176 ; LA32F-NEXT: pcalau12i $a0, %pc_hi20(.LCPI2_2)
177 ; LA32F-NEXT: addi.w $a0, $a0, %pc_lo12(.LCPI2_2)
178 ; LA32F-NEXT: fld.s $fa7, $a0, 0
179 ; LA32F-NEXT: fadd.s $fa3, $fa3, $fa4
180 ; LA32F-NEXT: fadd.s $fa2, $fa2, $fa5
181 ; LA32F-NEXT: fadd.s $fa1, $fa1, $fa6
182 ; LA32F-NEXT: fadd.s $fa0, $fa0, $fa7
183 ; LA32F-NEXT: fst.s $fa0, $a1, 12
184 ; LA32F-NEXT: fst.s $fa1, $a1, 8
185 ; LA32F-NEXT: fst.s $fa2, $a1, 4
186 ; LA32F-NEXT: fst.s $fa3, $a1, 0
189 ; LA32D-LABEL: test_f4:
191 ; LA32D-NEXT: fld.s $fa0, $a0, 12
192 ; LA32D-NEXT: fld.s $fa1, $a0, 8
193 ; LA32D-NEXT: fld.s $fa2, $a0, 4
194 ; LA32D-NEXT: fld.s $fa3, $a0, 0
195 ; LA32D-NEXT: addi.w $a0, $zero, 1
196 ; LA32D-NEXT: movgr2fr.w $fa4, $a0
197 ; LA32D-NEXT: ffint.s.w $fa4, $fa4
198 ; LA32D-NEXT: pcalau12i $a0, %pc_hi20(.LCPI2_0)
199 ; LA32D-NEXT: addi.w $a0, $a0, %pc_lo12(.LCPI2_0)
200 ; LA32D-NEXT: fld.s $fa5, $a0, 0
201 ; LA32D-NEXT: pcalau12i $a0, %pc_hi20(.LCPI2_1)
202 ; LA32D-NEXT: addi.w $a0, $a0, %pc_lo12(.LCPI2_1)
203 ; LA32D-NEXT: fld.s $fa6, $a0, 0
204 ; LA32D-NEXT: pcalau12i $a0, %pc_hi20(.LCPI2_2)
205 ; LA32D-NEXT: addi.w $a0, $a0, %pc_lo12(.LCPI2_2)
206 ; LA32D-NEXT: fld.s $fa7, $a0, 0
207 ; LA32D-NEXT: fadd.s $fa3, $fa3, $fa4
208 ; LA32D-NEXT: fadd.s $fa2, $fa2, $fa5
209 ; LA32D-NEXT: fadd.s $fa1, $fa1, $fa6
210 ; LA32D-NEXT: fadd.s $fa0, $fa0, $fa7
211 ; LA32D-NEXT: fst.s $fa0, $a1, 12
212 ; LA32D-NEXT: fst.s $fa1, $a1, 8
213 ; LA32D-NEXT: fst.s $fa2, $a1, 4
214 ; LA32D-NEXT: fst.s $fa3, $a1, 0
217 ; LA64F-LABEL: test_f4:
219 ; LA64F-NEXT: fld.s $fa0, $a0, 12
220 ; LA64F-NEXT: fld.s $fa1, $a0, 8
221 ; LA64F-NEXT: fld.s $fa2, $a0, 4
222 ; LA64F-NEXT: fld.s $fa3, $a0, 0
223 ; LA64F-NEXT: addi.w $a0, $zero, 1
224 ; LA64F-NEXT: movgr2fr.w $fa4, $a0
225 ; LA64F-NEXT: ffint.s.w $fa4, $fa4
226 ; LA64F-NEXT: pcalau12i $a0, %pc_hi20(.LCPI2_0)
227 ; LA64F-NEXT: addi.d $a0, $a0, %pc_lo12(.LCPI2_0)
228 ; LA64F-NEXT: fld.s $fa5, $a0, 0
229 ; LA64F-NEXT: pcalau12i $a0, %pc_hi20(.LCPI2_1)
230 ; LA64F-NEXT: addi.d $a0, $a0, %pc_lo12(.LCPI2_1)
231 ; LA64F-NEXT: fld.s $fa6, $a0, 0
232 ; LA64F-NEXT: pcalau12i $a0, %pc_hi20(.LCPI2_2)
233 ; LA64F-NEXT: addi.d $a0, $a0, %pc_lo12(.LCPI2_2)
234 ; LA64F-NEXT: fld.s $fa7, $a0, 0
235 ; LA64F-NEXT: fadd.s $fa3, $fa3, $fa4
236 ; LA64F-NEXT: fadd.s $fa2, $fa2, $fa5
237 ; LA64F-NEXT: fadd.s $fa1, $fa1, $fa6
238 ; LA64F-NEXT: fadd.s $fa0, $fa0, $fa7
239 ; LA64F-NEXT: fst.s $fa0, $a1, 12
240 ; LA64F-NEXT: fst.s $fa1, $a1, 8
241 ; LA64F-NEXT: fst.s $fa2, $a1, 4
242 ; LA64F-NEXT: fst.s $fa3, $a1, 0
245 ; LA64D-LABEL: test_f4:
247 ; LA64D-NEXT: fld.s $fa0, $a0, 12
248 ; LA64D-NEXT: fld.s $fa1, $a0, 8
249 ; LA64D-NEXT: fld.s $fa2, $a0, 4
250 ; LA64D-NEXT: fld.s $fa3, $a0, 0
251 ; LA64D-NEXT: addi.w $a0, $zero, 1
252 ; LA64D-NEXT: movgr2fr.w $fa4, $a0
253 ; LA64D-NEXT: ffint.s.w $fa4, $fa4
254 ; LA64D-NEXT: pcalau12i $a0, %pc_hi20(.LCPI2_0)
255 ; LA64D-NEXT: addi.d $a0, $a0, %pc_lo12(.LCPI2_0)
256 ; LA64D-NEXT: fld.s $fa5, $a0, 0
257 ; LA64D-NEXT: pcalau12i $a0, %pc_hi20(.LCPI2_1)
258 ; LA64D-NEXT: addi.d $a0, $a0, %pc_lo12(.LCPI2_1)
259 ; LA64D-NEXT: fld.s $fa6, $a0, 0
260 ; LA64D-NEXT: pcalau12i $a0, %pc_hi20(.LCPI2_2)
261 ; LA64D-NEXT: addi.d $a0, $a0, %pc_lo12(.LCPI2_2)
262 ; LA64D-NEXT: fld.s $fa7, $a0, 0
263 ; LA64D-NEXT: fadd.s $fa3, $fa3, $fa4
264 ; LA64D-NEXT: fadd.s $fa2, $fa2, $fa5
265 ; LA64D-NEXT: fadd.s $fa1, $fa1, $fa6
266 ; LA64D-NEXT: fadd.s $fa0, $fa0, $fa7
267 ; LA64D-NEXT: fst.s $fa0, $a1, 12
268 ; LA64D-NEXT: fst.s $fa1, $a1, 8
269 ; LA64D-NEXT: fst.s $fa2, $a1, 4
270 ; LA64D-NEXT: fst.s $fa3, $a1, 0
272 %p = load %f4, ptr %P
273 %R = fadd %f4 %p, < float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00 >
278 define void @test_f8(ptr %P, ptr %S) nounwind {
279 ; LA32F-LABEL: test_f8:
281 ; LA32F-NEXT: addi.w $a2, $zero, 1
282 ; LA32F-NEXT: movgr2fr.w $fa0, $a2
283 ; LA32F-NEXT: pcalau12i $a2, %pc_hi20(.LCPI3_0)
284 ; LA32F-NEXT: addi.w $a2, $a2, %pc_lo12(.LCPI3_0)
285 ; LA32F-NEXT: fld.s $fa1, $a2, 0
286 ; LA32F-NEXT: pcalau12i $a2, %pc_hi20(.LCPI3_1)
287 ; LA32F-NEXT: addi.w $a2, $a2, %pc_lo12(.LCPI3_1)
288 ; LA32F-NEXT: fld.s $fa2, $a2, 0
289 ; LA32F-NEXT: pcalau12i $a2, %pc_hi20(.LCPI3_2)
290 ; LA32F-NEXT: addi.w $a2, $a2, %pc_lo12(.LCPI3_2)
291 ; LA32F-NEXT: fld.s $fa3, $a2, 0
292 ; LA32F-NEXT: fld.s $fa4, $a0, 28
293 ; LA32F-NEXT: fld.s $fa5, $a0, 24
294 ; LA32F-NEXT: fld.s $fa6, $a0, 12
295 ; LA32F-NEXT: fld.s $fa7, $a0, 8
296 ; LA32F-NEXT: fld.s $ft0, $a0, 0
297 ; LA32F-NEXT: fld.s $ft1, $a0, 16
298 ; LA32F-NEXT: fld.s $ft2, $a0, 4
299 ; LA32F-NEXT: ffint.s.w $fa0, $fa0
300 ; LA32F-NEXT: fadd.s $ft0, $ft0, $fa0
301 ; LA32F-NEXT: fadd.s $fa0, $ft1, $fa0
302 ; LA32F-NEXT: fld.s $ft1, $a0, 20
303 ; LA32F-NEXT: fadd.s $ft2, $ft2, $fa1
304 ; LA32F-NEXT: fadd.s $fa7, $fa7, $fa2
305 ; LA32F-NEXT: fadd.s $fa6, $fa6, $fa3
306 ; LA32F-NEXT: fadd.s $fa1, $ft1, $fa1
307 ; LA32F-NEXT: fadd.s $fa2, $fa5, $fa2
308 ; LA32F-NEXT: fadd.s $fa3, $fa4, $fa3
309 ; LA32F-NEXT: fst.s $fa3, $a1, 28
310 ; LA32F-NEXT: fst.s $fa2, $a1, 24
311 ; LA32F-NEXT: fst.s $fa1, $a1, 20
312 ; LA32F-NEXT: fst.s $fa6, $a1, 12
313 ; LA32F-NEXT: fst.s $fa7, $a1, 8
314 ; LA32F-NEXT: fst.s $ft2, $a1, 4
315 ; LA32F-NEXT: fst.s $fa0, $a1, 16
316 ; LA32F-NEXT: fst.s $ft0, $a1, 0
319 ; LA32D-LABEL: test_f8:
321 ; LA32D-NEXT: addi.w $a2, $zero, 1
322 ; LA32D-NEXT: movgr2fr.w $fa0, $a2
323 ; LA32D-NEXT: pcalau12i $a2, %pc_hi20(.LCPI3_0)
324 ; LA32D-NEXT: addi.w $a2, $a2, %pc_lo12(.LCPI3_0)
325 ; LA32D-NEXT: fld.s $fa1, $a2, 0
326 ; LA32D-NEXT: pcalau12i $a2, %pc_hi20(.LCPI3_1)
327 ; LA32D-NEXT: addi.w $a2, $a2, %pc_lo12(.LCPI3_1)
328 ; LA32D-NEXT: fld.s $fa2, $a2, 0
329 ; LA32D-NEXT: pcalau12i $a2, %pc_hi20(.LCPI3_2)
330 ; LA32D-NEXT: addi.w $a2, $a2, %pc_lo12(.LCPI3_2)
331 ; LA32D-NEXT: fld.s $fa3, $a2, 0
332 ; LA32D-NEXT: fld.s $fa4, $a0, 28
333 ; LA32D-NEXT: fld.s $fa5, $a0, 24
334 ; LA32D-NEXT: fld.s $fa6, $a0, 12
335 ; LA32D-NEXT: fld.s $fa7, $a0, 8
336 ; LA32D-NEXT: fld.s $ft0, $a0, 0
337 ; LA32D-NEXT: fld.s $ft1, $a0, 16
338 ; LA32D-NEXT: fld.s $ft2, $a0, 4
339 ; LA32D-NEXT: ffint.s.w $fa0, $fa0
340 ; LA32D-NEXT: fadd.s $ft0, $ft0, $fa0
341 ; LA32D-NEXT: fadd.s $fa0, $ft1, $fa0
342 ; LA32D-NEXT: fld.s $ft1, $a0, 20
343 ; LA32D-NEXT: fadd.s $ft2, $ft2, $fa1
344 ; LA32D-NEXT: fadd.s $fa7, $fa7, $fa2
345 ; LA32D-NEXT: fadd.s $fa6, $fa6, $fa3
346 ; LA32D-NEXT: fadd.s $fa1, $ft1, $fa1
347 ; LA32D-NEXT: fadd.s $fa2, $fa5, $fa2
348 ; LA32D-NEXT: fadd.s $fa3, $fa4, $fa3
349 ; LA32D-NEXT: fst.s $fa3, $a1, 28
350 ; LA32D-NEXT: fst.s $fa2, $a1, 24
351 ; LA32D-NEXT: fst.s $fa1, $a1, 20
352 ; LA32D-NEXT: fst.s $fa6, $a1, 12
353 ; LA32D-NEXT: fst.s $fa7, $a1, 8
354 ; LA32D-NEXT: fst.s $ft2, $a1, 4
355 ; LA32D-NEXT: fst.s $fa0, $a1, 16
356 ; LA32D-NEXT: fst.s $ft0, $a1, 0
359 ; LA64F-LABEL: test_f8:
361 ; LA64F-NEXT: addi.w $a2, $zero, 1
362 ; LA64F-NEXT: movgr2fr.w $fa0, $a2
363 ; LA64F-NEXT: pcalau12i $a2, %pc_hi20(.LCPI3_0)
364 ; LA64F-NEXT: addi.d $a2, $a2, %pc_lo12(.LCPI3_0)
365 ; LA64F-NEXT: fld.s $fa1, $a2, 0
366 ; LA64F-NEXT: pcalau12i $a2, %pc_hi20(.LCPI3_1)
367 ; LA64F-NEXT: addi.d $a2, $a2, %pc_lo12(.LCPI3_1)
368 ; LA64F-NEXT: fld.s $fa2, $a2, 0
369 ; LA64F-NEXT: pcalau12i $a2, %pc_hi20(.LCPI3_2)
370 ; LA64F-NEXT: addi.d $a2, $a2, %pc_lo12(.LCPI3_2)
371 ; LA64F-NEXT: fld.s $fa3, $a2, 0
372 ; LA64F-NEXT: fld.s $fa4, $a0, 28
373 ; LA64F-NEXT: fld.s $fa5, $a0, 24
374 ; LA64F-NEXT: fld.s $fa6, $a0, 12
375 ; LA64F-NEXT: fld.s $fa7, $a0, 8
376 ; LA64F-NEXT: fld.s $ft0, $a0, 0
377 ; LA64F-NEXT: fld.s $ft1, $a0, 16
378 ; LA64F-NEXT: fld.s $ft2, $a0, 4
379 ; LA64F-NEXT: ffint.s.w $fa0, $fa0
380 ; LA64F-NEXT: fadd.s $ft0, $ft0, $fa0
381 ; LA64F-NEXT: fadd.s $fa0, $ft1, $fa0
382 ; LA64F-NEXT: fld.s $ft1, $a0, 20
383 ; LA64F-NEXT: fadd.s $ft2, $ft2, $fa1
384 ; LA64F-NEXT: fadd.s $fa7, $fa7, $fa2
385 ; LA64F-NEXT: fadd.s $fa6, $fa6, $fa3
386 ; LA64F-NEXT: fadd.s $fa1, $ft1, $fa1
387 ; LA64F-NEXT: fadd.s $fa2, $fa5, $fa2
388 ; LA64F-NEXT: fadd.s $fa3, $fa4, $fa3
389 ; LA64F-NEXT: fst.s $fa3, $a1, 28
390 ; LA64F-NEXT: fst.s $fa2, $a1, 24
391 ; LA64F-NEXT: fst.s $fa1, $a1, 20
392 ; LA64F-NEXT: fst.s $fa6, $a1, 12
393 ; LA64F-NEXT: fst.s $fa7, $a1, 8
394 ; LA64F-NEXT: fst.s $ft2, $a1, 4
395 ; LA64F-NEXT: fst.s $fa0, $a1, 16
396 ; LA64F-NEXT: fst.s $ft0, $a1, 0
399 ; LA64D-LABEL: test_f8:
401 ; LA64D-NEXT: addi.w $a2, $zero, 1
402 ; LA64D-NEXT: movgr2fr.w $fa0, $a2
403 ; LA64D-NEXT: pcalau12i $a2, %pc_hi20(.LCPI3_0)
404 ; LA64D-NEXT: addi.d $a2, $a2, %pc_lo12(.LCPI3_0)
405 ; LA64D-NEXT: fld.s $fa1, $a2, 0
406 ; LA64D-NEXT: pcalau12i $a2, %pc_hi20(.LCPI3_1)
407 ; LA64D-NEXT: addi.d $a2, $a2, %pc_lo12(.LCPI3_1)
408 ; LA64D-NEXT: fld.s $fa2, $a2, 0
409 ; LA64D-NEXT: pcalau12i $a2, %pc_hi20(.LCPI3_2)
410 ; LA64D-NEXT: addi.d $a2, $a2, %pc_lo12(.LCPI3_2)
411 ; LA64D-NEXT: fld.s $fa3, $a2, 0
412 ; LA64D-NEXT: fld.s $fa4, $a0, 28
413 ; LA64D-NEXT: fld.s $fa5, $a0, 24
414 ; LA64D-NEXT: fld.s $fa6, $a0, 12
415 ; LA64D-NEXT: fld.s $fa7, $a0, 8
416 ; LA64D-NEXT: fld.s $ft0, $a0, 0
417 ; LA64D-NEXT: fld.s $ft1, $a0, 16
418 ; LA64D-NEXT: fld.s $ft2, $a0, 4
419 ; LA64D-NEXT: ffint.s.w $fa0, $fa0
420 ; LA64D-NEXT: fadd.s $ft0, $ft0, $fa0
421 ; LA64D-NEXT: fadd.s $fa0, $ft1, $fa0
422 ; LA64D-NEXT: fld.s $ft1, $a0, 20
423 ; LA64D-NEXT: fadd.s $ft2, $ft2, $fa1
424 ; LA64D-NEXT: fadd.s $fa7, $fa7, $fa2
425 ; LA64D-NEXT: fadd.s $fa6, $fa6, $fa3
426 ; LA64D-NEXT: fadd.s $fa1, $ft1, $fa1
427 ; LA64D-NEXT: fadd.s $fa2, $fa5, $fa2
428 ; LA64D-NEXT: fadd.s $fa3, $fa4, $fa3
429 ; LA64D-NEXT: fst.s $fa3, $a1, 28
430 ; LA64D-NEXT: fst.s $fa2, $a1, 24
431 ; LA64D-NEXT: fst.s $fa1, $a1, 20
432 ; LA64D-NEXT: fst.s $fa6, $a1, 12
433 ; LA64D-NEXT: fst.s $fa7, $a1, 8
434 ; LA64D-NEXT: fst.s $ft2, $a1, 4
435 ; LA64D-NEXT: fst.s $fa0, $a1, 16
436 ; LA64D-NEXT: fst.s $ft0, $a1, 0
438 %p = load %f8, ptr %P
439 %R = fadd %f8 %p, < float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00 >
444 define void @test_d2(ptr %P, ptr %S) nounwind {
445 ; LA32F-LABEL: test_d2:
447 ; LA32F-NEXT: addi.w $sp, $sp, -32
448 ; LA32F-NEXT: st.w $ra, $sp, 28 # 4-byte Folded Spill
449 ; LA32F-NEXT: st.w $fp, $sp, 24 # 4-byte Folded Spill
450 ; LA32F-NEXT: st.w $s0, $sp, 20 # 4-byte Folded Spill
451 ; LA32F-NEXT: st.w $s1, $sp, 16 # 4-byte Folded Spill
452 ; LA32F-NEXT: st.w $s2, $sp, 12 # 4-byte Folded Spill
453 ; LA32F-NEXT: st.w $s3, $sp, 8 # 4-byte Folded Spill
454 ; LA32F-NEXT: ld.w $fp, $a0, 8
455 ; LA32F-NEXT: ld.w $s0, $a0, 12
456 ; LA32F-NEXT: ld.w $a2, $a0, 0
457 ; LA32F-NEXT: ld.w $a4, $a0, 4
458 ; LA32F-NEXT: move $s1, $a1
459 ; LA32F-NEXT: lu12i.w $a3, 261888
460 ; LA32F-NEXT: move $a0, $a2
461 ; LA32F-NEXT: move $a1, $a4
462 ; LA32F-NEXT: move $a2, $zero
463 ; LA32F-NEXT: bl %plt(__adddf3)
464 ; LA32F-NEXT: move $s2, $a0
465 ; LA32F-NEXT: move $s3, $a1
466 ; LA32F-NEXT: lu12i.w $a3, 262144
467 ; LA32F-NEXT: move $a0, $fp
468 ; LA32F-NEXT: move $a1, $s0
469 ; LA32F-NEXT: move $a2, $zero
470 ; LA32F-NEXT: bl %plt(__adddf3)
471 ; LA32F-NEXT: st.w $a0, $s1, 8
472 ; LA32F-NEXT: st.w $a1, $s1, 12
473 ; LA32F-NEXT: st.w $s2, $s1, 0
474 ; LA32F-NEXT: st.w $s3, $s1, 4
475 ; LA32F-NEXT: ld.w $s3, $sp, 8 # 4-byte Folded Reload
476 ; LA32F-NEXT: ld.w $s2, $sp, 12 # 4-byte Folded Reload
477 ; LA32F-NEXT: ld.w $s1, $sp, 16 # 4-byte Folded Reload
478 ; LA32F-NEXT: ld.w $s0, $sp, 20 # 4-byte Folded Reload
479 ; LA32F-NEXT: ld.w $fp, $sp, 24 # 4-byte Folded Reload
480 ; LA32F-NEXT: ld.w $ra, $sp, 28 # 4-byte Folded Reload
481 ; LA32F-NEXT: addi.w $sp, $sp, 32
484 ; LA32D-LABEL: test_d2:
486 ; LA32D-NEXT: fld.d $fa0, $a0, 8
487 ; LA32D-NEXT: fld.d $fa1, $a0, 0
488 ; LA32D-NEXT: addi.w $a0, $zero, 1
489 ; LA32D-NEXT: movgr2fr.w $fa2, $a0
490 ; LA32D-NEXT: pcalau12i $a0, %pc_hi20(.LCPI4_0)
491 ; LA32D-NEXT: addi.w $a0, $a0, %pc_lo12(.LCPI4_0)
492 ; LA32D-NEXT: fld.d $fa3, $a0, 0
493 ; LA32D-NEXT: ffint.s.w $fa2, $fa2
494 ; LA32D-NEXT: fcvt.d.s $fa2, $fa2
495 ; LA32D-NEXT: fadd.d $fa1, $fa1, $fa2
496 ; LA32D-NEXT: fadd.d $fa0, $fa0, $fa3
497 ; LA32D-NEXT: fst.d $fa0, $a1, 8
498 ; LA32D-NEXT: fst.d $fa1, $a1, 0
501 ; LA64F-LABEL: test_d2:
503 ; LA64F-NEXT: addi.d $sp, $sp, -32
504 ; LA64F-NEXT: st.d $ra, $sp, 24 # 8-byte Folded Spill
505 ; LA64F-NEXT: st.d $fp, $sp, 16 # 8-byte Folded Spill
506 ; LA64F-NEXT: st.d $s0, $sp, 8 # 8-byte Folded Spill
507 ; LA64F-NEXT: st.d $s1, $sp, 0 # 8-byte Folded Spill
508 ; LA64F-NEXT: ld.d $fp, $a0, 8
509 ; LA64F-NEXT: ld.d $a0, $a0, 0
510 ; LA64F-NEXT: move $s0, $a1
511 ; LA64F-NEXT: lu52i.d $a1, $zero, 1023
512 ; LA64F-NEXT: bl %plt(__adddf3)
513 ; LA64F-NEXT: move $s1, $a0
514 ; LA64F-NEXT: lu52i.d $a1, $zero, 1024
515 ; LA64F-NEXT: move $a0, $fp
516 ; LA64F-NEXT: bl %plt(__adddf3)
517 ; LA64F-NEXT: st.d $a0, $s0, 8
518 ; LA64F-NEXT: st.d $s1, $s0, 0
519 ; LA64F-NEXT: ld.d $s1, $sp, 0 # 8-byte Folded Reload
520 ; LA64F-NEXT: ld.d $s0, $sp, 8 # 8-byte Folded Reload
521 ; LA64F-NEXT: ld.d $fp, $sp, 16 # 8-byte Folded Reload
522 ; LA64F-NEXT: ld.d $ra, $sp, 24 # 8-byte Folded Reload
523 ; LA64F-NEXT: addi.d $sp, $sp, 32
526 ; LA64D-LABEL: test_d2:
528 ; LA64D-NEXT: fld.d $fa0, $a0, 8
529 ; LA64D-NEXT: fld.d $fa1, $a0, 0
530 ; LA64D-NEXT: addi.d $a0, $zero, 1
531 ; LA64D-NEXT: pcalau12i $a2, %pc_hi20(.LCPI4_0)
532 ; LA64D-NEXT: addi.d $a2, $a2, %pc_lo12(.LCPI4_0)
533 ; LA64D-NEXT: fld.d $fa2, $a2, 0
534 ; LA64D-NEXT: movgr2fr.d $fa3, $a0
535 ; LA64D-NEXT: ffint.d.l $fa3, $fa3
536 ; LA64D-NEXT: fadd.d $fa1, $fa1, $fa3
537 ; LA64D-NEXT: fadd.d $fa0, $fa0, $fa2
538 ; LA64D-NEXT: fst.d $fa0, $a1, 8
539 ; LA64D-NEXT: fst.d $fa1, $a1, 0
541 %p = load %d2, ptr %P
542 %R = fadd %d2 %p, < double 1.000000e+00, double 2.000000e+00 >
547 define void @test_d4(ptr %P, ptr %S) nounwind {
548 ; LA32F-LABEL: test_d4:
550 ; LA32F-NEXT: addi.w $sp, $sp, -48
551 ; LA32F-NEXT: st.w $ra, $sp, 44 # 4-byte Folded Spill
552 ; LA32F-NEXT: st.w $fp, $sp, 40 # 4-byte Folded Spill
553 ; LA32F-NEXT: st.w $s0, $sp, 36 # 4-byte Folded Spill
554 ; LA32F-NEXT: st.w $s1, $sp, 32 # 4-byte Folded Spill
555 ; LA32F-NEXT: st.w $s2, $sp, 28 # 4-byte Folded Spill
556 ; LA32F-NEXT: st.w $s3, $sp, 24 # 4-byte Folded Spill
557 ; LA32F-NEXT: st.w $s4, $sp, 20 # 4-byte Folded Spill
558 ; LA32F-NEXT: st.w $s5, $sp, 16 # 4-byte Folded Spill
559 ; LA32F-NEXT: st.w $s6, $sp, 12 # 4-byte Folded Spill
560 ; LA32F-NEXT: st.w $s7, $sp, 8 # 4-byte Folded Spill
561 ; LA32F-NEXT: ld.w $fp, $a0, 24
562 ; LA32F-NEXT: ld.w $s0, $a0, 28
563 ; LA32F-NEXT: ld.w $s1, $a0, 16
564 ; LA32F-NEXT: ld.w $s2, $a0, 20
565 ; LA32F-NEXT: ld.w $s3, $a0, 8
566 ; LA32F-NEXT: ld.w $s4, $a0, 12
567 ; LA32F-NEXT: ld.w $a2, $a0, 0
568 ; LA32F-NEXT: ld.w $a4, $a0, 4
569 ; LA32F-NEXT: move $s5, $a1
570 ; LA32F-NEXT: lu12i.w $a3, 261888
571 ; LA32F-NEXT: move $a0, $a2
572 ; LA32F-NEXT: move $a1, $a4
573 ; LA32F-NEXT: move $a2, $zero
574 ; LA32F-NEXT: bl %plt(__adddf3)
575 ; LA32F-NEXT: move $s6, $a0
576 ; LA32F-NEXT: move $s7, $a1
577 ; LA32F-NEXT: lu12i.w $a3, 262144
578 ; LA32F-NEXT: move $a0, $s3
579 ; LA32F-NEXT: move $a1, $s4
580 ; LA32F-NEXT: move $a2, $zero
581 ; LA32F-NEXT: bl %plt(__adddf3)
582 ; LA32F-NEXT: move $s3, $a0
583 ; LA32F-NEXT: move $s4, $a1
584 ; LA32F-NEXT: lu12i.w $a3, 262272
585 ; LA32F-NEXT: move $a0, $s1
586 ; LA32F-NEXT: move $a1, $s2
587 ; LA32F-NEXT: move $a2, $zero
588 ; LA32F-NEXT: bl %plt(__adddf3)
589 ; LA32F-NEXT: move $s1, $a0
590 ; LA32F-NEXT: move $s2, $a1
591 ; LA32F-NEXT: lu12i.w $a3, 262400
592 ; LA32F-NEXT: move $a0, $fp
593 ; LA32F-NEXT: move $a1, $s0
594 ; LA32F-NEXT: move $a2, $zero
595 ; LA32F-NEXT: bl %plt(__adddf3)
596 ; LA32F-NEXT: st.w $a0, $s5, 24
597 ; LA32F-NEXT: st.w $a1, $s5, 28
598 ; LA32F-NEXT: st.w $s1, $s5, 16
599 ; LA32F-NEXT: st.w $s2, $s5, 20
600 ; LA32F-NEXT: st.w $s3, $s5, 8
601 ; LA32F-NEXT: st.w $s4, $s5, 12
602 ; LA32F-NEXT: st.w $s6, $s5, 0
603 ; LA32F-NEXT: st.w $s7, $s5, 4
604 ; LA32F-NEXT: ld.w $s7, $sp, 8 # 4-byte Folded Reload
605 ; LA32F-NEXT: ld.w $s6, $sp, 12 # 4-byte Folded Reload
606 ; LA32F-NEXT: ld.w $s5, $sp, 16 # 4-byte Folded Reload
607 ; LA32F-NEXT: ld.w $s4, $sp, 20 # 4-byte Folded Reload
608 ; LA32F-NEXT: ld.w $s3, $sp, 24 # 4-byte Folded Reload
609 ; LA32F-NEXT: ld.w $s2, $sp, 28 # 4-byte Folded Reload
610 ; LA32F-NEXT: ld.w $s1, $sp, 32 # 4-byte Folded Reload
611 ; LA32F-NEXT: ld.w $s0, $sp, 36 # 4-byte Folded Reload
612 ; LA32F-NEXT: ld.w $fp, $sp, 40 # 4-byte Folded Reload
613 ; LA32F-NEXT: ld.w $ra, $sp, 44 # 4-byte Folded Reload
614 ; LA32F-NEXT: addi.w $sp, $sp, 48
617 ; LA32D-LABEL: test_d4:
619 ; LA32D-NEXT: fld.d $fa0, $a0, 24
620 ; LA32D-NEXT: fld.d $fa1, $a0, 16
621 ; LA32D-NEXT: fld.d $fa2, $a0, 8
622 ; LA32D-NEXT: fld.d $fa3, $a0, 0
623 ; LA32D-NEXT: addi.w $a0, $zero, 1
624 ; LA32D-NEXT: movgr2fr.w $fa4, $a0
625 ; LA32D-NEXT: ffint.s.w $fa4, $fa4
626 ; LA32D-NEXT: fcvt.d.s $fa4, $fa4
627 ; LA32D-NEXT: pcalau12i $a0, %pc_hi20(.LCPI5_0)
628 ; LA32D-NEXT: addi.w $a0, $a0, %pc_lo12(.LCPI5_0)
629 ; LA32D-NEXT: fld.d $fa5, $a0, 0
630 ; LA32D-NEXT: pcalau12i $a0, %pc_hi20(.LCPI5_1)
631 ; LA32D-NEXT: addi.w $a0, $a0, %pc_lo12(.LCPI5_1)
632 ; LA32D-NEXT: fld.d $fa6, $a0, 0
633 ; LA32D-NEXT: pcalau12i $a0, %pc_hi20(.LCPI5_2)
634 ; LA32D-NEXT: addi.w $a0, $a0, %pc_lo12(.LCPI5_2)
635 ; LA32D-NEXT: fld.d $fa7, $a0, 0
636 ; LA32D-NEXT: fadd.d $fa3, $fa3, $fa4
637 ; LA32D-NEXT: fadd.d $fa2, $fa2, $fa5
638 ; LA32D-NEXT: fadd.d $fa1, $fa1, $fa6
639 ; LA32D-NEXT: fadd.d $fa0, $fa0, $fa7
640 ; LA32D-NEXT: fst.d $fa0, $a1, 24
641 ; LA32D-NEXT: fst.d $fa1, $a1, 16
642 ; LA32D-NEXT: fst.d $fa2, $a1, 8
643 ; LA32D-NEXT: fst.d $fa3, $a1, 0
646 ; LA64F-LABEL: test_d4:
648 ; LA64F-NEXT: addi.d $sp, $sp, -48
649 ; LA64F-NEXT: st.d $ra, $sp, 40 # 8-byte Folded Spill
650 ; LA64F-NEXT: st.d $fp, $sp, 32 # 8-byte Folded Spill
651 ; LA64F-NEXT: st.d $s0, $sp, 24 # 8-byte Folded Spill
652 ; LA64F-NEXT: st.d $s1, $sp, 16 # 8-byte Folded Spill
653 ; LA64F-NEXT: st.d $s2, $sp, 8 # 8-byte Folded Spill
654 ; LA64F-NEXT: st.d $s3, $sp, 0 # 8-byte Folded Spill
655 ; LA64F-NEXT: ld.d $fp, $a0, 24
656 ; LA64F-NEXT: ld.d $s0, $a0, 8
657 ; LA64F-NEXT: ld.d $s1, $a0, 0
658 ; LA64F-NEXT: ld.d $a0, $a0, 16
659 ; LA64F-NEXT: move $s2, $a1
660 ; LA64F-NEXT: ori $a1, $zero, 0
661 ; LA64F-NEXT: lu32i.d $a1, -524288
662 ; LA64F-NEXT: lu52i.d $a1, $a1, 1024
663 ; LA64F-NEXT: bl %plt(__adddf3)
664 ; LA64F-NEXT: move $s3, $a0
665 ; LA64F-NEXT: lu52i.d $a1, $zero, 1023
666 ; LA64F-NEXT: move $a0, $s1
667 ; LA64F-NEXT: bl %plt(__adddf3)
668 ; LA64F-NEXT: move $s1, $a0
669 ; LA64F-NEXT: lu52i.d $a1, $zero, 1024
670 ; LA64F-NEXT: move $a0, $s0
671 ; LA64F-NEXT: bl %plt(__adddf3)
672 ; LA64F-NEXT: move $s0, $a0
673 ; LA64F-NEXT: lu52i.d $a1, $zero, 1025
674 ; LA64F-NEXT: move $a0, $fp
675 ; LA64F-NEXT: bl %plt(__adddf3)
676 ; LA64F-NEXT: st.d $a0, $s2, 24
677 ; LA64F-NEXT: st.d $s0, $s2, 8
678 ; LA64F-NEXT: st.d $s1, $s2, 0
679 ; LA64F-NEXT: st.d $s3, $s2, 16
680 ; LA64F-NEXT: ld.d $s3, $sp, 0 # 8-byte Folded Reload
681 ; LA64F-NEXT: ld.d $s2, $sp, 8 # 8-byte Folded Reload
682 ; LA64F-NEXT: ld.d $s1, $sp, 16 # 8-byte Folded Reload
683 ; LA64F-NEXT: ld.d $s0, $sp, 24 # 8-byte Folded Reload
684 ; LA64F-NEXT: ld.d $fp, $sp, 32 # 8-byte Folded Reload
685 ; LA64F-NEXT: ld.d $ra, $sp, 40 # 8-byte Folded Reload
686 ; LA64F-NEXT: addi.d $sp, $sp, 48
689 ; LA64D-LABEL: test_d4:
691 ; LA64D-NEXT: fld.d $fa0, $a0, 24
692 ; LA64D-NEXT: fld.d $fa1, $a0, 16
693 ; LA64D-NEXT: fld.d $fa2, $a0, 8
694 ; LA64D-NEXT: fld.d $fa3, $a0, 0
695 ; LA64D-NEXT: addi.d $a0, $zero, 1
696 ; LA64D-NEXT: movgr2fr.d $fa4, $a0
697 ; LA64D-NEXT: ffint.d.l $fa4, $fa4
698 ; LA64D-NEXT: pcalau12i $a0, %pc_hi20(.LCPI5_0)
699 ; LA64D-NEXT: addi.d $a0, $a0, %pc_lo12(.LCPI5_0)
700 ; LA64D-NEXT: fld.d $fa5, $a0, 0
701 ; LA64D-NEXT: pcalau12i $a0, %pc_hi20(.LCPI5_1)
702 ; LA64D-NEXT: addi.d $a0, $a0, %pc_lo12(.LCPI5_1)
703 ; LA64D-NEXT: fld.d $fa6, $a0, 0
704 ; LA64D-NEXT: pcalau12i $a0, %pc_hi20(.LCPI5_2)
705 ; LA64D-NEXT: addi.d $a0, $a0, %pc_lo12(.LCPI5_2)
706 ; LA64D-NEXT: fld.d $fa7, $a0, 0
707 ; LA64D-NEXT: fadd.d $fa3, $fa3, $fa4
708 ; LA64D-NEXT: fadd.d $fa2, $fa2, $fa5
709 ; LA64D-NEXT: fadd.d $fa1, $fa1, $fa6
710 ; LA64D-NEXT: fadd.d $fa0, $fa0, $fa7
711 ; LA64D-NEXT: fst.d $fa0, $a1, 24
712 ; LA64D-NEXT: fst.d $fa1, $a1, 16
713 ; LA64D-NEXT: fst.d $fa2, $a1, 8
714 ; LA64D-NEXT: fst.d $fa3, $a1, 0
716 %p = load %d4, ptr %P
717 %R = fadd %d4 %p, < double 1.000000e+00, double 2.000000e+00, double 3.000000e+00, double 4.000000e+00 >
722 define void @test_d8(ptr %P, ptr %S) nounwind {
723 ; LA32F-LABEL: test_d8:
725 ; LA32F-NEXT: addi.w $sp, $sp, -96
726 ; LA32F-NEXT: st.w $ra, $sp, 92 # 4-byte Folded Spill
727 ; LA32F-NEXT: st.w $fp, $sp, 88 # 4-byte Folded Spill
728 ; LA32F-NEXT: st.w $s0, $sp, 84 # 4-byte Folded Spill
729 ; LA32F-NEXT: st.w $s1, $sp, 80 # 4-byte Folded Spill
730 ; LA32F-NEXT: st.w $s2, $sp, 76 # 4-byte Folded Spill
731 ; LA32F-NEXT: st.w $s3, $sp, 72 # 4-byte Folded Spill
732 ; LA32F-NEXT: st.w $s4, $sp, 68 # 4-byte Folded Spill
733 ; LA32F-NEXT: st.w $s5, $sp, 64 # 4-byte Folded Spill
734 ; LA32F-NEXT: st.w $s6, $sp, 60 # 4-byte Folded Spill
735 ; LA32F-NEXT: st.w $s7, $sp, 56 # 4-byte Folded Spill
736 ; LA32F-NEXT: st.w $s8, $sp, 52 # 4-byte Folded Spill
737 ; LA32F-NEXT: ld.w $a2, $a0, 56
738 ; LA32F-NEXT: st.w $a2, $sp, 48 # 4-byte Folded Spill
739 ; LA32F-NEXT: ld.w $a2, $a0, 60
740 ; LA32F-NEXT: st.w $a2, $sp, 44 # 4-byte Folded Spill
741 ; LA32F-NEXT: ld.w $a2, $a0, 48
742 ; LA32F-NEXT: st.w $a2, $sp, 32 # 4-byte Folded Spill
743 ; LA32F-NEXT: ld.w $a2, $a0, 52
744 ; LA32F-NEXT: st.w $a2, $sp, 28 # 4-byte Folded Spill
745 ; LA32F-NEXT: ld.w $s8, $a0, 40
746 ; LA32F-NEXT: ld.w $a2, $a0, 44
747 ; LA32F-NEXT: st.w $a2, $sp, 16 # 4-byte Folded Spill
748 ; LA32F-NEXT: ld.w $s3, $a0, 32
749 ; LA32F-NEXT: ld.w $s4, $a0, 36
750 ; LA32F-NEXT: ld.w $s5, $a0, 24
751 ; LA32F-NEXT: ld.w $s6, $a0, 28
752 ; LA32F-NEXT: ld.w $s1, $a0, 16
753 ; LA32F-NEXT: ld.w $s2, $a0, 20
754 ; LA32F-NEXT: ld.w $s7, $a0, 8
755 ; LA32F-NEXT: ld.w $s0, $a0, 12
756 ; LA32F-NEXT: ld.w $a2, $a0, 0
757 ; LA32F-NEXT: ld.w $a4, $a0, 4
758 ; LA32F-NEXT: move $fp, $a1
759 ; LA32F-NEXT: lu12i.w $a3, 261888
760 ; LA32F-NEXT: move $a0, $a2
761 ; LA32F-NEXT: move $a1, $a4
762 ; LA32F-NEXT: move $a2, $zero
763 ; LA32F-NEXT: bl %plt(__adddf3)
764 ; LA32F-NEXT: st.w $a0, $sp, 40 # 4-byte Folded Spill
765 ; LA32F-NEXT: st.w $a1, $sp, 36 # 4-byte Folded Spill
766 ; LA32F-NEXT: lu12i.w $a3, 262144
767 ; LA32F-NEXT: move $a0, $s7
768 ; LA32F-NEXT: move $a1, $s0
769 ; LA32F-NEXT: move $a2, $zero
770 ; LA32F-NEXT: move $s0, $a3
771 ; LA32F-NEXT: bl %plt(__adddf3)
772 ; LA32F-NEXT: st.w $a0, $sp, 24 # 4-byte Folded Spill
773 ; LA32F-NEXT: st.w $a1, $sp, 20 # 4-byte Folded Spill
774 ; LA32F-NEXT: lu12i.w $s7, 262272
775 ; LA32F-NEXT: move $a0, $s1
776 ; LA32F-NEXT: move $a1, $s2
777 ; LA32F-NEXT: move $a2, $zero
778 ; LA32F-NEXT: move $a3, $s7
779 ; LA32F-NEXT: bl %plt(__adddf3)
780 ; LA32F-NEXT: st.w $a0, $sp, 12 # 4-byte Folded Spill
781 ; LA32F-NEXT: move $s2, $a1
782 ; LA32F-NEXT: lu12i.w $a3, 262400
783 ; LA32F-NEXT: move $a0, $s5
784 ; LA32F-NEXT: move $a1, $s6
785 ; LA32F-NEXT: move $a2, $zero
786 ; LA32F-NEXT: bl %plt(__adddf3)
787 ; LA32F-NEXT: move $s5, $a0
788 ; LA32F-NEXT: move $s6, $a1
789 ; LA32F-NEXT: move $a0, $s3
790 ; LA32F-NEXT: move $a1, $s4
791 ; LA32F-NEXT: move $a2, $zero
792 ; LA32F-NEXT: lu12i.w $a3, 261888
793 ; LA32F-NEXT: bl %plt(__adddf3)
794 ; LA32F-NEXT: move $s3, $a0
795 ; LA32F-NEXT: move $s4, $a1
796 ; LA32F-NEXT: move $a0, $s8
797 ; LA32F-NEXT: ld.w $a1, $sp, 16 # 4-byte Folded Reload
798 ; LA32F-NEXT: move $a2, $zero
799 ; LA32F-NEXT: move $a3, $s0
800 ; LA32F-NEXT: bl %plt(__adddf3)
801 ; LA32F-NEXT: move $s8, $a0
802 ; LA32F-NEXT: move $s0, $a1
803 ; LA32F-NEXT: ld.w $a0, $sp, 32 # 4-byte Folded Reload
804 ; LA32F-NEXT: ld.w $a1, $sp, 28 # 4-byte Folded Reload
805 ; LA32F-NEXT: move $a2, $zero
806 ; LA32F-NEXT: move $a3, $s7
807 ; LA32F-NEXT: bl %plt(__adddf3)
808 ; LA32F-NEXT: move $s7, $a0
809 ; LA32F-NEXT: move $s1, $a1
810 ; LA32F-NEXT: ld.w $a0, $sp, 48 # 4-byte Folded Reload
811 ; LA32F-NEXT: ld.w $a1, $sp, 44 # 4-byte Folded Reload
812 ; LA32F-NEXT: move $a2, $zero
813 ; LA32F-NEXT: lu12i.w $a3, 262400
814 ; LA32F-NEXT: bl %plt(__adddf3)
815 ; LA32F-NEXT: st.w $a0, $fp, 56
816 ; LA32F-NEXT: st.w $a1, $fp, 60
817 ; LA32F-NEXT: st.w $s7, $fp, 48
818 ; LA32F-NEXT: st.w $s1, $fp, 52
819 ; LA32F-NEXT: st.w $s8, $fp, 40
820 ; LA32F-NEXT: st.w $s0, $fp, 44
821 ; LA32F-NEXT: st.w $s3, $fp, 32
822 ; LA32F-NEXT: st.w $s4, $fp, 36
823 ; LA32F-NEXT: st.w $s5, $fp, 24
824 ; LA32F-NEXT: st.w $s6, $fp, 28
825 ; LA32F-NEXT: ld.w $a0, $sp, 12 # 4-byte Folded Reload
826 ; LA32F-NEXT: st.w $a0, $fp, 16
827 ; LA32F-NEXT: st.w $s2, $fp, 20
828 ; LA32F-NEXT: ld.w $a0, $sp, 24 # 4-byte Folded Reload
829 ; LA32F-NEXT: st.w $a0, $fp, 8
830 ; LA32F-NEXT: ld.w $a0, $sp, 20 # 4-byte Folded Reload
831 ; LA32F-NEXT: st.w $a0, $fp, 12
832 ; LA32F-NEXT: ld.w $a0, $sp, 40 # 4-byte Folded Reload
833 ; LA32F-NEXT: st.w $a0, $fp, 0
834 ; LA32F-NEXT: ld.w $a0, $sp, 36 # 4-byte Folded Reload
835 ; LA32F-NEXT: st.w $a0, $fp, 4
836 ; LA32F-NEXT: ld.w $s8, $sp, 52 # 4-byte Folded Reload
837 ; LA32F-NEXT: ld.w $s7, $sp, 56 # 4-byte Folded Reload
838 ; LA32F-NEXT: ld.w $s6, $sp, 60 # 4-byte Folded Reload
839 ; LA32F-NEXT: ld.w $s5, $sp, 64 # 4-byte Folded Reload
840 ; LA32F-NEXT: ld.w $s4, $sp, 68 # 4-byte Folded Reload
841 ; LA32F-NEXT: ld.w $s3, $sp, 72 # 4-byte Folded Reload
842 ; LA32F-NEXT: ld.w $s2, $sp, 76 # 4-byte Folded Reload
843 ; LA32F-NEXT: ld.w $s1, $sp, 80 # 4-byte Folded Reload
844 ; LA32F-NEXT: ld.w $s0, $sp, 84 # 4-byte Folded Reload
845 ; LA32F-NEXT: ld.w $fp, $sp, 88 # 4-byte Folded Reload
846 ; LA32F-NEXT: ld.w $ra, $sp, 92 # 4-byte Folded Reload
847 ; LA32F-NEXT: addi.w $sp, $sp, 96
850 ; LA32D-LABEL: test_d8:
852 ; LA32D-NEXT: addi.w $a2, $zero, 1
853 ; LA32D-NEXT: movgr2fr.w $fa0, $a2
854 ; LA32D-NEXT: pcalau12i $a2, %pc_hi20(.LCPI6_0)
855 ; LA32D-NEXT: addi.w $a2, $a2, %pc_lo12(.LCPI6_0)
856 ; LA32D-NEXT: fld.d $fa1, $a2, 0
857 ; LA32D-NEXT: pcalau12i $a2, %pc_hi20(.LCPI6_1)
858 ; LA32D-NEXT: addi.w $a2, $a2, %pc_lo12(.LCPI6_1)
859 ; LA32D-NEXT: fld.d $fa2, $a2, 0
860 ; LA32D-NEXT: pcalau12i $a2, %pc_hi20(.LCPI6_2)
861 ; LA32D-NEXT: addi.w $a2, $a2, %pc_lo12(.LCPI6_2)
862 ; LA32D-NEXT: fld.d $fa3, $a2, 0
863 ; LA32D-NEXT: fld.d $fa4, $a0, 56
864 ; LA32D-NEXT: fld.d $fa5, $a0, 48
865 ; LA32D-NEXT: fld.d $fa6, $a0, 24
866 ; LA32D-NEXT: fld.d $fa7, $a0, 16
867 ; LA32D-NEXT: fld.d $ft0, $a0, 8
868 ; LA32D-NEXT: fld.d $ft1, $a0, 0
869 ; LA32D-NEXT: fld.d $ft2, $a0, 32
870 ; LA32D-NEXT: ffint.s.w $fa0, $fa0
871 ; LA32D-NEXT: fcvt.d.s $fa0, $fa0
872 ; LA32D-NEXT: fadd.d $ft1, $ft1, $fa0
873 ; LA32D-NEXT: fadd.d $fa0, $ft2, $fa0
874 ; LA32D-NEXT: fld.d $ft2, $a0, 40
875 ; LA32D-NEXT: fadd.d $ft0, $ft0, $fa1
876 ; LA32D-NEXT: fadd.d $fa7, $fa7, $fa2
877 ; LA32D-NEXT: fadd.d $fa6, $fa6, $fa3
878 ; LA32D-NEXT: fadd.d $fa1, $ft2, $fa1
879 ; LA32D-NEXT: fadd.d $fa2, $fa5, $fa2
880 ; LA32D-NEXT: fadd.d $fa3, $fa4, $fa3
881 ; LA32D-NEXT: fst.d $fa3, $a1, 56
882 ; LA32D-NEXT: fst.d $fa2, $a1, 48
883 ; LA32D-NEXT: fst.d $fa1, $a1, 40
884 ; LA32D-NEXT: fst.d $fa6, $a1, 24
885 ; LA32D-NEXT: fst.d $fa7, $a1, 16
886 ; LA32D-NEXT: fst.d $ft0, $a1, 8
887 ; LA32D-NEXT: fst.d $fa0, $a1, 32
888 ; LA32D-NEXT: fst.d $ft1, $a1, 0
891 ; LA64F-LABEL: test_d8:
893 ; LA64F-NEXT: addi.d $sp, $sp, -112
894 ; LA64F-NEXT: st.d $ra, $sp, 104 # 8-byte Folded Spill
895 ; LA64F-NEXT: st.d $fp, $sp, 96 # 8-byte Folded Spill
896 ; LA64F-NEXT: st.d $s0, $sp, 88 # 8-byte Folded Spill
897 ; LA64F-NEXT: st.d $s1, $sp, 80 # 8-byte Folded Spill
898 ; LA64F-NEXT: st.d $s2, $sp, 72 # 8-byte Folded Spill
899 ; LA64F-NEXT: st.d $s3, $sp, 64 # 8-byte Folded Spill
900 ; LA64F-NEXT: st.d $s4, $sp, 56 # 8-byte Folded Spill
901 ; LA64F-NEXT: st.d $s5, $sp, 48 # 8-byte Folded Spill
902 ; LA64F-NEXT: st.d $s6, $sp, 40 # 8-byte Folded Spill
903 ; LA64F-NEXT: st.d $s7, $sp, 32 # 8-byte Folded Spill
904 ; LA64F-NEXT: st.d $s8, $sp, 24 # 8-byte Folded Spill
905 ; LA64F-NEXT: ld.d $a2, $a0, 56
906 ; LA64F-NEXT: st.d $a2, $sp, 16 # 8-byte Folded Spill
907 ; LA64F-NEXT: ld.d $s1, $a0, 40
908 ; LA64F-NEXT: ld.d $s2, $a0, 32
909 ; LA64F-NEXT: ld.d $s3, $a0, 24
910 ; LA64F-NEXT: ld.d $s4, $a0, 8
911 ; LA64F-NEXT: ld.d $s5, $a0, 0
912 ; LA64F-NEXT: ld.d $s6, $a0, 48
913 ; LA64F-NEXT: ld.d $a0, $a0, 16
914 ; LA64F-NEXT: move $fp, $a1
915 ; LA64F-NEXT: ori $a1, $zero, 0
916 ; LA64F-NEXT: lu32i.d $a1, -524288
917 ; LA64F-NEXT: lu52i.d $s7, $a1, 1024
918 ; LA64F-NEXT: move $a1, $s7
919 ; LA64F-NEXT: bl %plt(__adddf3)
920 ; LA64F-NEXT: st.d $a0, $sp, 8 # 8-byte Folded Spill
921 ; LA64F-NEXT: move $a0, $s6
922 ; LA64F-NEXT: move $a1, $s7
923 ; LA64F-NEXT: bl %plt(__adddf3)
924 ; LA64F-NEXT: move $s6, $a0
925 ; LA64F-NEXT: lu52i.d $s7, $zero, 1023
926 ; LA64F-NEXT: move $a0, $s5
927 ; LA64F-NEXT: move $a1, $s7
928 ; LA64F-NEXT: bl %plt(__adddf3)
929 ; LA64F-NEXT: move $s5, $a0
930 ; LA64F-NEXT: lu52i.d $s0, $zero, 1024
931 ; LA64F-NEXT: move $a0, $s4
932 ; LA64F-NEXT: move $a1, $s0
933 ; LA64F-NEXT: bl %plt(__adddf3)
934 ; LA64F-NEXT: move $s4, $a0
935 ; LA64F-NEXT: lu52i.d $s8, $zero, 1025
936 ; LA64F-NEXT: move $a0, $s3
937 ; LA64F-NEXT: move $a1, $s8
938 ; LA64F-NEXT: bl %plt(__adddf3)
939 ; LA64F-NEXT: move $s3, $a0
940 ; LA64F-NEXT: move $a0, $s2
941 ; LA64F-NEXT: move $a1, $s7
942 ; LA64F-NEXT: bl %plt(__adddf3)
943 ; LA64F-NEXT: move $s2, $a0
944 ; LA64F-NEXT: move $a0, $s1
945 ; LA64F-NEXT: move $a1, $s0
946 ; LA64F-NEXT: bl %plt(__adddf3)
947 ; LA64F-NEXT: move $s0, $a0
948 ; LA64F-NEXT: ld.d $a0, $sp, 16 # 8-byte Folded Reload
949 ; LA64F-NEXT: move $a1, $s8
950 ; LA64F-NEXT: bl %plt(__adddf3)
951 ; LA64F-NEXT: st.d $a0, $fp, 56
952 ; LA64F-NEXT: st.d $s0, $fp, 40
953 ; LA64F-NEXT: st.d $s2, $fp, 32
954 ; LA64F-NEXT: st.d $s3, $fp, 24
955 ; LA64F-NEXT: st.d $s4, $fp, 8
956 ; LA64F-NEXT: st.d $s5, $fp, 0
957 ; LA64F-NEXT: st.d $s6, $fp, 48
958 ; LA64F-NEXT: ld.d $a0, $sp, 8 # 8-byte Folded Reload
959 ; LA64F-NEXT: st.d $a0, $fp, 16
960 ; LA64F-NEXT: ld.d $s8, $sp, 24 # 8-byte Folded Reload
961 ; LA64F-NEXT: ld.d $s7, $sp, 32 # 8-byte Folded Reload
962 ; LA64F-NEXT: ld.d $s6, $sp, 40 # 8-byte Folded Reload
963 ; LA64F-NEXT: ld.d $s5, $sp, 48 # 8-byte Folded Reload
964 ; LA64F-NEXT: ld.d $s4, $sp, 56 # 8-byte Folded Reload
965 ; LA64F-NEXT: ld.d $s3, $sp, 64 # 8-byte Folded Reload
966 ; LA64F-NEXT: ld.d $s2, $sp, 72 # 8-byte Folded Reload
967 ; LA64F-NEXT: ld.d $s1, $sp, 80 # 8-byte Folded Reload
968 ; LA64F-NEXT: ld.d $s0, $sp, 88 # 8-byte Folded Reload
969 ; LA64F-NEXT: ld.d $fp, $sp, 96 # 8-byte Folded Reload
970 ; LA64F-NEXT: ld.d $ra, $sp, 104 # 8-byte Folded Reload
971 ; LA64F-NEXT: addi.d $sp, $sp, 112
974 ; LA64D-LABEL: test_d8:
976 ; LA64D-NEXT: addi.d $a2, $zero, 1
977 ; LA64D-NEXT: movgr2fr.d $fa0, $a2
978 ; LA64D-NEXT: pcalau12i $a2, %pc_hi20(.LCPI6_0)
979 ; LA64D-NEXT: addi.d $a2, $a2, %pc_lo12(.LCPI6_0)
980 ; LA64D-NEXT: fld.d $fa1, $a2, 0
981 ; LA64D-NEXT: pcalau12i $a2, %pc_hi20(.LCPI6_1)
982 ; LA64D-NEXT: addi.d $a2, $a2, %pc_lo12(.LCPI6_1)
983 ; LA64D-NEXT: fld.d $fa2, $a2, 0
984 ; LA64D-NEXT: pcalau12i $a2, %pc_hi20(.LCPI6_2)
985 ; LA64D-NEXT: addi.d $a2, $a2, %pc_lo12(.LCPI6_2)
986 ; LA64D-NEXT: fld.d $fa3, $a2, 0
987 ; LA64D-NEXT: fld.d $fa4, $a0, 56
988 ; LA64D-NEXT: fld.d $fa5, $a0, 48
989 ; LA64D-NEXT: fld.d $fa6, $a0, 24
990 ; LA64D-NEXT: fld.d $fa7, $a0, 16
991 ; LA64D-NEXT: fld.d $ft0, $a0, 0
992 ; LA64D-NEXT: fld.d $ft1, $a0, 32
993 ; LA64D-NEXT: fld.d $ft2, $a0, 8
994 ; LA64D-NEXT: ffint.d.l $fa0, $fa0
995 ; LA64D-NEXT: fadd.d $ft0, $ft0, $fa0
996 ; LA64D-NEXT: fadd.d $fa0, $ft1, $fa0
997 ; LA64D-NEXT: fld.d $ft1, $a0, 40
998 ; LA64D-NEXT: fadd.d $ft2, $ft2, $fa1
999 ; LA64D-NEXT: fadd.d $fa7, $fa7, $fa2
1000 ; LA64D-NEXT: fadd.d $fa6, $fa6, $fa3
1001 ; LA64D-NEXT: fadd.d $fa1, $ft1, $fa1
1002 ; LA64D-NEXT: fadd.d $fa2, $fa5, $fa2
1003 ; LA64D-NEXT: fadd.d $fa3, $fa4, $fa3
1004 ; LA64D-NEXT: fst.d $fa3, $a1, 56
1005 ; LA64D-NEXT: fst.d $fa2, $a1, 48
1006 ; LA64D-NEXT: fst.d $fa1, $a1, 40
1007 ; LA64D-NEXT: fst.d $fa6, $a1, 24
1008 ; LA64D-NEXT: fst.d $fa7, $a1, 16
1009 ; LA64D-NEXT: fst.d $ft2, $a1, 8
1010 ; LA64D-NEXT: fst.d $fa0, $a1, 32
1011 ; LA64D-NEXT: fst.d $ft0, $a1, 0
1013 %p = load %d8, ptr %P
1014 %R = fadd %d8 %p, < double 1.000000e+00, double 2.000000e+00, double 3.000000e+00, double 4.000000e+00, double 1.000000e+00, double 2.000000e+00, double 3.000000e+00, double 4.000000e+00 >
1015 store %d8 %R, ptr %S