links are part of footnotes
authorJacob Lifshay <programmerjake@gmail.com>
Fri, 7 Jul 2023 00:17:50 +0000 (17:17 -0700)
committerJacob Lifshay <programmerjake@gmail.com>
Fri, 7 Jul 2023 00:17:50 +0000 (17:17 -0700)
openpower/sv/int_fp_mv/cvt_fp_to_int_overview.mdwn

index 9f1d8fc7fd79617348c28828c65875467fb508c9..3187d5322cf6ea0a7ec480a552a1dae693f1aac0 100644 (file)
@@ -12,28 +12,43 @@ modes supported by the `cffpr` instruction are as follows:
     as well as commonly used floating-point to integer conversions on x86.
 
 * S-Type: <div id="fpr-to-gpr-conversion-s-type"></div>
-    Used for WebAssembly's
-    [`trunc_sat_u`](https://webassembly.github.io/spec/core/exec/numerics.html#op-trunc-sat-u)
-    and
-    [`trunc_sat_s`](https://webassembly.github.io/spec/core/exec/numerics.html#op-trunc-sat-s)
-    instructions, as well as several notable programming languages:
-
-    * Java's conversion from
-        [`float`/`double` to `long`/`int`](https://docs.oracle.com/javase/specs/jls/se16/html/jls-5.html#jls-5.1.3)
-    * Rust's [`as` operator](https://doc.rust-lang.org/1.70.0/reference/expressions/operator-expr.html#numeric-cast)
-    * LLVM's [`llvm.fptosi.sat`](https://llvm.org/docs/LangRef.html#llvm-fptosi-sat-intrinsic) and
-        [`llvm.fptoui.sat`](https://llvm.org/docs/LangRef.html#llvm-fptoui-sat-intrinsic) intrinsics
-    * SPIR-V's OpenCL dialect's
-        [`OpConvertFToU`](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#OpConvertFToU) and
-        [`OpConvertFToS`](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#OpConvertFToS)
-        instructions when decorated with
-        [the `SaturatedConversion` decorator](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_decoration_a_decoration).
+    Used for WebAssembly's `trunc_sat_u`[^trunc_sat_u] and
+    `trunc_sat_s`[^trunc_sat_s] instructions, as well as several notable
+    programming languages:
+
+    * Java's conversion from `float`/`double` to `long`/`int`[^java_fp_to_int]
+    * Rust's `as` operator[^rust_as_operator]
+    * LLVM's `llvm.fptosi.sat`[^llvm_fptosi_sat] and
+        `llvm.fptoui.sat`[^llvm_fptoui_sat] intrinsics
+    * SPIR-V's OpenCL dialect's `OpConvertFToU`[^SPIRV_OpConvertFToU] and
+        `OpConvertFToS`[^SPIRV_OpConvertFToS] instructions when decorated with
+        the `SaturatedConversion`[^SPIRV_SaturatedConversion] decorator.
 
 * E-Type: <div id="fpr-to-gpr-conversion-e-type"></div>
-    Used for
-    [ECMAScript's `ToInt32` abstract operation](https://262.ecma-international.org/14.0/#sec-toint32).
-    Also implemented in ARMv8.3A as the `FJCVTZS`
-    instruction.
+    Used for ECMAScript's `ToInt32` abstract operation[^ECMAScript_ToInt32].
+    Also implemented in ARMv8.3A as the `FJCVTZS` instruction[^ARM_FJCVTZS].
+
+[^trunc_sat_u]: WASM's `trunc_sat_u`:
+    <https://webassembly.github.io/spec/core/exec/numerics.html#op-trunc-sat-u>
+[^trunc_sat_s]: WASM's `trunc_sat_s`:
+    <https://webassembly.github.io/spec/core/exec/numerics.html#op-trunc-sat-s>
+[^java_fp_to_int]: Java `float`/`double` to `long`/`int` conversion:
+    <https://docs.oracle.com/javase/specs/jls/se16/html/jls-5.html#jls-5.1.3>
+[^rust_as_operator]: Rust's `as` operator:
+    <https://doc.rust-lang.org/1.70.0/reference/expressions/operator-expr.html#numeric-cast>
+[^llvm_fptosi_sat]: LLVM's `llvm.fptosi.sat` intrinsic:
+    <https://llvm.org/docs/LangRef.html#llvm-fptosi-sat-intrinsic>
+[^llvm_fptoui_sat]: LLVM's `llvm.fptoui.sat` intrinsic:
+    <https://llvm.org/docs/LangRef.html#llvm-fptoui-sat-intrinsic>
+[^SPIRV_OpConvertFToU]: SPIR-V's `OpConvertFToU` instruction:
+    <https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#OpConvertFToU>
+[^SPIRV_OpConvertFToS]: SPIR-V's `OpConvertFToS` instruction:
+    <https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#OpConvertFToS>
+[^SPIRV_SaturatedConversion]: SPIR-V's `SaturatedConversion` decorator:<br/>
+    <https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_decoration_a_decoration>
+[^ECMAScript_ToInt32]: ECMAScript's `ToInt32` abstract operation:
+    <https://262.ecma-international.org/14.0/#sec-toint32>
+[^ARM_FJCVTZS]: ARM's `FJCVTZS` instruction:
     <https://developer.arm.com/documentation/dui0801/g/hko1477562192868>
 
 ### Floating-point to Integer Conversion Semantics Summary