Skip to content

Commit e7a2158

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 e7a2158

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

test/core/relaxed-simd/i32x4_relaxed_trunc.wast

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,17 @@
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 and SpiderMonkey
63+
(v128.const i32x4 0x80000000 0x80000000 0x80000000 0x80000000)))
6064

6165
(assert_return (invoke "i32x4.relaxed_trunc_f64x2_s_zero"
6266
(v128.const f64x2 -2147483904.0 2147483904.0))
@@ -73,7 +77,9 @@
7377
(v128.const f64x2 -1.0 4294967296.0))
7478
;; out of range -> saturate or UINT32_MAX
7579
(either (v128.const i32x4 0 0xffffffff 0 0)
76-
(v128.const i32x4 0xffffffff 0xffffffff 0 0)))
80+
(v128.const i32x4 0xffffffff 0xffffffff 0 0)
81+
;; output generated by the algorithm in V8 and SpiderMonkey
82+
(v128.const i32x4 0xfffffffe 0 0 0)))
7783

7884
(assert_return (invoke "i32x4.relaxed_trunc_f64x2_u_zero"
7985
(v128.const f64x2 nan -nan))

0 commit comments

Comments
 (0)