summaryrefslogtreecommitdiff
path: root/test/wasm-only.fromasm.no-opts
diff options
context:
space:
mode:
Diffstat (limited to 'test/wasm-only.fromasm.no-opts')
-rw-r--r--test/wasm-only.fromasm.no-opts92
1 files changed, 83 insertions, 9 deletions
diff --git a/test/wasm-only.fromasm.no-opts b/test/wasm-only.fromasm.no-opts
index c0cfa4676..bbb32c5f3 100644
--- a/test/wasm-only.fromasm.no-opts
+++ b/test/wasm-only.fromasm.no-opts
@@ -343,6 +343,32 @@
)
)
)
+ (func $f32-to-int64 (param $0 f32) (result i64)
+ (if (result i64)
+ (f32.ne
+ (get_local $0)
+ (get_local $0)
+ )
+ (i64.const -9223372036854775808)
+ (if (result i64)
+ (f32.ge
+ (get_local $0)
+ (f32.const 9223372036854775808)
+ )
+ (i64.const -9223372036854775808)
+ (if (result i64)
+ (f32.le
+ (get_local $0)
+ (f32.const -9223372036854775808)
+ )
+ (i64.const -9223372036854775808)
+ (i64.trunc_s/f32
+ (get_local $0)
+ )
+ )
+ )
+ )
+ )
(func $f64-to-int64 (param $0 f64) (result i64)
(if (result i64)
(f64.ne
@@ -369,6 +395,58 @@
)
)
)
+ (func $f32-to-uint64 (param $0 f32) (result i64)
+ (if (result i64)
+ (f32.ne
+ (get_local $0)
+ (get_local $0)
+ )
+ (i64.const 0)
+ (if (result i64)
+ (f32.ge
+ (get_local $0)
+ (f32.const 18446744073709551615)
+ )
+ (i64.const 0)
+ (if (result i64)
+ (f32.le
+ (get_local $0)
+ (f32.const -1)
+ )
+ (i64.const 0)
+ (i64.trunc_u/f32
+ (get_local $0)
+ )
+ )
+ )
+ )
+ )
+ (func $f64-to-uint64 (param $0 f64) (result i64)
+ (if (result i64)
+ (f64.ne
+ (get_local $0)
+ (get_local $0)
+ )
+ (i64.const 0)
+ (if (result i64)
+ (f64.ge
+ (get_local $0)
+ (f64.const 18446744073709551615)
+ )
+ (i64.const 0)
+ (if (result i64)
+ (f64.le
+ (get_local $0)
+ (f64.const -1)
+ )
+ (i64.const 0)
+ (i64.trunc_u/f64
+ (get_local $0)
+ )
+ )
+ )
+ )
+ )
(func $test64
(local $x i64)
(local $y i64)
@@ -601,10 +679,8 @@
)
)
(set_local $x
- (call $f64-to-int64
- (f64.promote/f32
- (get_local $float32)
- )
+ (call $f32-to-int64
+ (get_local $float32)
)
)
(set_local $x
@@ -613,14 +689,12 @@
)
)
(set_local $x
- (call $f64-to-int64
- (f64.promote/f32
- (get_local $float32)
- )
+ (call $f32-to-uint64
+ (get_local $float32)
)
)
(set_local $x
- (call $f64-to-int64
+ (call $f64-to-uint64
(get_local $float64)
)
)