Alexandre Oliva <ol...@adacore.com> writes: > On Jun 24, 2024, "Richard Earnshaw (lists)" <richard.earns...@arm.com> wrote: > >> A signed shift right on a 16-bit vector element by 15 would still >> yield -1 > > Yeah. Indeed, ISTM that we *could* have retained the clamping > transformation for *signed* shifts, since the clamping would only make a > difference in case of (undefined) overflow. Only for unsigned shifts > can well-defined shifts yield different results with clamping. > > Richard (Sandiford), do you happen to recall why the IRC conversation > mentioned in the PR trail decided to drop it entirely, even for signed > types?
In the PR, the original shift was 32768 >> x (x >= 16) on ints, which the vectoriser was narrowing to 32768 >> x' on shorts. The original shift is well-defined for both signed and unsigned shifts, and no valid x' exists for that case. Thanks, Richard