[GHC] #5615: ghc produces poor code for `div` with constant powers of 2.
GHC
cvs-ghc at haskell.org
Wed Nov 9 10:38:15 CET 2011
#5615: ghc produces poor code for `div` with constant powers of 2.
---------------------------------+------------------------------------------
Reporter: Lennart | Owner:
Type: bug | Status: new
Priority: normal | Component: Compiler
Version: 7.2.1 | Keywords:
Testcase: | Blockedby:
Os: Unknown/Multiple | Blocking:
Architecture: x86 | Failure: None/Unknown
---------------------------------+------------------------------------------
The code for Int {{{(div x c)}}} where {{{c}}} is a constant of the form
2^n^ should be implemented with an arithmetic right shift, currently it's
a call to a function. This optimization should be done for all signed
types.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5615>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the Glasgow-haskell-bugs
mailing list