+__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 */
+ int sign, iexp;
+ 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 */
+ low = u.i[L];
+ high = u.i[H];
+
+ if (low == 0 && (high & ~DMSBIT) == 0) {
+ *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--;
+ }
+ }
+ *exp = (I_) iexp;
+ *man_low = low;
+ *man_high = high;
+ *man_sign = (sign < 0) ? -1 : 1;
+ }
+}
+
+void