Skip to content

Commit

Permalink
Fix relaxed trunc pseudocode in Overview
Browse files Browse the repository at this point in the history
  • Loading branch information
thibaudmichaud authored and ngzhian committed Oct 3, 2023
1 parent cd9c447 commit 22257c5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions proposals/relaxed-simd/Overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ def relaxed_i32x4_trunc_f32x4_s(a : f32x4) -> i32x4:
for i in range(4):
if isnan(a[i]):
result[i] = IMPLEMENTATION_DEFINED_ONE_OF(0, INT32_MIN)
continue
r = truncate(a[i])
if r < INT32_MIN:
result[i] = INT32_MIN
Expand All @@ -128,6 +129,7 @@ def relaxed_i32x4_trunc_f32x4_u(a : f32x4) -> i32x4:
for i in range(4):
if isnan(a[i]):
result[i] = IMPLEMENTATION_DEFINED_ONE_OF(0, UINT32_MAX)
continue
r = truncate(a[i])
if r < UINT32_MIN:
result[i] = IMPLEMENTATION_DEFINED_ONE_OF(UINT32_MIN, UINT32_MAX)
Expand All @@ -141,6 +143,7 @@ def relaxed_i32x4_trunc_f64x2_zero_s(a : f64x2) -> i32x4:
for i in range(2):
if isnan(a[i]):
result[i] = IMPLEMENTATION_DEFINED_ONE_OF(0, INT32_MIN)
continue
r = truncate(a[i])
if r < INT32_MIN:
result[i] = INT32_MIN
Expand All @@ -154,6 +157,7 @@ def relaxed_i32x4_trunc_f64x2_zero_u(a : f64x2) -> i32x4:
for i in range(2):
if isnan(a[i]):
result[i] = IMPLEMENTATION_DEFINED_ONE_OF(0, UINT32_MAX)
continue
r = truncate(a[i])
if r < UINT32_MIN:
result[i] = IMPLEMENTATION_DEFINED_ONE_OF(UINT32_MIN, UINT32_MAX)
Expand Down

0 comments on commit 22257c5

Please sign in to comment.