the opportunity may be taken to modernise the instructions and make them
well-suited for common/important conversion sequences:
-* **standard IEEE754** - used by most languages and CPUs
-* **standard OpenPOWER** - saturation with NaN
- converted to minimum valid integer
-* **Java** - saturation with NaN converted to 0
-* **JavaScript** - modulo wrapping with Inf/NaN converted to 0
+* Int -> Float
+ * **standard IEEE754** - used by most languages and CPUs
+* Float -> Int
+ * **standard OpenPOWER** - saturation with NaN
+ converted to minimum valid integer
+ * **Java/Saturating** - saturation with NaN converted to 0
+ * **JavaScript** - modulo wrapping with Inf/NaN converted to 0
The assembly listings in the [[int_fp_mv/appendix]] show how costly
some of these language-specific conversions are: Javascript, the
Those same semantics are used in some way by all of the following languages (not necessarily for the default conversion method):
* Java's
- [FP -> Integer conversion](https://docs.oracle.com/javase/specs/jls/se16/html/jls-5.html#jls-5.1.3)
+ [FP -> Integer conversion](https://docs.oracle.com/javase/specs/jls/se16/html/jls-5.html#jls-5.1.3) (only for long/int results)
* Rust's FP -> Integer conversion using the
[`as` operator](https://doc.rust-lang.org/reference/expressions/operator-expr.html#semantics)
* LLVM's
<div id="fp-to-int-java-saturating-conversion-semantics"></div>
[Java/Saturating conversion semantics](https://docs.oracle.com/javase/specs/jls/se16/html/jls-5.html#jls-5.1.3)
-/
+(only for long/int results)/
[Rust semantics](https://doc.rust-lang.org/reference/expressions/operator-expr.html#semantics)
(with adjustment to add non-truncate rounding modes):
```
-def fp_to_int_java<fp, int>(v: fp) -> int:
+def fp_to_int_java_saturating<fp, int>(v: fp) -> int:
if v is NaN:
return 0
if v >= int::MAX_VALUE:
| `fcvttgud[o]. RT, FRB, CVM` | `fcvttg[o] RT, FRB, CVM, 3, 1` |
| `fcvtstgud[o] RT, FRB, CVM` | `fcvttg[o] RT, FRB, CVM, 3, 2` |
| `fcvtstgud[o]. RT, FRB, CVM` | `fcvttg[o] RT, FRB, CVM, 3, 3` |
-
-[mode `Mode`]: #fpr-to-gpr-conversion-mode
-
Those same semantics are used in some way by all of the following languages (not necessarily for the default conversion method):
* Java's
- [FP -> Integer conversion](https://docs.oracle.com/javase/specs/jls/se16/html/jls-5.html#jls-5.1.3)
+ [FP -> Integer conversion](https://docs.oracle.com/javase/specs/jls/se16/html/jls-5.html#jls-5.1.3) (only for long/int results)
* Rust's FP -> Integer conversion using the
[`as` operator](https://doc.rust-lang.org/reference/expressions/operator-expr.html#semantics)
* LLVM's
Those same semantics are used in some way by all of the following languages (not necessarily for the default conversion method):
* Java's
- [FP -> Integer conversion](https://docs.oracle.com/javase/specs/jls/se16/html/jls-5.html#jls-5.1.3)
+ [FP -> Integer conversion](https://docs.oracle.com/javase/specs/jls/se16/html/jls-5.html#jls-5.1.3) (only for ling/int results)
* Rust's FP -> Integer conversion using the
[`as` operator](https://doc.rust-lang.org/reference/expressions/operator-expr.html#semantics)
* LLVM's
<div id="fp-to-int-java-saturating-conversion-semantics"></div>
[Java/Saturating conversion semantics](https://docs.oracle.com/javase/specs/jls/se16/html/jls-5.html#jls-5.1.3)
-/
+ (only for long/int results)/
[Rust semantics](https://doc.rust-lang.org/reference/expressions/operator-expr.html#semantics)
(with adjustment to add non-truncate rounding modes):
```
-def fp_to_int_java<fp, int>(v: fp) -> int:
+def fp_to_int_java_saturating<fp, int>(v: fp) -> int:
if v is NaN:
return 0
if v >= int::MAX_VALUE: