[PATCH] D128235: [RISCV] Add support for the Zawrs extension

Kito Cheng via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 20 23:45:37 PDT 2022


kito-cheng added inline comments.


================
Comment at: clang/lib/Basic/Targets/RISCV.cpp:195
+  if (ISAInfo->hasExtension("zawrs"))
+    Builder.defineMacro("__riscv_zawrs");
 }
----------------
You don't need this line, that would be defined automatically once you've add  `zawrs` in `RISCVISAInfo.cpp`, see the loop in the earlier in this function, it's done by there:

```
  for (auto &Extension : ISAInfo->getExtensions()) {
    auto ExtName = Extension.first;
    auto ExtInfo = Extension.second;
    unsigned Version =
        (ExtInfo.MajorVersion * 1000000) + (ExtInfo.MinorVersion * 1000);

    Builder.defineMacro(Twine("__riscv_", ExtName), Twine(Version));
  }
```


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

https://reviews.llvm.org/D128235



More information about the cfe-commits mailing list