#5615: ghc produces poor code for `div` with constant powers of 2.
-------------------------+--------------------------------------------------
Reporter: Lennart | Owner: daniel.is.fischer
Type: bug | Status: new
Priority: normal | Milestone: 7.6.1
Component: Compiler | Version: 7.2.1
Keywords: | Os: Unknown/Multiple
Architecture: x86 | Failure: None/Unknown
Difficulty: Unknown | Testcase:
Blockedby: | Blocking:
Related: |
-------------------------+--------------------------------------------------
Changes (by simonpj):
* difficulty: => Unknown
Comment:
I don't see the problem here. We can add a rule for `divInt#` in
`PrelRules`. The rule would replace {{{(x `divInt#` 8)}}} with {{{(x
`uncheckedIShiftRA#` 3)}}}; except that obviously instead of 8 we'd have
any power of 2. We can get the `Id` for any primop easily.
Daniel might you look at this?
Simon
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5615#comment:7>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs