Implement shifts of vectors by i32. Since LLVM defines shifts as
binary operations between two vectors, this involves pattern matching
on splatted shift operands. For v2i64 shifts any i32 shift operands
have to be zero extended in the input and any i64 shift operands have
to be wrapped in the output. Depends on D52007.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
Does this work when the first argument is not in a splat pattern as well? If so, maybe add a test case for that?
lib/Target/WebAssembly/WebAssemblyInstrSIMD.td | ||
---|---|---|
130 ↗ | (On Diff #165195) | Maybe shift_amount or shift_amount_pat instead of pat to denote this is not the pattern for the whole instruction but for the shift amount operand? |
No, our shift is weird because it takes only a single shift amount to apply uniformly to all lanes rather than a vector of shift amounts. Currently LLVM shifts by non-splat vectors will fail in isel, but that's ok for now.
Oh, what I meant is, the right operand is created not with insertelement + shufflevector but with just a constant vector whose all elements are the same integer. My comment was not very accurate because I think I remember you included that constant pattern as a splat too. So I guess it would work, but having a test case for that wouldn't hurt.