OLD | NEW |
| (Empty) |
1 ; RUN: llc -emscripten-precise-f32=false < %s | FileCheck %s | |
2 ; RUN: llc -emscripten-precise-f32=true < %s | FileCheck --check-prefix=CHECK-PR
ECISE_F32 %s | |
3 | |
4 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" | |
5 target triple = "asmjs-unknown-emscripten" | |
6 | |
7 ; SIMD_float32x4_splat needs a float32 input even if we're not in precise-f32 mo
de. | |
8 | |
9 ; CHECK: test( | |
10 ; CHECK: $d = SIMD_float32x4_splat(Math_fround($f)); | |
11 ; CHECK-PRECISE_F32: test( | |
12 ; CHECK-PRECISE_F32: $f = Math_fround($f); | |
13 ; CHECK-PRECISE_F32: $d = SIMD_float32x4_splat($f); | |
14 define <4 x float> @test(float %f) { | |
15 %a = insertelement <4 x float> undef, float %f, i32 0 | |
16 %b = insertelement <4 x float> %a, float %f, i32 1 | |
17 %c = insertelement <4 x float> %b, float %f, i32 2 | |
18 %d = insertelement <4 x float> %c, float %f, i32 3 | |
19 ret <4 x float> %d | |
20 } | |
21 | |
22 ; CHECK: test_insert( | |
23 ; CHECK: $a = SIMD_float32x4_withX($v,Math_fround($g)); | |
24 ; CHECK-PRECISE_F32: test_insert( | |
25 ; CHECK-PRECISE_F32: $g = Math_fround($g); | |
26 ; CHECK-PRECISE_F32: $a = SIMD_float32x4_withX($v,$g); | |
27 define <4 x float> @test_insert(<4 x float> %v, float %g) { | |
28 %a = insertelement <4 x float> %v, float %g, i32 0 | |
29 ret <4 x float> %a | |
30 } | |
31 | |
32 ; CHECK: test_ctor( | |
33 ; CHECK: $d = SIMD_float32x4(Math_fround($x), Math_fround($y), Math_fround($z),
Math_fround($w)); | |
34 ; CHECK-PRECISE_F32: test_ctor( | |
35 ; CHECK-PRECISE_F32: $x = Math_fround($x); | |
36 ; CHECK-PRECISE_F32: $y = Math_fround($y); | |
37 ; CHECK-PRECISE_F32: $z = Math_fround($z); | |
38 ; CHECK-PRECISE_F32: $w = Math_fround($w); | |
39 ; CHECK-PRECISE_F32: $d = SIMD_float32x4($x, $y, $z, $w); | |
40 define <4 x float> @test_ctor(<4 x float> %v, float %x, float %y, float %z, floa
t %w) { | |
41 %a = insertelement <4 x float> undef, float %x, i32 0 | |
42 %b = insertelement <4 x float> %a, float %y, i32 1 | |
43 %c = insertelement <4 x float> %b, float %z, i32 2 | |
44 %d = insertelement <4 x float> %c, float %w, i32 3 | |
45 ret <4 x float> %d | |
46 } | |
OLD | NEW |