| 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 ; RUN: %if --need=target_MIPS32 --need=allow_dump \ | |
| 9 ; RUN: --command %p2i --filetype=asm --assemble --disassemble --target mips32\ | |
| 10 ; RUN: -i %s --args -O2 --skip-unimplemented \ | |
| 11 ; RUN: -allow-externally-defined-symbols \ | |
| 12 ; RUN: | %if --need=target_MIPS32 --need=allow_dump \ | |
| 13 ; RUN: --command FileCheck --check-prefix MIPS32-O2 %s | |
| 14 | |
| 15 declare float @llvm.sqrt.f32(float) | |
| 16 declare double @llvm.sqrt.f64(double) | |
| 17 declare float @llvm.fabs.f32(float) | |
| 18 declare double @llvm.fabs.f64(double) | |
| 19 | |
| 20 define internal float @test_sqrt_float(float %x, i32 %iptr) { | |
| 21 entry: | |
| 22 %r = call float @llvm.sqrt.f32(float %x) | |
| 23 %r2 = call float @llvm.sqrt.f32(float %r) | |
| 24 %r3 = call float @llvm.sqrt.f32(float -0.0) | |
| 25 %r4 = fadd float %r2, %r3 | |
| 26 ret float %r4 | |
| 27 } | |
| 28 ; MIPS32-LABEL: test_sqrt_float | |
| 29 ; MIPS32: sqrt.s | |
| 30 ; MIPS32: sqrt.s | |
| 31 ; MIPS32: sqrt.s | |
| 32 ; MIPS32: add.s | |
| 33 ; MIPS32-O2-LABEL: test_sqrt_float | |
| 34 ; MIPS32-O2: sqrt.s | |
| 35 ; MIPS32-O2: sqrt.s | |
| 36 ; MIPS32-O2: sqrt.s | |
| 37 ; MIPS32-O2: 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 ; MIPS32-O2-LABEL: test_sqrt_double | |
| 53 ; MIPS32-O2: sqrt.d | |
| 54 ; MIPS32-O2: sqrt.d | |
| 55 ; MIPS32-O2: sqrt.d | |
| 56 ; MIPS32-O2: add.d | |
| 57 | |
| 58 define internal float @test_sqrt_ignored(float %x, double %y) { | |
| 59 entry: | |
| 60 %ignored1 = call float @llvm.sqrt.f32(float %x) | |
| 61 %ignored2 = call double @llvm.sqrt.f64(double %y) | |
| 62 ret float 0.0 | |
| 63 } | |
| 64 ; MIPS32-LABEL: test_sqrt_ignored | |
| 65 ; MIPS32: sqrt.s | |
| 66 ; MIPS32: sqrt.d | |
| 67 ; MIPS32-O2-LABEL: test_sqrt_ignored | |
| 68 | |
| 69 define internal float @test_fabs_float(float %x) { | |
| 70 entry: | |
| 71 %r = call float @llvm.fabs.f32(float %x) | |
| 72 %r2 = call float @llvm.fabs.f32(float %r) | |
| 73 %r3 = call float @llvm.fabs.f32(float -0.0) | |
| 74 %r4 = fadd float %r2, %r3 | |
| 75 ret float %r4 | |
| 76 } | |
| 77 ; MIPS32-LABEL: test_fabs_float | |
| 78 ; MIPS32: abs.s | |
| 79 ; MIPS32: abs.s | |
| 80 ; MIPS32: abs.s | |
| 81 ; MIPS32: add.s | |
| 82 ; MIPS32-O2-LABEL: test_fabs_float | |
| 83 ; MIPS32-O2: abs.s | |
| 84 ; MIPS32-O2: abs.s | |
| 85 ; MIPS32-O2: abs.s | |
| 86 ; MIPS32-O2: add.s | |
| 87 | |
| 88 define internal double @test_fabs_double(double %x) { | |
| 89 entry: | |
| 90 %r = call double @llvm.fabs.f64(double %x) | |
| 91 %r2 = call double @llvm.fabs.f64(double %r) | |
| 92 %r3 = call double @llvm.fabs.f64(double -0.0) | |
| 93 %r4 = fadd double %r2, %r3 | |
| 94 ret double %r4 | |
| 95 } | |
| 96 ; MIPS32-LABEL: test_fabs_double | |
| 97 ; MIPS32: abs.d | |
| 98 ; MIPS32: abs.d | |
| 99 ; MIPS32: abs.d | |
| 100 ; MIPS32: add.d | |
| 101 ; MIPS32-O2-LABEL: test_fabs_double | |
| 102 ; MIPS32-O2: abs.d | |
| 103 ; MIPS32-O2: abs.d | |
| 104 ; MIPS32-O2: abs.d | |
| 105 ; MIPS32-O2: add.d | |
| OLD | NEW |