[clang] [llvm] [LLVMABI] Add support for SVE types in the LLVM ABI library (PR #221375)

Madhur Amilkanthwar via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 9 00:28:45 PDT 2026


================
@@ -242,11 +267,27 @@ QualTypeMapper::convertBuiltinType(const BuiltinType *BT) {
   case BuiltinType::ObjCSel:
     return createPointerTypeForPointee(QT);
 
-    // Target-specific vector/matrix types — not yet implemented.
-#define SVE_TYPE(Name, Id, SingletonId) case BuiltinType::Id:
+    // AArch64 SVE data and predicate types, including the x2/x3/x4 tuples.
+#define SVE_VECTOR_TYPE(Name, MangledName, Id, SingletonId)                    \
+  case BuiltinType::Id:
+#define SVE_PREDICATE_TYPE(Name, MangledName, Id, SingletonId)                 \
+  case BuiltinType::Id:
 #include "clang/Basic/AArch64ACLETypes.def"
+    return convertSVEBuiltinType(BT);
+
+  case BuiltinType::SveCount:
+    return Builder.getSVECountType(getTypeAlign(QT));
+
+  // TODO: __mfp8 has no floating-point semantics of its own, so representing
+  // it needs a decision about how the ABI library should model opaque
+  // floating-point data. As an mfloat8 vector element it is treated as an
+  // 8-bit integer, but that is not right for the scalar type, which is passed
+  // in a floating-point register.
+  case BuiltinType::MFloat8:
----------------
madhur13490 wrote:

Two things fatal-error here that the classic path handles fine, so they shouldn't abort under the flag:

plain __mfp8 — the classic path just passes it as a normal SIMD scalar.
a fixed-length svmfloat8 (arm_sve_vector_bits) — it reaches this same error, because the fixed-length path at line 381 calls convertType() on the __mfp8 element, while convertSVEBuiltinType special-cases it to i8.

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


More information about the cfe-commits mailing list