Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 ; RUN: %if --need=target_MIPS32 --need=allow_dump \ | |
| 2 ; RUN: --command %p2i --filetype=asm --assemble --disassemble --target mips32\ | |
| 3 ; RUN: -i %s --args -Om1 --skip-unimplemented \ | |
| 4 ; RUN: -allow-externally-defined-symbols \ | |
| 5 ; RUN: | %if --need=target_MIPS32 --need=allow_dump \ | |
| 6 ; RUN: --command FileCheck --check-prefix MIPS32 %s | |
| 7 | |
| 8 declare float @llvm.sqrt.f32(float) | |
| 9 declare double @llvm.sqrt.f64(double) | |
| 10 declare float @llvm.fabs.f32(float) | |
| 11 declare double @llvm.fabs.f64(double) | |
| 12 | |
| 13 define internal float @test_sqrt_float(float %x, i32 %iptr) { | |
| 14 entry: | |
| 15 %r = call float @llvm.sqrt.f32(float %x) | |
| 16 %r2 = call float @llvm.sqrt.f32(float %r) | |
| 17 %r3 = call float @llvm.sqrt.f32(float -0.0) | |
| 18 %r4 = fadd float %r2, %r3 | |
| 19 ret float %r4 | |
| 20 } | |
| 21 ; MIPS32-LABEL: test_sqrt_float | |
| 22 ; MIPS32: sqrt.s | |
| 23 ; MIPS32: sqrt.s | |
| 24 ; MIPS32: sqrt.s | |
| 25 ; MIPS32: add.s | |
| 26 | |
| 27 define internal float @test_sqrt_float_mergeable_load(float %x, i32 %iptr) { | |
|
Jim Stichnoth
2016/09/09 17:12:41
Do you need these "mergeable_load" tests?
I think
obucinac
2016/09/09 17:39:40
Removed
| |
| 28 entry: | |
| 29 %__2 = inttoptr i32 %iptr to float* | |
| 30 %y = load float, float* %__2, align 4 | |
| 31 %r5 = call float @llvm.sqrt.f32(float %y) | |
| 32 %r6 = fadd float %x, %r5 | |
| 33 ret float %r6 | |
| 34 } | |
| 35 ; MIPS32-LABEL: test_sqrt_float_mergeable_load | |
| 36 ; MIPS32: sqrt.s | |
| 37 ; MIPS32: add.s | |
| 38 | |
| 39 define internal double @test_sqrt_double(double %x, i32 %iptr) { | |
| 40 entry: | |
| 41 %r = call double @llvm.sqrt.f64(double %x) | |
| 42 %r2 = call double @llvm.sqrt.f64(double %r) | |
| 43 %r3 = call double @llvm.sqrt.f64(double -0.0) | |
| 44 %r4 = fadd double %r2, %r3 | |
| 45 ret double %r4 | |
| 46 } | |
| 47 ; MIPS32-LABEL: test_sqrt_double | |
| 48 ; MIPS32: sqrt.d | |
| 49 ; MIPS32: sqrt.d | |
| 50 ; MIPS32: sqrt.d | |
| 51 ; MIPS32: add.d | |
| 52 | |
| 53 define internal double @test_sqrt_double_mergeable_load(double %x, i32 %iptr) { | |
| 54 entry: | |
| 55 %__2 = inttoptr i32 %iptr to double* | |
| 56 %y = load double, double* %__2, align 8 | |
| 57 %r5 = call double @llvm.sqrt.f64(double %y) | |
| 58 %r6 = fadd double %x, %r5 | |
| 59 ret double %r6 | |
| 60 } | |
| 61 ; MIPS32-LABEL: test_sqrt_double_mergeable_load | |
| 62 ; MIPS32: sqrt.d | |
| 63 ; MIPS32: add.d | |
| 64 | |
| 65 define internal float @test_sqrt_ignored(float %x, double %y) { | |
| 66 entry: | |
| 67 %ignored1 = call float @llvm.sqrt.f32(float %x) | |
| 68 %ignored2 = call double @llvm.sqrt.f64(double %y) | |
| 69 ret float 0.0 | |
| 70 } | |
| 71 ; MIPS32-LABEL: test_sqrt_ignored | |
| 72 ; MIPS32: sqrt.s | |
| 73 ; MIPS32: sqrt.d | |
| 74 | |
| 75 define internal float @test_fabs_float(float %x) { | |
| 76 entry: | |
| 77 %r = call float @llvm.fabs.f32(float %x) | |
| 78 %r2 = call float @llvm.fabs.f32(float %r) | |
| 79 %r3 = call float @llvm.fabs.f32(float -0.0) | |
| 80 %r4 = fadd float %r2, %r3 | |
| 81 ret float %r4 | |
| 82 } | |
| 83 ; MIPS32-LABEL: test_fabs_float | |
| 84 ; MIPS32: abs.s | |
| 85 ; MIPS32: abs.s | |
| 86 ; MIPS32: abs.s | |
| 87 ; MIPS32: add.s | |
| 88 | |
| 89 define internal double @test_fabs_double(double %x) { | |
| 90 entry: | |
| 91 %r = call double @llvm.fabs.f64(double %x) | |
| 92 %r2 = call double @llvm.fabs.f64(double %r) | |
| 93 %r3 = call double @llvm.fabs.f64(double -0.0) | |
| 94 %r4 = fadd double %r2, %r3 | |
| 95 ret double %r4 | |
| 96 } | |
| 97 ; MIPS32-LABEL: test_fabs_double | |
| 98 ; MIPS32: abs.d | |
| 99 ; MIPS32: abs.d | |
| 100 ; MIPS32: abs.d | |
| 101 ; MIPS32: add.d | |
| OLD | NEW |