@@ -35,6 +35,14 @@ detailed in this document.
3535
3636[ :unicorn : ] [ future general ] = Planned [ future] [ future general ] feature
3737
38+ ## Post-MVP Features
39+
40+ Some features were added post-MVP. These are indicated with the following symbols:
41+
42+ | Symbol | Feature |
43+ | ---------- | ------- |
44+ | :bowling : | Saturating float to int conversions |
45+
3846## Traps
3947
4048Some operators may * trap* under some conditions, as noted below. In the MVP,
@@ -640,6 +648,14 @@ is NaN, and *ordered* otherwise.
640648 * ` f64.convert_u/i32 ` : convert an unsigned 32-bit integer to a 64-bit float
641649 * ` f64.convert_u/i64 ` : convert an unsigned 64-bit integer to a 64-bit float
642650 * ` f64.reinterpret/i64 ` : reinterpret the bits of a 64-bit integer as a 64-bit float
651+ * ` i32.trunc_sat_f32_s ` : :bowling : truncate a 32-bit float to a signed 32-bit integer with saturation
652+ * ` i32.trunc_sat_f64_s ` : :bowling : truncate a 64-bit float to a signed 32-bit integer with saturation
653+ * ` i32.trunc_sat_f32_u ` : :bowling : truncate a 32-bit float to an unsigned 32-bit integer with saturation
654+ * ` i32.trunc_sat_f64_u ` : :bowling : truncate a 64-bit float to an unsigned 32-bit integer with saturation
655+ * ` i64.trunc_sat_f32_s ` : :bowling : truncate a 32-bit float to a signed 64-bit integer with saturation
656+ * ` i64.trunc_sat_f64_s ` : :bowling : truncate a 64-bit float to a signed 64-bit integer with saturation
657+ * ` i64.trunc_sat_f32_u ` : :bowling : truncate a 32-bit float to an unsigned 64-bit integer with saturation
658+ * ` i64.trunc_sat_f64_u ` : :bowling : truncate a 64-bit float to an unsigned 64-bit integer with saturation
643659
644660Wrapping and extension of integer values always succeed.
645661Promotion and demotion of floating point values always succeed.
@@ -665,7 +681,12 @@ round-to-nearest ties-to-even rounding.
665681
666682Truncation from floating point to integer where IEEE 754-2008 would specify an
667683invalid operator exception (e.g. when the floating point value is NaN or
668- outside the range which rounds to an integer in range) traps.
684+ outside the range which rounds to an integer in range) is handled as follows:
685+ - For instructions with no exceptional behavior specified, a trap is produced.
686+ - :bowling : For instructions containing ` _sat ` , no trap is produced, and:
687+ - If the floating-point value is positive, the maximum integer value is returned.
688+ - If the floating-point value is negative, the minimum integer value is returned.
689+ - If the floating-point value is NaN, zero is returned.
669690
670691## Type-parametric operators
671692
0 commit comments