X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=cbits%2Flonglong.c;fp=cbits%2Flonglong.c;h=21c9adb0c337764e0ea8ea68af4f371a8f765d74;hb=a597405dc3b74978ad20b91f9af82b3d387ac82c;hp=c8147733d381134aff4cfe01089e19a34c427c97;hpb=a5e24955ea9e3bfb971a3d9523e01893049e4d7e;p=ghc-prim.git diff --git a/cbits/longlong.c b/cbits/longlong.c index c814773..21c9adb 100644 --- a/cbits/longlong.c +++ b/cbits/longlong.c @@ -79,8 +79,6 @@ HsInt64 hs_uncheckedIShiftRL64 (HsInt64 a, HsInt b) {return (HsInt64) ((HsWord64) a >> b);} /* Casting between longs and longer longs. - (the primops that cast from long longs to Integers - expressed as macros, since these may cause some heap allocation). */ HsInt64 hs_intToInt64 (HsInt i) {return (HsInt64) i;} @@ -90,40 +88,4 @@ HsWord64 hs_wordToWord64 (HsWord w) {return (HsWord64) w;} HsWord hs_word64ToWord (HsWord64 w) {return (HsWord) w;} HsInt64 hs_word64ToInt64 (HsWord64 w) {return (HsInt64) w;} -HsWord64 hs_integerToWord64 (HsInt sa, StgByteArray /* Really: mp_limb_t* */ da) -{ - mp_limb_t* d; - HsInt s; - HsWord64 res; - d = (mp_limb_t *)da; - s = sa; - switch (s) { - case 0: res = 0; break; - case 1: res = d[0]; break; - case -1: res = -(HsWord64)d[0]; break; - default: - res = (HsWord64)d[0] + ((HsWord64)d[1] << (BITS_IN (mp_limb_t))); - if (s < 0) res = -res; - } - return res; -} - -HsInt64 hs_integerToInt64 (HsInt sa, StgByteArray /* Really: mp_limb_t* */ da) -{ - mp_limb_t* d; - HsInt s; - HsInt64 res; - d = (mp_limb_t *)da; - s = (sa); - switch (s) { - case 0: res = 0; break; - case 1: res = d[0]; break; - case -1: res = -(HsInt64)d[0]; break; - default: - res = (HsInt64)d[0] + ((HsWord64)d[1] << (BITS_IN (mp_limb_t))); - if (s < 0) res = -res; - } - return res; -} - #endif /* SUPPORT_LONG_LONGS */