aboutsummaryrefslogtreecommitdiff
path: root/gcc/debug.cc
diff options
context:
space:
mode:
authorGeorg-Johann Lay <avr@gjlay.de>2024-11-29 18:08:20 +0100
committerGeorg-Johann Lay <avr@gjlay.de>2024-11-29 18:59:29 +0100
commitd833114c5f8816dcddfd84a9c64e87c0eed46fe2 (patch)
treef43c432b638a30c6d4840bb302fdd8aa6dc25101 /gcc/debug.cc
parentf3ee8bc1cb19a3a173b1caba01de9adfd93157ec (diff)
downloadgcc-d833114c5f8816dcddfd84a9c64e87c0eed46fe2.zip
gcc-d833114c5f8816dcddfd84a9c64e87c0eed46fe2.tar.gz
gcc-d833114c5f8816dcddfd84a9c64e87c0eed46fe2.tar.bz2
AVR: target/117726 - Better optimize shifts.
This patch splits 2-byte and 3-byte shifts after reload into a 3-operand byte shift and a residual 2-operand shift. The "2op" shift insn alternatives are not needed and removed because all shift insn already have a "r,0,n" alternative that does the job. PR target/117726 gcc/ * config/avr/avr-passes.cc (avr_shift_is_3op, avr_emit_shift): Also handle 2-byte and 3-byte shifts. (avr_split_shift4, avr_split_shift3, avr_split_shift2): New local helper functions. (avr_split_shift): Use them. * config/avr/avr-passes.def (avr_pass_split_after_peephole2): Adjust comments. * config/avr/avr.cc (avr_out_ashlpsi3, avr_out_ashrpsi3) (avr_out_lshrpsi3): Support offset 15. (ashrhi3_out): Support offset 7 as 3-op. (ashrsi3_out): Support offset 15. (avr_rtx_costs_1): Adjust shift costs. * config/avr/avr.md (2op): Remove attribute value and all such insn alternatives. (ashlhi3, *ashlhi3, *ashlhi3_const): Add 3-op alternatives like C2l. (ashrhi3, *ashrhi3, *ashrhi3_const): Add 3-op alternatives like C2a. (lshrhi3, *lshrhi3, *lshrhi3_const): Add 3-op alternatives like C2r. (*ashlpsi3_split, *ashlpsi3): Add 3-op alternatives C15 and C3l. (*ashrpsi3_split, *ashrpsi3): Add 3-op alternatives C15 and C3r. (*lshrpsi3_split, *lshrpsi3): Add 3-op alternatives C15 and C3r. (ashlsi3, *ashlsi3, *ashlsi3_const): Remove "2op" alternative. (ashrsi3, *ashrsi3, *ashrsi3_const): Same. (lshrsi3, *lshrsi3, *lshrsi3_const): Same. (constr_split_suffix): Code attr morphed from constr_split_shift4. * config/avr/constraints.md (C2a, C2r, C2l) (C3a, C3r, C3l): New constraints. * doc/invoke.texi (AVR Options) <-msplit-bit-shift>: Adjust doc.
Diffstat (limited to 'gcc/debug.cc')
0 files changed, 0 insertions, 0 deletions