[clang] [llvm] [Clang][ARM] Fix immediate range for NEON widening left-shifts (PR #212459)

Kieran B via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 3 06:55:51 PDT 2026


kieroxide wrote:

@davemgreen Yes, this PR now restricts the range to the source eltsize, this will match GCC and is what the ACLE defines. 

A shift range of 0..(2n - 1) would be reasonable for a widening shift. However, vshll_n lowers to either SSHLL or USHLL, whose immediate operands are limited to 0..(source element size - 1), or to SHLL, which always shifts by exactly the source element size. So, GCC's behavior is correct. 

Before, when the shift was out of range, it lowered to separate widen then a shift instruction. Which is not defined in the ACLE.

https://github.com/llvm/llvm-project/pull/212459


More information about the cfe-commits mailing list