Ticket #5615 (new bug)
ghc produces poor code for `div` with constant powers of 2.
| Reported by: | Lennart | Owned by: | daniel.is.fischer |
|---|---|---|---|
| Priority: | normal | Milestone: | 7.6.2 |
| Component: | Compiler | Version: | 7.4.1-rc1 |
| Keywords: | Cc: | dterei, carter.schonwald@… | |
| Operating System: | Unknown/Multiple | Architecture: | x86 |
| Type of failure: | None/Unknown | Difficulty: | Unknown |
| Test Case: | Blocked By: | ||
| Blocking: | Related Tickets: |
Description
The code for Int (div x c) where c is a constant of the form 2n 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.
Change History
Note: See
TracTickets for help on using
tickets.
