aboutsummaryrefslogtreecommitdiff
path: root/gcc/range-op.cc
diff options
context:
space:
mode:
authorGeorg-Johann Lay <avr@gjlay.de>2024-11-18 17:35:33 +0100
committerGeorg-Johann Lay <avr@gjlay.de>2024-11-19 18:30:26 +0100
commit9f7b323caab2215042df0ab0f4eef251c54128fc (patch)
tree533904e60c94c14783084bbfea7a75ac151b9978 /gcc/range-op.cc
parent49f4e96996e319d4c99a890597316c57188e2159 (diff)
downloadgcc-9f7b323caab2215042df0ab0f4eef251c54128fc.zip
gcc-9f7b323caab2215042df0ab0f4eef251c54128fc.tar.gz
gcc-9f7b323caab2215042df0ab0f4eef251c54128fc.tar.bz2
AVR: Overhaul shift insns.
This patch adds 3-operand alternatives to the shift insns for offsets that are one less than the bit-size of the mode. For example, ashrhi3 can support "r,r,C15" without overhead. Apart from that, the asm out functions for the shifts now use avr_asm_len to print assembly and to track the isnsns' lengths. gcc/ * config/avr/avr.md (ashlhi3, *ashlhi3_const_split, *ashlhi3_const) (*ashlpsi3_split, *ashlpsi3) (ashlsi3, *ashlsi3_const_split, *ashlsi3_const) (ashrhi3, *ashrhi3, ashrpsi3, *ashrpsi3, ashrsi3, *ashrsi3) (*ashrhi3_const_split, *ashrhi3_const, *ashrsi3_const_split, *ashrsi3_const): Add constraint alternatives that allow a 3-operand operation when the shift offset is one less than the mode's bitsize. * config/avr/avr.cc (ashl<mode>3_out, ashr<mode>3_out) (lshr<mode>3_out): Use avr_asm_len for asm_out and length tracking. (ashrhi3_out, ashlhi3_out): Support the new "r,r,C15" alternatives. (ashrsi3_out, ashlsi3_out): Support the new "r,r,C31" alternatives. (avr_out_ashrpsi3, avr_out_ashlpsi3): Support the new "r,r,C23" alternatives. gcc/testsuite/ * gcc.target/avr/torture/test-shift.h: New file. * gcc.target/avr/torture/shift-l-u32.c: New test. * gcc.target/avr/torture/shift-r-u32.c: New test. * gcc.target/avr/torture/shift-r-i32.c: New test. * gcc.target/avr/torture/shift-l-u24.c: New test. * gcc.target/avr/torture/shift-r-u24.c: New test. * gcc.target/avr/torture/shift-r-i24.c: New test. * gcc.target/avr/torture/shift-l-u16.c: New test. * gcc.target/avr/torture/shift-r-u16.c: New test. * gcc.target/avr/torture/shift-r-i16.c: New test. * gcc.target/avr/torture/shift-l-u8.c: New test. * gcc.target/avr/torture/shift-r-u8.c: New test. * gcc.target/avr/torture/shift-r-i8.c: New test.
Diffstat (limited to 'gcc/range-op.cc')
0 files changed, 0 insertions, 0 deletions