STG_INLINE
void
-#ifdef __STDC__
ASSIGN_DBL(W_ p_dest[], StgDouble src)
-#else
-ASSIGN_DBL(p_dest, src)
- W_ p_dest[]; StgDouble src;
-#endif
{
double_thing y;
y.d = src;
STG_INLINE
StgDouble
-#ifdef __STDC__
PK_DBL(W_ p_src[])
-#else
-PK_DBL(p_src)
- W_ p_src[];
-#endif
{
double_thing y;
y.du.dhi = p_src[0];
STG_INLINE
void
-#ifdef __STDC__
ASSIGN_FLT(W_ p_dest[], StgFloat src)
-#else
-ASSIGN_FLT(p_dest, src)
- W_ p_dest[]; StgFloat src;
-#endif
{
float_thing y;
y.f = src;
STG_INLINE
StgFloat
-#ifdef __STDC__
PK_FLT(W_ p_src[])
-#else
-PK_FLT(p_src)
- W_ p_src[];
-#endif
{
float_thing y;
y.fu = *p_src;
\begin{code}
StgDouble
-#if __STDC__
__encodeDouble (MP_INT *s, I_ e) /* result = s * 2^e */
-#else
-__encodeDouble (s, e)
- MP_INT *s; I_ e;
-#endif /* ! __STDC__ */
{
StgDouble r;
I_ i;
r = -r;
/*
- temp = xmalloc(mpz_sizeinbase(s,10)+2);
+ temp = stgMallocBytes(mpz_sizeinbase(s,10)+2);
fprintf(stderr, "__encodeDouble(%s, %ld) => %g\n", mpz_get_str(temp,10,s), e, r);
*/
#if ! alpha_TARGET_ARCH
/* On the alpha, Stg{Floats,Doubles} are the same */
StgFloat
-#if __STDC__
__encodeFloat (MP_INT *s, I_ e) /* result = s * 2^e */
-#else
-__encodeFloat (s, e)
- MP_INT *s; I_ e;
-#endif /* ! __STDC__ */
{
StgFloat r;
I_ i;
#endif /* alpha */
void
-#if __STDC__
__decodeDouble (MP_INT *man, I_ *exp, StgDouble dbl)
-#else
-__decodeDouble (man, exp, dbl)
- MP_INT *man;
- I_ *exp;
- StgDouble dbl;
-#endif /* ! __STDC__ */
{
#if ! IEEE_FLOATING_POINT
fprintf(stderr, "__decodeDouble: non-IEEE not yet supported\n");
}
/*
- temp = xmalloc(mpz_sizeinbase(man,10)+2);
+ temp = stgMallocBytes(mpz_sizeinbase(man,10)+2);
fprintf(stderr, "__decodeDouble(%g) => %s, %ld\n", dbl, mpz_get_str(temp,10,man), *exp);
*/
#if ! alpha_TARGET_ARCH
/* Again, on the alpha we do not have separate "StgFloat" routines */
void
-#if __STDC__
__decodeFloat (MP_INT *man, I_ *exp, StgFloat flt)
-#else
-__decodeFloat (man, exp, flt)
- MP_INT *man;
- I_ *exp;
- StgFloat flt;
-#endif /* ! __STDC__ */
{
#if ! IEEE_FLOATING_POINT
fprintf(stderr, "__decodeFloat: non-IEEE not yet supported\n");
*/
SAVE_Hp += total_size_in_words;
-#if ! defined(DO_SPAT_PROFILING)
- /* Note: ActivityReg is not defined in this .lc file */
-
ALLOC_HEAP(total_size_in_words); /* ticky-ticky profiling */
/* ALLOC_CON(DATA_HS,data_size_in_words,0); */
ALLOC_PRIM(DATA_HS,data_size_in_words,0,total_size_in_words);
-#endif /* ! DO_SPAT_PROFILING */
+
CC_ALLOC(CCC,total_size_in_words,CON_K); /* cc profiling */
/* NB: HACK WARNING: The above line will do The WRONG THING
if the CurrCostCentre reg is ever put in a Real Machine Register (TM).
*/
-#if defined(LIFE_PROFILE) /* HACK warning -- Bump HpLim (see also StgMacros.lh)*/
- SAVE_HpLim += 1; /* SET_DATA_HDR attempted HpLim++ in wrong window */
-#endif
-
/* and return what we said we would */
return(stuff_ptr);
}