Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(226)

Side by Side Diff: tests_lit/assembler/mips32/encoding_test_arith_fp.ll

Issue 2341713003: Subzero, MIPS32: Floating point support in ELF output (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Encodings for more existing instructions, alphabetized Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/IceRegistersMIPS32.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 ; Test encoding of MIPS32 floating point arithmetic instructions
2
3 ; REQUIRES: allow_dump
4
5 ; Compile using standalone assembler.
6 ; RUN: %p2i --filetype=asm -i %s --target=mips32 --args -O2 \
7 ; RUN: --allow-externally-defined-symbols --skip-unimplemented \
8 ; RUN: | FileCheck %s --check-prefix=ASM
9
10 ; Show bytes in assembled standalone code.
11 ; RUN: %p2i --filetype=asm -i %s --target=mips32 --assemble --disassemble \
12 ; RUN: --args -O2 --allow-externally-defined-symbols --skip-unimplemented \
13 ; RUN: | FileCheck %s --check-prefix=DIS
14
15 ; Compile using integrated assembler.
16 ; RUN: %p2i --filetype=iasm -i %s --target=mips32 --args -O2 \
17 ; RUN: --allow-externally-defined-symbols --skip-unimplemented \
18 ; RUN: | FileCheck %s --check-prefix=IASM
19
20 ; Show bytes in assembled integrated code.
21 ; RUN: %p2i --filetype=iasm -i %s --target=mips32 --assemble --disassemble \
22 ; RUN: --args -O2 --allow-externally-defined-symbols --skip-unimplemented \
23 ; RUN: | FileCheck %s --check-prefix=DIS
24
25 declare float @llvm.fabs.f32(float)
26 declare double @llvm.fabs.f64(double)
27 declare float @llvm.sqrt.f32(float)
28 declare double @llvm.sqrt.f64(double)
29
30 define internal float @encAbsFloat(float %a) {
31 entry:
32 %c = call float @llvm.fabs.f32(float %a)
33 ret float %c
34 }
35
36 ; ASM-LABEL: encAbsFloat
37 ; ASM-NEXT: .LencAbsFloat$entry:
38 ; ASM-NEXT: abs.s $f12, $f12
39 ; ASM-NEXT: mov.s $f0, $f12
40 ; ASM-NEXT: jr $ra
41
42 ; DIS-LABEL: 00000000 <encAbsFloat>:
43 ; DIS-NEXT: 0: 46006305 abs.s $f12,$f12
44 ; DIS-NEXT: 4: 46006006 mov.s $f0,$f12
45 ; DIS-NEXT: 8: 03e00008 jr ra
46 ; DIS-NEXT: c: 00000000 nop
47
48 ; IASM-LABEL: encAbsFloat:
49 ; IASM-NEXT: .LencAbsFloat$entry:
50 ; IASM-NEXT: .byte 0x5
51 ; IASM-NEXT: .byte 0x63
52 ; IASM-NEXT: .byte 0x0
53 ; IASM-NEXT: .byte 0x46
54 ; IASM-NEXT: .byte 0x6
55 ; IASM-NEXT: .byte 0x60
56 ; IASM-NEXT: .byte 0x0
57 ; IASM-NEXT: .byte 0x46
58 ; IASM-NEXT: .byte 0x8
59 ; IASM-NEXT: .byte 0x0
60 ; IASM-NEXT: .byte 0xe0
61 ; IASM-NEXT: .byte 0x3
62 ; IASM-NEXT: .byte 0x0
63 ; IASM-NEXT: .byte 0x0
64 ; IASM-NEXT: .byte 0x0
65 ; IASM-NEXT: .byte 0x0
66
67 define internal double @encAbsDouble(double %a) {
68 entry:
69 %c = call double @llvm.fabs.f64(double %a)
70 ret double %c
71 }
72
73 ; ASM-LABEL: encAbsDouble:
74 ; ASM-NEXT: .LencAbsDouble$entry:
75 ; ASM-NEXT: abs.d $f12, $f12
76 ; ASM-NEXT: mov.d $f0, $f12
77 ; ASM-NEXT: jr $ra
78
79 ; DIS-LABEL: 00000010 <encAbsDouble>:
80 ; DIS-NEXT: 10: 46206305 abs.d $f12,$f12
81 ; DIS-NEXT: 14: 46206006 mov.d $f0,$f12
82 ; DIS-NEXT: 18: 03e00008 jr ra
83 ; DIS-NEXT: 1c: 00000000 nop
84
85 ; IASM-LABEL: encAbsDouble:
86 ; IASM-NEXT: .LencAbsDouble$entry:
87 ; IASM-NEXT: .byte 0x5
88 ; IASM-NEXT: .byte 0x63
89 ; IASM-NEXT: .byte 0x20
90 ; IASM-NEXT: .byte 0x46
91 ; IASM-NEXT: .byte 0x6
92 ; IASM-NEXT: .byte 0x60
93 ; IASM-NEXT: .byte 0x20
94 ; IASM-NEXT: .byte 0x46
95 ; IASM-NEXT: .byte 0x8
96 ; IASM-NEXT: .byte 0x0
97 ; IASM-NEXT: .byte 0xe0
98 ; IASM-NEXT: .byte 0x3
99 ; IASM-NEXT: .byte 0x0
100 ; IASM-NEXT: .byte 0x0
101 ; IASM-NEXT: .byte 0x0
102 ; IASM-NEXT: .byte 0x0
103
104 define internal float @encAddFloat(float %a, float %b) {
105 entry:
106 %c = fadd float %a, %b
107 ret float %c
108 }
109
110 ; ASM-LABEL: encAddFloat
111 ; ASM-NEXT: .LencAddFloat$entry:
112 ; ASM-NEXT: add.s $f12, $f12, $f14
113 ; ASM-NEXT: mov.s $f0, $f12
114 ; ASM-NEXT: jr $ra
115
116 ; DIS-LABEL: 00000020 <encAddFloat>:
117 ; DIS-NEXT: 20: 460e6300 add.s $f12,$f12,$f14
118 ; DIS-NEXT: 24: 46006006 mov.s $f0,$f12
119 ; DIS-NEXT: 28: 03e00008 jr ra
120 ; DIS-NEXT: 2c: 00000000 nop
121
122 ; IASM-LABEL: encAddFloat:
123 ; IASM-NEXT: .LencAddFloat$entry:
124 ; IASM-NEXT: .byte 0x0
125 ; IASM-NEXT: .byte 0x63
126 ; IASM-NEXT: .byte 0xe
127 ; IASM-NEXT: .byte 0x46
128 ; IASM-NEXT: .byte 0x6
129 ; IASM-NEXT: .byte 0x60
130 ; IASM-NEXT: .byte 0x0
131 ; IASM-NEXT: .byte 0x46
132 ; IASM-NEXT: .byte 0x8
133 ; IASM-NEXT: .byte 0x0
134 ; IASM-NEXT: .byte 0xe0
135 ; IASM-NEXT: .byte 0x3
136 ; IASM-NEXT: .byte 0x0
137 ; IASM-NEXT: .byte 0x0
138 ; IASM-NEXT: .byte 0x0
139 ; IASM-NEXT: .byte 0x0
140
141 define internal double @encAddDouble(double %a, double %b) {
142 entry:
143 %c = fadd double %a, %b
144 ret double %c
145 }
146
147 ; ASM-LABEL: encAddDouble
148 ; ASM-NEXT: .LencAddDouble$entry:
149 ; ASM-NEXT: add.d $f12, $f12, $f14
150 ; ASM-NEXT: mov.d $f0, $f12
151 ; ASM-NEXT: jr $ra
152
153 ; DIS-LABEL: 00000030 <encAddDouble>:
154 ; DIS-NEXT: 30: 462e6300 add.d $f12,$f12,$f14
155 ; DIS-NEXT: 34: 46206006 mov.d $f0,$f12
156 ; DIS-NEXT: 38: 03e00008 jr ra
157 ; DIS-NEXT: 3c: 00000000 nop
158
159 ; IASM-LABEL: encAddDouble:
160 ; IASM-NEXT: .LencAddDouble$entry:
161 ; IASM-NEXT: .byte 0x0
162 ; IASM-NEXT: .byte 0x63
163 ; IASM-NEXT: .byte 0x2e
164 ; IASM-NEXT: .byte 0x46
165 ; IASM-NEXT: .byte 0x6
166 ; IASM-NEXT: .byte 0x60
167 ; IASM-NEXT: .byte 0x20
168 ; IASM-NEXT: .byte 0x46
169 ; IASM-NEXT: .byte 0x8
170 ; IASM-NEXT: .byte 0x0
171 ; IASM-NEXT: .byte 0xe0
172 ; IASM-NEXT: .byte 0x3
173 ; IASM-NEXT: .byte 0x0
174 ; IASM-NEXT: .byte 0x0
175 ; IASM-NEXT: .byte 0x0
176 ; IASM-NEXT: .byte 0x0
177
178 define internal float @encDivFloat(float %a, float %b) {
179 entry:
180 %c = fdiv float %a, %b
181 ret float %c
182 }
183
184 ; ASM-LABEL: encDivFloat
185 ; ASM-NEXT: .LencDivFloat$entry:
186 ; ASM-NEXT: div.s $f12, $f12, $f14
187 ; ASM-NEXT: mov.s $f0, $f12
188 ; ASM-NEXT: jr $ra
189
190 ; DIS-LABEL: 00000040 <encDivFloat>:
191 ; DIS-NEXT: 40: 460e6303 div.s $f12,$f12,$f14
192 ; DIS-NEXT: 44: 46006006 mov.s $f0,$f12
193 ; DIS-NEXT: 48: 03e00008 jr ra
194 ; DIS-NEXT: 4c: 00000000 nop
195
196 ; IASM-LABEL: encDivFloat:
197 ; IASM-NEXT: .LencDivFloat$entry:
198 ; IASM-NEXT: .byte 0x3
199 ; IASM-NEXT: .byte 0x63
200 ; IASM-NEXT: .byte 0xe
201 ; IASM-NEXT: .byte 0x46
202 ; IASM-NEXT: .byte 0x6
203 ; IASM-NEXT: .byte 0x60
204 ; IASM-NEXT: .byte 0x0
205 ; IASM-NEXT: .byte 0x46
206 ; IASM-NEXT: .byte 0x8
207 ; IASM-NEXT: .byte 0x0
208 ; IASM-NEXT: .byte 0xe0
209 ; IASM-NEXT: .byte 0x3
210 ; IASM-NEXT: .byte 0x0
211 ; IASM-NEXT: .byte 0x0
212 ; IASM-NEXT: .byte 0x0
213 ; IASM-NEXT: .byte 0x0
214
215 define internal double @encDivDouble(double %a, double %b) {
216 entry:
217 %c = fdiv double %a, %b
218 ret double %c
219 }
220
221 ; ASM-LABEL: encDivDouble
222 ; ASM-NEXT: .LencDivDouble$entry:
223 ; ASM-NEXT: div.d $f12, $f12, $f14
224 ; ASM-NEXT: mov.d $f0, $f12
225 ; ASM-NEXT: jr $ra
226
227 ; DIS-LABEL: 00000050 <encDivDouble>:
228 ; DIS-NEXT: 50: 462e6303 div.d $f12,$f12,$f14
229 ; DIS-NEXT: 54: 46206006 mov.d $f0,$f12
230 ; DIS-NEXT: 58: 03e00008 jr ra
231 ; DIS-NEXT: 5c: 00000000 nop
232
233 ; IASM-LABEL: encDivDouble:
234 ; IASM-NEXT: .LencDivDouble$entry:
235 ; IASM-NEXT: .byte 0x3
236 ; IASM-NEXT: .byte 0x63
237 ; IASM-NEXT: .byte 0x2e
238 ; IASM-NEXT: .byte 0x46
239 ; IASM-NEXT: .byte 0x6
240 ; IASM-NEXT: .byte 0x60
241 ; IASM-NEXT: .byte 0x20
242 ; IASM-NEXT: .byte 0x46
243 ; IASM-NEXT: .byte 0x8
244 ; IASM-NEXT: .byte 0x0
245 ; IASM-NEXT: .byte 0xe0
246 ; IASM-NEXT: .byte 0x3
247 ; IASM-NEXT: .byte 0x0
248 ; IASM-NEXT: .byte 0x0
249 ; IASM-NEXT: .byte 0x0
250 ; IASM-NEXT: .byte 0x0
251
252 define internal float @encMulFloat(float %a, float %b) {
253 entry:
254 %c = fmul float %a, %b
255 ret float %c
256 }
257
258 ; ASM-LABEL: encMulFloat
259 ; ASM-NEXT: .LencMulFloat$entry:
260 ; ASM-NEXT: mul.s $f12, $f12, $f14
261 ; ASM-NEXT: mov.s $f0, $f12
262 ; ASM-NEXT: jr $ra
263
264 ; DIS-LABEL: 00000060 <encMulFloat>:
265 ; DIS-NEXT: 60: 460e6302 mul.s $f12,$f12,$f14
266 ; DIS-NEXT: 64: 46006006 mov.s $f0,$f12
267 ; DIS-NEXT: 68: 03e00008 jr ra
268 ; DIS-NEXT: 6c: 00000000 nop
269
270 ; IASM-LABEL: encMulFloat:
271 ; IASM-NEXT: .LencMulFloat$entry:
272 ; IASM-NEXT: .byte 0x2
273 ; IASM-NEXT: .byte 0x63
274 ; IASM-NEXT: .byte 0xe
275 ; IASM-NEXT: .byte 0x46
276 ; IASM-NEXT: .byte 0x6
277 ; IASM-NEXT: .byte 0x60
278 ; IASM-NEXT: .byte 0x0
279 ; IASM-NEXT: .byte 0x46
280 ; IASM-NEXT: .byte 0x8
281 ; IASM-NEXT: .byte 0x0
282 ; IASM-NEXT: .byte 0xe0
283 ; IASM-NEXT: .byte 0x3
284 ; IASM-NEXT: .byte 0x0
285 ; IASM-NEXT: .byte 0x0
286 ; IASM-NEXT: .byte 0x0
287 ; IASM-NEXT: .byte 0x0
288
289 define internal double @encMulDouble(double %a, double %b) {
290 entry:
291 %c = fmul double %a, %b
292 ret double %c
293 }
294
295 ; ASM-LABEL: encMulDouble
296 ; ASM-NEXT: .LencMulDouble$entry:
297 ; ASM-NEXT: mul.d $f12, $f12, $f14
298 ; ASM-NEXT: mov.d $f0, $f12
299 ; ASM-NEXT: jr $ra
300
301 ; DIS-LABEL: 00000070 <encMulDouble>:
302 ; DIS-NEXT: 70: 462e6302 mul.d $f12,$f12,$f14
303 ; DIS-NEXT: 74: 46206006 mov.d $f0,$f12
304 ; DIS-NEXT: 78: 03e00008 jr ra
305 ; DIS-NEXT: 7c: 00000000 nop
306
307 ; IASM-LABEL: encMulDouble:
308 ; IASM-NEXT: .LencMulDouble$entry:
309 ; IASM-NEXT: .byte 0x2
310 ; IASM-NEXT: .byte 0x63
311 ; IASM-NEXT: .byte 0x2e
312 ; IASM-NEXT: .byte 0x46
313 ; IASM-NEXT: .byte 0x6
314 ; IASM-NEXT: .byte 0x60
315 ; IASM-NEXT: .byte 0x20
316 ; IASM-NEXT: .byte 0x46
317 ; IASM-NEXT: .byte 0x8
318 ; IASM-NEXT: .byte 0x0
319 ; IASM-NEXT: .byte 0xe0
320 ; IASM-NEXT: .byte 0x3
321 ; IASM-NEXT: .byte 0x0
322 ; IASM-NEXT: .byte 0x0
323 ; IASM-NEXT: .byte 0x0
324 ; IASM-NEXT: .byte 0x0
325
326 define internal float @encSqrtFloat(float %a) {
327 entry:
328 %c = call float @llvm.sqrt.f32(float %a)
329 ret float %c
330 }
331
332 ; ASM-LABEL: encSqrtFloat
333 ; ASM-NEXT: .LencSqrtFloat$entry:
334 ; ASM-NEXT: sqrt.s $f12, $f12
335 ; ASM-NEXT: mov.s $f0, $f12
336 ; ASM-NEXT: jr $ra
337
338 ; DIS-LABEL: 00000080 <encSqrtFloat>:
339 ; DIS-NEXT: 80: 46006304 sqrt.s $f12,$f12
340 ; DIS-NEXT: 84: 46006006 mov.s $f0,$f12
341 ; DIS-NEXT: 88: 03e00008 jr ra
342 ; DIS-NEXT: 8c: 00000000 nop
343
344 ; IASM-LABEL: encSqrtFloat:
345 ; IASM-NEXT: .LencSqrtFloat$entry:
346 ; IASM-NEXT: .byte 0x4
347 ; IASM-NEXT: .byte 0x63
348 ; IASM-NEXT: .byte 0x0
349 ; IASM-NEXT: .byte 0x46
350 ; IASM-NEXT: .byte 0x6
351 ; IASM-NEXT: .byte 0x60
352 ; IASM-NEXT: .byte 0x0
353 ; IASM-NEXT: .byte 0x46
354 ; IASM-NEXT: .byte 0x8
355 ; IASM-NEXT: .byte 0x0
356 ; IASM-NEXT: .byte 0xe0
357 ; IASM-NEXT: .byte 0x3
358 ; IASM-NEXT: .byte 0x0
359 ; IASM-NEXT: .byte 0x0
360 ; IASM-NEXT: .byte 0x0
361 ; IASM-NEXT: .byte 0x0
362
363 define internal double @encSqrtDouble(double %a) {
364 entry:
365 %c = call double @llvm.sqrt.f64(double %a)
366 ret double %c
367 }
368
369 ; ASM-LABEL: encSqrtDouble
370 ; ASM-NEXT: .LencSqrtDouble$entry:
371 ; ASM-NEXT: sqrt.d $f12, $f12
372 ; ASM-NEXT: mov.d $f0, $f12
373 ; ASM-NEXT: jr $ra
374
375 ; DIS-LABEL: 00000090 <encSqrtDouble>:
376 ; DIS-NEXT: 90: 46206304 sqrt.d $f12,$f12
377 ; DIS-NEXT: 94: 46206006 mov.d $f0,$f12
378 ; DIS-NEXT: 98: 03e00008 jr ra
379 ; DIS-NEXT: 9c: 00000000 nop
380
381 ; IASM-LABEL: encSqrtDouble:
382 ; IASM-NEXT: .LencSqrtDouble$entry:
383 ; IASM-NEXT: .byte 0x4
384 ; IASM-NEXT: .byte 0x63
385 ; IASM-NEXT: .byte 0x20
386 ; IASM-NEXT: .byte 0x46
387 ; IASM-NEXT: .byte 0x6
388 ; IASM-NEXT: .byte 0x60
389 ; IASM-NEXT: .byte 0x20
390 ; IASM-NEXT: .byte 0x46
391 ; IASM-NEXT: .byte 0x8
392 ; IASM-NEXT: .byte 0x0
393 ; IASM-NEXT: .byte 0xe0
394 ; IASM-NEXT: .byte 0x3
395 ; IASM-NEXT: .byte 0x0
396 ; IASM-NEXT: .byte 0x0
397 ; IASM-NEXT: .byte 0x0
398 ; IASM-NEXT: .byte 0x0
399
400 define internal float @encSubFloat(float %a, float %b) {
401 entry:
402 %c = fsub float %a, %b
403 ret float %c
404 }
405
406 ; ASM-LABEL: encSubFloat
407 ; ASM-NEXT: .LencSubFloat$entry:
408 ; ASM-NEXT: sub.s $f12, $f12, $f14
409 ; ASM-NEXT: mov.s $f0, $f12
410 ; ASM-NEXT: jr $ra
411
412 ; DIS-LABEL: 000000a0 <encSubFloat>:
413 ; DIS-NEXT: a0: 460e6301 sub.s $f12,$f12,$f14
414 ; DIS-NEXT: a4: 46006006 mov.s $f0,$f12
415 ; DIS-NEXT: a8: 03e00008 jr ra
416 ; DIS-NEXT: ac: 00000000 nop
417
418 ; IASM-LABEL: encSubFloat:
419 ; IASM-NEXT: .LencSubFloat$entry:
420 ; IASM-NEXT: .byte 0x1
421 ; IASM-NEXT: .byte 0x63
422 ; IASM-NEXT: .byte 0xe
423 ; IASM-NEXT: .byte 0x46
424 ; IASM-NEXT: .byte 0x6
425 ; IASM-NEXT: .byte 0x60
426 ; IASM-NEXT: .byte 0x0
427 ; IASM-NEXT: .byte 0x46
428 ; IASM-NEXT: .byte 0x8
429 ; IASM-NEXT: .byte 0x0
430 ; IASM-NEXT: .byte 0xe0
431 ; IASM-NEXT: .byte 0x3
432 ; IASM-NEXT: .byte 0x0
433 ; IASM-NEXT: .byte 0x0
434 ; IASM-NEXT: .byte 0x0
435 ; IASM-NEXT: .byte 0x0
436
437 define internal double @encSubDouble(double %a, double %b) {
438 entry:
439 %c = fsub double %a, %b
440 ret double %c
441 }
442
443 ; ASM-LABEL: encSubDouble
444 ; ASM-NEXT: .LencSubDouble$entry:
445 ; ASM-NEXT: sub.d $f12, $f12, $f14
446 ; ASM-NEXT: mov.d $f0, $f12
447 ; ASM-NEXT: jr $ra
448
449 ; DIS-LABEL: 000000b0 <encSubDouble>:
450 ; DIS-NEXT: b0: 462e6301 sub.d $f12,$f12,$f14
451 ; DIS-NEXT: b4: 46206006 mov.d $f0,$f12
452 ; DIS-NEXT: b8: 03e00008 jr ra
453 ; DIS-NEXT: bc: 00000000 nop
454
455 ; IASM-LABEL: encSubDouble:
456 ; IASM-NEXT: .LencSubDouble$entry:
457 ; IASM-NEXT: .byte 0x1
458 ; IASM-NEXT: .byte 0x63
459 ; IASM-NEXT: .byte 0x2e
460 ; IASM-NEXT: .byte 0x46
461 ; IASM-NEXT: .byte 0x6
462 ; IASM-NEXT: .byte 0x60
463 ; IASM-NEXT: .byte 0x20
464 ; IASM-NEXT: .byte 0x46
465 ; IASM-NEXT: .byte 0x8
466 ; IASM-NEXT: .byte 0x0
467 ; IASM-NEXT: .byte 0xe0
468 ; IASM-NEXT: .byte 0x3
469 ; IASM-NEXT: .byte 0x0
470 ; IASM-NEXT: .byte 0x0
471 ; IASM-NEXT: .byte 0x0
472 ; IASM-NEXT: .byte 0x0
OLDNEW
« no previous file with comments | « src/IceRegistersMIPS32.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698