Skip to content

Commit 0f40696

Browse files
committed
Alternative output for i32x4_relaxed_trunc.wast tests
Additional variants for i32x4.relaxed_trunc_f32x4_u and i32x4.relaxed_trunc_f64x2_u_zero based on algorithms implemented by SpiderMonkey and v8.
1 parent ba2d5eb commit 0f40696

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

test/core/relaxed-simd/i32x4_relaxed_trunc.wast

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,19 @@
5050
(v128.const f32x4 0 -1.0 4294967040.0 4294967296.0))
5151
;; out of range -> saturate or UINT32_MAX
5252
(either (v128.const i32x4 0 0 4294967040 0xffffffff)
53-
(v128.const i32x4 0 0xffffffff 4294967040 0xffffffff)))
53+
(v128.const i32x4 0 0xffffffff 4294967040 0xffffffff)
54+
;; output generated by the algorithm in V8 and SpiderMonkey
55+
(v128.const i32x4 0 0xffffffff 4294967040 0)))
5456

5557
(assert_return (invoke "i32x4.relaxed_trunc_f32x4_u"
5658
(v128.const f32x4 nan -nan nan:0x444444 -nan:0x444444))
5759
;; nans -> 0 or UINT32_MAX
5860
(either (v128.const i32x4 0 0 0 0)
59-
(v128.const i32x4 0xffffffff 0xffffffff 0xffffffff 0xffffffff)))
61+
(v128.const i32x4 0xffffffff 0xffffffff 0xffffffff 0xffffffff)
62+
;; output generated by the algorithm in V8
63+
(v128.const i32x4 0xc0000000 0xc0000000 0xc4444400 0xc4444400)
64+
;; output generated by the algorithm in SpiderMonkey
65+
(v128.const i32x4 0x80000000 0x80000000 0x80000000 0x80000000)))
6066

6167
(assert_return (invoke "i32x4.relaxed_trunc_f64x2_s_zero"
6268
(v128.const f64x2 -2147483904.0 2147483904.0))
@@ -73,7 +79,9 @@
7379
(v128.const f64x2 -1.0 4294967296.0))
7480
;; out of range -> saturate or UINT32_MAX
7581
(either (v128.const i32x4 0 0xffffffff 0 0)
76-
(v128.const i32x4 0xffffffff 0xffffffff 0 0)))
82+
(v128.const i32x4 0xffffffff 0xffffffff 0 0)
83+
;; output generated by the algorithm in V8 and SpiderMonkey
84+
(v128.const i32x4 0xfffffffe 0 0 0)))
7785

7886
(assert_return (invoke "i32x4.relaxed_trunc_f64x2_u_zero"
7987
(v128.const f64x2 nan -nan))

0 commit comments

Comments
 (0)