RISC-V: Implement new style of architecture extension test macros.
authorKito Cheng <kito.cheng@sifive.com>
Fri, 11 Dec 2020 08:51:40 +0000 (16:51 +0800)
committerKito Cheng <kito.cheng@sifive.com>
Fri, 8 Jan 2021 03:14:02 +0000 (11:14 +0800)
commite3354b6de7a348386425879847c4f18ef1e82791
tree684a084e45f07dad44b2eccefdf7e654a6033fea
parent0b7b4710111e0ac42d14ffdd1d71ff9c6751414e
RISC-V: Implement new style of architecture extension test macros.

- This patch introduce new set of architecture extension test macros
  which is accept on riscv-c-api-doc recently.
  - https://github.com/riscv/riscv-c-api-doc/blob/master/riscv-c-api.md#architecture-extension-test-macro

- We will also mark deprecated for legacy architecture extension test macros
  in GCC 11, but still support that for 1 or 2 release cycles.

gcc/ChangeLog:

* common/config/riscv/riscv-common.c (riscv_current_subset_list): New.
* config/riscv/riscv-c.c (riscv-subset.h): New.
(INCLUDE_STRING): Define.
(riscv_cpu_cpp_builtins): Add new style architecture extension
test macros.
* config/riscv/riscv-subset.h (riscv_subset_list::begin): New.
(riscv_subset_list::end): New.
(riscv_current_subset_list): New.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/predef-10.c: New.
* gcc.target/riscv/predef-11.c: New.
* gcc.target/riscv/predef-12.c: New.
* gcc.target/riscv/predef-13.c: New.
gcc/common/config/riscv/riscv-common.c
gcc/config/riscv/riscv-c.c
gcc/config/riscv/riscv-subset.h
gcc/testsuite/gcc.target/riscv/predef-10.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/predef-11.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/predef-12.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/predef-13.c [new file with mode: 0644]