diff options
author | Bor Grošelj Simić <bor.groseljsimic@telemach.net> | 2022-01-28 02:06:18 +0100 |
---|---|---|
committer | Quentin Carbonneaux <quentin@c9x.me> | 2022-01-28 09:24:15 +0100 |
commit | 3964574a8325ab802f98856195b8214dcce3124c (patch) | |
tree | 0ac6128a201088b186d642b990a02c6e78cf715a /doc | |
parent | 74d022f975f22fda20c0d1fe09a3f6fc7680f64f (diff) | |
download | roux-3964574a8325ab802f98856195b8214dcce3124c.tar.gz |
implement float -> unsigned casts
amd64 lacks instruction for this so it has to be implemented with float -> signed casts. The approach is borrowed from llvm.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/il.txt | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/doc/il.txt b/doc/il.txt index 818f0a4..2236340 100644 --- a/doc/il.txt +++ b/doc/il.txt @@ -696,7 +696,9 @@ or convert a floating point into an integer and vice versa. * `exts` -- `d(s)` * `truncd` -- `s(d)` * `stosi` -- `I(ss)` + * `stoui` -- `I(ss)` * `dtosi` -- `I(dd)` + * `dtoui` -- `I(dd)` * `swtof` -- `F(ww)` * `uwtof` -- `F(ww)` * `sltof` -- `F(ll)` @@ -716,12 +718,12 @@ 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 `stosi` (single to signed integer), `dtosi` -(double to signed integer), `swtof` (signed word to float), -`uwtof` (unsigned word to float), `sltof` (signed long -to float) and `ultof` (unsigned long to float). Conversion -from unsigned types is not yet supported. +Converting between signed integers and floating points is done +using `stosi` (single to signed integer), `stoui` (single to +unsigned integer`, `dtosi` (double to signed integer), `dtoui` +(double to unsigned integer), `swtof` (signed word to float), +`uwtof` (unsigned word to float), `sltof` (signed long to +float) and `ultof` (unsigned long to float). Because of <@ Subtyping >, there is no need to have an instruction to lower the precision of an integer temporary. @@ -984,6 +986,7 @@ instructions unless you know exactly what you are doing. * <@ Conversions >: * `dtosi` + * `dtoui` * `exts` * `extsb` * `extsh` @@ -994,6 +997,7 @@ instructions unless you know exactly what you are doing. * `sltof` * `ultof` * `stosi` + * `stoui` * `swtof` * `uwtof` * `truncd` |