RISC-V: Fix supporting data type according to RVV ISA. [PR109479]
authorJu-Zhe Zhong <juzhe.zhong@rivai.ai>
Wed, 12 Apr 2023 13:56:05 +0000 (21:56 +0800)
committerKito Cheng <kito.cheng@sifive.com>
Wed, 12 Apr 2023 15:08:08 +0000 (23:08 +0800)
commit31eb8f18bbe64613fd8d77c4520c00beeb13598f
tree0fc6b338aa966a30ceade176b6df5a096610c232
parent51856718a82ce60f067910d9037ca255645b37eb
RISC-V: Fix supporting data type according to RVV ISA. [PR109479]

For vint64m*_t, we should only allow them in zve64* instead of zve32*_zvl64b (>=64b).
Ideally, we should make error message more friendly like Clang.
https://godbolt.org/z/f9GMv4dMo to report the RVV type require extenstion name.
However, I failed to find a way to do that. So current GCC can only report "unknown" type.
And I added comments to remind us doing this in the future.

gcc/ChangeLog:

PR target/109479
* config/riscv/riscv-vector-builtins-types.def (vint8mf8_t): Fix predicate.
(vint16mf4_t): Ditto.
(vint32mf2_t): Ditto.
(vint64m1_t): Ditto.
(vint64m2_t): Ditto.
(vint64m4_t): Ditto.
(vint64m8_t): Ditto.
(vuint8mf8_t): Ditto.
(vuint16mf4_t): Ditto.
(vuint32mf2_t): Ditto.
(vuint64m1_t): Ditto.
(vuint64m2_t): Ditto.
(vuint64m4_t): Ditto.
(vuint64m8_t): Ditto.
(vfloat32mf2_t): Ditto.
(vbool64_t): Ditto.
* config/riscv/riscv-vector-builtins.cc (register_builtin_type): Add comments.
(register_vector_type): Ditto.
(check_required_extensions): Fix condition.
* config/riscv/riscv-vector-builtins.h (RVV_REQUIRE_ZVE64): Remove it.
(RVV_REQUIRE_ELEN_64): New define.
(RVV_REQUIRE_MIN_VLEN_64): Ditto.
* config/riscv/riscv-vector-switch.def (TARGET_VECTOR_FP32): Remove it.
(TARGET_VECTOR_FP64): Ditto.
(ENTRY): Fix predicate.
* config/riscv/vector-iterators.md: Fix predicate.

gcc/testsuite/ChangeLog:

PR target/109479
* gcc.target/riscv/rvv/base/pr109479-1.c: New test.
* gcc.target/riscv/rvv/base/pr109479-2.c: New test.
* gcc.target/riscv/rvv/base/pr109479-3.c: New test.
* gcc.target/riscv/rvv/base/pr109479-4.c: New test.
* gcc.target/riscv/rvv/base/pr109479-5.c: New test.
* gcc.target/riscv/rvv/base/pr109479-6.c: New test.
gcc/config/riscv/riscv-vector-builtins-types.def
gcc/config/riscv/riscv-vector-builtins.cc
gcc/config/riscv/riscv-vector-builtins.h
gcc/config/riscv/riscv-vector-switch.def
gcc/config/riscv/vector-iterators.md
gcc/testsuite/gcc.target/riscv/rvv/base/pr109479-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/rvv/base/pr109479-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/rvv/base/pr109479-3.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/rvv/base/pr109479-4.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/rvv/base/pr109479-5.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/rvv/base/pr109479-6.c [new file with mode: 0644]