RISC-V: Fix attributes bug configuration of ternary instructions
commit0627d1f5340c693699ad36fa2b741ff11d6f026a
authorJuzhe-Zhong <juzhe.zhong@rivai.ai>
Mon, 15 Jan 2024 06:57:38 +0000 (15 14:57 +0800)
committerPan Li <pan2.li@intel.com>
Mon, 15 Jan 2024 07:55:39 +0000 (15 15:55 +0800)
treec3a64dcc32d57a79ef5c5426b564e67842647cbe
parent65678b2bae5a16396b87266bb1ddfca2a47fa7e8
RISC-V: Fix attributes bug configuration of ternary instructions

This patch fixes the following FAILs:

Running target riscv-sim/-march=rv64gcv/-mabi=lp64d/-mcmodel=medlow/--param=riscv-autovec-preference=fixed-vlmax
FAIL: gcc.c-torture/execute/pr68532.c   -O0  execution test
FAIL: gcc.c-torture/execute/pr68532.c   -O1  execution test
FAIL: gcc.c-torture/execute/pr68532.c   -O2  execution test
FAIL: gcc.c-torture/execute/pr68532.c   -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions  execution test
FAIL: gcc.c-torture/execute/pr68532.c   -O3 -g  execution test
FAIL: gcc.c-torture/execute/pr68532.c   -Os  execution test
FAIL: gcc.c-torture/execute/pr68532.c   -O2 -flto -fno-use-linker-plugin -flto-partition=none  execution test

Running target riscv-sim/-march=rv64gcv/-mabi=lp64d/-mcmodel=medlow/--param=riscv-autovec-lmul=m2/--param=riscv-autovec-preference=fixed-vlmax
FAIL: gcc.dg/vect/pr60196-1.c execution test
FAIL: gcc.dg/vect/pr60196-1.c -flto -ffat-lto-objects execution test

Running target riscv-sim/-march=rv64gcv/-mabi=lp64d/-mcmodel=medlow/--param=riscv-autovec-preference=fixed-vlmax
FAIL: gcc.dg/vect/pr60196-1.c execution test
FAIL: gcc.dg/vect/pr60196-1.c -flto -ffat-lto-objects execution test

Running target riscv-sim/-march=rv64gcv_zvl256b/-mabi=lp64d/-mcmodel=medlow/--param=riscv-autovec-preference=fixed-vlmax
FAIL: gcc.dg/vect/pr60196-1.c execution test
FAIL: gcc.dg/vect/pr60196-1.c -flto -ffat-lto-objects execution test

The root cause is attributes of ternary intructions are incorrect which cause AVL prop PASS and VSETVL PASS behave
incorrectly.

Tested no regression and committed.

PR target/113393

gcc/ChangeLog:

* config/riscv/vector.md: Fix ternary attributes.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/rvv/autovec/pr113393-1.c: New test.
* gcc.target/riscv/rvv/autovec/pr113393-2.c: New test.
* gcc.target/riscv/rvv/autovec/pr113393-3.c: New test.
gcc/config/riscv/vector.md
gcc/testsuite/gcc.target/riscv/rvv/autovec/pr113393-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/rvv/autovec/pr113393-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/rvv/autovec/pr113393-3.c [new file with mode: 0644]