Opened 6 weeks ago

Last modified 6 weeks ago

#15842 new feature request

Exponentiation needs PrelRules

Reported by: dfeuer Owned by:
Priority: normal Milestone: 8.8.1
Component: Compiler Version: 8.6.1
Keywords: newcomer Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Runtime performance bug Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

When a user writes a ^ lb, where lb is an integer literal, the type of lb defaults to Integer unless it's annotated. If lb is very small, then RULES will expand the whole expression into a few multiplications. If not, the computation will pay the price of Integer arithmetic. If we want, we should be able to improve this with a special compilation rule. When lb :: Integer, and 0 <= lb <= maxBound :: Word, we should be able to replace lb by the equivalent Word. The same problem appears with ^^ and stimes. Perhaps those can be fixed up as well, somehow.

Change History (1)

comment:1 Changed 6 weeks ago by bgamari

Keywords: newcomer added
Note: See TracTickets for help on using tickets.