[committed] Fix length computation for logical shifts on H8
commit4ac358c619e364ad767242409765c178da9d83e0
authorJeff Law <jlaw@ventanamicro.com>
Sun, 10 Dec 2023 16:32:55 +0000 (10 09:32 -0700)
committerJeff Law <jlaw@ventanamicro.com>
Sun, 10 Dec 2023 16:32:55 +0000 (10 09:32 -0700)
treea7bcda2d899f1c8026e67c3546a9fe946bf6537f
parentfbfe43daec6443978df65530dc5f7f3f8a4e6f9e
[committed] Fix length computation for logical shifts on H8

This fixes the length computation for logical shifts on the H8/SX.

The H8/SX has a richer set of logical shifts compared to early parts in the H8
family.  It has special 2 byte instructions for shifts by power of two
immediate values as well as a special 4 byte shift by other immediate values.

These were never accounted for (AFIACT) in the length computation for shifts.
Until now that's mostly just affected branch shortening.  But an upcoming patch
uses instruction lengths to select between two potential sequences and getting
these lengths wrong will cause it to miss optimization opportunities on the
H8/SX.

gcc
* config/h8300/h8300.cc (compute_a_shift_length): Fix computation
of logical shifts on the H8/SX.
gcc/config/h8300/h8300.cc