Commit graph

8 commits

Author SHA1 Message Date
George Koehler b1b737ed6c Optimize procedures that do both a / b and a % b.
Enable this in CS for PowerPC; disable it for all other machines.
PowerPC has no remainder instruction; the back end uses division to
compute remainder.  If CS finds both a / b and a % b, then CS now
rewrites a % b as a - b * (a / b) and computes a / b only once.  This
removes an extra division in the PowerPC code, so it saves both time
and space.

I have not considered whether to enable this optimization for other
machines.  It might be less useful in machines with a remainder
instruction.  Also, if a % b occurs before a / b, the EM code gets a
DUP.  PowerPC ncg handles this DUP well; other back ends might not.
2018-03-05 13:32:06 -05:00
George Koehler 0a6d3de7fe Use prototypes in ego/cs, ego/sp. 2018-02-05 16:09:30 -05:00
ceriel 5c83e7dbb5 Header --> Id 1994-06-24 11:31:16 +00:00
ceriel 2b7aae3b44 Added support for volatile 1991-10-02 13:03:31 +00:00
ceriel e264b45120 Changed #include's 1991-03-05 12:16:17 +00:00
ceriel 6eaf182cee Added Rcs Id 1987-03-10 11:49:39 +00:00
ceriel 815166e421 Added copyright notice 1987-03-09 19:15:41 +00:00
bal 415ae7e922 Initial revision 1984-11-26 13:58:05 +00:00