summaryrefslogtreecommitdiff
path: root/compiler/prelude
diff options
context:
space:
mode:
authorHerbert Valerio Riedel <hvr@gnu.org>2014-09-17 17:54:20 +0200
committerHerbert Valerio Riedel <hvr@gnu.org>2014-09-17 17:55:37 +0200
commitb62bd5ecf3be421778e4835010b6b334e95c5a56 (patch)
treee19e2efc012ec3940c4b4c739f0b1e8bcfed3eaf /compiler/prelude
parent3c2829017943522a946e7ae0560034c7d28d96ce (diff)
downloadhaskell-b62bd5ecf3be421778e4835010b6b334e95c5a56.tar.gz
Implement `decodeDouble_Int64#` primop
The existing `decodeDouble_2Int#` primop is rather inconvenient to use (and in fact is not even used by `integer-gmp`) as the mantissa is split into 3 components which would actually fit in an `Int64#` value. However, `decodeDouble_Int64#` is to be used by the new `integer-gmp2` re-implementation (see #9281). Moreover, `decodeDouble_2Int#` performs direct bit-wise operations on the IEEE representation which can be replaced by a combination of the portable standard C99 `scalbn(3)` and `frexp(3)` functions. Differential Revision: https://phabricator.haskell.org/D160
Diffstat (limited to 'compiler/prelude')
-rw-r--r--compiler/prelude/primops.txt.pp5
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/prelude/primops.txt.pp b/compiler/prelude/primops.txt.pp
index b78bc95353..a3c15a9c46 100644
--- a/compiler/prelude/primops.txt.pp
+++ b/compiler/prelude/primops.txt.pp
@@ -606,6 +606,11 @@ primop DoubleDecode_2IntOp "decodeDouble_2Int#" GenPrimOp
respectively, and the last is the exponent.}
with out_of_line = True
+primop DoubleDecode_Int64Op "decodeDouble_Int64#" GenPrimOp
+ Double# -> (# INT64, Int# #)
+ {Decode {\tt Double\#} into mantissa and base-2 exponent.}
+ with out_of_line = True
+
------------------------------------------------------------------------
section "Float#"
{Operations on single-precision (32-bit) floating-point numbers.}