Commit graph

10 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
ceriel 0bfa4970c5 Added i386 description 1992-02-11 16:59:43 +00:00
ceriel e264b45120 Changed #include's 1991-03-05 12:16:17 +00:00
ceriel 79cb35ec4f Added SLI reduce 1991-02-19 16:45:57 +00:00
ceriel a432f84eb0 more fine-tuning 1989-03-20 12:36:22 +00:00
ceriel 0975784c8d some changes for more fine-tuning 1989-03-13 14:12:22 +00:00
ceriel 23f2646704 use general as pointer flag added 1989-03-07 10:24:32 +00:00
ceriel e8f4e47da5 better info for SLI 1988-06-21 16:10:19 +00:00
ceriel 35d8ec11fa be a bit more optimistic about gain for pointer registers 1988-06-15 15:28:10 +00:00
ceriel 75cfdc06c6 Initial revision 1987-02-23 19:14:34 +00:00