commit 1b2721500337d37f189c7e5d714c9c943062ea79
parent f691d4fb6b92caf32db2e27fa03e714397ecfdc5
Author: Quentin Carbonneaux <quentin.carbonneaux@yale.edu>
Date: Tue, 15 Mar 2016 14:07:13 -0400
document exts and truncd
Diffstat:
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/doc/il.txt b/doc/il.txt
@@ -642,6 +642,8 @@ or convert a floating point into an integer and vice versa.
* `extsw`, `extzw` -- `l(w)`
* `extsh`, `extzh` -- `I(ww)`
* `extsb`, `extzb` -- `I(ww)`
+ * `exts` -- `d(s)`
+ * `truncd` -- `s(d)`
* `ftosi` -- `I(F)`
* `sitof` -- `F(I)`
@@ -653,6 +655,12 @@ exist to sign-extend and zero-extend a value. For example,
least-significant bits to a full word or long, depending on
the return type.
+The instructions `exts` and `truncd` are provided to change
+the precision of a floating point value. When the double
+argument of `truncd` cannot be represented as a
+single-precision floating point, it is truncated towards
+zero.
+
Converting between signed integers and floating points is
done using `ftosi` (float to signed integer) and `sitof`
(signed integer to float). Note that the bit width of the
@@ -661,7 +669,7 @@ point number can only be converted directly to a long
integer.
Because of <@ Subtyping >, there is no need to have an
-instruction to lower the precision of a temporary.
+instruction to lower the precision of an integer temporary.
~ Cast
~~~~~~