| OLD | NEW |
| 1 ; Show that we translate intrinsics for fabs on float and double. | 1 ; Show that we translate intrinsics for fabs on float, double and float vectors. |
| 2 | 2 |
| 3 ; REQUIRES: allow_dump | 3 ; REQUIRES: allow_dump |
| 4 | 4 |
| 5 ; Compile using standalone assembler. | 5 ; Compile using standalone assembler. |
| 6 ; RUN: %p2i --filetype=asm -i %s --target=arm32 --args -Om1 \ | 6 ; RUN: %p2i --filetype=asm -i %s --target=arm32 --args -Om1 \ |
| 7 ; RUN: -reg-use s20,d22 \ | 7 ; RUN: -reg-use s20,d22 \ |
| 8 ; RUN: | FileCheck %s --check-prefix=ASM | 8 ; RUN: | FileCheck %s --check-prefix=ASM |
| 9 | 9 |
| 10 ; Show bytes in assembled standalone code. | 10 ; Show bytes in assembled standalone code. |
| 11 ; RUN: %p2i --filetype=asm -i %s --target=arm32 --assemble --disassemble \ | 11 ; RUN: %p2i --filetype=asm -i %s --target=arm32 --assemble --disassemble \ |
| 12 ; RUN: --args -Om1 \ | 12 ; RUN: --args -Om1 \ |
| 13 ; RUN: -reg-use s20,d22 \ | 13 ; RUN: -reg-use s20,d22 \ |
| 14 ; RUN: | FileCheck %s --check-prefix=DIS | 14 ; RUN: | FileCheck %s --check-prefix=DIS |
| 15 | 15 |
| 16 ; Compile using integrated assembler. | 16 ; Compile using integrated assembler. |
| 17 ; RUN: %p2i --filetype=iasm -i %s --target=arm32 --args -Om1 \ | 17 ; RUN: %p2i --filetype=iasm -i %s --target=arm32 --args -Om1 \ |
| 18 ; RUN: -reg-use s20,d22 \ | 18 ; RUN: -reg-use s20,d22 \ |
| 19 ; RUN: | FileCheck %s --check-prefix=IASM | 19 ; RUN: | FileCheck %s --check-prefix=IASM |
| 20 | 20 |
| 21 ; Show bytes in assembled integrated code. | 21 ; Show bytes in assembled integrated code. |
| 22 ; RUN: %p2i --filetype=iasm -i %s --target=arm32 --assemble --disassemble \ | 22 ; RUN: %p2i --filetype=iasm -i %s --target=arm32 --assemble --disassemble \ |
| 23 ; RUN: --args -Om1 \ | 23 ; RUN: --args -Om1 \ |
| 24 ; RUN: -reg-use s20,d22 \ | 24 ; RUN: -reg-use s20,d22 \ |
| 25 ; RUN: | FileCheck %s --check-prefix=DIS | 25 ; RUN: | FileCheck %s --check-prefix=DIS |
| 26 | 26 |
| 27 declare float @llvm.fabs.f32(float) | 27 declare float @llvm.fabs.f32(float) |
| 28 declare double @llvm.fabs.f64(double) | 28 declare double @llvm.fabs.f64(double) |
| 29 declare <4 x float> @llvm.fabs.v4f32(<4 x float>) |
| 29 | 30 |
| 30 define internal float @test_fabs_float(float %x) { | 31 define internal float @test_fabs_float(float %x) { |
| 31 ; ASM-LABEL: test_fabs_float: | 32 ; ASM-LABEL: test_fabs_float: |
| 32 ; DIS-LABEL: 00000000 <test_fabs_float>: | 33 ; DIS-LABEL: 00000000 <test_fabs_float>: |
| 33 ; IASM-LABEL: test_fabs_float: | 34 ; IASM-LABEL: test_fabs_float: |
| 34 | 35 |
| 35 entry: | 36 entry: |
| 36 %r = call float @llvm.fabs.f32(float %x) | 37 %r = call float @llvm.fabs.f32(float %x) |
| 37 | 38 |
| 38 ; ASM: vabs.f32 s20, s20 | 39 ; ASM: vabs.f32 s20, s20 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 49 | 50 |
| 50 entry: | 51 entry: |
| 51 %r = call double @llvm.fabs.f64(double %x) | 52 %r = call double @llvm.fabs.f64(double %x) |
| 52 | 53 |
| 53 ; ASM: vabs.f64 d22, d22 | 54 ; ASM: vabs.f64 d22, d22 |
| 54 ; DIS: 3c: eef06be6 | 55 ; DIS: 3c: eef06be6 |
| 55 ; IASM-NOT: vabs.64 | 56 ; IASM-NOT: vabs.64 |
| 56 | 57 |
| 57 ret double %r | 58 ret double %r |
| 58 } | 59 } |
| 60 |
| 61 define internal <4 x float> @test_fabs_4float(<4 x float> %x) { |
| 62 ; ASM-LABEL: test_fabs_4float: |
| 63 ; DIS-LABEL: 00000050 <test_fabs_4float>: |
| 64 ; IASM-LABEL: test_fabs_4float: |
| 65 |
| 66 entry: |
| 67 %r = call <4 x float> @llvm.fabs.v4f32(<4 x float> %x) |
| 68 |
| 69 ; ASM: vabs.f32 q0, q0 |
| 70 ; DIS: 60: f3b90740 |
| 71 ; IASM-NOT: vabs.f32 |
| 72 |
| 73 ret <4 x float> %r |
| 74 } |
| OLD | NEW |