Improve SImode shifts for H8
authorJeff Law <jlaw@localhost.localdomain>
Tue, 17 Aug 2021 02:23:30 +0000 (22:23 -0400)
committerJeff Law <jlaw@localhost.localdomain>
Tue, 17 Aug 2021 02:26:35 +0000 (22:26 -0400)
commit75a7176575c409940b66020def23508f5701f5fb
tree73549b2950c9464e7c6a8141e713115bdd5224f9
parentd56607c16deb278918cf0febba62263c39041039
Improve SImode shifts for H8

Similar to the H8/300H patch, this improves SImode shifts for the H8/S.
It's not as big a win on the H8/S since we can shift two positions at a
time.  But that also means that we can handle more residuals with minimal
ode growth after a special shift-by-16 or shift-by-24 sequence.

I think there's more to do here, but this seemed like as good a checkpoint
as any.  Tested without regressions.

gcc/
* config/h8300/h8300.c (shift_alg_si): Avoid loops for most SImode
shifts on the H8/S.
(h8300_option_override): Use loops on H8/S more often when optimizing
for size.
(get_shift_alg): Handle new "special" cases on H8/S.  Simplify
accordingly.  Handle various arithmetic right shifts with special
sequences that we couldn't handle before.
gcc/config/h8300/h8300.c