https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120356

--- Comment #5 from Alexey Merzlyakov <alexey.merzlyakov at samsung dot com> ---
Analysis update: vector calculation chain in the loop from the above comment
remains from the initial expand pass, while other duplicated code was moved to
the first function BB by loop2_invariant.

After more detailed comparison it was discovered that both assembler chains are
different. In the moved by loop invariant code (that was initially emitted by
"expand") we have the right shift of vector items:

   vsrl.vi v1,v2,1

while the remaining loop's body part (emitted as constant vector expanding
though the LRA) has left shift, which seem to be the cause of incorrect
results:

   vsll.vi v2,v1,1

Indeed, the initial code before the
https://gcc.gnu.org/cgit/gcc/commit/?id=28b2ad5341f contained instructions of
LSHIFTRT type for expanding interleaved stepped patterns for const vectors, and
it seems should be the same type for both: LRA and non-LRA cases.

Submitted the patch on it into mailing list
https://gcc.gnu.org/pipermail/gcc-patches/2025-July/688139.html

Reply via email to