[project @ 2001-02-28 00:01:01 by qrczak]
authorqrczak <unknown>
Wed, 28 Feb 2001 00:01:04 +0000 (00:01 +0000)
committerqrczak <unknown>
Wed, 28 Feb 2001 00:01:04 +0000 (00:01 +0000)
commit871db587eda4fcba3fdc049b225a1d63a4ebe641
tree29931f22a4b793598daf2264c7eee119aa7da097
parent60ac8eb441cf3f8a4660bb38455426cba9064c85
[project @ 2001-02-28 00:01:01 by qrczak]
* Add {intToInt,wordToWord}{8,16,32}# primops. WARNING: Not implemented
  in ncg for Alpha and Sparc. But -O -fasm is not going to go far anyway
  because of other omissions.

* Have full repertoire of 8,16,32-bit signed and unsigned MachMisc.Size
  values. Again only x86 is fully supported. They are used for
  {index,read,write}{Int,Word}{8,16,32}{OffAddr,Array}# and
  {intToInt,wordToWord}{8,16,32}# primops.

* Have full repertoire of
  {index,read,write}\
  {Char,WideChar,Int,Word,Addr,Float,Double,StablePtr,\
   {Int,Word}{8,16,32,64}}\
  {OffAddr,Array} primops and appropriate instances.
  There were various omissions in various places.

* Add {plus,minus,times}Word# primops to avoid so many Word# <-> Int#
  coercions.

* Rewrite modules PrelWord and PrelInt almost from scratch.

* Simplify fromInteger and realToFrac rules. For each of
  {Int,Word}{8,16,32} there is just a pair of fromInteger rules
  replacing the source or target type with Int or Word. For
  {Int,Word,Int64,Word64} there are rules from any to any.
  Don't include rules which are derivable from inlining anyway,
  e.g. those mentioning Integer. Old explicit coercions are simply
  defined as appropriately typed fromInteger.

* Various old coercion functions marked as deprecated.

* Add instance Bits Int, and
  instance {Show,Num,Real,Enum,Integral,Bounded,Ix,Read,Bits} Word.

* Coercions to sized integer types consistently behave as cutting the
  right amount of bits from the infinite two-complement representation.
  For example (fromIntegral (-1 :: Int8) :: Word64) == maxBound.

* ghc/tests/numeric/should_run/arith011 tests {Int,Word}64 and instance
  Bits Int, and does not try to use overflowing toEnum. arith011.stdout
  is not updated yet because of a problem I will tell about soon.

* Move fromInteger and realToFrac from Prelude to PrelReal.
  Move fromInt from PrelNum to PrelReal and define as fromInteger.
  Define toInt as fromInteger. fromInteger is the place to write
  integer conversion rules for.

* Remove ArrayBase.newInitialisedArray, use default definition of
  newArray instead.

* Bugs fixed:
  - {quot,rem}Word# primop attributes.
  - integerToInt64# for small negative values.
  - {min,max}Bound::Int on 64-bit platforms.
  - iShiftRL64#.
  - Various Bits instances.

* Polishing:
  - Use 'ppr' instead of 'pprPrimOp' and 'text . showPrimRep'.
  - PrimRep.{primRepString,showPrimRepToUser} removed.
  - MachMisc.sizeOf returns Int instead of Integer.
  - Some eta reduction, parens, spacing, and reordering cleanups -
    sorry, couldn't resist.

* Questions:
  - Should iShiftRL and iShiftRL64 be removed? IMHO they should,
    s/iShiftRA/iShiftR/, s/shiftRL/shiftR/. The behaviour on shifting
    is a property of the signedness of the type, not the operation!
    I haven't done this change.
31 files changed:
ghc/compiler/absCSyn/CLabel.lhs
ghc/compiler/absCSyn/PprAbsC.lhs
ghc/compiler/nativeGen/MachCode.lhs
ghc/compiler/nativeGen/MachMisc.lhs
ghc/compiler/nativeGen/PprMach.lhs
ghc/compiler/nativeGen/RegAllocInfo.lhs
ghc/compiler/nativeGen/Stix.lhs
ghc/compiler/nativeGen/StixPrim.lhs
ghc/compiler/prelude/PrimOp.lhs
ghc/compiler/prelude/PrimRep.lhs
ghc/compiler/prelude/primops.txt
ghc/compiler/typecheck/TcGenDeriv.lhs
ghc/includes/PrimOps.h
ghc/lib/std/Numeric.lhs
ghc/lib/std/PrelBase.lhs
ghc/lib/std/PrelBits.lhs
ghc/lib/std/PrelFloat.lhs
ghc/lib/std/PrelGHC.hi-boot
ghc/lib/std/PrelInt.lhs
ghc/lib/std/PrelNum.lhs
ghc/lib/std/PrelRead.lhs
ghc/lib/std/PrelReal.lhs
ghc/lib/std/PrelShow.lhs
ghc/lib/std/PrelStorable.lhs
ghc/lib/std/PrelWord.lhs
ghc/lib/std/Prelude.lhs
ghc/lib/std/Random.lhs
ghc/lib/std/Time.hsc
ghc/rts/PrimOps.hc
ghc/rts/StgLongLong.c
ghc/tests/numeric/should_run/arith011.hs