[PATCH] D143665: [Clang][RISCV] Guard vector int64, float32, float64 with semantic analysis

Craig Topper via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 10 21:32:59 PST 2023


craig.topper added inline comments.


================
Comment at: clang/lib/Sema/Sema.cpp:2049
 
-    if (Ty->isVectorFloat16Type() &&
-        !Context.getTargetInfo().hasVectorFloat16Support()) {
+    if ((Ty->isVectorInt64Type() &&
+         !Context.getTargetInfo().hasVectorInt64Support()) ||
----------------
eopXD wrote:
> > Overall it might be cleaner to call S.Context.getTargetInfo().hasFeature( from RISCV-V specific code in Sema instead of trying to define a generic interface.
> 
> If so, we will have something like:
> 
> ```
> if (Ty->isRVVInt64Type() && !Context.getTargetInfo().hasFeature("zve64x")) {
>   Diag(Loc, diag::err_riscv_type_requires_extension, FD) << Ty << "zve64x";
> }
> ```
> 
> I don't have a preference here, if this matches your expectation, I will update the revision this way.
I'm ok with what you did the Zvfh patch.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D143665



More information about the cfe-commits mailing list