[commit: packages/ghc-prim] master: Change return type for emulated 64bit comparisons (84fed89)

git at git.haskell.org git at git.haskell.org
Fri Aug 16 11:52:51 CEST 2013


Repository : ssh://git@git.haskell.org/ghc-prim

On branch  : master
Link       : http://git.haskell.org/?p=packages/ghc-prim.git;a=commit;h=84fed8933a53cd15e39123a8a0067369c060e69e

>---------------------------------------------------------------

commit 84fed8933a53cd15e39123a8a0067369c060e69e
Author: Jan Stolarek <jan.stolarek at p.lodz.pl>
Date:   Fri Aug 16 08:32:34 2013 +0100

    Change return type for emulated 64bit comparisons
    
    In the previous patch I used Int64# as a return value for
    comparison primops used on 32bit machines for comparing Int64#
    and Word64#. This obviously wasn't a good idea. This patch changes
    return type from emulated Int64# to a native Int#.


>---------------------------------------------------------------

84fed8933a53cd15e39123a8a0067369c060e69e
 GHC/IntWord64.hs |   48 ++++++++++++++++++++++++------------------------
 cbits/longlong.c |   26 +++++++++++++-------------
 2 files changed, 37 insertions(+), 37 deletions(-)

diff --git a/GHC/IntWord64.hs b/GHC/IntWord64.hs
index ef72736..5b5b9a3 100644
--- a/GHC/IntWord64.hs
+++ b/GHC/IntWord64.hs
@@ -29,44 +29,44 @@ import GHC.Prim
 import GHC.Types
 
 eqWord64# :: Word64# -> Word64# -> Bool
-eqWord64# a b = tagToEnum# (int64ToInt# (eqWord64## a b))
+eqWord64# a b = tagToEnum# (eqWord64## a b)
 neWord64# :: Word64# -> Word64# -> Bool
-neWord64# a b = tagToEnum# (int64ToInt# (neWord64## a b))
+neWord64# a b = tagToEnum# (neWord64## a b)
 ltWord64# :: Word64# -> Word64# -> Bool
-ltWord64# a b = tagToEnum# (int64ToInt# (ltWord64## a b))
+ltWord64# a b = tagToEnum# (ltWord64## a b)
 leWord64# :: Word64# -> Word64# -> Bool
-leWord64# a b = tagToEnum# (int64ToInt# (leWord64## a b))
+leWord64# a b = tagToEnum# (leWord64## a b)
 gtWord64# :: Word64# -> Word64# -> Bool
-gtWord64# a b = tagToEnum# (int64ToInt# (gtWord64## a b))
+gtWord64# a b = tagToEnum# (gtWord64## a b)
 geWord64# :: Word64# -> Word64# -> Bool
-geWord64# a b = tagToEnum# (int64ToInt# (geWord64## a b))
+geWord64# a b = tagToEnum# (geWord64## a b)
 
 eqInt64# :: Int64# -> Int64# -> Bool
-eqInt64# a b = tagToEnum# (int64ToInt# (eqInt64## a b))
+eqInt64# a b = tagToEnum# (eqInt64## a b)
 neInt64# :: Int64# -> Int64# -> Bool
-neInt64# a b = tagToEnum# (int64ToInt# (neInt64## a b))
+neInt64# a b = tagToEnum# (neInt64## a b)
 ltInt64# :: Int64# -> Int64# -> Bool
-ltInt64# a b = tagToEnum# (int64ToInt# (ltInt64## a b))
+ltInt64# a b = tagToEnum# (ltInt64## a b)
 leInt64# :: Int64# -> Int64# -> Bool
-leInt64# a b = tagToEnum# (int64ToInt# (leInt64## a b))
+leInt64# a b = tagToEnum# (leInt64## a b)
 gtInt64# :: Int64# -> Int64# -> Bool
-gtInt64# a b = tagToEnum# (int64ToInt# (gtInt64## a b))
+gtInt64# a b = tagToEnum# (gtInt64## a b)
 geInt64# :: Int64# -> Int64# -> Bool
-geInt64# a b = tagToEnum# (int64ToInt# (geInt64## a b))
+geInt64# a b = tagToEnum# (geInt64## a b)
 
-foreign import ccall unsafe "hs_eqWord64"    eqWord64##     :: Word64# -> Word64# -> Int64#
-foreign import ccall unsafe "hs_neWord64"    neWord64##     :: Word64# -> Word64# -> Int64#
-foreign import ccall unsafe "hs_ltWord64"    ltWord64##     :: Word64# -> Word64# -> Int64#
-foreign import ccall unsafe "hs_leWord64"    leWord64##     :: Word64# -> Word64# -> Int64#
-foreign import ccall unsafe "hs_gtWord64"    gtWord64##     :: Word64# -> Word64# -> Int64#
-foreign import ccall unsafe "hs_geWord64"    geWord64##     :: Word64# -> Word64# -> Int64#
+foreign import ccall unsafe "hs_eqWord64"    eqWord64##     :: Word64# -> Word64# -> Int#
+foreign import ccall unsafe "hs_neWord64"    neWord64##     :: Word64# -> Word64# -> Int#
+foreign import ccall unsafe "hs_ltWord64"    ltWord64##     :: Word64# -> Word64# -> Int#
+foreign import ccall unsafe "hs_leWord64"    leWord64##     :: Word64# -> Word64# -> Int#
+foreign import ccall unsafe "hs_gtWord64"    gtWord64##     :: Word64# -> Word64# -> Int#
+foreign import ccall unsafe "hs_geWord64"    geWord64##     :: Word64# -> Word64# -> Int#
 
