RISC-V: Implement misc macro for vector extensions.
authorKito Cheng <kito.cheng@sifive.com>
Mon, 21 Mar 2022 08:16:14 +0000 (16:16 +0800)
committerKito Cheng <kito.cheng@sifive.com>
Mon, 21 Mar 2022 08:17:12 +0000 (16:17 +0800)
commit5177634148aab7a7b193eaa9b8c73ce00a38c481
treef107ae1dbc9b8e1440f46197a50f5ca90647bd88
parente767da23de12ceb1bf3aece4dae0ae20bf605b04
RISC-V: Implement misc macro for vector extensions.

See also:
https://github.com/riscv-non-isa/riscv-c-api-doc/pull/21

gcc/ChangeLog:

* common/config/riscv/riscv-common.cc (riscv_ext_flag_table):
Update flag name and mask name.
* config/riscv/riscv-c.cc (riscv_cpu_cpp_builtins): Define
misc macro for vector extensions.
* config/riscv/riscv-opts.h (MASK_VECTOR_EEW_32): Rename to ...
(MASK_VECTOR_ELEN_32): ... this.
(MASK_VECTOR_EEW_64): Rename to ...
(MASK_VECTOR_ELEN_64): ... this.
(MASK_VECTOR_EEW_FP_32): Rename to ...
(MASK_VECTOR_ELEN_FP_32): ... this.
(MASK_VECTOR_EEW_FP_64): Rename to ...
(MASK_VECTOR_ELEN_FP_64): ... this.
(TARGET_VECTOR_ELEN_32): New.
(TARGET_VECTOR_ELEN_64): Ditto.
(TARGET_VECTOR_ELEN_FP_32): Ditto.
(TARGET_VECTOR_ELEN_FP_64): Ditto.
(TARGET_MIN_VLEN): Ditto.
* config/riscv/riscv.opt (riscv_vector_eew_flags): Rename to ...
(riscv_vector_elen_flags): ... this.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/arch-13.c: New.
* gcc.target/riscv/arch-14.c: Ditto.
* gcc.target/riscv/arch-15.c: Ditto.
* gcc.target/riscv/predef-18.c: Ditto.
* gcc.target/riscv/predef-19.c: Ditto.
* gcc.target/riscv/predef-20.c: Ditto.
gcc/common/config/riscv/riscv-common.cc
gcc/config/riscv/riscv-c.cc
gcc/config/riscv/riscv-opts.h
gcc/config/riscv/riscv.opt
gcc/testsuite/gcc.target/riscv/arch-13.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/arch-14.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/arch-15.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/predef-18.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/predef-19.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/predef-20.c [new file with mode: 0644]