[clang] [AArch64] Implement reinterpret builtins for SVE vector tuples (PR #69598)

Momchil Velikov via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 26 11:24:44 PDT 2023


================
@@ -64,26 +65,29 @@ class ImmCheck {
 };
 
 class SVEType {
-  TypeSpec TS;
   bool Float, Signed, Immediate, Void, Constant, Pointer, BFloat;
   bool DefaultType, IsScalable, Predicate, PredicatePattern, PrefetchOp,
       Svcount;
   unsigned Bitwidth, ElementBitwidth, NumVectors;
 
 public:
-  SVEType() : SVEType(TypeSpec(), 'v') {}
+  SVEType() : SVEType("", 'v', 0) {}
 
-  SVEType(TypeSpec TS, char CharMod, unsigned NumVectors = 1)
-      : TS(TS), Float(false), Signed(true), Immediate(false), Void(false),
+  SVEType(StringRef TS, char CharMod = 'd', unsigned NumVectors = 0)
----------------
momchil-velikov wrote:

> I know that it only works with 'd'. But it should be able to be empty. 

I don't understand.

Also there wasn't a default parameter value, therefore all users passed an explicit value and adding a default cannot affect  them.

> ?Why NumVectors=0?

The idea is that you get the most basic possible instance of this type if you pass the least amount of information( i.e. `SVType(TS)`) and you get progressively more complex variants when you add information, like type modifier or vector length. That's why 'd' and `0` were chosen as defaults - they correspond to the most basic variant.

> I believe it still works if we change to 1, so maybe we can reduce some of the changes, for instance lane 918, 970 and 976

I don't agree with the criteria "minimising changes", but really it's not then important, so I'll make the changes as you request and move on.


https://github.com/llvm/llvm-project/pull/69598


More information about the cfe-commits mailing list