summaryrefslogtreecommitdiff
path: root/runtime/ia32/i64_utod.S
diff options
context:
space:
mode:
authorGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2013-05-06 08:20:06 +0000
committerGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2013-05-06 08:20:06 +0000
commit9b3388bea495d027aa618118096a8223f6866437 (patch)
tree3d1b1bf3b1e0af9d094b2b04a2dfbfd7d18d1f58 /runtime/ia32/i64_utod.S
parentb257a6d283f6f5784cb351856b5dbe8c645a1f6f (diff)
Support for in64 -> float conversions w/ correct rounding.
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@2235 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'runtime/ia32/i64_utod.S')
-rw-r--r--runtime/ia32/i64_utod.S6
1 files changed, 5 insertions, 1 deletions
diff --git a/runtime/ia32/i64_utod.S b/runtime/ia32/i64_utod.S
index 7754ef2..428a3b9 100644
--- a/runtime/ia32/i64_utod.S
+++ b/runtime/ia32/i64_utod.S
@@ -36,7 +36,7 @@
#include "sysdeps.h"
-// Conversion unsigned long -> float
+// Conversion unsigned long -> double-precision float
FUNCTION(__i64_utod)
fildll 4(%esp) // convert as if signed
@@ -44,6 +44,10 @@ FUNCTION(__i64_utod)
jns 1f
fadds LC1 // adjust by 2^64
1: ret
+ // The result is in extended precision (80 bits) and therefore
+ // exact (64 bits of mantissa). It will be rounded to double
+ // precision by the caller, when transferring the result
+ // to an XMM register or a 64-bit stack slot.
.p2align 2
LC1: .long 0x5f800000 // 2^64 in single precision