diff options
author | Bor Grošelj Simić <bor.groseljsimic@telemach.net> | 2022-01-28 02:06:17 +0100 |
---|---|---|
committer | Quentin Carbonneaux <quentin@c9x.me> | 2022-01-28 09:24:15 +0100 |
commit | 74d022f975f22fda20c0d1fe09a3f6fc7680f64f (patch) | |
tree | a8b7e9e1e822d8eee5eb694984f7d45d8a7f43f0 /arm64 | |
parent | b0d27d8a019811d6a4e0c0cb7ec804ab27fcec80 (diff) | |
download | roux-74d022f975f22fda20c0d1fe09a3f6fc7680f64f.tar.gz |
implement unsigned -> float casts
amd64 lacks an instruction for this so it has to be implemented with signed -> float casts: - Word casting is done by zero-extending the word to a long and then doing a regular signed cast. - Long casting is done by dividing by two with correct rounding if the highest bit is set and casting that to float, then adding 1 to mantissa with integer addition
Diffstat (limited to 'arm64')
-rw-r--r-- | arm64/emit.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/arm64/emit.c b/arm64/emit.c index de1859b..7cebcab 100644 --- a/arm64/emit.c +++ b/arm64/emit.c @@ -91,7 +91,9 @@ static struct { { Ostosi, Ka, "fcvtzs %=, %S0" }, { Odtosi, Ka, "fcvtzs %=, %D0" }, { Oswtof, Ka, "scvtf %=, %W0" }, + { Ouwtof, Ka, "ucvtf %=, %W0" }, { Osltof, Ka, "scvtf %=, %L0" }, + { Oultof, Ka, "ucvtf %=, %L0" }, { Ocall, Kw, "blr %L0" }, { Oacmp, Ki, "cmp %0, %1" }, |