]> git.ipfire.org Git - thirdparty/gcc.git/commit
AVR: Add an insn combine pattern for offset computation.
authorGeorg-Johann Lay <avr@gjlay.de>
Fri, 8 Mar 2024 12:29:13 +0000 (13:29 +0100)
committerGeorg-Johann Lay <avr@gjlay.de>
Fri, 8 Mar 2024 12:40:20 +0000 (13:40 +0100)
commit40209cb15a3f2af8233ee887dc960992f358ad86
tree14fc73534ca31b218612a135408021d9de4bd6c2
parentd6bcc2e257026b383ac3e6ccdee13f7763b38621
AVR: Add an insn combine pattern for offset computation.

Computing  uint16_t += 2 * uint8_t  can occur when an offset
into a 16-bit array is computed.  Without this pattern is costs
six instructions: A move (1), a zero-extend (1), a shift (2) and
an addition (2).  With this pattern it costs 4.

gcc/
* config/avr/avr.md (*addhi3_zero_extend.ashift1): New pattern.
* config/avr/avr.cc (avr_rtx_costs_1) [PLUS]: Compute its cost.
gcc/config/avr/avr.cc
gcc/config/avr/avr.md