Index: libraries/base/GHC/Word.hs =================================================================== RCS file: /cvs/fptools/libraries/base/GHC/Word.hs,v retrieving revision 1.8 diff -u -r1.8 Word.hs --- libraries/base/GHC/Word.hs 14 Jul 2005 15:36:32 -0000 1.8 +++ libraries/base/GHC/Word.hs 20 Nov 2005 19:36:59 -0000 @@ -650,14 +650,14 @@ (W64# x#) >= (W64# y#) = x# `geWord64#` y# instance Num Word64 where - (W64# x#) + (W64# y#) = W64# (int64ToWord64# (word64ToInt64# x# `plusInt64#` word64ToInt64# y#)) - (W64# x#) - (W64# y#) = W64# (int64ToWord64# (word64ToInt64# x# `minusInt64#` word64ToInt64# y#)) - (W64# x#) * (W64# y#) = W64# (int64ToWord64# (word64ToInt64# x# `timesInt64#` word64ToInt64# y#)) - negate (W64# x#) = W64# (int64ToWord64# (negateInt64# (word64ToInt64# x#))) + (W64# x#) + (W64# y#) = W64# (x# `plusWord64#` y#) + (W64# x#) - (W64# y#) = W64# (x# `minusWord64#` y#) + (W64# x#) * (W64# y#) = W64# (x# `timesWord64#` y#) + negate (W64# x#) = W64# (negateWord64# x#) abs x = x signum 0 = 0 signum _ = 1 - fromInteger (S# i#) = W64# (int64ToWord64# (intToInt64# i#)) + fromInteger (S# i#) = W64# (intToWord64# i#) fromInteger (J# s# d#) = W64# (integerToWord64# s# d#) instance Enum Word64 where @@ -741,13 +741,13 @@ foreign import ccall unsafe "stg_geWord64" geWord64# :: Word64# -> Word64# -> Bool foreign import ccall unsafe "stg_int64ToWord64" int64ToWord64# :: Int64# -> Word64# foreign import ccall unsafe "stg_word64ToInt64" word64ToInt64# :: Word64# -> Int64# -foreign import ccall unsafe "stg_intToInt64" intToInt64# :: Int# -> Int64# +foreign import ccall unsafe "stg_intToWord64" intToWord64# :: Int# -> Word64# foreign import ccall unsafe "stg_wordToWord64" wordToWord64# :: Word# -> Word64# foreign import ccall unsafe "stg_word64ToWord" word64ToWord# :: Word64# -> Word# -foreign import ccall unsafe "stg_plusInt64" plusInt64# :: Int64# -> Int64# -> Int64# -foreign import ccall unsafe "stg_minusInt64" minusInt64# :: Int64# -> Int64# -> Int64# -foreign import ccall unsafe "stg_timesInt64" timesInt64# :: Int64# -> Int64# -> Int64# -foreign import ccall unsafe "stg_negateInt64" negateInt64# :: Int64# -> Int64# +foreign import ccall unsafe "stg_plusWord64" plusWord64# :: Word64# -> Word64# -> Word64# +foreign import ccall unsafe "stg_minusWord64" minusWord64# :: Word64# -> Word64# -> Word64# +foreign import ccall unsafe "stg_timesWord64" timesWord64# :: Word64# -> Word64# -> Word64# +foreign import ccall unsafe "stg_negateWord64" negateWord64# :: Word64# -> Word64# foreign import ccall unsafe "stg_quotWord64" quotWord64# :: Word64# -> Word64# -> Word64# foreign import ccall unsafe "stg_remWord64" remWord64# :: Word64# -> Word64# -> Word64# foreign import ccall unsafe "stg_and64" and64# :: Word64# -> Word64# -> Word64# @@ -761,7 +761,7 @@ {-# RULES -"fromIntegral/Int->Word64" fromIntegral = \(I# x#) -> W64# (int64ToWord64# (intToInt64# x#)) +"fromIntegral/Int->Word64" fromIntegral = \(I# x#) -> W64# (intToWord64# x#) "fromIntegral/Word->Word64" fromIntegral = \(W# x#) -> W64# (wordToWord64# x#) "fromIntegral/Word64->Int" fromIntegral = \(W64# x#) -> I# (word2Int# (word64ToWord# x#)) "fromIntegral/Word64->Word" fromIntegral = \(W64# x#) -> W# (word64ToWord# x#) Index: libraries/base/cbits/longlong.c =================================================================== RCS file: /cvs/fptools/libraries/base/cbits/longlong.c,v retrieving revision 1.4 diff -u -r1.4 longlong.c --- libraries/base/cbits/longlong.c 13 Dec 2002 14:23:42 -0000 1.4 +++ libraries/base/cbits/longlong.c 20 Nov 2005 19:38:02 -0000 @@ -48,8 +48,13 @@ /* Arithmetic operators */ -StgWord64 stg_remWord64 (StgWord64 a, StgWord64 b) {return a % b;} -StgWord64 stg_quotWord64 (StgWord64 a, StgWord64 b) {return a / b;} +StgWord64 stg_remWord64 (StgWord64 a, StgWord64 b) {return a % b;} +StgWord64 stg_quotWord64 (StgWord64 a, StgWord64 b) {return a / b;} +StgInt64 stg_negateWord64 (StgWord64 a) {return -a;} +StgInt64 stg_plusWord64 (StgWord64 a, StgWord64 b) {return a + b;} +StgInt64 stg_minusWord64 (StgWord64 a, StgWord64 b) {return a - b;} +StgInt64 stg_timesWord64 (StgWord64 a, StgWord64 b) {return a * b;} + StgInt64 stg_remInt64 (StgInt64 a, StgInt64 b) {return a % b;} StgInt64 stg_quotInt64 (StgInt64 a, StgInt64 b) {return a / b;} StgInt64 stg_negateInt64 (StgInt64 a) {return -a;} @@ -82,6 +87,8 @@ StgInt64 stg_intToInt64 (StgInt i) {return (StgInt64) i;} StgInt stg_int64ToInt (StgInt64 i) {return (StgInt) i;} StgWord64 stg_int64ToWord64 (StgInt64 i) {return (StgWord64) i;} + +StgInt64 stg_intToInt64 (StgInt i) {return (StgWord64) i;} StgWord64 stg_wordToWord64 (StgWord w) {return (StgWord64) w;} StgWord stg_word64ToWord (StgWord64 w) {return (StgWord) w;} StgInt64 stg_word64ToInt64 (StgWord64 w) {return (StgInt64) w;}