[AVR] Optimize 32-bit shifts: shift by 4 bits
authorAyke van Laethem <aykevanlaethem@gmail.com>
Tue, 6 Dec 2022 13:26:01 +0000 (14:26 +0100)
committerAyke van Laethem <aykevanlaethem@gmail.com>
Sun, 8 Jan 2023 19:05:31 +0000 (20:05 +0100)
commit81f5f22f27847b9adc69485aff4a36af205c0549
treeb29d851e38bebcdbed5529217b379690467af2b2
parent8f8afabd32092590a81e10e11e0a2c8b24e09b76
[AVR] Optimize 32-bit shifts: shift by 4 bits

This uses a complicated shift sequence that avr-gcc also uses, but
extended to work over any number of bytes and in both directions
(logical shift left and logical shift right). Unfortunately it can't be
used for an arithmetic shift right: I've tried to come up with a
sequence but couldn't.

Differential Revision: https://reviews.llvm.org/D140571
llvm/lib/Target/AVR/AVRISelLowering.cpp
llvm/test/CodeGen/AVR/shift32.ll