]> git.ipfire.org Git - thirdparty/gcc.git/commit
AVR: Tidy up subtract-and-zero_extend insns.
authorGeorg-Johann Lay <avr@gjlay.de>
Thu, 11 Jul 2024 11:08:19 +0000 (13:08 +0200)
committerGeorg-Johann Lay <avr@gjlay.de>
Thu, 11 Jul 2024 11:09:39 +0000 (13:09 +0200)
commit077f16b249346b560169cf89849779272327a2da
treef204701038ae4fc5b07fe7acdc036e6435e96dd8
parentf04f9714fca40315360af109b9e5ca2305fd75db
AVR: Tidy up subtract-and-zero_extend insns.

There are these insns that subtract and zero-extend where
the subtrahend is zero-extended to the mode of the minuend.
This patch uses one insn (and split) with mode iterators
instead of spelling out each variant individually.
This has the additional benefit that u32 - u24 is also supported,
which previously wasn't.

gcc/
* config/avr/avr-protos.h (avr_out_minus): New prototype.
* config/avr/avr.cc (avr_out_minus): New function.
* config/avr/avr.md (*sub<HISI:mode>3.zero_extend.<QIPSI:mode>)
(*sub<HISI:mode>3.zero_extend.<QIPSI:mode>_split): New insns.
(*subpsi3_zero_extend.qi_split): Remove isns_and_split.
(*subpsi3_zero_extend.hi_split): Remove insn_and_split.
(*subhi3_zero_extend1_split): Remove insn_and_split.
(*subsi3_zero_extend_split): Remove insn_and_split.
(*subsi3_zero_extend.hi_split): Remove insn_and_split.
(*subpsi3_zero_extend.qi): Remove insn.
(*subpsi3_zero_extend.hi): Remove insn.
(*subhi3_zero_extend1): Remove insn.
(*subsi3_zero_extend): Remove insn.
(*subsi3_zero_extend.hi): Remove insn.
gcc/testsuite/
* gcc.target/avr/torture/sub-zerox.c: New test.
gcc/config/avr/avr-protos.h
gcc/config/avr/avr.cc
gcc/config/avr/avr.md
gcc/testsuite/gcc.target/avr/torture/sub-zerox.c [new file with mode: 0644]