[PATCH] D145088: [RISCV] Add attribute(riscv_rvv_vector_bits(N)) based on AArch64 arm_sve_vector_bits.

Craig Topper via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 3 09:22:07 PDT 2023


craig.topper added inline comments.


================
Comment at: clang/lib/Sema/SemaType.cpp:8234
+                                             ParsedAttr &Attr, Sema &S) {
+  // Target must have SVE.
+  if (!S.Context.getTargetInfo().hasFeature("zve32x")) {
----------------
I need to fix this comment.


================
Comment at: clang/lib/Sema/SemaType.cpp:8265
+  // The attribute vector size must match -mrvv-vector-bits.
+  // FIXME: LMUL from type and scale it.
+  if (VecSize != VScale->first * llvm::RISCV::RVVBitsPerBlock) {
----------------
aaron.ballman wrote:
> Should this be done as part of this patch (are we accepting code we shouldn't be accepting)?
No. I need to phrase this FIXME better. I'm only accepting types that have LMUL=1. (length multiplier). This is enforced in `Type::isRVVVLSBuiltinType()` where there's another FIXME about LMUL=1.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D145088



More information about the cfe-commits mailing list