[GHC] #9786: Make quot/rem/div/mod with known divisors fast

GHC ghc-devs at haskell.org
Mon Nov 10 01:06:33 UTC 2014


#9786: Make quot/rem/div/mod with known divisors fast
-------------------------------------+-------------------------------------
       Reporter:  dfeuer             |                   Owner:
           Type:  task               |                  Status:  new
       Priority:  normal             |               Milestone:  7.12.1
      Component:  Compiler           |                 Version:  7.9
       Keywords:                     |        Operating System:
   Architecture:  Unknown/Multiple   |  Unknown/Multiple
     Difficulty:  Unknown            |         Type of failure:  Runtime
     Blocked By:                     |  performance bug
Related Tickets:                     |               Test Case:
                                     |                Blocking:
                                     |  Differential Revisions:
-------------------------------------+-------------------------------------
 GHC (with NCG) currently optimizes `Int` division by powers of two, but
 not by other known divisors. The Intel Optimization Manual section 9.2.4
 describes a general technique for replacing division by known,
 sufficiently small, divisors with multiplication. LLVM appears to go
 further in some fashion. There's no reason we can't do something similar.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9786>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list