On 3/11/25 9:10 AM, Robin Dapp wrote:
Hi,

in the somewhat convoluted vector code of PR119114 we extracting
a <signed-boolean:1> mask value from a vector mask.  After some
middle-end simplifications we end up with a value of -2.  Its
lowest bit is correctly unset representing "false".
When initializing a bitmak vector from values we compare the full
value/register against zero instead of just the last bit.  This
causes erroneous mask values.

This patch masks the values by & 0x1 before comparing against 0.

Regtested on rv64gcv_zvl512b, let's see what the CI has to say.

Regards
Robin

     PR target/119114

gcc/ChangeLog:

     * config/riscv/autovec.md: Apply & 0x1 mask when initializing
     bitmask vector.

gcc/testsuite/ChangeLog:

     * gcc.target/riscv/rvv/autovec/pr119114.c: New test.
OK
jeff

Reply via email to