selftests: riscv: fix v_exec_initval_nolibc.c
authorIgnacio Encinas <ignacio@iencinas.com>
Thu, 6 Mar 2025 19:49:27 +0000 (20:49 +0100)
committerAlexandre Ghiti <alexghiti@rivosinc.com>
Tue, 1 Apr 2025 07:03:04 +0000 (07:03 +0000)
commit79ba5c1c7767a539f42c6f6db46961b0bec2bc03
tree978ff76dc90bdd902900740bffa8edc421d5bd05
parent83d78ac677b9fdd8ea763507c6fe02d6bf415f3a
selftests: riscv: fix v_exec_initval_nolibc.c

Vector registers are zero initialized by the kernel. Stop accepting
"all ones" as a clean value.

Note that this was not working as expected given that
value == 0xff
can be assumed to be always false by the compiler as value's range is
[-128, 127]. Both GCC (-Wtype-limits) and clang
(-Wtautological-constant-out-of-range-compare) warn about this.

Reviewed-by: Charlie Jenkins <charlie@rivosinc.com>
Tested-by: Charlie Jenkins <charlie@rivosinc.com>
Signed-off-by: Ignacio Encinas <ignacio@iencinas.com>
Link: https://lore.kernel.org/r/20250306-fix-v_exec_initval_nolibc-v2-1-97f9dc8a7faf@iencinas.com
Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
tools/testing/selftests/riscv/vector/v_exec_initval_nolibc.c