-foreign import ccall unsafe "hs_eqInt64"     eqInt64##      :: Int64# -> Int64# -> Int64#
-foreign import ccall unsafe "hs_neInt64"     neInt64##      :: Int64# -> Int64# -> Int64#
-foreign import ccall unsafe "hs_ltInt64"     ltInt64##      :: Int64# -> Int64# -> Int64#
-foreign import ccall unsafe "hs_leInt64"     leInt64##      :: Int64# -> Int64# -> Int64#
-foreign import ccall unsafe "hs_gtInt64"     gtInt64##      :: Int64# -> Int64# -> Int64#
-foreign import ccall unsafe "hs_geInt64"     geInt64##      :: Int64# -> Int64# -> Int64#
+foreign import ccall unsafe "hs_eqInt64"     eqInt64##      :: Int64# -> Int64# -> Int#
+foreign import ccall unsafe "hs_neInt64"     neInt64##      :: Int64# -> Int64# -> Int#
+foreign import ccall unsafe "hs_ltInt64"     ltInt64##      :: Int64# -> Int64# -> Int#
+foreign import ccall unsafe "hs_leInt64"     leInt64##      :: Int64# -> Int64# -> Int#
+foreign import ccall unsafe "hs_gtInt64"     gtInt64##      :: Int64# -> Int64# -> Int#
+foreign import ccall unsafe "hs_geInt64"     geInt64##      :: Int64# -> Int64# -> Int#
 foreign import ccall unsafe "hs_quotInt64"   quotInt64#     :: Int64# -> Int64# -> Int64#
 foreign import ccall unsafe "hs_remInt64"    remInt64#      :: Int64# -> Int64# -> Int64#
 
diff --git a/cbits/longlong.c b/cbits/longlong.c
index ba2645e..7f3554b 100644
--- a/cbits/longlong.c
+++ b/cbits/longlong.c
@@ -32,19 +32,19 @@ The exceptions to the rule are primops that cast to and from
 
 /* Relational operators */
 
-HsInt64 hs_gtWord64 (HsWord64 a, HsWord64 b) {return a >  b;}
-HsInt64 hs_geWord64 (HsWord64 a, HsWord64 b) {return a >= b;}
-HsInt64 hs_eqWord64 (HsWord64 a, HsWord64 b) {return a == b;}
-HsInt64 hs_neWord64 (HsWord64 a, HsWord64 b) {return a != b;}
-HsInt64 hs_ltWord64 (HsWord64 a, HsWord64 b) {return a <  b;}
-HsInt64 hs_leWord64 (HsWord64 a, HsWord64 b) {return a <= b;}
-
-HsInt64 hs_gtInt64 (HsInt64 a, HsInt64 b) {return a >  b;}
-HsInt64 hs_geInt64 (HsInt64 a, HsInt64 b) {return a >= b;}
-HsInt64 hs_eqInt64 (HsInt64 a, HsInt64 b) {return a == b;}
-HsInt64 hs_neInt64 (HsInt64 a, HsInt64 b) {return a != b;}
-HsInt64 hs_ltInt64 (HsInt64 a, HsInt64 b) {return a <  b;}
-HsInt64 hs_leInt64 (HsInt64 a, HsInt64 b) {return a <= b;}
+HsInt hs_gtWord64 (HsWord64 a, HsWord64 b) {return a >  b;}
+HsInt hs_geWord64 (HsWord64 a, HsWord64 b) {return a >= b;}
+HsInt hs_eqWord64 (HsWord64 a, HsWord64 b) {return a == b;}
+HsInt hs_neWord64 (HsWord64 a, HsWord64 b) {return a != b;}
+HsInt hs_ltWord64 (HsWord64 a, HsWord64 b) {return a <  b;}
+HsInt hs_leWord64 (HsWord64 a, HsWord64 b) {return a <= b;}
+
+HsInt hs_gtInt64 (HsInt64 a, HsInt64 b) {return a >  b;}
+HsInt hs_geInt64 (HsInt64 a, HsInt64 b) {return a >= b;}
+HsInt hs_eqInt64 (HsInt64 a, HsInt64 b) {return a == b;}
+HsInt hs_neInt64 (HsInt64 a, HsInt64 b) {return a != b;}
+HsInt hs_ltInt64 (HsInt64 a, HsInt64 b) {return a <  b;}
+HsInt hs_leInt64 (HsInt64 a, HsInt64 b) {return a <= b;}
 
 /* Arithmetic operators */
 





More information about the ghc-commits mailing list