Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
20169649
Commit
20169649
authored
Jun 11, 2009
by
Duncan Coutts
Browse files
Remove __encodeDouble and __encodeFloat from the rts
They now live in the integer-gmp package.
parent
1d141bd5
Changes
2
Hide whitespace changes
Inline
Side-by-side
rts/Linker.c
View file @
20169649
...
...
@@ -590,8 +590,6 @@ typedef struct _RtsSymbolVal {
SymI_HasProto(OnExitHook) \
SymI_HasProto(OutOfHeapHook) \
SymI_HasProto(StackOverflowHook) \
SymI_HasProto(__encodeDouble) \
SymI_HasProto(__encodeFloat) \
SymI_HasProto(addDLL) \
GMP_SYMS \
SymI_HasProto(__int_encodeDouble) \
...
...
rts/StgPrimFloat.c
View file @
20169649
...
...
@@ -59,28 +59,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
)
{
...
...
@@ -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
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment