summary refs log tree commit diff
path: root/ops.h
diff options
context:
space:
mode:
authorBor Grošelj Simić <bor.groseljsimic@telemach.net>2022-01-28 02:06:17 +0100
committerQuentin Carbonneaux <quentin@c9x.me>2022-01-28 09:24:15 +0100
commit74d022f975f22fda20c0d1fe09a3f6fc7680f64f (patch)
treea8b7e9e1e822d8eee5eb694984f7d45d8a7f43f0 /ops.h
parentb0d27d8a019811d6a4e0c0cb7ec804ab27fcec80 (diff)
downloadroux-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 'ops.h')
-rw-r--r--ops.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/ops.h b/ops.h
index 0729d46..04b0cf8 100644
--- a/ops.h
+++ b/ops.h
@@ -98,7 +98,9 @@ O(truncd,  T(e,e,d,e, e,e,x,e), 1) X(0, 0, 1)
 O(stosi,   T(s,s,e,e, x,x,e,e), 1) X(0, 0, 1)
 O(dtosi,   T(d,d,e,e, x,x,e,e), 1) X(0, 0, 1)
 O(swtof,   T(e,e,w,w, e,e,x,x), 1) X(0, 0, 1)
+O(uwtof,   T(e,e,w,w, e,e,x,x), 1) X(0, 0, 1)
 O(sltof,   T(e,e,l,l, e,e,x,x), 1) X(0, 0, 1)
+O(ultof,   T(e,e,l,l, e,e,x,x), 1) X(0, 0, 1)
 O(cast,    T(s,d,w,l, x,x,x,x), 1) X(0, 0, 1)
 
 /* Stack Allocation */