summaryrefslogtreecommitdiff
path: root/rts/StgPrimFloat.c
diff options
context:
space:
mode:
authorAustin Seipp <austin@well-typed.com>2014-08-20 12:26:29 -0500
committerAustin Seipp <austin@well-typed.com>2014-08-20 12:26:29 -0500
commit2f34ab2a91d2356286c7e20ab786e04f30e43fe6 (patch)
tree4efce80e28c9be7c593e7bdb69ad3002fa0cea19 /rts/StgPrimFloat.c
parent1a6a6103f59619c94f2d2818874d1a738f8fac50 (diff)
downloadhaskell-2f34ab2a91d2356286c7e20ab786e04f30e43fe6.tar.gz
rts: detabify/dewhitespace StgPrimFloat.c
Signed-off-by: Austin Seipp <austin@well-typed.com>
Diffstat (limited to 'rts/StgPrimFloat.c')
-rw-r--r--rts/StgPrimFloat.c96
1 files changed, 48 insertions, 48 deletions
diff --git a/rts/StgPrimFloat.c b/rts/StgPrimFloat.c
index 63fe52ec80..123e77b806 100644
--- a/rts/StgPrimFloat.c
+++ b/rts/StgPrimFloat.c
@@ -41,7 +41,7 @@
#define H 1
#endif
-#define __abs(a) (( (a) >= 0 ) ? (a) : (-(a)))
+#define __abs(a) (( (a) >= 0 ) ? (a) : (-(a)))
/* Special version for words */
StgDouble
@@ -117,44 +117,44 @@ void
__decodeDouble_2Int (I_ *man_sign, W_ *man_high, W_ *man_low, I_ *exp, StgDouble dbl)
{
/* Do some bit fiddling on IEEE */
- unsigned int low, high; /* assuming 32 bit ints */
+ unsigned int low, high; /* assuming 32 bit ints */
int sign, iexp;
- union { double d; unsigned int i[2]; } u; /* assuming 32 bit ints, 64 bit double */
+ union { double d; unsigned int i[2]; } u; /* assuming 32 bit ints, 64 bit double */
ASSERT(sizeof(unsigned int ) == 4 );
ASSERT(sizeof(dbl ) == 8 );
ASSERT(sizeof(dbl ) == SIZEOF_DOUBLE);
- u.d = dbl; /* grab chunks of the double */
+ u.d = dbl; /* grab chunks of the double */
low = u.i[L];
high = u.i[H];
if (low == 0 && (high & ~DMSBIT) == 0) {
- *man_low = 0;
- *man_high = 0;
- *exp = 0L;
+ *man_low = 0;
+ *man_high = 0;
+ *exp = 0L;
} else {
- iexp = ((high >> 20) & 0x7ff) + MY_DMINEXP;
- sign = high;
-
- high &= DHIGHBIT-1;
- if (iexp != MY_DMINEXP) /* don't add hidden bit to denorms */
- high |= DHIGHBIT;
- else {
- iexp++;
- /* A denorm, normalize the mantissa */
- while (! (high & DHIGHBIT)) {
- high <<= 1;
- if (low & DMSBIT)
- high++;
- low <<= 1;
- iexp--;
- }
- }
+ iexp = ((high >> 20) & 0x7ff) + MY_DMINEXP;
+ sign = high;
+
+ high &= DHIGHBIT-1;
+ if (iexp != MY_DMINEXP) /* don't add hidden bit to denorms */
+ high |= DHIGHBIT;
+ else {
+ iexp++;
+ /* A denorm, normalize the mantissa */
+ while (! (high & DHIGHBIT)) {
+ high <<= 1;
+ if (low & DMSBIT)
+ high++;
+ low <<= 1;
+ iexp--;
+ }
+ }
*exp = (I_) iexp;
- *man_low = low;
- *man_high = high;
- *man_sign = (sign < 0) ? -1 : 1;
+ *man_low = low;
+ *man_high = high;
+ *man_sign = (sign < 0) ? -1 : 1;
}
}
@@ -166,37 +166,37 @@ void
__decodeFloat_Int (I_ *man, I_ *exp, StgFloat flt)
{
/* Do some bit fiddling on IEEE */
- int high, sign; /* assuming 32 bit ints */
+ int high, sign; /* assuming 32 bit ints */
union { float f; int i; } u; /* assuming 32 bit float and int */
ASSERT(sizeof(int ) == 4 );
ASSERT(sizeof(flt ) == 4 );
ASSERT(sizeof(flt ) == SIZEOF_FLOAT );
- u.f = flt; /* grab the float */
+ u.f = flt; /* grab the float */
high = u.i;
if ((high & ~FMSBIT) == 0) {
- *man = 0;
- *exp = 0;
+ *man = 0;
+ *exp = 0;
} else {
- *exp = ((high >> 23) & 0xff) + MY_FMINEXP;
- sign = high;
-
- high &= FHIGHBIT-1;
- if (*exp != MY_FMINEXP) /* don't add hidden bit to denorms */
- high |= FHIGHBIT;
- else {
- (*exp)++;
- /* A denorm, normalize the mantissa */
- while (! (high & FHIGHBIT)) {
- high <<= 1;
- (*exp)--;
- }
- }
- *man = high;
- if (sign < 0)
- *man = - *man;
+ *exp = ((high >> 23) & 0xff) + MY_FMINEXP;
+ sign = high;
+
+ high &= FHIGHBIT-1;
+ if (*exp != MY_FMINEXP) /* don't add hidden bit to denorms */
+ high |= FHIGHBIT;
+ else {
+ (*exp)++;
+ /* A denorm, normalize the mantissa */
+ while (! (high & FHIGHBIT)) {
+ high <<= 1;
+ (*exp)--;
+ }
+ }
+ *man = high;
+ if (sign < 0)
+ *man = - *man;
}
}