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 \ |
| 11 ; RUN: | %if --need=allow_dump --need=target_ARM32 --command FileCheck %s \ |
| 12 ; RUN: --check-prefix=ARM32 |
| 13 |
| 14 ; RUN: %if --need=allow_dump --need=target_ARM32 --command %p2i --filetype=asm \ |
10 ; RUN: --target arm32 -i %s --args -Om1 --skip-unimplemented \ | 15 ; RUN: --target arm32 -i %s --args -Om1 --skip-unimplemented \ |
11 ; RUN: | %if --need=target_ARM32 --command FileCheck %s --check-prefix=ARM32 | 16 ; RUN: | %if --need=allow_dump --need=target_ARM32 --command FileCheck %s \ |
| 17 ; RUN: --check-prefix=ARM32 |
12 | 18 |
13 define internal float @fptrunc(double %a) { | 19 define internal float @fptrunc(double %a) { |
14 entry: | 20 entry: |
15 %conv = fptrunc double %a to float | 21 %conv = fptrunc double %a to float |
16 ret float %conv | 22 ret float %conv |
17 } | 23 } |
18 ; CHECK-LABEL: fptrunc | 24 ; CHECK-LABEL: fptrunc |
19 ; CHECK: cvtsd2ss | 25 ; CHECK: cvtsd2ss |
20 ; CHECK: fld | 26 ; CHECK: fld |
21 ; ARM32-LABEL: fptrunc | 27 ; ARM32-LABEL: fptrunc |
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
547 ; ARM32-DAG: vcvt.f32.u32 {{s[0-9]+}}, [[SRC]] | 553 ; ARM32-DAG: vcvt.f32.u32 {{s[0-9]+}}, [[SRC]] |
548 | 554 |
549 define internal float @int32BitcastToFloat(i32 %a) { | 555 define internal float @int32BitcastToFloat(i32 %a) { |
550 entry: | 556 entry: |
551 %conv = bitcast i32 %a to float | 557 %conv = bitcast i32 %a to float |
552 ret float %conv | 558 ret float %conv |
553 } | 559 } |
554 ; CHECK-LABEL: int32BitcastToFloat | 560 ; CHECK-LABEL: int32BitcastToFloat |
555 ; CHECK: mov | 561 ; CHECK: mov |
556 ; ARM32-LABEL: int32BitcastToFloat | 562 ; ARM32-LABEL: int32BitcastToFloat |
557 ; TODO(jpp): implement this test. | 563 ; ARM32: vmov s{{[0-9]+}}, r{{[0-9]+}} |
558 | |
559 define internal float @int32BitcastToFloatConst() { | 564 define internal float @int32BitcastToFloatConst() { |
560 entry: | 565 entry: |
561 %conv = bitcast i32 8675309 to float | 566 %conv = bitcast i32 8675309 to float |
562 ret float %conv | 567 ret float %conv |
563 } | 568 } |
564 ; CHECK-LABEL: int32BitcastToFloatConst | 569 ; CHECK-LABEL: int32BitcastToFloatConst |
565 ; CHECK: mov | 570 ; CHECK: mov |
566 ; ARM32-LABEL: int32BitcastToFloatConst | 571 ; ARM32-LABEL: int32BitcastToFloatConst |
567 ; TODO(jpp): implement this test. | 572 ; ARM32-DAG: movw [[REG:r[0-9]+]], #24557 |
| 573 ; ARM32-DAG: movt [[REG]], #132 |
| 574 ; ARM32: vmov s{{[0-9]+}}, [[REG]] |
568 | 575 |
569 define internal double @int64BitcastToDouble(i64 %a) { | 576 define internal double @int64BitcastToDouble(i64 %a) { |
570 entry: | 577 entry: |
571 %conv = bitcast i64 %a to double | 578 %conv = bitcast i64 %a to double |
572 ret double %conv | 579 ret double %conv |
573 } | 580 } |
574 ; CHECK-LABEL: int64BitcastToDouble | 581 ; CHECK-LABEL: int64BitcastToDouble |
575 ; CHECK: mov | 582 ; CHECK: mov |
576 ; ARM32-LABEL: int64BitcastToDouble | 583 ; ARM32-LABEL: int64BitcastToDouble |
577 ; TODO(jpp): implement this test. | 584 ; ARM32: vmov d{{[0-9]+}}, r{{[0-9]+}}, r{{[0-9]+}} |
578 | 585 |
579 define internal double @int64BitcastToDoubleConst() { | 586 define internal double @int64BitcastToDoubleConst() { |
580 entry: | 587 entry: |
581 %conv = bitcast i64 9035768 to double | 588 %conv = bitcast i64 9035768 to double |
582 ret double %conv | 589 ret double %conv |
583 } | 590 } |
584 ; CHECK-LABEL: int64BitcastToDoubleConst | 591 ; CHECK-LABEL: int64BitcastToDoubleConst |
585 ; CHECK: mov | 592 ; CHECK: mov |
586 ; ARM32-LABEL: int64BitcastToDoubleConst | 593 ; ARM32-LABEL: int64BitcastToDoubleConst |
587 ; TODO(jpp): implement this test. | 594 ; ARM32-DAG: movw [[REG0:r[0-9]+]], #57336 |
588 | 595 ; ARM32-DAG: movt [[REG0]], #137 |
| 596 ; ARM32-DAG: movw [[REG1:r[0-9]+]], #0 |
| 597 ; ARM32-DAG: vmov d{{[0-9]+}}, [[REG0]], [[REG1]] |
OLD | NEW |