Skip to content
  • Julian Seward's avatar
    [project @ 2001-12-14 15:26:14 by sewardj] · 7dee9e10
    Julian Seward authored
    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.
    7dee9e10