Skip to content
This repository was archived by the owner on Dec 22, 2021. It is now read-only.

Commit 5bd1db5

Browse files
Jakob Stoklund Olesenstoklund
authored andcommitted
Saturating float-to-int conversions.
The CG consensus was to replace the trapping conversion instructions with saturating semantics.
1 parent 6edd8c2 commit 5bd1db5

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

proposals/simd/SIMD.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -662,13 +662,14 @@ Lane-wise IEEE `squareRoot`.
662662
Lane-wise conversion from integer to floating point. Some integer values will be
663663
rounded.
664664

665-
### Floating point to integer
666-
* `i32x4.trunc_s/f32x4(a: v128) -> v128`
667-
* `i32x4.trunc_u/f32x4(a: v128) -> v128`
668-
* `i64x2.trunc_s/f64x2(a: v128) -> v128`
669-
* `i64x2.trunc_u/f64x2(a: v128) -> v128`
670-
671-
Lane-wise conversion from floating point to integer using the IEEE
672-
`convertToIntegerTowardZero` function. If any lane is a NaN or the rounded
673-
integer value is outside the range of the destination type, these instructions
674-
trap.
665+
### Floating point to integer with saturation
666+
* `i32x4.trunc_s/f32x4:sat(a: v128) -> v128`
667+
* `i32x4.trunc_u/f32x4:sat(a: v128) -> v128`
668+
* `i64x2.trunc_s/f64x2:sat(a: v128) -> v128`
669+
* `i64x2.trunc_u/f64x2:sat(a: v128) -> v128`
670+
671+
Lane-wise saturating conversion from floating point to integer using the IEEE
672+
`convertToIntegerTowardZero` function. If any input lane is a NaN, the
673+
resulting lane is 0. If the rounded integer value of a lane is outside the
674+
range of the destination type, the result is saturated to the nearest
675+
representable integer value.

0 commit comments

Comments
 (0)