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.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/Target/AVR/AVRISelLowering.cpp | ||
---|---|---|
1934 | I have two concerns here:
| |
1941 | Use I than 'i' to be conform with other loops in this function. | |
1946 | I think it would be better to change to if (i > 0). | |
1957 | I think it would be better to change to if (i > 0). | |
1963 | How about size_t PrevIdx = ShiftLeft ? Idx - 1 : Idx + 1; Regs[PrevIdx] = std::pair(R, 0); | |
llvm/test/CodeGen/AVR/shift32.ll | ||
168 | This looks really great! |
- apply review feedback
llvm/lib/Target/AVR/AVRISelLowering.cpp | ||
---|---|---|
1934 | Yes, this isn't very clear. I have updated the explanation in a way that better explains what the code does. | |
1946 | Hmm, somehow I missed this while rebasing. Fixed. | |
1957 | Fixed. | |
1963 | Not sure which one is clearer but seems good to me. Change applied. |
I have two concerns here: