c-rhodes added inline comments.

================
Comment at: clang/lib/AST/ASTContext.cpp:8522
+          return VT->getElementType().getCanonicalType() ==
+                 getBuiltinVectorTypeInfo(BT).ElementType;
       }
----------------
efriedma wrote:
> c-rhodes wrote:
> > efriedma wrote:
> > > We allow casting SVE fixed-width vectors only if the element type is 
> > > identical, but we allow casting to GNU fixed-width vectors if the vector 
> > > width is the same?  That seems sort of loose; could allow weird casts, 
> > > particularly when bool vectors are involved.
> > > We allow casting SVE fixed-width vectors only if the element type is 
> > > identical, but we allow casting to GNU fixed-width vectors if the vector 
> > > width is the same? That seems sort of loose; could allow weird casts, 
> > > particularly when bool vectors are involved.
> > 
> > Fixed-length SVE vectors are created with the attribute and the vector 
> > width must match `-msve-vector-bits`, which should guarantee consistent 
> > vector widths for a given input. This is checking the vector width is the 
> > same and the element type matches when casting between GNU and SVE vectors, 
> > although since neither of those types are created by the attribute it's 
> > necessary to check the vector width to validate `__ARM_FEATURE_SVE_BITS==N`.
> > 
> > Predicates are treated differently in the ACLE and it doesn't mention 
> > supporting casts between GNU bool vectors and SVE VLS/VLA predicates. I'm 
> > also not sure the GNU vector_size extension is defined for bool elements 
> > yet, but I did notice Simon Moll is working on this (D81083).
> I think you need to check both the size and the element type here?
> I think you need to check both the size and the element type here?

Compare the size of a scalable and fixed-length vector?


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

https://reviews.llvm.org/D87607

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to