aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/resolve.c
diff options
context:
space:
mode:
authorJeff Law <jlaw@localhost.localdomain>2021-08-15 00:13:23 -0400
committerJeff Law <jlaw@localhost.localdomain>2021-08-15 00:15:32 -0400
commit882f1d58bfa56737ff2de84c3cd1e0acfc318b86 (patch)
tree53e5b9a5e8befa1037ebf41d9616656715f7c433 /gcc/fortran/resolve.c
parent829931ec93ab7d5ab73f31be9da504abb6ae459e (diff)
downloadgcc-882f1d58bfa56737ff2de84c3cd1e0acfc318b86.zip
gcc-882f1d58bfa56737ff2de84c3cd1e0acfc318b86.tar.gz
gcc-882f1d58bfa56737ff2de84c3cd1e0acfc318b86.tar.bz2
Improve many SImode shifts on the H8/300H
As I've mentioned before, the H8/300H can only shift a single bit position at a time. Naturally this means many shifts are implemented as loops. There's a variety of special cases that we can do without loops by using rotates, sub-word moves, etc. The general guidance for the port has been to only use inline or special sequences if they're shorter or just one instruction longer than the loop. This was pretty reasonable guidance for QI/HI mode. It was relaxed a bit about 10 years ago for HImode in particular where the kpit team realized they could save 50-100 cycles for some shifts by allowing 2 instructions of code growth over the loop implementation. But they only re-tuned HImode shifts. There's even bigger benefits for re-tuning SImode shifts. There's cases where we can save close to 200 cycles by allowing 2 additional instructions. This patch re-tunes SImode shifts on the H8/300H primarily by inlining more often or using a special sequence + inlining for residuals. Both cases were already supported and this just uses those existing capabilities more often, so it was trivial to implement. I think there's some cases were entirely new special sequences could be used, but I haven't tried those yet. gcc/ * config/h8300/h8300.c (shift_alg_si): Retune H8/300H shifts to allow a bit more code growth, saving many dozens of cycles. (h8300_option_override): Adjus shift_alg_si if optimizing for code size. (get_shift_alg): Use special + inline shifts for residuals in more cases.
Diffstat (limited to 'gcc/fortran/resolve.c')
0 files changed, 0 insertions, 0 deletions