[project @ 2001-12-14 15:26:14 by sewardj]
authorsewardj <unknown>
Fri, 14 Dec 2001 15:26:16 +0000 (15:26 +0000)
committersewardj <unknown>
Fri, 14 Dec 2001 15:26:16 +0000 (15:26 +0000)
commit7dee9e10796acdc3af04f222ef06808ad3d1b611
treed81906c8cfa22fc53a09db01cf0ad51faa5ec342
parent8cb83b665c1131654703fb84d80db027929db09e
[project @ 2001-12-14 15:26:14 by sewardj]
Get rid of multiple-result MachOps (MO_NatS_AddC, MO_NatS_SubC,
MO_NatS_MulC) which implement {add,sub,mul}IntC#.  Supporting gunk
in the NCG disappears as a result.

Instead:

* {add,sub}IntC# are translated out during abstract C simplification,
  turning into the xor-xor-invert-and-shift sequence previously defined
  in PrimOps.h.

* mulIntC# is more difficult to get rid of portably.  Instead we have
  a new single-result PrimOp, mulIntMayOflo, with corresponding MachOp
  MO_NatS_MulMayOflo.  This tells you whether a W x W -> W signed
  multiply might overflow, where W is the word size.  When W=32, is
  implemented by computing a 2W-long result.  When W=64, we use the
  previous approximation.

PrelNum.lhs' implementation of timesInteger changes slightly, to use
the new PrimOp.
16 files changed:
ghc/compiler/absCSyn/AbsCSyn.lhs
ghc/compiler/absCSyn/AbsCUtils.lhs
ghc/compiler/absCSyn/MachOp.hs
ghc/compiler/absCSyn/PprAbsC.lhs
ghc/compiler/nativeGen/AbsCStixGen.lhs
ghc/compiler/nativeGen/AsmCodeGen.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/prelude/primops.txt.pp
ghc/compiler/utils/Maybes.lhs
ghc/includes/PrimOps.h
ghc/lib/std/PrelGHC.hi-boot.pp
ghc/lib/std/PrelNum.lhs