[PATCH] D94403: [RISCV] Implement new architecture extension macros

Kito Cheng via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 19 01:33:05 PST 2021


kito-cheng added a comment.

Just note how current GCC implemented, GCC implement that like implied extension, e.g. `V` implied `Zvamo` and `Zvlsseg`, so `__riscv_zvamo` is naturally defined when `V`-ext is enabled.



================
Comment at: clang/lib/Basic/Targets/RISCV.cpp:148
+  if (HasB) {
+    Builder.defineMacro("__riscv_b", "92000");
     Builder.defineMacro("__riscv_bitmanip");
----------------
kito-cheng wrote:
> Could you add all subset included in `B`, like zba, zbb, zbc, zbp...
I expect there `HasB` also define `__riscv_zbb`, `__riscv_zbc`... as well here.


================
Comment at: clang/lib/Basic/Targets/RISCV.cpp:153
+  if (HasV) {
+    Builder.defineMacro("__riscv_v", "9000");
     Builder.defineMacro("__riscv_vector");
----------------
kito-cheng wrote:
> Could you add all subset included in `V`, `Zvamo` and `Zvlsseg`.
Ditto, I expect there `HasV` also define `__riscv_zvamo`, `__riscv_zvlsseg`... as well here.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D94403/new/

https://reviews.llvm.org/D94403



More information about the cfe-commits mailing list