OLD | NEW |
1 ; This tries to be a comprehensive test of f32 and f64 convert operations. | 1 ; This tries to be a comprehensive test of f32 and f64 convert operations. |
2 ; The CHECK lines are only checking for basic instruction patterns | 2 ; The CHECK lines are only checking for basic instruction patterns |
3 ; that should be present regardless of the optimization level, so | 3 ; that should be present regardless of the optimization level, so |
4 ; there are no special OPTM1 match lines. | 4 ; there are no special OPTM1 match lines. |
5 | 5 |
6 ; RUN: %p2i --filetype=obj --disassemble -i %s --args -O2 | FileCheck %s | 6 ; RUN: %p2i --filetype=obj --disassemble -i %s --args -O2 | FileCheck %s |
7 ; RUN: %p2i --filetype=obj --disassemble -i %s --args -Om1 | FileCheck %s | 7 ; RUN: %p2i --filetype=obj --disassemble -i %s --args -Om1 | FileCheck %s |
8 | 8 |
9 ; RUN: %if --need=allow_dump --need=target_ARM32 --command %p2i --filetype=asm \ | 9 ; RUN: %if --need=allow_dump --need=target_ARM32 --command %p2i --filetype=asm \ |
10 ; RUN: --target arm32 -i %s --args -O2 --skip-unimplemented \ | 10 ; RUN: --target arm32 -i %s --args -O2 --skip-unimplemented \ |
11 ; RUN: | %if --need=allow_dump --need=target_ARM32 --command FileCheck %s \ | 11 ; RUN: | %if --need=allow_dump --need=target_ARM32 --command FileCheck %s \ |
12 ; RUN: --check-prefix=ARM32 | 12 ; RUN: --check-prefix=ARM32 |
13 | 13 |
14 ; RUN: %if --need=allow_dump --need=target_ARM32 --command %p2i --filetype=asm \ | 14 ; RUN: %if --need=allow_dump --need=target_ARM32 --command %p2i --filetype=asm \ |
15 ; RUN: --target arm32 -i %s --args -Om1 --skip-unimplemented \ | 15 ; RUN: --target arm32 -i %s --args -Om1 --skip-unimplemented \ |
16 ; RUN: | %if --need=allow_dump --need=target_ARM32 --command FileCheck %s \ | 16 ; RUN: | %if --need=allow_dump --need=target_ARM32 --command FileCheck %s \ |
17 ; RUN: --check-prefix=ARM32 | 17 ; RUN: --check-prefix=ARM32 |
18 | 18 |
| 19 ; RUN: %if --need=allow_dump --need=target_MIPS32 --command %p2i \ |
| 20 ; RUN: --filetype=asm --target mips32 -i %s --args -O2 --skip-unimplemented \ |
| 21 ; RUN: | %if --need=allow_dump --need=target_MIPS32 --command FileCheck %s \ |
| 22 ; RUN: --check-prefix=MIPS32 |
| 23 |
19 define internal float @fptrunc(double %a) { | 24 define internal float @fptrunc(double %a) { |
20 entry: | 25 entry: |
21 %conv = fptrunc double %a to float | 26 %conv = fptrunc double %a to float |
22 ret float %conv | 27 ret float %conv |
23 } | 28 } |
24 ; CHECK-LABEL: fptrunc | 29 ; CHECK-LABEL: fptrunc |
25 ; CHECK: cvtsd2ss | 30 ; CHECK: cvtsd2ss |
26 ; CHECK: fld | 31 ; CHECK: fld |
27 ; ARM32-LABEL: fptrunc | 32 ; ARM32-LABEL: fptrunc |
28 ; ARM32: vcvt.f32.f64 {{s[0-9]+}}, {{d[0-9]+}} | 33 ; ARM32: vcvt.f32.f64 {{s[0-9]+}}, {{d[0-9]+}} |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 define internal i32 @floatToSigned32(float %a) { | 111 define internal i32 @floatToSigned32(float %a) { |
107 entry: | 112 entry: |
108 %conv = fptosi float %a to i32 | 113 %conv = fptosi float %a to i32 |
109 ret i32 %conv | 114 ret i32 %conv |
110 } | 115 } |
111 ; CHECK-LABEL: floatToSigned32 | 116 ; CHECK-LABEL: floatToSigned32 |
112 ; CHECK: cvttss2si | 117 ; CHECK: cvttss2si |
113 ; ARM32-LABEL: floatToSigned32 | 118 ; ARM32-LABEL: floatToSigned32 |
114 ; ARM32-DAG: vcvt.s32.f32 [[REG:s[0-9]+]], {{s[0-9]+}} | 119 ; ARM32-DAG: vcvt.s32.f32 [[REG:s[0-9]+]], {{s[0-9]+}} |
115 ; ARM32-DAG: vmov {{r[0-9]+}}, [[REG]] | 120 ; ARM32-DAG: vmov {{r[0-9]+}}, [[REG]] |
| 121 ; MIPS32-LABEL: floatToSigned32 |
| 122 ; MIPS32: trunc.w.s $f12, $f12 |
| 123 ; MIPS32: mfc1 $v0, $f12 |
116 | 124 |
117 define internal i32 @doubleToUnsigned32(double %a) { | 125 define internal i32 @doubleToUnsigned32(double %a) { |
118 entry: | 126 entry: |
119 %conv = fptoui double %a to i32 | 127 %conv = fptoui double %a to i32 |
120 ret i32 %conv | 128 ret i32 %conv |
121 } | 129 } |
122 ; CHECK-LABEL: doubleToUnsigned32 | 130 ; CHECK-LABEL: doubleToUnsigned32 |
123 ; CHECK: call {{.*}} R_{{.*}} __Sz_fptoui_f64_i32 | 131 ; CHECK: call {{.*}} R_{{.*}} __Sz_fptoui_f64_i32 |
124 ; ARM32-LABEL: doubleToUnsigned32 | 132 ; ARM32-LABEL: doubleToUnsigned32 |
125 ; ARM32-DAG: vcvt.u32.f64 [[REG:s[0-9]+]], {{d[0-9]+}} | 133 ; ARM32-DAG: vcvt.u32.f64 [[REG:s[0-9]+]], {{d[0-9]+}} |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 entry: | 374 entry: |
367 %conv = sitofp i32 %a to float | 375 %conv = sitofp i32 %a to float |
368 ret float %conv | 376 ret float %conv |
369 } | 377 } |
370 ; CHECK-LABEL: signed32ToFloat | 378 ; CHECK-LABEL: signed32ToFloat |
371 ; CHECK: cvtsi2ss | 379 ; CHECK: cvtsi2ss |
372 ; CHECK: fld | 380 ; CHECK: fld |
373 ; ARM32-LABEL: signed32ToFloat | 381 ; ARM32-LABEL: signed32ToFloat |
374 ; ARM32-DAG: vmov [[SRC:s[0-9]+]], {{r[0-9]+}} | 382 ; ARM32-DAG: vmov [[SRC:s[0-9]+]], {{r[0-9]+}} |
375 ; ARM32-DAG: vcvt.f32.s32 {{s[0-9]+}}, [[SRC]] | 383 ; ARM32-DAG: vcvt.f32.s32 {{s[0-9]+}}, [[SRC]] |
| 384 ; MIPS32-LABEL: signed32ToFloat |
| 385 ; MIPS32: mtc1 $a0, $f0 |
| 386 ; MIPS32: cvt.s.w $f0, $f0 |
376 | 387 |
377 define internal double @unsigned32ToDouble(i32 %a) { | 388 define internal double @unsigned32ToDouble(i32 %a) { |
378 entry: | 389 entry: |
379 %conv = uitofp i32 %a to double | 390 %conv = uitofp i32 %a to double |
380 ret double %conv | 391 ret double %conv |
381 } | 392 } |
382 ; CHECK-LABEL: unsigned32ToDouble | 393 ; CHECK-LABEL: unsigned32ToDouble |
383 ; CHECK: call {{.*}} R_{{.*}} __Sz_uitofp_i32_f64 | 394 ; CHECK: call {{.*}} R_{{.*}} __Sz_uitofp_i32_f64 |
384 ; CHECK: fstp QWORD | 395 ; CHECK: fstp QWORD |
385 ; ARM32-LABEL: unsigned32ToDouble | 396 ; ARM32-LABEL: unsigned32ToDouble |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
588 %conv = bitcast i64 9035768 to double | 599 %conv = bitcast i64 9035768 to double |
589 ret double %conv | 600 ret double %conv |
590 } | 601 } |
591 ; CHECK-LABEL: int64BitcastToDoubleConst | 602 ; CHECK-LABEL: int64BitcastToDoubleConst |
592 ; CHECK: mov | 603 ; CHECK: mov |
593 ; ARM32-LABEL: int64BitcastToDoubleConst | 604 ; ARM32-LABEL: int64BitcastToDoubleConst |
594 ; ARM32-DAG: movw [[REG0:r[0-9]+]], #57336 | 605 ; ARM32-DAG: movw [[REG0:r[0-9]+]], #57336 |
595 ; ARM32-DAG: movt [[REG0]], #137 | 606 ; ARM32-DAG: movt [[REG0]], #137 |
596 ; ARM32-DAG: mov [[REG1:r[0-9]+]], #0 | 607 ; ARM32-DAG: mov [[REG1:r[0-9]+]], #0 |
597 ; ARM32-DAG: vmov d{{[0-9]+}}, [[REG0]], [[REG1]] | 608 ; ARM32-DAG: vmov d{{[0-9]+}}, [[REG0]], [[REG1]] |
OLD | NEW |