summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/emcc_hello_world.fromasm.imprecise2
-rw-r--r--test/emcc_hello_world.fromasm.imprecise.no-opts2
-rw-r--r--test/unit.asm.js11
-rw-r--r--test/unit.fromasm15
-rw-r--r--test/unit.fromasm.clamp15
-rw-r--r--test/unit.fromasm.clamp.no-opts24
-rw-r--r--test/unit.fromasm.imprecise20
-rw-r--r--test/unit.fromasm.imprecise.no-opts24
-rw-r--r--test/unit.fromasm.no-opts24
9 files changed, 135 insertions, 2 deletions
diff --git a/test/emcc_hello_world.fromasm.imprecise b/test/emcc_hello_world.fromasm.imprecise
index 20af7061a..3aa9ed739 100644
--- a/test/emcc_hello_world.fromasm.imprecise
+++ b/test/emcc_hello_world.fromasm.imprecise
@@ -4530,7 +4530,7 @@
(i32.store
(get_local $7)
(tee_local $5
- (i32.trunc_s/f64
+ (i32.trunc_u/f64
(get_local $15)
)
)
diff --git a/test/emcc_hello_world.fromasm.imprecise.no-opts b/test/emcc_hello_world.fromasm.imprecise.no-opts
index 7faa18088..d33f824e2 100644
--- a/test/emcc_hello_world.fromasm.imprecise.no-opts
+++ b/test/emcc_hello_world.fromasm.imprecise.no-opts
@@ -9847,7 +9847,7 @@
(loop $while-in60
(block $while-out59
(set_local $$conv216$i
- (i32.trunc_s/f64
+ (i32.trunc_u/f64
(get_local $$y$addr$4$i)
)
)
diff --git a/test/unit.asm.js b/test/unit.asm.js
index 11de89c60..9d5f40aea 100644
--- a/test/unit.asm.js
+++ b/test/unit.asm.js
@@ -680,8 +680,19 @@ function asm(global, env, buffer) {
return +(+Math_sqrt(x) + +Math_fround(Math_sqrt(Math_fround(x))));
}
+ function f2u(x) {
+ x = +x;
+ return (~~x>>>0) | 0;
+ }
+ function f2s(x) {
+ x = +x;
+ return (~~x) | 0;
+ }
+
function keepAlive() {
sqrts(3.14159);
+ f2u(100.0);
+ f2s(100.0);
}
function v() {
diff --git a/test/unit.fromasm b/test/unit.fromasm
index fd0fb27a0..45dc81937 100644
--- a/test/unit.fromasm
+++ b/test/unit.fromasm
@@ -1155,12 +1155,27 @@
)
)
)
+ (func $f2u (param $0 f64) (result i32)
+ (call $f64-to-int
+ (get_local $0)
+ )
+ )
(func $keepAlive
(drop
(call $sqrts
(f64.const 3.14159)
)
)
+ (drop
+ (call $f2u
+ (f64.const 100)
+ )
+ )
+ (drop
+ (call $f2u
+ (f64.const 100)
+ )
+ )
)
(func $vi (param $0 i32)
(nop)
diff --git a/test/unit.fromasm.clamp b/test/unit.fromasm.clamp
index ffe26a3a2..469c4932b 100644
--- a/test/unit.fromasm.clamp
+++ b/test/unit.fromasm.clamp
@@ -1179,12 +1179,27 @@
)
)
)
+ (func $f2u (param $0 f64) (result i32)
+ (call $f64-to-int
+ (get_local $0)
+ )
+ )
(func $keepAlive
(drop
(call $sqrts
(f64.const 3.14159)
)
)
+ (drop
+ (call $f2u
+ (f64.const 100)
+ )
+ )
+ (drop
+ (call $f2u
+ (f64.const 100)
+ )
+ )
)
(func $vi (param $0 i32)
(nop)
diff --git a/test/unit.fromasm.clamp.no-opts b/test/unit.fromasm.clamp.no-opts
index 9d9258bf2..d8fab1d25 100644
--- a/test/unit.fromasm.clamp.no-opts
+++ b/test/unit.fromasm.clamp.no-opts
@@ -1911,12 +1911,36 @@
)
)
)
+ (func $f2u (param $x f64) (result i32)
+ (return
+ (call $f64-to-int
+ (get_local $x)
+ )
+ )
+ )
+ (func $f2s (param $x f64) (result i32)
+ (return
+ (call $f64-to-int
+ (get_local $x)
+ )
+ )
+ )
(func $keepAlive
(drop
(call $sqrts
(f64.const 3.14159)
)
)
+ (drop
+ (call $f2u
+ (f64.const 100)
+ )
+ )
+ (drop
+ (call $f2s
+ (f64.const 100)
+ )
+ )
)
(func $v
(nop)
diff --git a/test/unit.fromasm.imprecise b/test/unit.fromasm.imprecise
index e94c07f7f..3254980d9 100644
--- a/test/unit.fromasm.imprecise
+++ b/test/unit.fromasm.imprecise
@@ -1123,12 +1123,32 @@
)
)
)
+ (func $f2u (param $0 f64) (result i32)
+ (i32.trunc_u/f64
+ (get_local $0)
+ )
+ )
+ (func $f2s (param $0 f64) (result i32)
+ (i32.trunc_s/f64
+ (get_local $0)
+ )
+ )
(func $keepAlive
(drop
(call $sqrts
(f64.const 3.14159)
)
)
+ (drop
+ (call $f2u
+ (f64.const 100)
+ )
+ )
+ (drop
+ (call $f2s
+ (f64.const 100)
+ )
+ )
)
(func $vi (param $0 i32)
(nop)
diff --git a/test/unit.fromasm.imprecise.no-opts b/test/unit.fromasm.imprecise.no-opts
index f1625311d..736f51222 100644
--- a/test/unit.fromasm.imprecise.no-opts
+++ b/test/unit.fromasm.imprecise.no-opts
@@ -1871,12 +1871,36 @@
)
)
)
+ (func $f2u (param $x f64) (result i32)
+ (return
+ (i32.trunc_u/f64
+ (get_local $x)
+ )
+ )
+ )
+ (func $f2s (param $x f64) (result i32)
+ (return
+ (i32.trunc_s/f64
+ (get_local $x)
+ )
+ )
+ )
(func $keepAlive
(drop
(call $sqrts
(f64.const 3.14159)
)
)
+ (drop
+ (call $f2u
+ (f64.const 100)
+ )
+ )
+ (drop
+ (call $f2s
+ (f64.const 100)
+ )
+ )
)
(func $v
(nop)
diff --git a/test/unit.fromasm.no-opts b/test/unit.fromasm.no-opts
index 2bffda308..3b80ebe1b 100644
--- a/test/unit.fromasm.no-opts
+++ b/test/unit.fromasm.no-opts
@@ -1887,12 +1887,36 @@
)
)
)
+ (func $f2u (param $x f64) (result i32)
+ (return
+ (call $f64-to-int
+ (get_local $x)
+ )
+ )
+ )
+ (func $f2s (param $x f64) (result i32)
+ (return
+ (call $f64-to-int
+ (get_local $x)
+ )
+ )
+ )
(func $keepAlive
(drop
(call $sqrts
(f64.const 3.14159)
)
)
+ (drop
+ (call $f2u
+ (f64.const 100)
+ )
+ )
+ (drop
+ (call $f2s
+ (f64.const 100)
+ )
+ )
)
(func $v
(nop)