Skip to content

Commit

Permalink
Alternative output for i32x4_relaxed_trunc.wast tests
Browse files Browse the repository at this point in the history
Additional variants for i32x4.relaxed_trunc_f32x4_u and i32x4.relaxed_trunc_f64x2_u_zero
based on algorithms implemented by SpiderMonkey and v8.
  • Loading branch information
yurydelendik committed Mar 23, 2023
1 parent ba2d5eb commit c8f02b4
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions test/core/relaxed-simd/i32x4_relaxed_trunc.wast
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,15 @@
(v128.const f32x4 0 -1.0 4294967040.0 4294967296.0))
;; out of range -> saturate or UINT32_MAX
(either (v128.const i32x4 0 0 4294967040 0xffffffff)
(v128.const i32x4 0 0xffffffff 4294967040 0xffffffff)))
(v128.const i32x4 0 0xffffffff 4294967040 0xffffffff)
(v128.const i32x4 0 0xffffffff 4294967040 0)))

(assert_return (invoke "i32x4.relaxed_trunc_f32x4_u"
(v128.const f32x4 nan -nan nan:0x444444 -nan:0x444444))
;; nans -> 0 or UINT32_MAX
(either (v128.const i32x4 0 0 0 0)
(v128.const i32x4 0xffffffff 0xffffffff 0xffffffff 0xffffffff)))
(v128.const i32x4 0xffffffff 0xffffffff 0xffffffff 0xffffffff)
(v128.const i32x4 0x80000000 0x80000000 0x80000000 0x80000000)))

(assert_return (invoke "i32x4.relaxed_trunc_f64x2_s_zero"
(v128.const f64x2 -2147483904.0 2147483904.0))
Expand All @@ -73,7 +75,8 @@
(v128.const f64x2 -1.0 4294967296.0))
;; out of range -> saturate or UINT32_MAX
(either (v128.const i32x4 0 0xffffffff 0 0)
(v128.const i32x4 0xffffffff 0xffffffff 0 0)))
(v128.const i32x4 0xffffffff 0xffffffff 0 0)
(v128.const i32x4 0xfffffffe 0 0 0)))

(assert_return (invoke "i32x4.relaxed_trunc_f64x2_u_zero"
(v128.const f64x2 nan -nan))
Expand Down

0 comments on commit c8f02b4

Please sign in to comment.