diff options
author | Duncan Coutts <duncan@well-typed.com> | 2009-06-11 15:48:52 +0000 |
---|---|---|
committer | Duncan Coutts <duncan@well-typed.com> | 2009-06-11 15:48:52 +0000 |
commit | 2016964946f0bff4753295bd4918f98cc1195a7c (patch) | |
tree | 0d5cd81e3f65e79d4e1a931ffdf8d58e04b97623 /rts/StgPrimFloat.c | |
parent | 1d141bd52e6eea321e90cd11059f726094dd50be (diff) | |
download | haskell-2016964946f0bff4753295bd4918f98cc1195a7c.tar.gz |
Remove __encodeDouble and __encodeFloat from the rts
They now live in the integer-gmp package.
Diffstat (limited to 'rts/StgPrimFloat.c')
-rw-r--r-- | rts/StgPrimFloat.c | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/rts/StgPrimFloat.c b/rts/StgPrimFloat.c index 3db953e2d3..743e0ea408 100644 --- a/rts/StgPrimFloat.c +++ b/rts/StgPrimFloat.c @@ -60,28 +60,6 @@ #define __abs(a) (( (a) >= 0 ) ? (a) : (-(a))) StgDouble -__encodeDouble (I_ size, StgByteArray ba, I_ e) /* result = s * 2^e */ -{ - StgDouble r; - const mp_limb_t *const arr = (const mp_limb_t *)ba; - I_ i; - - /* Convert MP_INT to a double; knows a lot about internal rep! */ - for(r = 0.0, i = __abs(size)-1; i >= 0; i--) - r = (r * GMP_BASE) + arr[i]; - - /* Now raise to the exponent */ - if ( r != 0.0 ) /* Lennart suggests this avoids a bug in MIPS's ldexp */ - r = ldexp(r, e); - - /* sign is encoded in the size */ - if (size < 0) - r = -r; - - return r; -} - -StgDouble __2Int_encodeDouble (I_ j_high, I_ j_low, I_ e) { StgDouble r; @@ -138,28 +116,6 @@ __int_encodeDouble (I_ j, I_ e) return r; } -StgFloat -__encodeFloat (I_ size, StgByteArray ba, I_ e) /* result = s * 2^e */ -{ - StgFloat r; - const mp_limb_t *arr = (const mp_limb_t *)ba; - I_ i; - - /* Convert MP_INT to a float; knows a lot about internal rep! */ - for(r = 0.0, i = __abs(size)-1; i >= 0; i--) - r = (r * GMP_BASE) + arr[i]; - - /* Now raise to the exponent */ - if ( r != 0.0 ) /* Lennart suggests this avoids a bug in MIPS's ldexp */ - r = ldexp(r, e); - - /* sign is encoded in the size */ - if (size < 0) - r = -r; - - return r; -} - /* Special version for small Integers */ StgFloat __int_encodeFloat (I_ j, I_ e) |