Hi everyone,
here's a simple program:
foo :: Int
foo = 8 `div` 1
I was a bit surprised to see that GHC (both 6.8 and HEAD) generates the
following Core for this:
foo = case GHC.Base.divInt# 8 1 of wild21_afL
{ __DEFAULT -> GHC.Base.I# wild21_afL }
It turns out that there are no rules for divInt#, quotInt#, remInt# and
modInt# in GHC.Base and that no constant folding happens for divInt# and
modInt# in PrelRules.lhs. In fact, the latter two don't even seem to be
primops. This also seems to be the case for their Word# counterparts. I
assume this is just an oversight but thought I'd ask before doing
anything. Is it ok to add the primops and a couple of rules?
Roman
_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc