From 8eda4709fdb427ad135776c9584afff102246174 Mon Sep 17 00:00:00 2001 From: simonmar Date: Tue, 3 Apr 2001 15:05:53 +0000 Subject: [PATCH] [project @ 2001-04-03 15:05:52 by simonmar] Move the RULES for intToInt32# and wordToWord32# to PrelBase, so that PrelInt and PrelWord are no longer orphan modules. --- ghc/lib/std/PrelBase.lhs | 9 ++++++++- ghc/lib/std/PrelInt.lhs | 4 ---- ghc/lib/std/PrelWord.lhs | 4 ---- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/ghc/lib/std/PrelBase.lhs b/ghc/lib/std/PrelBase.lhs index 2026a35..fde9554 100644 --- a/ghc/lib/std/PrelBase.lhs +++ b/ghc/lib/std/PrelBase.lhs @@ -1,5 +1,5 @@ % ----------------------------------------------------------------------------- -% $Id: PrelBase.lhs,v 1.43 2001/03/01 09:23:40 qrczak Exp $ +% $Id: PrelBase.lhs,v 1.44 2001/04/03 15:05:52 simonmar Exp $ % % (c) The University of Glasgow, 1992-2000 % @@ -630,6 +630,13 @@ gtInt, geInt, eqInt, neInt, ltInt, leInt :: Int -> Int -> Bool (I# x) `ltInt` (I# y) = x <# y (I# x) `leInt` (I# y) = x <=# y +#if WORD_SIZE_IN_BYTES == 4 +{-# RULES +"intToInt32#" forall x#. intToInt32# x# = x# +"wordToWord32#" forall x#. wordToWord32# x# = x# + #-} +#endif + {-# RULES "int2Word2Int" forall x#. int2Word# (word2Int# x#) = x# "word2Int2Word" forall x#. word2Int# (int2Word# x#) = x# diff --git a/ghc/lib/std/PrelInt.lhs b/ghc/lib/std/PrelInt.lhs index 728f262..c1ea194 100644 --- a/ghc/lib/std/PrelInt.lhs +++ b/ghc/lib/std/PrelInt.lhs @@ -241,10 +241,6 @@ instance Bits Int16 where data Int32 = I32# Int# deriving (Eq, Ord) -#if WORD_SIZE_IN_BYTES == 4 -{-# RULES "intToInt32#" forall x#. intToInt32# x# = x# #-} -#endif - instance CCallable Int32 instance CReturnable Int32 diff --git a/ghc/lib/std/PrelWord.lhs b/ghc/lib/std/PrelWord.lhs index f5f0d99..63d8cc8 100644 --- a/ghc/lib/std/PrelWord.lhs +++ b/ghc/lib/std/PrelWord.lhs @@ -380,10 +380,6 @@ instance Bits Word16 where data Word32 = W32# Word# deriving (Eq, Ord) -#if WORD_SIZE_IN_BYTES == 4 -{-# RULES "wordToWord32#" forall x#. wordToWord32# x# = x# #-} -#endif - instance CCallable Word32 instance CReturnable Word32 -- 1.7.10.4