| OLD | NEW |
| (Empty) |
| 1 ; RUN: llc < %s | FileCheck %s | |
| 2 | |
| 3 ; Use proper types to ffi calls, no float32 | |
| 4 | |
| 5 target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64
:64:64-p:32:32:32-v128:32:128-n32-S128" | |
| 6 target triple = "asmjs-unknown-emscripten" | |
| 7 | |
| 8 ; CHECK: (+Math_sqrt(+1)); | |
| 9 ; CHECK-NEXT: (+Math_sqrt(+1)); | |
| 10 ; CHECK-NEXT: (+Math_sqrt((+$d))); | |
| 11 ; CHECK-NEXT: (+Math_sqrt((+$f))); | |
| 12 ; CHECK-NEXT: (+Math_ceil(+1)); | |
| 13 ; CHECK-NEXT: (+Math_ceil(+1)); | |
| 14 ; CHECK-NEXT: (+Math_floor(+1)); | |
| 15 ; CHECK-NEXT: (+Math_floor(+1)); | |
| 16 ; CHECK-NEXT: (+_min(+1,+1)); | |
| 17 ; CHECK-NEXT: (+_fmin(+1,+1)); | |
| 18 ; CHECK-NEXT: (+_max(+1,+1)); | |
| 19 ; CHECK-NEXT: (+_fmax(+1,+1)); | |
| 20 ; CHECK-NEXT: (+Math_abs(+1)); | |
| 21 ; CHECK-NEXT: (+_absf(+1)); | |
| 22 ; CHECK-NEXT: (+Math_sin(+1)); | |
| 23 ; CHECK-NEXT: (+Math_sin(+1)); | |
| 24 define void @foo(i32 %x) { | |
| 25 entry: | |
| 26 %f = fadd float 1.0, 2.0 | |
| 27 %d = fadd double 1.0, 2.0 | |
| 28 | |
| 29 %sqrtd = call double @sqrt(double 1.0) | |
| 30 %sqrtf = call float @sqrtf(float 1.0) | |
| 31 %sqrtdv = call double @sqrt(double %d) ; check vars too | |
| 32 %sqrtfv = call float @sqrtf(float %f) | |
| 33 | |
| 34 %ceild = call double @ceil(double 1.0) | |
| 35 %ceilf = call float @ceilf(float 1.0) | |
| 36 | |
| 37 %floord = call double @floor(double 1.0) | |
| 38 %floorf = call float @floorf(float 1.0) | |
| 39 | |
| 40 ; these could be optimized in theory | |
| 41 | |
| 42 %mind = call double @min(double 1.0, double 1.0) | |
| 43 %minf = call float @fmin(float 1.0, float 1.0) | |
| 44 | |
| 45 %maxd = call double @max(double 1.0, double 1.0) | |
| 46 %maxf = call float @fmax(float 1.0, float 1.0) | |
| 47 | |
| 48 %absd = call double @abs(double 1.0) | |
| 49 %absf = call float @absf(float 1.0) | |
| 50 | |
| 51 ; sin is NOT optimizable with floats | |
| 52 | |
| 53 %sind = call double @sin(double 1.0) | |
| 54 %sinf = call float @sinf(float 1.0) | |
| 55 | |
| 56 ret void | |
| 57 } | |
| 58 | |
| 59 declare double @sqrt(double %x) | |
| 60 declare float @sqrtf(float %x) | |
| 61 | |
| 62 declare double @ceil(double %x) | |
| 63 declare float @ceilf(float %x) | |
| 64 | |
| 65 declare double @floor(double %x) | |
| 66 declare float @floorf(float %x) | |
| 67 | |
| 68 declare double @min(double %x, double %y) | |
| 69 declare float @fmin(float %x, float %y) | |
| 70 | |
| 71 declare double @max(double %x, double %y) | |
| 72 declare float @fmax(float %x, float %y) | |
| 73 | |
| 74 declare double @abs(double %x) | |
| 75 declare float @absf(float %x) | |
| 76 | |
| 77 declare double @sin(double %x) | |
| 78 declare float @sinf(float %x) | |
| 79 | |
| 80 attributes #0 = { nounwind readnone } | |
| 81 | |
| OLD | NEW |