[clang] [CIR] Add an explicit mfp8 type (PR #245394)

Andy Kaylor via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 23 16:49:55 PST 2026


https://github.com/andykaylor updated https://github.com/llvm/llvm-project/pull/245394

>From 3f05132f7851a3a729a5957e35bb35475f4be01d Mon Sep 17 00:00:00 2001
From: Andy Kaylor <akaylor at nvidia.com>
Date: Thu, 19 Nov 2026 12:53:26 -0800
Subject: [PATCH 1/3] [CIR] Add an explicit mfp8 type

Previously, CIR was mapping __mfp8 values as signed 8-bit integers. This is
a slight divergence from classic codegen, which maps them as <1 x i8>.
More importantly, we will need to identify __mfp8 values during calling
convention lowering to handle them correctly.

This change introduces a new type to explicitly represent __mfp8 as an
opaque floating-point type. I am introducing a CIR_OpaqueFloatType base
class because I think this will also be useful when we eventually add
support for RISC-V's vectors of opaque floats.

Assisted-by: Cursor / claude-opus-5.5
---
 .../CIR/Dialect/Builder/CIRBaseBuilder.h      |   2 +
 .../CIR/Dialect/IR/CIRDialectBytecode.td      |   2 +
 clang/include/clang/CIR/Dialect/IR/CIROps.td  |   4 -
 .../CIR/Dialect/IR/CIRTypeConstraints.td      |  14 +-
 .../include/clang/CIR/Dialect/IR/CIRTypes.td  |  36 +++-
 clang/lib/CIR/CodeGen/CIRGenBuilder.h         |   1 +
 .../lib/CIR/CodeGen/CIRGenBuiltinAArch64.cpp  |   4 +-
 clang/lib/CIR/CodeGen/CIRGenModule.cpp        |   1 +
 clang/lib/CIR/CodeGen/CIRGenTypeCache.h       |   3 +
 clang/lib/CIR/CodeGen/CIRGenTypes.cpp         |  14 +-
 clang/lib/CIR/Dialect/IR/CIRDialect.cpp       |   7 +-
 clang/lib/CIR/Dialect/IR/CIRTypes.cpp         |  24 ++-
 .../CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp |  80 ++++++++-
 clang/test/CIR/Bytecode/types.cir             |   3 +
 clang/test/CIR/CodeGen/aarch64-mfp8.c         | 167 ++++++++++++++++++
 clang/test/CIR/IR/invalid-vector.cir          |  10 +-
 clang/test/CIR/IR/vector.cir                  |   4 +
 clang/test/CIR/Lowering/mfp8.cir              |  89 ++++++++++
 18 files changed, 427 insertions(+), 38 deletions(-)
 create mode 100644 clang/test/CIR/CodeGen/aarch64-mfp8.c
 create mode 100644 clang/test/CIR/Lowering/mfp8.cir

diff --git a/clang/include/clang/CIR/Dialect/Builder/CIRBaseBuilder.h b/clang/include/clang/CIR/Dialect/Builder/CIRBaseBuilder.h
index d4aed1169d279d..55b6f2ca24a313 100644
--- a/clang/include/clang/CIR/Dialect/Builder/CIRBaseBuilder.h
+++ b/clang/include/clang/CIR/Dialect/Builder/CIRBaseBuilder.h
@@ -115,6 +115,8 @@ class CIRBaseBuilderTy : public mlir::OpBuilder {
       return cir::IntAttr::get(ty, 0);
     if (cir::isAnyFloatingPointType(ty))
       return cir::FPAttr::getZero(ty);
+    if (cir::isAnyOpaqueFloatingPointType(ty))
+      return cir::ZeroAttr::get(ty);
     if (auto complexType = mlir::dyn_cast<cir::ComplexType>(ty))
       return cir::ZeroAttr::get(complexType);
     if (auto arrTy = mlir::dyn_cast<cir::ArrayType>(ty))
diff --git a/clang/include/clang/CIR/Dialect/IR/CIRDialectBytecode.td b/clang/include/clang/CIR/Dialect/IR/CIRDialectBytecode.td
index 31ccff87f8004b..507d1167ea671f 100644
--- a/clang/include/clang/CIR/Dialect/IR/CIRDialectBytecode.td
+++ b/clang/include/clang/CIR/Dialect/IR/CIRDialectBytecode.td
@@ -300,6 +300,7 @@ def FP128Type : DialectType<(type)>;
 def LongDoubleType : CheckedDialectType<(type
   Type:$underlying
 )>;
+def MFloat8Type : DialectType<(type)>;
 
 def BoolType : DialectType<(type)>;
 def VoidType : DialectType<(type)>;
@@ -444,6 +445,7 @@ def CIRDialectTypes : DialectTypes<"CIR"> {
     EhTokenType,
     CleanupTokenType,
     CatchTokenType,
+    MFloat8Type,
     // APPEND ONLY, as for the attributes. Types not listed here, including
     // the mutable struct and union types, keep the assembly-format fallback.
   ];
diff --git a/clang/include/clang/CIR/Dialect/IR/CIROps.td b/clang/include/clang/CIR/Dialect/IR/CIROps.td
index 23199270a8ce2b..1d01eeef18ea0f 100644
--- a/clang/include/clang/CIR/Dialect/IR/CIROps.td
+++ b/clang/include/clang/CIR/Dialect/IR/CIROps.td
@@ -6803,8 +6803,6 @@ def CIR_VecInsertOp : CIR_Op<"vec.insert", [
     $value `,` $vec `[` $index `:` type($index) `]` attr-dict `:`
     qualified(type($vec))
   }];
-
-  let llvmOp = "InsertElementOp";
 }
 
 //===----------------------------------------------------------------------===//
@@ -6836,8 +6834,6 @@ def CIR_VecExtractOp : CIR_Op<"vec.extract", [
   }];
 
   let hasFolder = 1;
-
-  let llvmOp = "ExtractElementOp";
 }
 
 //===----------------------------------------------------------------------===//
diff --git a/clang/include/clang/CIR/Dialect/IR/CIRTypeConstraints.td b/clang/include/clang/CIR/Dialect/IR/CIRTypeConstraints.td
index c2b0f0d864ff88..17c750f7c96d13 100644
--- a/clang/include/clang/CIR/Dialect/IR/CIRTypeConstraints.td
+++ b/clang/include/clang/CIR/Dialect/IR/CIRTypeConstraints.td
@@ -192,6 +192,14 @@ def CIR_AnyFloatType : AnyTypeOf<[
     let cppFunctionName = "isAnyFloatingPointType";
 }
 
+def CIR_AnyMFloat8Type : CIR_TypeBase<"::cir::MFloat8Type", "mfp8 type">,
+      BuildableType<"$_builder.getType<" # cppType # ">()">;
+
+def CIR_AnyOpaqueFloatType : AnyTypeOf<[CIR_AnyMFloat8Type],
+    "opaque floating point type"> {
+    let cppFunctionName = "isAnyOpaqueFloatingPointType";
+}
+
 def CIR_AnyIntOrFloatType : AnyTypeOf<[CIR_AnyFloatType, CIR_AnyIntType],
     "integer or floating point type"
 > {
@@ -328,8 +336,10 @@ def CIR_PtrToArray : CIR_PtrToType<CIR_AnyArrayType>;
 def CIR_AnyVectorType : CIR_TypeBase<"::cir::VectorType", "vector type">;
 
 def CIR_VectorElementType
-    : AnyTypeOf<[CIR_AnyBoolType, CIR_AnyIntOrFloatType],
-                "any cir boolean, integer, floating point"> {
+    : AnyTypeOf<[CIR_AnyBoolType, CIR_AnyIntOrFloatType,
+                 CIR_AnyOpaqueFloatType],
+                "any cir boolean, integer, floating point or opaque floating " #
+                "point type"> {
   let cppFunctionName = "isValidVectorTypeElementType";
 }
 
diff --git a/clang/include/clang/CIR/Dialect/IR/CIRTypes.td b/clang/include/clang/CIR/Dialect/IR/CIRTypes.td
index 6c63ea5efb79fb..08d34e32b9fcf1 100644
--- a/clang/include/clang/CIR/Dialect/IR/CIRTypes.td
+++ b/clang/include/clang/CIR/Dialect/IR/CIRTypes.td
@@ -212,6 +212,33 @@ def CIR_LongDouble : CIR_FloatType<"LongDouble", "long_double"> {
   }];
 }
 
+//===----------------------------------------------------------------------===//
+// OpaqueFloatType
+//===----------------------------------------------------------------------===//
+
+// A floating-point type with a fixed width and no fixed format. The format of
+// a value is determined at run time, so these types have no float semantics
+// and do not implement CIR_FPTypeInterface.
+class CIR_OpaqueFloatType<string name, string mnemonic, int width>
+    : CIR_Type<name, mnemonic, [
+  DeclareTypeInterfaceMethods<DataLayoutTypeInterface>,
+  DeclareTypeInterfaceMethods<CIR_SizedTypeInterface>
+]> {
+  let extraClassDeclaration = [{
+    /// Returns the bit width of this type.
+    unsigned getWidth() const { return }] # !cast<string>(width) # [{; }
+  }];
+}
+
+def CIR_MFloat8 : CIR_OpaqueFloatType<"MFloat8", "mfp8", 8> {
+  let summary = "CIR AArch64 modal 8-bit float type";
+  let description = [{
+    An 8-bit floating-point type whose format is selected at run time by the
+    AArch64 FPMR register, and is either E5M2 or E4M3. It represents the type
+    `__mfp8` (`mfloat8_t`) in C and C++.
+  }];
+}
+
 //===----------------------------------------------------------------------===//
 // ComplexType
 //===----------------------------------------------------------------------===//
@@ -523,7 +550,7 @@ def CIR_VectorType : CIR_Type<"Vector", "vector", [
     ```
     vector-type ::= !cir.vector<size x element-type (`,` kind)?>
     size ::= (decimal-literal | `[` decimal-literal `]`)
-    element-type ::= float-type | integer-type | bool-type
+    element-type ::= float-type | opaque-float-type | integer-type | bool-type
     kind ::= `sve_data` | `sve_predicate`
     ```
 
@@ -554,7 +581,8 @@ def CIR_VectorType : CIR_Type<"Vector", "vector", [
     length by `arm_sve_vector_bits`:
 
     - An `sve_data` vector has 8-, 16-, 32-, or 64-bit integer elements or
-      `!cir.f16`, `!cir.bf16`, `!cir.float`, or `!cir.double` elements.
+      `!cir.mfp8`, `!cir.f16`, `!cir.bf16`, `!cir.float`, or `!cir.double`
+      elements.
     - A scalable `sve_predicate` vector has `!cir.int<u, 1>` elements. A
       fixed-length `sve_predicate` vector holds the predicate one bit per lane
       in `!cir.int<u, 8>` elements.
@@ -1348,8 +1376,8 @@ def CIR_CatchTokenType : CIR_Type<"CatchToken", "catch_token"> {
 
 def CIR_AnyType : AnyTypeOf<[
   CIR_VoidType, CIR_BoolType, CIR_ArrayType, CIR_VectorType, CIR_MatrixType,
-  CIR_IntType, CIR_AnyFloatType, CIR_PointerType, CIR_FuncType, CIR_StructType,
-  CIR_UnionType, CIR_BitFieldType,
+  CIR_IntType, CIR_AnyFloatType, CIR_AnyOpaqueFloatType, CIR_PointerType,
+  CIR_FuncType, CIR_StructType, CIR_UnionType, CIR_BitFieldType,
   CIR_ComplexType, CIR_VPtrType, CIR_CUDADeviceSurfaceType,
   CIR_CUDADeviceTextureType,
   CIR_DataMemberType, CIR_MethodType,
diff --git a/clang/lib/CIR/CodeGen/CIRGenBuilder.h b/clang/lib/CIR/CodeGen/CIRGenBuilder.h
index deb3d29a4294aa..5193db8292639c 100644
--- a/clang/lib/CIR/CodeGen/CIRGenBuilder.h
+++ b/clang/lib/CIR/CodeGen/CIRGenBuilder.h
@@ -331,6 +331,7 @@ class CIRGenBuilderTy : public cir::CIRBaseBuilderTy {
   cir::BF16Type getBfloat16Ty() { return typeCache.bFloat16Ty; }
   cir::SingleType getSingleTy() { return typeCache.floatTy; }
   cir::DoubleType getDoubleTy() { return typeCache.doubleTy; }
+  cir::MFloat8Type getMFloat8Ty() { return typeCache.mFloat8Ty; }
 
   cir::ConstantOp getConstInt(mlir::Location loc, llvm::APSInt intVal);
 
diff --git a/clang/lib/CIR/CodeGen/CIRGenBuiltinAArch64.cpp b/clang/lib/CIR/CodeGen/CIRGenBuiltinAArch64.cpp
index 401eb4813628c1..7ccf9ff1e1ee3e 100644
--- a/clang/lib/CIR/CodeGen/CIRGenBuiltinAArch64.cpp
+++ b/clang/lib/CIR/CodeGen/CIRGenBuiltinAArch64.cpp
@@ -679,7 +679,7 @@ static cir::VectorType getNeonType(CIRGenFunction *cgf, NeonTypeFlags typeFlags,
                                                             : cgf->sInt8Ty,
                                      v1Ty ? 1 : (8 << isQuad));
   case NeonTypeFlags::MFloat8:
-    return cir::VectorType::getFixed(cgf->uInt8Ty, v1Ty ? 1 : (8 << isQuad));
+    return cir::VectorType::getFixed(cgf->mFloat8Ty, v1Ty ? 1 : (8 << isQuad));
   case NeonTypeFlags::Int16:
   case NeonTypeFlags::Poly16:
     return cir::VectorType::getFixed(typeFlags.isUnsigned() ? cgf->uInt16Ty
@@ -1618,7 +1618,7 @@ cir::VectorType CIRGenFunction::getSVEType(const SVETypeFlags &typeFlags) {
                                         cir::VectorAbiKind::SVEData);
 
   case SVETypeFlags::EltTyMFloat8:
-    return cir::VectorType::getScalable(builder.getUInt8Ty(), 16,
+    return cir::VectorType::getScalable(builder.getMFloat8Ty(), 16,
                                         cir::VectorAbiKind::SVEData);
   case SVETypeFlags::EltTyFloat16:
     return cir::VectorType::getScalable(builder.getFp16Ty(), 8,
diff --git a/clang/lib/CIR/CodeGen/CIRGenModule.cpp b/clang/lib/CIR/CodeGen/CIRGenModule.cpp
index b4df2fb4ce36a9..397b340c486e3a 100644
--- a/clang/lib/CIR/CodeGen/CIRGenModule.cpp
+++ b/clang/lib/CIR/CodeGen/CIRGenModule.cpp
@@ -123,6 +123,7 @@ CIRGenModule::CIRGenModule(mlir::MLIRContext &mlirContext,
   doubleTy = cir::DoubleType::get(&getMLIRContext());
   fP80Ty = cir::FP80Type::get(&getMLIRContext());
   fP128Ty = cir::FP128Type::get(&getMLIRContext());
+  mFloat8Ty = cir::MFloat8Type::get(&getMLIRContext());
 
   allocaInt8PtrTy = cir::PointerType::get(uInt8Ty, cirAllocaAddressSpace);
 
diff --git a/clang/lib/CIR/CodeGen/CIRGenTypeCache.h b/clang/lib/CIR/CodeGen/CIRGenTypeCache.h
index 4f3c319816e3ac..0de25f3cc891bd 100644
--- a/clang/lib/CIR/CodeGen/CIRGenTypeCache.h
+++ b/clang/lib/CIR/CodeGen/CIRGenTypeCache.h
@@ -51,6 +51,9 @@ struct CIRGenTypeCache {
   cir::FP80Type fP80Ty;
   cir::FP128Type fP128Ty;
 
+  // ClangIR floating-point types whose format is selected at run time
+  cir::MFloat8Type mFloat8Ty;
+
   /// ClangIR char
   mlir::Type uCharTy;
 
diff --git a/clang/lib/CIR/CodeGen/CIRGenTypes.cpp b/clang/lib/CIR/CodeGen/CIRGenTypes.cpp
index fa96c9b655c1c2..229717c090221b 100644
--- a/clang/lib/CIR/CodeGen/CIRGenTypes.cpp
+++ b/clang/lib/CIR/CodeGen/CIRGenTypes.cpp
@@ -405,16 +405,10 @@ mlir::Type CIRGenTypes::convertType(QualType type) {
           resultType = cgm.sInt32Ty;
           break;
         }
-        // A predicate holds one bit per lane. An svmfloat8_t lane is an 8-bit
-        // integer, independent of how the scalar __mfp8 type is represented.
+        // A predicate holds one bit per lane.
         bool isPredicate = info.ElementType->isBooleanType();
-        mlir::Type eltTy;
-        if (isPredicate)
-          eltTy = builder.getUIntNTy(1);
-        else if (info.ElementType->isMFloat8Type())
-          eltTy = builder.getUInt8Ty();
-        else
-          eltTy = convertType(info.ElementType);
+        mlir::Type eltTy =
+            isPredicate ? builder.getUIntNTy(1) : convertType(info.ElementType);
         resultType =
             cir::VectorType::get(eltTy, info.EC,
                                  isPredicate ? cir::VectorAbiKind::SVEPredicate
@@ -463,7 +457,7 @@ mlir::Type CIRGenTypes::convertType(QualType type) {
       resultType = cgm.bFloat16Ty;
       break;
     case BuiltinType::MFloat8:
-      resultType = cgm.uInt8Ty;
+      resultType = cgm.mFloat8Ty;
       break;
     case BuiltinType::Float:
       assert(&astContext.getFloatTypeSemantics(type) ==
diff --git a/clang/lib/CIR/Dialect/IR/CIRDialect.cpp b/clang/lib/CIR/Dialect/IR/CIRDialect.cpp
index 58c501955777f2..4cc0f623e54e6f 100644
--- a/clang/lib/CIR/Dialect/IR/CIRDialect.cpp
+++ b/clang/lib/CIR/Dialect/IR/CIRDialect.cpp
@@ -963,10 +963,11 @@ static LogicalResult checkConstantTypes(mlir::Operation *op, mlir::Type opType,
 
   if (isa<cir::ZeroAttr>(attrType)) {
     if (isa<cir::RecordType, cir::ArrayType, cir::MatrixType, cir::VectorType,
-            cir::ComplexType>(opType))
+            cir::ComplexType>(opType) ||
+        cir::isAnyOpaqueFloatingPointType(opType))
       return success();
-    return op->emitOpError(
-        "zero expects struct, array, vector, or complex type");
+    return op->emitOpError("zero expects struct, array, vector, complex, or "
+                           "opaque floating-point type");
   }
 
   if (mlir::isa<cir::UndefAttr>(attrType)) {
diff --git a/clang/lib/CIR/Dialect/IR/CIRTypes.cpp b/clang/lib/CIR/Dialect/IR/CIRTypes.cpp
index e82d5f55cbd974..70233d0f8d83a4 100644
--- a/clang/lib/CIR/Dialect/IR/CIRTypes.cpp
+++ b/clang/lib/CIR/Dialect/IR/CIRTypes.cpp
@@ -1306,6 +1306,22 @@ LongDoubleType::getABIAlignment(const mlir::DataLayout &dataLayout,
       .getABIAlignment(dataLayout, params);
 }
 
+//===----------------------------------------------------------------------===//
+// Opaque floating-point type definitions
+//===----------------------------------------------------------------------===//
+
+llvm::TypeSize
+MFloat8Type::getTypeSizeInBits(const mlir::DataLayout &dataLayout,
+                               mlir::DataLayoutEntryListRef params) const {
+  return llvm::TypeSize::getFixed(getWidth());
+}
+
+uint64_t
+MFloat8Type::getABIAlignment(const mlir::DataLayout &dataLayout,
+                             mlir::DataLayoutEntryListRef params) const {
+  return (uint64_t)(getWidth() / 8);
+}
+
 //===----------------------------------------------------------------------===//
 // ComplexType Definitions
 //===----------------------------------------------------------------------===//
@@ -1685,13 +1701,13 @@ mlir::LogicalResult cir::VectorType::verify(
       if (!intTy.isBitInt() &&
           (width == 8 || width == 16 || width == 32 || width == 64))
         return success();
-    } else if (mlir::isa<cir::FP16Type, cir::BF16Type, cir::SingleType,
-                         cir::DoubleType>(elementType)) {
+    } else if (mlir::isa<cir::MFloat8Type, cir::FP16Type, cir::BF16Type,
+                         cir::SingleType, cir::DoubleType>(elementType)) {
       return success();
     }
     return emitError() << "an SVE data vector must have 8-, 16-, 32-, or "
-                          "64-bit integer elements or f16, bf16, float, or "
-                          "double elements";
+                          "64-bit integer elements or mfp8, f16, bf16, float, "
+                          "or double elements";
   }
   case cir::VectorAbiKind::SVEPredicate: {
     unsigned width = size.isScalable() ? 1 : 8;
diff --git a/clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp b/clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp
index 8ca12695812802..e0dd52a9268739 100644
--- a/clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp
+++ b/clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp
@@ -2935,6 +2935,10 @@ mlir::LogicalResult CIRToLLVMConstantOpLowering::matchAndRewrite(
     attr = rewriter.getFloatAttr(
         typeConverter->convertType(op.getType()),
         mlir::cast<cir::FPAttr>(op.getValue()).getValue());
+  } else if (cir::isAnyOpaqueFloatingPointType(op.getType())) {
+    rewriter.replaceOpWithNewOp<mlir::LLVM::ZeroOp>(
+        op, typeConverter->convertType(op.getType()));
+    return mlir::success();
   } else if (mlir::isa<cir::PointerType>(op.getType())) {
     // Optimize with dedicated LLVM op for null pointers.
     if (mlir::isa<cir::ConstPtrAttr>(op.getValue())) {
@@ -4612,9 +4616,14 @@ static void prepareTypeConverter(mlir::LLVMTypeConverter &converter,
     if (auto intTy = mlir::dyn_cast<cir::IntType>(type.getElementType());
         intTy && intTy.isBitInt())
       return {};
-    const mlir::Type ty = converter.convertType(type.getElementType());
+    mlir::Type ty = converter.convertType(type.getElementType());
     if (!ty)
       return {};
+    // A scalar opaque float is lowered to a one-element vector of an integer
+    // of the same width. A vector of opaque floats has that integer as its
+    // element type.
+    if (cir::isAnyOpaqueFloatingPointType(type.getElementType()))
+      ty = mlir::cast<mlir::VectorType>(ty).getElementType();
     return mlir::VectorType::get(type.getSize().getKnownMinValue(), ty,
                                  {type.isScalable()});
   });
@@ -4652,6 +4661,13 @@ static void prepareTypeConverter(mlir::LLVMTypeConverter &converter,
   converter.addConversion([&](cir::BF16Type type) -> mlir::Type {
     return mlir::BFloat16Type::get(type.getContext());
   });
+  // LLVM IR has no type for a floating-point value whose format is not fixed.
+  // A scalar opaque float is lowered to a one-element vector of an integer of
+  // the same width.
+  converter.addConversion([&](cir::MFloat8Type type) -> mlir::Type {
+    return mlir::VectorType::get(
+        1, mlir::IntegerType::get(type.getContext(), type.getWidth()));
+  });
   converter.addConversion([&](cir::ComplexType type) -> mlir::Type {
     // A complex type is lowered to an LLVM struct that contains the real and
     // imaginary part as data fields.
@@ -5960,6 +5976,59 @@ mlir::LogicalResult CIRToLLVMVTTAddrPointOpLowering::matchAndRewrite(
   return mlir::success();
 }
 
+/// Converts \p value, the lowered form of a scalar of CIR type \p cirTy, to
+/// the LLVM vector element type for \p cirTy. A scalar opaque float is lowered
+/// to a one-element vector, which is bitcast to its element type.
+static mlir::Value toVectorElement(mlir::OpBuilder &builder, mlir::Location loc,
+                                   mlir::Type cirTy, mlir::Value value) {
+  if (!cir::isAnyOpaqueFloatingPointType(cirTy))
+    return value;
+  auto vecTy = mlir::cast<mlir::VectorType>(value.getType());
+  return mlir::LLVM::BitcastOp::create(builder, loc, vecTy.getElementType(),
+                                       value);
+}
+
+/// Converts \p element, an LLVM vector element of CIR type \p cirTy, to the
+/// lowered form of a scalar of that type. An opaque float element is inserted
+/// into a one-element vector.
+static mlir::Value fromVectorElement(mlir::OpBuilder &builder,
+                                     mlir::Location loc,
+                                     const mlir::TypeConverter &converter,
+                                     mlir::Type cirTy, mlir::Value element) {
+  if (!cir::isAnyOpaqueFloatingPointType(cirTy))
+    return element;
+  mlir::Value poison =
+      mlir::LLVM::PoisonOp::create(builder, loc, converter.convertType(cirTy));
+  mlir::Value zero =
+      mlir::LLVM::ConstantOp::create(builder, loc, builder.getI64Type(), 0);
+  return mlir::LLVM::InsertElementOp::create(builder, loc, poison, element,
+                                             zero);
+}
+
+mlir::LogicalResult CIRToLLVMVecExtractOpLowering::matchAndRewrite(
+    cir::VecExtractOp op, OpAdaptor adaptor,
+    mlir::ConversionPatternRewriter &rewriter) const {
+  const mlir::Location loc = op.getLoc();
+  mlir::Value vec = adaptor.getVec();
+  mlir::Type eltTy =
+      mlir::cast<mlir::VectorType>(vec.getType()).getElementType();
+  mlir::Value element = mlir::LLVM::ExtractElementOp::create(
+      rewriter, loc, eltTy, vec, adaptor.getIndex());
+  rewriter.replaceOp(op, fromVectorElement(rewriter, loc, *typeConverter,
+                                           op.getType(), element));
+  return mlir::success();
+}
+
+mlir::LogicalResult CIRToLLVMVecInsertOpLowering::matchAndRewrite(
+    cir::VecInsertOp op, OpAdaptor adaptor,
+    mlir::ConversionPatternRewriter &rewriter) const {
+  mlir::Value element = toVectorElement(
+      rewriter, op.getLoc(), op.getValue().getType(), adaptor.getValue());
+  rewriter.replaceOpWithNewOp<mlir::LLVM::InsertElementOp>(
+      op, adaptor.getVec(), element, adaptor.getIndex());
+  return mlir::success();
+}
+
 mlir::LogicalResult CIRToLLVMVecCreateOpLowering::matchAndRewrite(
     cir::VecCreateOp op, OpAdaptor adaptor,
     mlir::ConversionPatternRewriter &rewriter) const {
@@ -5976,8 +6045,10 @@ mlir::LogicalResult CIRToLLVMVecCreateOpLowering::matchAndRewrite(
   for (uint64_t i = 0; i < vectorSize; ++i) {
     const mlir::Value indexValue =
         mlir::LLVM::ConstantOp::create(rewriter, loc, rewriter.getI64Type(), i);
-    result = mlir::LLVM::InsertElementOp::create(
-        rewriter, loc, result, adaptor.getElements()[i], indexValue);
+    mlir::Value element = toVectorElement(rewriter, loc, vecTy.getElementType(),
+                                          adaptor.getElements()[i]);
+    result = mlir::LLVM::InsertElementOp::create(rewriter, loc, result, element,
+                                                 indexValue);
   }
 
   rewriter.replaceOp(op, result);
@@ -6063,7 +6134,8 @@ mlir::LogicalResult CIRToLLVMVecSplatOpLowering::matchAndRewrite(
   mlir::Location loc = op.getLoc();
   mlir::Value poison = mlir::LLVM::PoisonOp::create(rewriter, loc, llvmTy);
 
-  mlir::Value elementValue = adaptor.getValue();
+  mlir::Value elementValue = toVectorElement(
+      rewriter, loc, op.getValue().getType(), adaptor.getValue());
   if (elementValue.getDefiningOp<mlir::LLVM::PoisonOp>()) {
     // If the splat value is poison, then we can just use poison value
     // for the entire vector.
diff --git a/clang/test/CIR/Bytecode/types.cir b/clang/test/CIR/Bytecode/types.cir
index 9747f8873ae7ae..618660cfc85e40 100644
--- a/clang/test/CIR/Bytecode/types.cir
+++ b/clang/test/CIR/Bytecode/types.cir
@@ -28,6 +28,8 @@ module {
                            !cir.long_double<!cir.f80>,
                            !cir.long_double<!cir.f128>)
 
+  cir.func private @opaque_floats(!cir.mfp8, !cir.vector<16 x !cir.mfp8>)
+
   cir.func private @scalars(!cir.bool, !cir.vptr) -> !cir.bool
 
   cir.func private @ptrs(!cir.ptr<!s32i>, !cir.ptr<!cir.ptr<!u8i>>,
@@ -76,6 +78,7 @@ module {
 
 // CHECK: cir.func private @ints(!u8i, !s32i, !s64i, !cir.int<s, 13, bitint>, !u128i_bitint)
 // CHECK: cir.func private @floats(!cir.float, !cir.double, !cir.f16, !cir.bf16, !cir.f80, !cir.f128, !cir.long_double<!cir.double>, !cir.long_double<!cir.f80>, !cir.long_double<!cir.f128>)
+// CHECK: cir.func private @opaque_floats(!cir.mfp8, !cir.vector<16 x !cir.mfp8>)
 // CHECK: cir.func private @scalars(!cir.bool, !cir.vptr) -> !cir.bool
 // CHECK: cir.func private @ptrs(!cir.ptr<!s32i>, !cir.ptr<!cir.ptr<!u8i>>, !cir.ptr<!s32i, target_address_space(1)>, !cir.ptr<!s32i, lang_address_space(offload_global)>)
 // CHECK: cir.func private @arrays(!cir.array<!s32i x 4>, !cir.array<!cir.array<!u8i x 3> x 5>, !cir.array<!cir.ptr<!s32i> x 2>)
diff --git a/clang/test/CIR/CodeGen/aarch64-mfp8.c b/clang/test/CIR/CodeGen/aarch64-mfp8.c
new file mode 100644
index 00000000000000..d843d8b959b3dc
--- /dev/null
+++ b/clang/test/CIR/CodeGen/aarch64-mfp8.c
@@ -0,0 +1,167 @@
+// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +neon -target-feature +sve -mvscale-min=1 -mvscale-max=1 -fclangir -emit-cir %s -o %t.cir
+// RUN: FileCheck --check-prefix=CIR --input-file=%t.cir %s
+// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +neon -target-feature +sve -mvscale-min=1 -mvscale-max=1 -fclangir -emit-llvm %s -o %t-cir.ll
+// RUN: FileCheck --check-prefixes=LLVM,LLVMCIR --input-file=%t-cir.ll %s
+// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +neon -target-feature +sve -mvscale-min=1 -mvscale-max=1 -emit-llvm %s -o %t.ll
+// RUN: FileCheck --check-prefixes=LLVM,OGCG --input-file=%t.ll %s
+
+// __mfp8 values are kept out of function signatures here because calling
+// convention lowering does not yet handle the type.
+
+__mfp8 g;
+__mfp8 garr[4];
+__Mfloat8x8_t gv8;
+__Mfloat8x16_t gv16;
+
+struct S {
+  __mfp8 x;
+};
+
+struct S s;
+
+typedef __SVMfloat8_t fixed_mf8_t __attribute__((arm_sve_vector_bits(128)));
+fixed_mf8_t gfixed;
+
+// CIR: !rec_S = !cir.struct<"S" {data !cir.mfp8}>
+// CIR: cir.global external @g = #cir.zero : !cir.mfp8 align(1)
+// CIR: cir.global external @gv16 = #cir.zero : !cir.vector<16 x !cir.mfp8> align(16)
+// CIR: cir.global external @gv8 = #cir.zero : !cir.vector<8 x !cir.mfp8> align(8)
+// CIR: cir.global external @s = #cir.zero : !rec_S align(1)
+// CIR: cir.global external @garr = #cir.zero : !cir.array<!cir.mfp8 x 4> align(1)
+// CIR: cir.global external @gfixed = #cir.zero : !cir.vector<16 x !cir.mfp8, sve_data> align(16)
+
+// LLVM: %struct.S = type { <1 x i8> }
+// LLVM: @g = global <1 x i8> zeroinitializer, align 1
+// LLVM: @gv16 = global <16 x i8> zeroinitializer, align 16
+// LLVM: @gv8 = global <8 x i8> zeroinitializer, align 8
+// LLVM: @s = global %struct.S zeroinitializer, align 1
+// LLVM: @garr = global [4 x <1 x i8>] zeroinitializer, align 1
+// LLVM: @gfixed = global <16 x i8> zeroinitializer, align 16
+
+void copy_local(void) {
+  __mfp8 a[10];
+  a[2] = g;
+  g = a[2];
+}
+
+// CIR-LABEL: cir.func {{.*}} @copy_local()
+// CIR:   %[[A:.*]] = cir.alloca "a" align(1) : !cir.ptr<!cir.array<!cir.mfp8 x 10>>
+// CIR:   %[[G:.*]] = cir.get_global @g : !cir.ptr<!cir.mfp8>
+// CIR:   %[[G_VAL:.*]] = cir.load align(1) %[[G]] : !cir.ptr<!cir.mfp8>, !cir.mfp8
+// CIR:   %[[ELT:.*]] = cir.get_element inbounds %[[A]][%{{.*}} : !s64i] : !cir.ptr<!cir.array<!cir.mfp8 x 10>> -> !cir.ptr<!cir.mfp8>
+// CIR:   cir.store align(1) %[[G_VAL]], %[[ELT]] : !cir.mfp8, !cir.ptr<!cir.mfp8>
+// CIR:   %[[ELT2:.*]] = cir.get_element inbounds %[[A]][%{{.*}} : !s64i] : !cir.ptr<!cir.array<!cir.mfp8 x 10>> -> !cir.ptr<!cir.mfp8>
+// CIR:   %[[ELT_VAL:.*]] = cir.load align(1) %[[ELT2]] : !cir.ptr<!cir.mfp8>, !cir.mfp8
+// CIR:   %[[G2:.*]] = cir.get_global @g : !cir.ptr<!cir.mfp8>
+// CIR:   cir.store align(1) %[[ELT_VAL]], %[[G2]] : !cir.mfp8, !cir.ptr<!cir.mfp8>
+
+// LLVM-LABEL: define dso_local void @copy_local()
+// LLVM:   %[[A:.*]] = alloca [10 x <1 x i8>], align 1
+// LLVM:   %[[G_VAL:.*]] = load <1 x i8>, ptr @g, align 1
+// LLVM:   %[[ELT:.*]] = getelementptr inbounds [10 x <1 x i8>], ptr %[[A]], i64 0, i64 2
+// LLVM:   store <1 x i8> %[[G_VAL]], ptr %[[ELT]], align 1
+// LLVM:   %[[ELT2:.*]] = getelementptr inbounds [10 x <1 x i8>], ptr %[[A]], i64 0, i64 2
+// LLVM:   %[[ELT_VAL:.*]] = load <1 x i8>, ptr %[[ELT2]], align 1
+// LLVM:   store <1 x i8> %[[ELT_VAL]], ptr @g, align 1
+
+void extract_element(int i) {
+  g = gv16[i];
+}
+
+// CIR-LABEL: cir.func {{.*}} @extract_element(
+// CIR:   %[[GV16:.*]] = cir.get_global @gv16 : !cir.ptr<!cir.vector<16 x !cir.mfp8>>
+// CIR:   %[[VEC:.*]] = cir.load align(16) %[[GV16]] : !cir.ptr<!cir.vector<16 x !cir.mfp8>>, !cir.vector<16 x !cir.mfp8>
+// CIR:   %[[I:.*]] = cir.load align(4) %{{.*}} : !cir.ptr<!s32i>, !s32i
+// CIR:   %[[EXT:.*]] = cir.vec.extract %[[VEC]][%[[I]] : !s32i] : !cir.vector<16 x !cir.mfp8>
+// CIR:   %[[G:.*]] = cir.get_global @g : !cir.ptr<!cir.mfp8>
+// CIR:   cir.store align(1) %[[EXT]], %[[G]] : !cir.mfp8, !cir.ptr<!cir.mfp8>
+
+// LLVM-LABEL: define dso_local void @extract_element(
+// LLVM:   %[[VEC:.*]] = load <16 x i8>, ptr @gv16, align 16
+// LLVM:   %[[I:.*]] = load i32, ptr %{{.*}}, align 4
+// LLVM:   %[[EXT:.*]] = extractelement <16 x i8> %[[VEC]], i32 %[[I]]
+// LLVM:   %[[CAST:.*]] = insertelement <1 x i8> poison, i8 %[[EXT]], i64 0
+// LLVM:   store <1 x i8> %[[CAST]], ptr @g, align 1
+
+void insert_element(int i) {
+  gv16[i] = g;
+}
+
+// CIR-LABEL: cir.func {{.*}} @insert_element(
+// CIR:   %[[G:.*]] = cir.get_global @g : !cir.ptr<!cir.mfp8>
+// CIR:   %[[G_VAL:.*]] = cir.load align(1) %[[G]] : !cir.ptr<!cir.mfp8>, !cir.mfp8
+// CIR:   %[[GV16:.*]] = cir.get_global @gv16 : !cir.ptr<!cir.vector<16 x !cir.mfp8>>
+// CIR:   %[[I:.*]] = cir.load align(4) %{{.*}} : !cir.ptr<!s32i>, !s32i
+// CIR:   %[[VEC:.*]] = cir.load align(16) %[[GV16]] : !cir.ptr<!cir.vector<16 x !cir.mfp8>>, !cir.vector<16 x !cir.mfp8>
+// CIR:   %[[INS:.*]] = cir.vec.insert %[[G_VAL]], %[[VEC]][%[[I]] : !s32i] : !cir.vector<16 x !cir.mfp8>
+// CIR:   cir.store align(16) %[[INS]], %[[GV16]] : !cir.vector<16 x !cir.mfp8>, !cir.ptr<!cir.vector<16 x !cir.mfp8>>
+
+// LLVM-LABEL: define dso_local void @insert_element(
+// LLVM:   %[[G_VAL:.*]] = load <1 x i8>, ptr @g, align 1
+// LLVM:   %[[I:.*]] = load i32, ptr %{{.*}}, align 4
+// LLVM:   %[[VEC:.*]] = load <16 x i8>, ptr @gv16, align 16
+// LLVM:   %[[ELT:.*]] = bitcast <1 x i8> %[[G_VAL]] to i8
+// LLVM:   %[[INS:.*]] = insertelement <16 x i8> %[[VEC]], i8 %[[ELT]], i32 %[[I]]
+// LLVM:   store <16 x i8> %[[INS]], ptr @gv16, align 16
+
+void vector_init(void) {
+  gv8 = (__Mfloat8x8_t){g, g, g, g, g, g, g, g};
+}
+
+// CIR-LABEL: cir.func {{.*}} @vector_init()
+// CIR:   %[[CL:.*]] = cir.alloca ".compoundliteral" align(8) : !cir.ptr<!cir.vector<8 x !cir.mfp8>>
+// CIR:   %[[VEC:.*]] = cir.vec.create(%{{.*}}, %{{.*}}, %{{.*}}, %{{.*}}, %{{.*}}, %{{.*}}, %{{.*}}, %{{.*}} : !cir.mfp8, !cir.mfp8, !cir.mfp8, !cir.mfp8, !cir.mfp8, !cir.mfp8, !cir.mfp8, !cir.mfp8) : !cir.vector<8 x !cir.mfp8>
+// CIR:   cir.store align(8) %[[VEC]], %[[CL]] : !cir.vector<8 x !cir.mfp8>, !cir.ptr<!cir.vector<8 x !cir.mfp8>>
+// CIR:   %[[VAL:.*]] = cir.load align(8) %[[CL]] : !cir.ptr<!cir.vector<8 x !cir.mfp8>>, !cir.vector<8 x !cir.mfp8>
+// CIR:   %[[GV8:.*]] = cir.get_global @gv8 : !cir.ptr<!cir.vector<8 x !cir.mfp8>>
+// CIR:   cir.store align(8) %[[VAL]], %[[GV8]] : !cir.vector<8 x !cir.mfp8>, !cir.ptr<!cir.vector<8 x !cir.mfp8>>
+
+// LLVM-LABEL: define dso_local void @vector_init()
+// Classic codegen builds the vector by shuffling in each <1 x i8> element.
+// CIR bitcasts each element to i8 and inserts it.
+// LLVM:      %[[CL:.*]] = alloca <8 x i8>, align 8
+// LLVM:      %[[E0:.*]] = load <1 x i8>, ptr @g, align 1
+// LLVMCIR:   %[[E0_I8:.*]] = bitcast <1 x i8> %[[E0]] to i8
+// LLVMCIR:   %{{.*}} = insertelement <8 x i8> poison, i8 %[[E0_I8]], i64 0
+// LLVMCIR:   %[[VEC:.*]] = insertelement <8 x i8> %{{.*}}, i8 %{{.*}}, i64 7
+// OGCG:      %[[VEC:.*]] = shufflevector <8 x i8> %{{.*}}, <8 x i8> %{{.*}}, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 8>
+// LLVM:      store <8 x i8> %[[VEC]], ptr %[[CL]], align 8
+// LLVM:      %[[VAL:.*]] = load <8 x i8>, ptr %[[CL]], align 8
+// LLVM:      store <8 x i8> %[[VAL]], ptr @gv8, align 8
+
+void struct_init(void) {
+  s = (struct S){g};
+}
+
+// CIR-LABEL: cir.func {{.*}} @struct_init()
+// CIR:   %[[CL:.*]] = cir.alloca ".compoundliteral" align(1) : !cir.ptr<!rec_S>
+// CIR:   %[[S:.*]] = cir.get_global @s : !cir.ptr<!rec_S>
+// CIR:   %[[X:.*]] = cir.get_member %[[CL]][0] {name = "x"} : !cir.ptr<!rec_S> -> !cir.ptr<!cir.mfp8>
+// CIR:   %[[G:.*]] = cir.get_global @g : !cir.ptr<!cir.mfp8>
+// CIR:   %[[G_VAL:.*]] = cir.load align(1) %[[G]] : !cir.ptr<!cir.mfp8>, !cir.mfp8
+// CIR:   cir.store align(1) %[[G_VAL]], %[[X]] : !cir.mfp8, !cir.ptr<!cir.mfp8>
+// CIR:   cir.copy %[[CL]] align(1) to %[[S]] align(1) : !cir.ptr<!rec_S>
+
+// LLVM-LABEL: define dso_local void @struct_init()
+// LLVM:      %[[CL:.*]] = alloca %struct.S, align 1
+// LLVM:      %[[X:.*]] = getelementptr inbounds nuw %struct.S, ptr %[[CL]], i32 0, i32 0
+// LLVM:      %[[G_VAL:.*]] = load <1 x i8>, ptr @g, align 1
+// LLVM:      store <1 x i8> %[[G_VAL]], ptr %[[X]], align 1
+// LLVM:      call void @llvm.memcpy.p0.p0.i64(ptr align 1 @s, ptr align 1 %[[CL]], i64 1, i1 false)
+
+void sve_local(void) {
+  __SVMfloat8_t a, b;
+  a = b;
+}
+
+// CIR-LABEL: cir.func {{.*}} @sve_local()
+// CIR:   %[[A:.*]] = cir.alloca "a" align(16) : !cir.ptr<!cir.vector<[16] x !cir.mfp8, sve_data>>
+// CIR:   %[[B:.*]] = cir.alloca "b" align(16) : !cir.ptr<!cir.vector<[16] x !cir.mfp8, sve_data>>
+// CIR:   %[[B_VAL:.*]] = cir.load align(16) %[[B]] : !cir.ptr<!cir.vector<[16] x !cir.mfp8, sve_data>>, !cir.vector<[16] x !cir.mfp8, sve_data>
+// CIR:   cir.store align(16) %[[B_VAL]], %[[A]] : !cir.vector<[16] x !cir.mfp8, sve_data>, !cir.ptr<!cir.vector<[16] x !cir.mfp8, sve_data>>
+
+// LLVM-LABEL: define dso_local void @sve_local()
+// LLVM:   %[[A:.*]] = alloca <vscale x 16 x i8>, align 16
+// LLVM:   %[[B:.*]] = alloca <vscale x 16 x i8>, align 16
+// LLVM:   %[[B_VAL:.*]] = load <vscale x 16 x i8>, ptr %[[B]], align 16
+// LLVM:   store <vscale x 16 x i8> %[[B_VAL]], ptr %[[A]], align 16
diff --git a/clang/test/CIR/IR/invalid-vector.cir b/clang/test/CIR/IR/invalid-vector.cir
index f7606cfd0bcdad..dc0aa5be488161 100644
--- a/clang/test/CIR/IR/invalid-vector.cir
+++ b/clang/test/CIR/IR/invalid-vector.cir
@@ -220,27 +220,27 @@ cir.func private @kind_unknown(!cir.vector<4 x !s32i, neon>)
 
 // -----
 
-// expected-error @below {{an SVE data vector must have 8-, 16-, 32-, or 64-bit integer elements or f16, bf16, float, or double elements}}
+// expected-error @below {{an SVE data vector must have 8-, 16-, 32-, or 64-bit integer elements or mfp8, f16, bf16, float, or double elements}}
 cir.func private @sve_data_bitint(!cir.vector<[4] x !cir.int<s, 32, bitint>, sve_data>)
 
 // -----
 
-// expected-error @below {{an SVE data vector must have 8-, 16-, 32-, or 64-bit integer elements or f16, bf16, float, or double elements}}
+// expected-error @below {{an SVE data vector must have 8-, 16-, 32-, or 64-bit integer elements or mfp8, f16, bf16, float, or double elements}}
 cir.func private @sve_data_s24(!cir.vector<[4] x !cir.int<s, 24>, sve_data>)
 
 // -----
 
-// expected-error @below {{an SVE data vector must have 8-, 16-, 32-, or 64-bit integer elements or f16, bf16, float, or double elements}}
+// expected-error @below {{an SVE data vector must have 8-, 16-, 32-, or 64-bit integer elements or mfp8, f16, bf16, float, or double elements}}
 cir.func private @sve_data_u1(!cir.vector<[16] x !cir.int<u, 1>, sve_data>)
 
 // -----
 
-// expected-error @below {{an SVE data vector must have 8-, 16-, 32-, or 64-bit integer elements or f16, bf16, float, or double elements}}
+// expected-error @below {{an SVE data vector must have 8-, 16-, 32-, or 64-bit integer elements or mfp8, f16, bf16, float, or double elements}}
 cir.func private @sve_data_bool(!cir.vector<16 x !cir.bool, sve_data>)
 
 // -----
 
-// expected-error @below {{an SVE data vector must have 8-, 16-, 32-, or 64-bit integer elements or f16, bf16, float, or double elements}}
+// expected-error @below {{an SVE data vector must have 8-, 16-, 32-, or 64-bit integer elements or mfp8, f16, bf16, float, or double elements}}
 cir.func private @sve_data_f80(!cir.vector<[1] x !cir.long_double<!cir.f80>, sve_data>)
 
 // -----
diff --git a/clang/test/CIR/IR/vector.cir b/clang/test/CIR/IR/vector.cir
index 64d371d9b755c1..9b5b5455102b87 100644
--- a/clang/test/CIR/IR/vector.cir
+++ b/clang/test/CIR/IR/vector.cir
@@ -271,6 +271,8 @@ cir.func @vec_sve_kinds(
     %fixed_data: !cir.vector<16 x !s32i, sve_data>,
     %fixed_float: !cir.vector<8 x !cir.double, sve_data>,
     %fixed_pred: !cir.vector<8 x !cir.int<u, 8>, sve_predicate>,
+    %mfp8_data: !cir.vector<[16] x !cir.mfp8, sve_data>,
+    %fixed_mfp8: !cir.vector<16 x !cir.mfp8, sve_data>,
     %generic: !cir.vector<16 x !s32i>) {
   cir.return
 }
@@ -281,6 +283,8 @@ cir.func @vec_sve_kinds(
 // CHECK-SAME: %{{.*}}: !cir.vector<16 x !s32i, sve_data>,
 // CHECK-SAME: %{{.*}}: !cir.vector<8 x !cir.double, sve_data>,
 // CHECK-SAME: %{{.*}}: !cir.vector<8 x !u8i, sve_predicate>,
+// CHECK-SAME: %{{.*}}: !cir.vector<[16] x !cir.mfp8, sve_data>,
+// CHECK-SAME: %{{.*}}: !cir.vector<16 x !cir.mfp8, sve_data>,
 // CHECK-SAME: %{{.*}}: !cir.vector<16 x !s32i>)
 
 }
diff --git a/clang/test/CIR/Lowering/mfp8.cir b/clang/test/CIR/Lowering/mfp8.cir
new file mode 100644
index 00000000000000..ec44dbd9d63c42
--- /dev/null
+++ b/clang/test/CIR/Lowering/mfp8.cir
@@ -0,0 +1,89 @@
+// RUN: cir-translate %s -cir-to-llvmir --target aarch64-none-linux-gnu --disable-cc-lowering | FileCheck %s
+
+!s32i = !cir.int<s, 32>
+
+module {
+  cir.global external @g = #cir.zero : !cir.mfp8
+  cir.global external @gv = #cir.zero : !cir.vector<16 x !cir.mfp8>
+  cir.global external @gv2 = #cir.zero : !cir.vector<2 x !cir.mfp8>
+
+  cir.func @zero_store() {
+    %0 = cir.alloca "z" align(1) : !cir.ptr<!cir.mfp8>
+    %1 = cir.const #cir.zero : !cir.mfp8
+    cir.store align(1) %1, %0 : !cir.mfp8, !cir.ptr<!cir.mfp8>
+    cir.return
+  }
+
+  cir.func @extract(%arg0: !s32i) {
+    %0 = cir.get_global @gv : !cir.ptr<!cir.vector<16 x !cir.mfp8>>
+    %1 = cir.load align(16) %0 : !cir.ptr<!cir.vector<16 x !cir.mfp8>>, !cir.vector<16 x !cir.mfp8>
+    %2 = cir.vec.extract %1[%arg0 : !s32i] : !cir.vector<16 x !cir.mfp8>
+    %3 = cir.get_global @g : !cir.ptr<!cir.mfp8>
+    cir.store align(1) %2, %3 : !cir.mfp8, !cir.ptr<!cir.mfp8>
+    cir.return
+  }
+
+  cir.func @insert(%arg0: !s32i) {
+    %0 = cir.get_global @g : !cir.ptr<!cir.mfp8>
+    %1 = cir.load align(1) %0 : !cir.ptr<!cir.mfp8>, !cir.mfp8
+    %2 = cir.get_global @gv : !cir.ptr<!cir.vector<16 x !cir.mfp8>>
+    %3 = cir.load align(16) %2 : !cir.ptr<!cir.vector<16 x !cir.mfp8>>, !cir.vector<16 x !cir.mfp8>
+    %4 = cir.vec.insert %1, %3[%arg0 : !s32i] : !cir.vector<16 x !cir.mfp8>
+    cir.store align(16) %4, %2 : !cir.vector<16 x !cir.mfp8>, !cir.ptr<!cir.vector<16 x !cir.mfp8>>
+    cir.return
+  }
+
+  cir.func @create() {
+    %0 = cir.get_global @g : !cir.ptr<!cir.mfp8>
+    %1 = cir.load align(1) %0 : !cir.ptr<!cir.mfp8>, !cir.mfp8
+    %2 = cir.vec.create(%1, %1 : !cir.mfp8, !cir.mfp8) : !cir.vector<2 x !cir.mfp8>
+    %3 = cir.get_global @gv2 : !cir.ptr<!cir.vector<2 x !cir.mfp8>>
+    cir.store align(2) %2, %3 : !cir.vector<2 x !cir.mfp8>, !cir.ptr<!cir.vector<2 x !cir.mfp8>>
+    cir.return
+  }
+
+  cir.func @splat() {
+    %0 = cir.get_global @g : !cir.ptr<!cir.mfp8>
+    %1 = cir.load align(1) %0 : !cir.ptr<!cir.mfp8>, !cir.mfp8
+    %2 = cir.vec.splat %1 : !cir.mfp8, !cir.vector<16 x !cir.mfp8>
+    %3 = cir.get_global @gv : !cir.ptr<!cir.vector<16 x !cir.mfp8>>
+    cir.store align(16) %2, %3 : !cir.vector<16 x !cir.mfp8>, !cir.ptr<!cir.vector<16 x !cir.mfp8>>
+    cir.return
+  }
+}
+
+// CHECK: @g = global <1 x i8> zeroinitializer
+// CHECK: @gv = global <16 x i8> zeroinitializer
+// CHECK: @gv2 = global <2 x i8> zeroinitializer
+
+// CHECK-LABEL: define void @zero_store()
+// CHECK:         %[[Z:.*]] = alloca <1 x i8>, align 1
+// CHECK:         store <1 x i8> zeroinitializer, ptr %[[Z]], align 1
+
+// CHECK-LABEL: define void @extract(
+// CHECK:         %[[VEC:.*]] = load <16 x i8>, ptr @gv, align 16
+// CHECK:         %[[EXT:.*]] = extractelement <16 x i8> %[[VEC]], i32 %{{.*}}
+// CHECK:         %[[CAST:.*]] = insertelement <1 x i8> poison, i8 %[[EXT]], i64 0
+// CHECK:         store <1 x i8> %[[CAST]], ptr @g, align 1
+
+// CHECK-LABEL: define void @insert(
+// CHECK:         %[[VAL:.*]] = load <1 x i8>, ptr @g, align 1
+// CHECK:         %[[VEC:.*]] = load <16 x i8>, ptr @gv, align 16
+// CHECK:         %[[ELT:.*]] = bitcast <1 x i8> %[[VAL]] to i8
+// CHECK:         %[[INS:.*]] = insertelement <16 x i8> %[[VEC]], i8 %[[ELT]], i32 %{{.*}}
+// CHECK:         store <16 x i8> %[[INS]], ptr @gv, align 16
+
+// CHECK-LABEL: define void @create()
+// CHECK:         %[[VAL:.*]] = load <1 x i8>, ptr @g, align 1
+// CHECK:         %[[ELT0:.*]] = bitcast <1 x i8> %[[VAL]] to i8
+// CHECK:         %[[V0:.*]] = insertelement <2 x i8> poison, i8 %[[ELT0]], i64 0
+// CHECK:         %[[ELT1:.*]] = bitcast <1 x i8> %[[VAL]] to i8
+// CHECK:         %[[V1:.*]] = insertelement <2 x i8> %[[V0]], i8 %[[ELT1]], i64 1
+// CHECK:         store <2 x i8> %[[V1]], ptr @gv2, align 2
+
+// CHECK-LABEL: define void @splat()
+// CHECK:         %[[VAL:.*]] = load <1 x i8>, ptr @g, align 1
+// CHECK:         %[[ELT:.*]] = bitcast <1 x i8> %[[VAL]] to i8
+// CHECK:         %[[INS:.*]] = insertelement <16 x i8> poison, i8 %[[ELT]], i64 0
+// CHECK:         %[[SPLAT:.*]] = shufflevector <16 x i8> %[[INS]], <16 x i8> poison, <16 x i32> zeroinitializer
+// CHECK:         store <16 x i8> %[[SPLAT]], ptr @gv, align 16

>From fe3c36e0c9fc3bba904218a57d30af1db863098d Mon Sep 17 00:00:00 2001
From: Andy Kaylor <akaylor at nvidia.com>
Date: Mon, 23 Nov 2026 15:49:02 -0800
Subject: [PATCH 2/3] Update Neon builtin handling and tests

---
 .../lib/CIR/CodeGen/CIRGenBuiltinAArch64.cpp  |   9 +-
 clang/test/CodeGen/AArch64/neon/getset.c      |  10 +-
 clang/test/CodeGen/AArch64/neon/intrinsics.c  |  48 +++++----
 clang/test/CodeGen/AArch64/neon/load.c        |  38 +++----
 clang/test/CodeGen/AArch64/neon/perm.c        | 102 +++++++++---------
 clang/test/CodeGen/AArch64/neon/store.c       |  56 +++++-----
 6 files changed, 142 insertions(+), 121 deletions(-)

diff --git a/clang/lib/CIR/CodeGen/CIRGenBuiltinAArch64.cpp b/clang/lib/CIR/CodeGen/CIRGenBuiltinAArch64.cpp
index 7ccf9ff1e1ee3e..25839df96b4f37 100644
--- a/clang/lib/CIR/CodeGen/CIRGenBuiltinAArch64.cpp
+++ b/clang/lib/CIR/CodeGen/CIRGenBuiltinAArch64.cpp
@@ -781,6 +781,9 @@ static mlir::Value emitNeonRShiftImm(CIRGenFunction &cgf, mlir::Value shiftVec,
 
 static cir::VectorType getIntVecFromVecTy(CIRGenBuilderTy &builder,
                                           cir::VectorType vecTy) {
+  if (mlir::isa<cir::MFloat8Type>(vecTy.getElementType()))
+    return cir::VectorType::get(builder.getSInt8Ty(), vecTy.getSize(),
+                                vecTy.getKind());
   if (!cir::isAnyFloatingPointType(vecTy.getElementType()))
     return vecTy;
 
@@ -3769,7 +3772,11 @@ CIRGenFunction::emitAArch64BuiltinExpr(unsigned builtinID, const CallExpr *expr,
     return mlir::Value{};
   case NEON::BI__builtin_neon_vst1_lane_v:
   case NEON::BI__builtin_neon_vst1q_lane_v: {
-    ops[1] = builder.createBitcast(ops[1], ty);
+    // An mfp8 lane is stored as an i8.
+    cir::VectorType vecTy = ty;
+    if (mlir::isa<cir::MFloat8Type>(ty.getElementType()))
+      vecTy = getIntVecFromVecTy(builder, ty);
+    ops[1] = builder.createBitcast(ops[1], vecTy);
     mlir::Value scalar = builder.createExtractElement(
         loc, ops[1], static_cast<uint64_t>(getIntValueFromConstOp(ops[2])));
     builder.createStore(loc, scalar,
diff --git a/clang/test/CodeGen/AArch64/neon/getset.c b/clang/test/CodeGen/AArch64/neon/getset.c
index 79a4922c971f33..80f03670283ed9 100644
--- a/clang/test/CodeGen/AArch64/neon/getset.c
+++ b/clang/test/CodeGen/AArch64/neon/getset.c
@@ -1,8 +1,10 @@
 // REQUIRES: aarch64-registered-target || arm-registered-target
 
+// FIXME: Remove -fno-clangir-call-conv-lowering from the RUN lines once
+// calling-convention lowering is implemented for the mfp8 types.
 // RUN:                   %clang_cc1_cg_arm64_neon           -emit-llvm  %s -disable-O0-optnone | opt -S -passes=mem2reg,sroa | FileCheck %s --check-prefixes=ALL,LLVM
-// RUN: %if cir-enabled %{%clang_cc1_cg_arm64_neon -fclangir -emit-llvm  %s -disable-O0-optnone | opt -S -passes=mem2reg,sroa | FileCheck %s --check-prefixes=ALL,LLVM %}
-// RUN: %if cir-enabled %{%clang_cc1_cg_arm64_neon -fclangir -emit-cir   %s -disable-O0-optnone |                               FileCheck %s --check-prefixes=ALL,CIR %}
+// RUN: %if cir-enabled %{%clang_cc1_cg_arm64_neon -fclangir -fno-clangir-call-conv-lowering -emit-llvm  %s -disable-O0-optnone | opt -S -passes=mem2reg,sroa | FileCheck %s --check-prefixes=ALL,LLVM %}
+// RUN: %if cir-enabled %{%clang_cc1_cg_arm64_neon -fclangir -fno-clangir-call-conv-lowering -emit-cir   %s -disable-O0-optnone |                               FileCheck %s --check-prefixes=ALL,CIR %}
 
 //=============================================================================
 // NOTES
@@ -742,7 +744,7 @@ float16x4_t test_vset_lane_f16(float16_t a, float16x4_t b) {
 
 // ALL-LABEL: @test_vset_lane_mf8(
 mfloat8x8_t test_vset_lane_mf8(mfloat8_t a, mfloat8x8_t b) {
-// CIR: cir.vec.insert %{{.*}}, %{{.*}}[%{{.*}} : !s32i] : !cir.vector<8 x !u8i>
+// CIR: cir.vec.insert %{{.*}}, %{{.*}}[%{{.*}} : !s32i] : !cir.vector<8 x !cir.mfp8>
 
 // LLVM-SAME: {{.*}}<8 x i8> {{.*}}[[B:%.*]])
 // LLVM: [[VSET_LANE:%.*]] = insertelement <8 x i8> [[B]], i8 {{.*}}, i32 7
@@ -895,7 +897,7 @@ float16x8_t test_vsetq_lane_f16(float16_t a, float16x8_t b) {
 
 // ALL-LABEL: @test_vsetq_lane_mf8(
 mfloat8x16_t test_vsetq_lane_mf8(mfloat8_t a, mfloat8x16_t b) {
-// CIR: cir.vec.insert %{{.*}}, %{{.*}}[%{{.*}} : !s32i] : !cir.vector<16 x !u8i>
+// CIR: cir.vec.insert %{{.*}}, %{{.*}}[%{{.*}} : !s32i] : !cir.vector<16 x !cir.mfp8>
 
 // LLVM-SAME: {{.*}}<16 x i8> {{.*}}[[B:%.*]])
 // LLVM: [[VSET_LANE:%.*]] = insertelement <16 x i8> [[B]], i8 {{.*}}, i32 15
diff --git a/clang/test/CodeGen/AArch64/neon/intrinsics.c b/clang/test/CodeGen/AArch64/neon/intrinsics.c
index 5d699610e62265..02befefb2303e4 100644
--- a/clang/test/CodeGen/AArch64/neon/intrinsics.c
+++ b/clang/test/CodeGen/AArch64/neon/intrinsics.c
@@ -1,8 +1,10 @@
 // REQUIRES: aarch64-registered-target || arm-registered-target
 
+// FIXME: Remove -fno-clangir-call-conv-lowering from the RUN lines once
+// calling-convention lowering is implemented for the mfp8 types.
 // RUN:                   %clang_cc1_cg_arm64_neon           -emit-llvm %s -disable-O0-optnone | opt -S -passes=mem2reg,sroa | FileCheck %s --check-prefixes=ALL,LLVM
-// RUN: %if cir-enabled %{%clang_cc1_cg_arm64_neon -fclangir -emit-llvm %s -disable-O0-optnone | opt -S -passes=mem2reg,sroa | FileCheck %s --check-prefixes=ALL,LLVM %}
-// RUN: %if cir-enabled %{%clang_cc1_cg_arm64_neon -fclangir -emit-cir  %s -disable-O0-optnone |                               FileCheck %s --check-prefixes=ALL,CIR %}
+// RUN: %if cir-enabled %{%clang_cc1_cg_arm64_neon -fclangir -fno-clangir-call-conv-lowering -emit-llvm %s -disable-O0-optnone | opt -S -passes=mem2reg,sroa | FileCheck %s --check-prefixes=ALL,LLVM %}
+// RUN: %if cir-enabled %{%clang_cc1_cg_arm64_neon -fclangir -fno-clangir-call-conv-lowering -emit-cir  %s -disable-O0-optnone |                               FileCheck %s --check-prefixes=ALL,CIR %}
 
 //=============================================================================
 // NOTES
@@ -4985,16 +4987,17 @@ float64x2_t test_vbslq_f64(uint64x2_t v1, float64x2_t v2, float64x2_t v3) {
 // LLVM-LABEL: @test_vbsl_mf8(
 // CIR-LABEL: @vbsl_mf8(
 mfloat8x8_t test_vbsl_mf8(uint8x8_t v1, mfloat8x8_t v2, mfloat8x8_t v3) {
-  // CIR: cir.cast bitcast %{{.*}} : !cir.ptr<!cir.vector<8 x !u8i>> -> !cir.ptr<!cir.vector<8 x !s8i>>
-  // CIR: cir.cast bitcast %{{.*}} : !cir.ptr<!cir.vector<8 x !u8i>> -> !cir.ptr<!cir.vector<8 x !s8i>>
-  // CIR: cir.cast bitcast %{{.*}} : !cir.ptr<!cir.vector<8 x !u8i>> -> !cir.ptr<!cir.vector<8 x !s8i>>
-  // CIR: [[MASK:%.*]] = cir.cast bitcast %{{.*}} : !cir.vector<8 x !s8i> -> !cir.vector<8 x !u8i>
-  // CIR: [[VAL1:%.*]] = cir.cast bitcast %{{.*}} : !cir.vector<8 x !s8i> -> !cir.vector<8 x !u8i>
-  // CIR: [[VAL2:%.*]] = cir.cast bitcast %{{.*}} : !cir.vector<8 x !s8i> -> !cir.vector<8 x !u8i>
-  // CIR: [[AND:%.*]] = cir.and [[MASK]], [[VAL1]] : !cir.vector<8 x !u8i>
-  // CIR: [[NOT:%.*]] = cir.not [[MASK]] : !cir.vector<8 x !u8i>
-  // CIR: [[AND2:%.*]] = cir.and [[NOT]], [[VAL2]] : !cir.vector<8 x !u8i>
-  // CIR: [[RES:%.*]] = cir.or [[AND]], [[AND2]] : !cir.vector<8 x !u8i>
+  // CIR: [[MASK_PTR:%.*]] = cir.cast bitcast %{{.*}} : !cir.ptr<!cir.vector<8 x !u8i>> -> !cir.ptr<!cir.vector<8 x !s8i>>
+  // CIR: [[MASK:%.*]] = cir.load {{.*}}[[MASK_PTR]] : !cir.ptr<!cir.vector<8 x !s8i>>, !cir.vector<8 x !s8i>
+  // CIR: [[VAL1_PTR:%.*]] = cir.cast bitcast %{{.*}} : !cir.ptr<!cir.vector<8 x !cir.mfp8>> -> !cir.ptr<!cir.vector<8 x !s8i>>
+  // CIR: [[VAL1:%.*]] = cir.load {{.*}}[[VAL1_PTR]] : !cir.ptr<!cir.vector<8 x !s8i>>, !cir.vector<8 x !s8i>
+  // CIR: [[VAL2_PTR:%.*]] = cir.cast bitcast %{{.*}} : !cir.ptr<!cir.vector<8 x !cir.mfp8>> -> !cir.ptr<!cir.vector<8 x !s8i>>
+  // CIR: [[VAL2:%.*]] = cir.load {{.*}}[[VAL2_PTR]] : !cir.ptr<!cir.vector<8 x !s8i>>, !cir.vector<8 x !s8i>
+  // CIR: [[AND:%.*]] = cir.and [[MASK]], [[VAL1]] : !cir.vector<8 x !s8i>
+  // CIR: [[NOT:%.*]] = cir.not [[MASK]] : !cir.vector<8 x !s8i>
+  // CIR: [[AND2:%.*]] = cir.and [[NOT]], [[VAL2]] : !cir.vector<8 x !s8i>
+  // CIR: [[RES:%.*]] = cir.or [[AND]], [[AND2]] : !cir.vector<8 x !s8i>
+  // CIR: cir.cast bitcast [[RES]] : !cir.vector<8 x !s8i> -> !cir.vector<8 x !cir.mfp8>
 
   // LLVM-SAME: <8 x i8> {{.*}} [[V1:%.*]], <8 x i8> [[V2:%.*]], <8 x i8> [[V3:%.*]]) {{.*}} {
   // LLVM:      [[VBSL_I:%.*]] = and <8 x i8> [[V1]], [[V2]]
@@ -5008,16 +5011,17 @@ mfloat8x8_t test_vbsl_mf8(uint8x8_t v1, mfloat8x8_t v2, mfloat8x8_t v3) {
 // LLVM-LABEL: @test_vbslq_mf8(
 // CIR-LABEL: @vbslq_mf8(
 mfloat8x16_t test_vbslq_mf8(uint8x16_t v1, mfloat8x16_t v2, mfloat8x16_t v3) {
-  // CIR: cir.cast bitcast %{{.*}} : !cir.ptr<!cir.vector<16 x !u8i>> -> !cir.ptr<!cir.vector<16 x !s8i>>
-  // CIR: cir.cast bitcast %{{.*}} : !cir.ptr<!cir.vector<16 x !u8i>> -> !cir.ptr<!cir.vector<16 x !s8i>>
-  // CIR: cir.cast bitcast %{{.*}} : !cir.ptr<!cir.vector<16 x !u8i>> -> !cir.ptr<!cir.vector<16 x !s8i>>
-  // CIR: [[MASK:%.*]] = cir.cast bitcast %{{.*}} : !cir.vector<16 x !s8i> -> !cir.vector<16 x !u8i>
-  // CIR: [[VAL1:%.*]] = cir.cast bitcast %{{.*}} : !cir.vector<16 x !s8i> -> !cir.vector<16 x !u8i>
-  // CIR: [[VAL2:%.*]] = cir.cast bitcast %{{.*}} : !cir.vector<16 x !s8i> -> !cir.vector<16 x !u8i>
-  // CIR: [[AND:%.*]] = cir.and [[MASK]], [[VAL1]] : !cir.vector<16 x !u8i>
-  // CIR: [[NOT:%.*]] = cir.not [[MASK]] : !cir.vector<16 x !u8i>
-  // CIR: [[AND2:%.*]] = cir.and [[NOT]], [[VAL2]] : !cir.vector<16 x !u8i>
-  // CIR: [[RES:%.*]] = cir.or [[AND]], [[AND2]] : !cir.vector<16 x !u8i>
+  // CIR: [[MASK_PTR:%.*]] = cir.cast bitcast %{{.*}} : !cir.ptr<!cir.vector<16 x !u8i>> -> !cir.ptr<!cir.vector<16 x !s8i>>
+  // CIR: [[MASK:%.*]] = cir.load {{.*}}[[MASK_PTR]] : !cir.ptr<!cir.vector<16 x !s8i>>, !cir.vector<16 x !s8i>
+  // CIR: [[VAL1_PTR:%.*]] = cir.cast bitcast %{{.*}} : !cir.ptr<!cir.vector<16 x !cir.mfp8>> -> !cir.ptr<!cir.vector<16 x !s8i>>
+  // CIR: [[VAL1:%.*]] = cir.load {{.*}}[[VAL1_PTR]] : !cir.ptr<!cir.vector<16 x !s8i>>, !cir.vector<16 x !s8i>
+  // CIR: [[VAL2_PTR:%.*]] = cir.cast bitcast %{{.*}} : !cir.ptr<!cir.vector<16 x !cir.mfp8>> -> !cir.ptr<!cir.vector<16 x !s8i>>
+  // CIR: [[VAL2:%.*]] = cir.load {{.*}}[[VAL2_PTR]] : !cir.ptr<!cir.vector<16 x !s8i>>, !cir.vector<16 x !s8i>
+  // CIR: [[AND:%.*]] = cir.and [[MASK]], [[VAL1]] : !cir.vector<16 x !s8i>
+  // CIR: [[NOT:%.*]] = cir.not [[MASK]] : !cir.vector<16 x !s8i>
+  // CIR: [[AND2:%.*]] = cir.and [[NOT]], [[VAL2]] : !cir.vector<16 x !s8i>
+  // CIR: [[RES:%.*]] = cir.or [[AND]], [[AND2]] : !cir.vector<16 x !s8i>
+  // CIR: cir.cast bitcast [[RES]] : !cir.vector<16 x !s8i> -> !cir.vector<16 x !cir.mfp8>
 
   // LLVM-SAME: <16 x i8> {{.*}} [[V1:%.*]], <16 x i8> [[V2:%.*]], <16 x i8> [[V3:%.*]]) {{.*}} {
   // LLVM:      [[VBSL_I:%.*]] = and <16 x i8> [[V1]], [[V2]]
diff --git a/clang/test/CodeGen/AArch64/neon/load.c b/clang/test/CodeGen/AArch64/neon/load.c
index 0c130e434b17c8..7d77c75205ada1 100644
--- a/clang/test/CodeGen/AArch64/neon/load.c
+++ b/clang/test/CodeGen/AArch64/neon/load.c
@@ -1,8 +1,10 @@
 // REQUIRES: aarch64-registered-target || arm-registered-target
 
+// FIXME: Remove -fno-clangir-call-conv-lowering from the RUN lines once
+// calling-convention lowering is implemented for the mfp8 types.
 // RUN:                   %clang_cc1_cg_arm64_neon           -emit-llvm %s -disable-O0-optnone | opt -S -passes=sroa,instcombine | FileCheck %s --check-prefixes=ALL,LLVM
-// RUN: %if cir-enabled %{%clang_cc1_cg_arm64_neon -fclangir -emit-llvm %s -disable-O0-optnone | opt -S -passes=sroa,instcombine | FileCheck %s --check-prefixes=ALL,LLVM %}
-// RUN: %if cir-enabled %{%clang_cc1_cg_arm64_neon -fclangir -emit-cir  %s -disable-O0-optnone |                                   FileCheck %s --check-prefixes=ALL,CIR %}
+// RUN: %if cir-enabled %{%clang_cc1_cg_arm64_neon -fclangir -fno-clangir-call-conv-lowering -emit-llvm %s -disable-O0-optnone | opt -S -passes=sroa,instcombine | FileCheck %s --check-prefixes=ALL,LLVM %}
+// RUN: %if cir-enabled %{%clang_cc1_cg_arm64_neon -fclangir -fno-clangir-call-conv-lowering -emit-cir  %s -disable-O0-optnone |                                   FileCheck %s --check-prefixes=ALL,CIR %}
 
 #include <arm_neon.h>
 
@@ -43,7 +45,7 @@ float64x2_t test_vld1q_f64(float64_t const *a) {
 
 // ALL-LABEL: @test_vld1q_mf8(
 mfloat8x16_t test_vld1q_mf8(mfloat8_t const *a) {
-// CIR: cir.load align(1) {{.*}} : !cir.ptr<!cir.vector<16 x !u8i>>, !cir.vector<16 x !u8i>
+// CIR: cir.load align(1) {{.*}} : !cir.ptr<!cir.vector<16 x !cir.mfp8>>, !cir.vector<16 x !cir.mfp8>
 
 // LLVM-SAME: ptr {{.*}} [[A:%.*]])
 // LLVM: [[TMP0:%.*]] = load <16 x i8>, ptr [[A]], align 1
@@ -193,7 +195,7 @@ float64x1_t test_vld1_f64(float64_t const *a) {
 
 // ALL-LABEL: @test_vld1_mf8(
 mfloat8x8_t test_vld1_mf8(mfloat8_t const *a) {
-// CIR: cir.load align(1) {{.*}} : !cir.ptr<!cir.vector<8 x !u8i>>, !cir.vector<8 x !u8i>
+// CIR: cir.load align(1) {{.*}} : !cir.ptr<!cir.vector<8 x !cir.mfp8>>, !cir.vector<8 x !cir.mfp8>
 
 // LLVM-SAME: ptr {{.*}} [[A:%.*]])
 // LLVM: [[TMP0:%.*]] = load <8 x i8>, ptr [[A]], align 1
@@ -1511,8 +1513,8 @@ float64x2_t test_vld1q_lane_f64(float64_t  *a, float64x2_t b) {
 // ALL-LABEL: @test_vld1q_lane_mf8(
 mfloat8x16_t test_vld1q_lane_mf8(mfloat8_t  *a, mfloat8x16_t b) {
 // CIR: [[IDX:%.*]] = cir.const #cir.int<15> : !s32i
-// CIR: [[SCALAR:%.*]] = cir.load align(1) {{.*}} : !cir.ptr<!u8i>, !u8i
-// CIR: cir.vec.insert [[SCALAR]], {{.*}}[[IDX]] : !s32i] : !cir.vector<16 x !u8i>
+// CIR: [[SCALAR:%.*]] = cir.load align(1) {{.*}} : !cir.ptr<!cir.mfp8>, !cir.mfp8
+// CIR: cir.vec.insert [[SCALAR]], {{.*}}[[IDX]] : !s32i] : !cir.vector<16 x !cir.mfp8>
 
 // LLVM-SAME: ptr {{.*}} [[A:%.*]], <16 x i8> [[B:%.*]])
 // LLVM: [[TMP0:%.*]] = load i8, ptr [[A]], align 1
@@ -1706,8 +1708,8 @@ float64x1_t test_vld1_lane_f64(float64_t  *a, float64x1_t b) {
 // ALL-LABEL: @test_vld1_lane_mf8(
 mfloat8x8_t test_vld1_lane_mf8(mfloat8_t  *a, mfloat8x8_t b) {
 // CIR: [[IDX:%.*]] = cir.const #cir.int<7> : !s32i
-// CIR: [[SCALAR:%.*]] = cir.load align(1) {{.*}} : !cir.ptr<!u8i>, !u8i
-// CIR: cir.vec.insert [[SCALAR]], {{.*}}[[IDX]] : !s32i] : !cir.vector<8 x !u8i>
+// CIR: [[SCALAR:%.*]] = cir.load align(1) {{.*}} : !cir.ptr<!cir.mfp8>, !cir.mfp8
+// CIR: cir.vec.insert [[SCALAR]], {{.*}}[[IDX]] : !s32i] : !cir.vector<8 x !cir.mfp8>
 
 // LLVM-SAME: ptr {{.*}} [[A:%.*]], <8 x i8> [[B:%.*]])
 // LLVM: [[TMP0:%.*]] = load i8, ptr [[A]], align 1
@@ -1897,8 +1899,8 @@ float64x2_t test_vld1q_dup_f64(float64_t  *a) {
 
 // ALL-LABEL: @test_vld1q_dup_mf8(
 mfloat8x16_t test_vld1q_dup_mf8(mfloat8_t  *a) {
-// CIR: [[SCALAR:%.*]] = cir.load align(1) {{.*}} : !cir.ptr<!u8i>, !u8i
-// CIR: cir.vec.splat [[SCALAR]] : !u8i, !cir.vector<16 x !u8i>
+// CIR: [[SCALAR:%.*]] = cir.load align(1) {{.*}} : !cir.ptr<!cir.mfp8>, !cir.mfp8
+// CIR: cir.vec.splat [[SCALAR]] : !cir.mfp8, !cir.vector<16 x !cir.mfp8>
 
 // LLVM-SAME: ptr {{.*}} [[A:%.*]])
 // LLVM: [[TMP0:%.*]] = load i8, ptr [[A]], align 1
@@ -2088,8 +2090,8 @@ float64x1_t test_vld1_dup_f64(float64_t  *a) {
 
 // ALL-LABEL: @test_vld1_dup_mf8(
 mfloat8x8_t test_vld1_dup_mf8(mfloat8_t  *a) {
-// CIR: [[SCALAR:%.*]] = cir.load align(1) {{.*}} : !cir.ptr<!u8i>, !u8i
-// CIR: cir.vec.splat [[SCALAR]] : !u8i, !cir.vector<8 x !u8i>
+// CIR: [[SCALAR:%.*]] = cir.load align(1) {{.*}} : !cir.ptr<!cir.mfp8>, !cir.mfp8
+// CIR: cir.vec.splat [[SCALAR]] : !cir.mfp8, !cir.vector<8 x !cir.mfp8>
 
 // LLVM-SAME: ptr {{.*}} [[A:%.*]])
 // LLVM: [[TMP0:%.*]] = load i8, ptr [[A]], align 1
@@ -3491,7 +3493,7 @@ float64x2x2_t test_vld2q_lane_f64(float64_t  *a, float64x2x2_t b) {
 
 // ALL-LABEL: @test_vld2q_lane_mf8(
 mfloat8x16x2_t test_vld2q_lane_mf8(mfloat8_t  *a, mfloat8x16x2_t b) {
-// CIR: [[VLD:%.*]] = cir.call_llvm_intrinsic "aarch64.neon.ld2lane" {{.*}} : (!cir.vector<16 x !u8i>, !cir.vector<16 x !u8i>, !s64i, !cir.ptr<!void>) -> [[STY:!rec_anon_struct[0-9]*]]
+// CIR: [[VLD:%.*]] = cir.call_llvm_intrinsic "aarch64.neon.ld2lane" {{.*}} : (!cir.vector<16 x !cir.mfp8>, !cir.vector<16 x !cir.mfp8>, !s64i, !cir.ptr<!void>) -> [[STY:!rec_anon_struct[0-9]*]]
 // CIR: cir.store align(16) [[VLD]], {{.*}} : [[STY]], !cir.ptr<[[STY]]>
 
 // LLVM-SAME: ptr {{[a-z ]*}}[[A:%[a-z0-9_.]+]],
@@ -3659,7 +3661,7 @@ float64x1x2_t test_vld2_lane_f64(float64_t  *a, float64x1x2_t b) {
 
 // ALL-LABEL: @test_vld2_lane_mf8(
 mfloat8x8x2_t test_vld2_lane_mf8(mfloat8_t  *a, mfloat8x8x2_t b) {
-// CIR: [[VLD:%.*]] = cir.call_llvm_intrinsic "aarch64.neon.ld2lane" {{.*}} : (!cir.vector<8 x !u8i>, !cir.vector<8 x !u8i>, !s64i, !cir.ptr<!void>) -> [[STY:!rec_anon_struct[0-9]*]]
+// CIR: [[VLD:%.*]] = cir.call_llvm_intrinsic "aarch64.neon.ld2lane" {{.*}} : (!cir.vector<8 x !cir.mfp8>, !cir.vector<8 x !cir.mfp8>, !s64i, !cir.ptr<!void>) -> [[STY:!rec_anon_struct[0-9]*]]
 // CIR: cir.store align(8) [[VLD]], {{.*}} : [[STY]], !cir.ptr<[[STY]]>
 
 // LLVM-SAME: ptr {{[a-z ]*}}[[A:%[a-z0-9_.]+]],
@@ -3824,7 +3826,7 @@ float64x2x3_t test_vld3q_lane_f64(float64_t  *a, float64x2x3_t b) {
 
 // ALL-LABEL: @test_vld3q_lane_mf8(
 mfloat8x16x3_t test_vld3q_lane_mf8(mfloat8_t  *a, mfloat8x16x3_t b) {
-// CIR: [[VLD:%.*]] = cir.call_llvm_intrinsic "aarch64.neon.ld3lane" {{.*}} : (!cir.vector<16 x !u8i>, !cir.vector<16 x !u8i>, !cir.vector<16 x !u8i>, !s64i, !cir.ptr<!void>) -> [[STY:!rec_anon_struct[0-9]*]]
+// CIR: [[VLD:%.*]] = cir.call_llvm_intrinsic "aarch64.neon.ld3lane" {{.*}} : (!cir.vector<16 x !cir.mfp8>, !cir.vector<16 x !cir.mfp8>, !cir.vector<16 x !cir.mfp8>, !s64i, !cir.ptr<!void>) -> [[STY:!rec_anon_struct[0-9]*]]
 // CIR: cir.store align(16) [[VLD]], {{.*}} : [[STY]], !cir.ptr<[[STY]]>
 
 // LLVM-SAME: ptr {{[a-z ]*}}[[A:%[a-z0-9_.]+]],
@@ -4019,7 +4021,7 @@ float64x1x3_t test_vld3_lane_f64(float64_t  *a, float64x1x3_t b) {
 
 // ALL-LABEL: @test_vld3_lane_mf8(
 mfloat8x8x3_t test_vld3_lane_mf8(mfloat8_t  *a, mfloat8x8x3_t b) {
-// CIR: [[VLD:%.*]] = cir.call_llvm_intrinsic "aarch64.neon.ld3lane" {{.*}} : (!cir.vector<8 x !u8i>, !cir.vector<8 x !u8i>, !cir.vector<8 x !u8i>, !s64i, !cir.ptr<!void>) -> [[STY:!rec_anon_struct[0-9]*]]
+// CIR: [[VLD:%.*]] = cir.call_llvm_intrinsic "aarch64.neon.ld3lane" {{.*}} : (!cir.vector<8 x !cir.mfp8>, !cir.vector<8 x !cir.mfp8>, !cir.vector<8 x !cir.mfp8>, !s64i, !cir.ptr<!void>) -> [[STY:!rec_anon_struct[0-9]*]]
 // CIR: cir.store align(8) [[VLD]], {{.*}} : [[STY]], !cir.ptr<[[STY]]>
 
 // LLVM-SAME: ptr {{[a-z ]*}}[[A:%[a-z0-9_.]+]],
@@ -4225,7 +4227,7 @@ float64x2x4_t test_vld4q_lane_f64(float64_t  *a, float64x2x4_t b) {
 
 // ALL-LABEL: @test_vld4q_lane_mf8(
 mfloat8x16x4_t test_vld4q_lane_mf8(mfloat8_t  *a, mfloat8x16x4_t b) {
-// CIR: [[VLD:%.*]] = cir.call_llvm_intrinsic "aarch64.neon.ld4lane" {{.*}} : (!cir.vector<16 x !u8i>, !cir.vector<16 x !u8i>, !cir.vector<16 x !u8i>, !cir.vector<16 x !u8i>, !s64i, !cir.ptr<!void>) -> [[STY:!rec_anon_struct[0-9]*]]
+// CIR: [[VLD:%.*]] = cir.call_llvm_intrinsic "aarch64.neon.ld4lane" {{.*}} : (!cir.vector<16 x !cir.mfp8>, !cir.vector<16 x !cir.mfp8>, !cir.vector<16 x !cir.mfp8>, !cir.vector<16 x !cir.mfp8>, !s64i, !cir.ptr<!void>) -> [[STY:!rec_anon_struct[0-9]*]]
 // CIR: cir.store align(16) [[VLD]], {{.*}} : [[STY]], !cir.ptr<[[STY]]>
 
 // LLVM-SAME: ptr {{[a-z ]*}}[[A:%[a-z0-9_.]+]],
@@ -4435,7 +4437,7 @@ float64x1x4_t test_vld4_lane_f64(float64_t  *a, float64x1x4_t b) {
 
 // ALL-LABEL: @test_vld4_lane_mf8(
 mfloat8x8x4_t test_vld4_lane_mf8(mfloat8_t  *a, mfloat8x8x4_t b) {
-// CIR: [[VLD:%.*]] = cir.call_llvm_intrinsic "aarch64.neon.ld4lane" {{.*}} : (!cir.vector<8 x !u8i>, !cir.vector<8 x !u8i>, !cir.vector<8 x !u8i>, !cir.vector<8 x !u8i>, !s64i, !cir.ptr<!void>) -> [[STY:!rec_anon_struct[0-9]*]]
+// CIR: [[VLD:%.*]] = cir.call_llvm_intrinsic "aarch64.neon.ld4lane" {{.*}} : (!cir.vector<8 x !cir.mfp8>, !cir.vector<8 x !cir.mfp8>, !cir.vector<8 x !cir.mfp8>, !cir.vector<8 x !cir.mfp8>, !s64i, !cir.ptr<!void>) -> [[STY:!rec_anon_struct[0-9]*]]
 // CIR: cir.store align(8) [[VLD]], {{.*}} : [[STY]], !cir.ptr<[[STY]]>
 
 // LLVM-SAME: ptr {{[a-z ]*}}[[A:%[a-z0-9_.]+]],
diff --git a/clang/test/CodeGen/AArch64/neon/perm.c b/clang/test/CodeGen/AArch64/neon/perm.c
index d18ce4bc4d4ee4..5fba2c148c3392 100644
--- a/clang/test/CodeGen/AArch64/neon/perm.c
+++ b/clang/test/CodeGen/AArch64/neon/perm.c
@@ -1,8 +1,10 @@
 // REQUIRES: aarch64-registered-target || arm-registered-target
 
+// FIXME: Remove -fno-clangir-call-conv-lowering from the RUN lines once
+// calling-convention lowering is implemented for the mfp8 types.
 // RUN:                   %clang_cc1_cg_arm64_neon -disable-O0-optnone -flax-vector-conversions=none           -emit-llvm -o - %s | opt -S -passes=mem2reg,sroa,instcombine | FileCheck %s --check-prefixes=LLVM
-// RUN: %if cir-enabled %{%clang_cc1_cg_arm64_neon -disable-O0-optnone -flax-vector-conversions=none -fclangir -emit-llvm -o - %s | opt -S -passes=mem2reg,sroa,instcombine | FileCheck %s --check-prefixes=LLVM %}
-// RUN: %if cir-enabled %{%clang_cc1_cg_arm64_neon -disable-O0-optnone -flax-vector-conversions=none -fclangir -emit-cir  -o - %s |                               FileCheck %s --check-prefixes=CIR %}
+// RUN: %if cir-enabled %{%clang_cc1_cg_arm64_neon -disable-O0-optnone -flax-vector-conversions=none -fclangir -fno-clangir-call-conv-lowering -emit-llvm -o - %s | opt -S -passes=mem2reg,sroa,instcombine | FileCheck %s --check-prefixes=LLVM %}
+// RUN: %if cir-enabled %{%clang_cc1_cg_arm64_neon -disable-O0-optnone -flax-vector-conversions=none -fclangir -fno-clangir-call-conv-lowering -emit-cir  -o - %s |                               FileCheck %s --check-prefixes=CIR %}
 
 //=============================================================================
 // NOTES
@@ -266,7 +268,7 @@ return vzip1q_p16(a, b);
 // LLVM-LABEL: @test_vzip1_mf8(
 // CIR-LABEL: @vzip1_mf8(
 mfloat8x8_t test_vzip1_mf8(mfloat8x8_t a, mfloat8x8_t b) {
-// CIR: cir.vec.shuffle(%{{.*}}, %{{.*}} : !cir.vector<8 x !u8i>) [#cir.int<0> : !s64i, #cir.int<8> : !s64i, #cir.int<1> : !s64i, #cir.int<9> : !s64i, #cir.int<2> : !s64i, #cir.int<10> : !s64i, #cir.int<3> : !s64i, #cir.int<11> : !s64i] : !cir.vector<8 x !u8i>
+// CIR: cir.vec.shuffle(%{{.*}}, %{{.*}} : !cir.vector<8 x !cir.mfp8>) [#cir.int<0> : !s64i, #cir.int<8> : !s64i, #cir.int<1> : !s64i, #cir.int<9> : !s64i, #cir.int<2> : !s64i, #cir.int<10> : !s64i, #cir.int<3> : !s64i, #cir.int<11> : !s64i] : !cir.vector<8 x !cir.mfp8>
 
 // LLVM-SAME: <8 x i8>{{.*}}[[A:%.*]], <8 x i8>{{.*}}[[B:%.*]])
 // LLVM: [[VZIP:%.*]] = shufflevector <8 x i8> [[A]], <8 x i8> [[B]], <8 x i32> <i32 0, i32 8, i32 1, i32 9, i32 2, i32 10, i32 3, i32 11>
@@ -277,7 +279,7 @@ return vzip1_mf8(a, b);
 // LLVM-LABEL: @test_vzip1q_mf8(
 // CIR-LABEL: @vzip1q_mf8(
 mfloat8x16_t test_vzip1q_mf8(mfloat8x16_t a, mfloat8x16_t b) {
-// CIR: cir.vec.shuffle(%{{.*}}, %{{.*}} : !cir.vector<16 x !u8i>) [#cir.int<0> : !s64i, #cir.int<16> : !s64i, #cir.int<1> : !s64i, #cir.int<17> : !s64i, #cir.int<2> : !s64i, #cir.int<18> : !s64i, #cir.int<3> : !s64i, #cir.int<19> : !s64i, #cir.int<4> : !s64i, #cir.int<20> : !s64i, #cir.int<5> : !s64i, #cir.int<21> : !s64i, #cir.int<6> : !s64i, #cir.int<22> : !s64i, #cir.int<7> : !s64i, #cir.int<23> : !s64i] : !cir.vector<16 x !u8i>
+// CIR: cir.vec.shuffle(%{{.*}}, %{{.*}} : !cir.vector<16 x !cir.mfp8>) [#cir.int<0> : !s64i, #cir.int<16> : !s64i, #cir.int<1> : !s64i, #cir.int<17> : !s64i, #cir.int<2> : !s64i, #cir.int<18> : !s64i, #cir.int<3> : !s64i, #cir.int<19> : !s64i, #cir.int<4> : !s64i, #cir.int<20> : !s64i, #cir.int<5> : !s64i, #cir.int<21> : !s64i, #cir.int<6> : !s64i, #cir.int<22> : !s64i, #cir.int<7> : !s64i, #cir.int<23> : !s64i] : !cir.vector<16 x !cir.mfp8>
 
 // LLVM-SAME: <16 x i8>{{.*}}[[A:%.*]], <16 x i8>{{.*}}[[B:%.*]])
 // LLVM: [[VZIP:%.*]] = shufflevector <16 x i8> [[A]], <16 x i8> [[B]], <16 x i32> <i32 0, i32 16, i32 1, i32 17, i32 2, i32 18, i32 3, i32 19, i32 4, i32 20, i32 5, i32 21, i32 6, i32 22, i32 7, i32 23>
@@ -530,7 +532,7 @@ return vzip2q_p16(a, b);
 // LLVM-LABEL: @test_vzip2_mf8(
 // CIR-LABEL: @vzip2_mf8(
 mfloat8x8_t test_vzip2_mf8(mfloat8x8_t a, mfloat8x8_t b) {
-// CIR: cir.vec.shuffle(%{{.*}}, %{{.*}} : !cir.vector<8 x !u8i>) [#cir.int<4> : !s64i, #cir.int<12> : !s64i, #cir.int<5> : !s64i, #cir.int<13> : !s64i, #cir.int<6> : !s64i, #cir.int<14> : !s64i, #cir.int<7> : !s64i, #cir.int<15> : !s64i] : !cir.vector<8 x !u8i>
+// CIR: cir.vec.shuffle(%{{.*}}, %{{.*}} : !cir.vector<8 x !cir.mfp8>) [#cir.int<4> : !s64i, #cir.int<12> : !s64i, #cir.int<5> : !s64i, #cir.int<13> : !s64i, #cir.int<6> : !s64i, #cir.int<14> : !s64i, #cir.int<7> : !s64i, #cir.int<15> : !s64i] : !cir.vector<8 x !cir.mfp8>
 
 // LLVM-SAME: <8 x i8>{{.*}}[[A:%.*]], <8 x i8>{{.*}}[[B:%.*]])
 // LLVM: [[VZIP:%.*]] = shufflevector <8 x i8> [[A]], <8 x i8> [[B]], <8 x i32> <i32 4, i32 12, i32 5, i32 13, i32 6, i32 14, i32 7, i32 15>
@@ -541,7 +543,7 @@ return vzip2_mf8(a, b);
 // LLVM-LABEL: @test_vzip2q_mf8(
 // CIR-LABEL: @vzip2q_mf8(
 mfloat8x16_t test_vzip2q_mf8(mfloat8x16_t a, mfloat8x16_t b) {
-// CIR: cir.vec.shuffle(%{{.*}}, %{{.*}} : !cir.vector<16 x !u8i>) [#cir.int<8> : !s64i, #cir.int<24> : !s64i, #cir.int<9> : !s64i, #cir.int<25> : !s64i, #cir.int<10> : !s64i, #cir.int<26> : !s64i, #cir.int<11> : !s64i, #cir.int<27> : !s64i, #cir.int<12> : !s64i, #cir.int<28> : !s64i, #cir.int<13> : !s64i, #cir.int<29> : !s64i, #cir.int<14> : !s64i, #cir.int<30> : !s64i, #cir.int<15> : !s64i, #cir.int<31> : !s64i] : !cir.vector<16 x !u8i>
+// CIR: cir.vec.shuffle(%{{.*}}, %{{.*}} : !cir.vector<16 x !cir.mfp8>) [#cir.int<8> : !s64i, #cir.int<24> : !s64i, #cir.int<9> : !s64i, #cir.int<25> : !s64i, #cir.int<10> : !s64i, #cir.int<26> : !s64i, #cir.int<11> : !s64i, #cir.int<27> : !s64i, #cir.int<12> : !s64i, #cir.int<28> : !s64i, #cir.int<13> : !s64i, #cir.int<29> : !s64i, #cir.int<14> : !s64i, #cir.int<30> : !s64i, #cir.int<15> : !s64i, #cir.int<31> : !s64i] : !cir.vector<16 x !cir.mfp8>
 
 // LLVM-SAME: <16 x i8>{{.*}}[[A:%.*]], <16 x i8>{{.*}}[[B:%.*]])
 // LLVM: [[VZIP:%.*]] = shufflevector <16 x i8> [[A]], <16 x i8> [[B]], <16 x i32> <i32 8, i32 24, i32 9, i32 25, i32 10, i32 26, i32 11, i32 27, i32 12, i32 28, i32 13, i32 29, i32 14, i32 30, i32 15, i32 31>
@@ -662,12 +664,12 @@ return vzip_p16(a, b);
 // LLVM-LABEL: @test_vzip_mf8(
 // CIR-LABEL: @vzip_mf8(
 mfloat8x8x2_t test_vzip_mf8(mfloat8x8_t a, mfloat8x8_t b) {
-// CIR: [[A_CAST:%.*]] = cir.cast bitcast %{{.*}} : !cir.vector<8 x !s8i> -> !cir.vector<8 x !u8i>
-// CIR: [[B_CAST:%.*]] = cir.cast bitcast %{{.*}} : !cir.vector<8 x !s8i> -> !cir.vector<8 x !u8i>
-// CIR: [[LO:%.*]] = cir.vec.shuffle([[A_CAST]], [[B_CAST]] : !cir.vector<8 x !u8i>) [#cir.int<0> : !s32i, #cir.int<8> : !s32i, #cir.int<1> : !s32i, #cir.int<9> : !s32i, #cir.int<2> : !s32i, #cir.int<10> : !s32i, #cir.int<3> : !s32i, #cir.int<11> : !s32i] : !cir.vector<8 x !u8i>
-// CIR: cir.store [[LO]], %{{.*}} : !cir.vector<8 x !u8i>, !cir.ptr<!cir.vector<8 x !u8i>>
-// CIR: [[HI:%.*]] = cir.vec.shuffle([[A_CAST]], [[B_CAST]] : !cir.vector<8 x !u8i>) [#cir.int<4> : !s32i, #cir.int<12> : !s32i, #cir.int<5> : !s32i, #cir.int<13> : !s32i, #cir.int<6> : !s32i, #cir.int<14> : !s32i, #cir.int<7> : !s32i, #cir.int<15> : !s32i] : !cir.vector<8 x !u8i>
-// CIR: cir.store [[HI]], %{{.*}} : !cir.vector<8 x !u8i>, !cir.ptr<!cir.vector<8 x !u8i>>
+// CIR: [[A_CAST:%.*]] = cir.cast bitcast %{{.*}} : !cir.vector<8 x !s8i> -> !cir.vector<8 x !cir.mfp8>
+// CIR: [[B_CAST:%.*]] = cir.cast bitcast %{{.*}} : !cir.vector<8 x !s8i> -> !cir.vector<8 x !cir.mfp8>
+// CIR: [[LO:%.*]] = cir.vec.shuffle([[A_CAST]], [[B_CAST]] : !cir.vector<8 x !cir.mfp8>) [#cir.int<0> : !s32i, #cir.int<8> : !s32i, #cir.int<1> : !s32i, #cir.int<9> : !s32i, #cir.int<2> : !s32i, #cir.int<10> : !s32i, #cir.int<3> : !s32i, #cir.int<11> : !s32i] : !cir.vector<8 x !cir.mfp8>
+// CIR: cir.store [[LO]], %{{.*}} : !cir.vector<8 x !cir.mfp8>, !cir.ptr<!cir.vector<8 x !cir.mfp8>>
+// CIR: [[HI:%.*]] = cir.vec.shuffle([[A_CAST]], [[B_CAST]] : !cir.vector<8 x !cir.mfp8>) [#cir.int<4> : !s32i, #cir.int<12> : !s32i, #cir.int<5> : !s32i, #cir.int<13> : !s32i, #cir.int<6> : !s32i, #cir.int<14> : !s32i, #cir.int<7> : !s32i, #cir.int<15> : !s32i] : !cir.vector<8 x !cir.mfp8>
+// CIR: cir.store [[HI]], %{{.*}} : !cir.vector<8 x !cir.mfp8>, !cir.ptr<!cir.vector<8 x !cir.mfp8>>
 
 // LLVM-SAME: <8 x i8> {{.*}}[[A:%.*]], <8 x i8> {{.*}}[[B:%.*]]) {{.*}} {
 // LLVM: [[VZIP_LO:%.*]] = shufflevector <8 x i8> [[A]], <8 x i8> [[B]], <8 x i32> <i32 0, i32 8, i32 1, i32 9, i32 2, i32 10, i32 3, i32 11>
@@ -905,12 +907,12 @@ return vzipq_p16(a, b);
 // LLVM-LABEL: @test_vzipq_mf8(
 // CIR-LABEL: @vzipq_mf8(
 mfloat8x16x2_t test_vzipq_mf8(mfloat8x16_t a, mfloat8x16_t b) {
-// CIR: [[A_CAST:%.*]] = cir.cast bitcast %{{.*}} : !cir.vector<16 x !s8i> -> !cir.vector<16 x !u8i>
-// CIR: [[B_CAST:%.*]] = cir.cast bitcast %{{.*}} : !cir.vector<16 x !s8i> -> !cir.vector<16 x !u8i>
-// CIR: [[LO:%.*]] = cir.vec.shuffle([[A_CAST]], [[B_CAST]] : !cir.vector<16 x !u8i>) [#cir.int<0> : !s32i, #cir.int<16> : !s32i, #cir.int<1> : !s32i, #cir.int<17> : !s32i, #cir.int<2> : !s32i, #cir.int<18> : !s32i, #cir.int<3> : !s32i, #cir.int<19> : !s32i, #cir.int<4> : !s32i, #cir.int<20> : !s32i, #cir.int<5> : !s32i, #cir.int<21> : !s32i, #cir.int<6> : !s32i, #cir.int<22> : !s32i, #cir.int<7> : !s32i, #cir.int<23> : !s32i] : !cir.vector<16 x !u8i>
-// CIR: cir.store [[LO]], %{{.*}} : !cir.vector<16 x !u8i>, !cir.ptr<!cir.vector<16 x !u8i>>
-// CIR: [[HI:%.*]] = cir.vec.shuffle([[A_CAST]], [[B_CAST]] : !cir.vector<16 x !u8i>) [#cir.int<8> : !s32i, #cir.int<24> : !s32i, #cir.int<9> : !s32i, #cir.int<25> : !s32i, #cir.int<10> : !s32i, #cir.int<26> : !s32i, #cir.int<11> : !s32i, #cir.int<27> : !s32i, #cir.int<12> : !s32i, #cir.int<28> : !s32i, #cir.int<13> : !s32i, #cir.int<29> : !s32i, #cir.int<14> : !s32i, #cir.int<30> : !s32i, #cir.int<15> : !s32i, #cir.int<31> : !s32i] : !cir.vector<16 x !u8i>
-// CIR: cir.store [[HI]], %{{.*}} : !cir.vector<16 x !u8i>, !cir.ptr<!cir.vector<16 x !u8i>>
+// CIR: [[A_CAST:%.*]] = cir.cast bitcast %{{.*}} : !cir.vector<16 x !s8i> -> !cir.vector<16 x !cir.mfp8>
+// CIR: [[B_CAST:%.*]] = cir.cast bitcast %{{.*}} : !cir.vector<16 x !s8i> -> !cir.vector<16 x !cir.mfp8>
+// CIR: [[LO:%.*]] = cir.vec.shuffle([[A_CAST]], [[B_CAST]] : !cir.vector<16 x !cir.mfp8>) [#cir.int<0> : !s32i, #cir.int<16> : !s32i, #cir.int<1> : !s32i, #cir.int<17> : !s32i, #cir.int<2> : !s32i, #cir.int<18> : !s32i, #cir.int<3> : !s32i, #cir.int<19> : !s32i, #cir.int<4> : !s32i, #cir.int<20> : !s32i, #cir.int<5> : !s32i, #cir.int<21> : !s32i, #cir.int<6> : !s32i, #cir.int<22> : !s32i, #cir.int<7> : !s32i, #cir.int<23> : !s32i] : !cir.vector<16 x !cir.mfp8>
+// CIR: cir.store [[LO]], %{{.*}} : !cir.vector<16 x !cir.mfp8>, !cir.ptr<!cir.vector<16 x !cir.mfp8>>
+// CIR: [[HI:%.*]] = cir.vec.shuffle([[A_CAST]], [[B_CAST]] : !cir.vector<16 x !cir.mfp8>) [#cir.int<8> : !s32i, #cir.int<24> : !s32i, #cir.int<9> : !s32i, #cir.int<25> : !s32i, #cir.int<10> : !s32i, #cir.int<26> : !s32i, #cir.int<11> : !s32i, #cir.int<27> : !s32i, #cir.int<12> : !s32i, #cir.int<28> : !s32i, #cir.int<13> : !s32i, #cir.int<29> : !s32i, #cir.int<14> : !s32i, #cir.int<30> : !s32i, #cir.int<15> : !s32i, #cir.int<31> : !s32i] : !cir.vector<16 x !cir.mfp8>
+// CIR: cir.store [[HI]], %{{.*}} : !cir.vector<16 x !cir.mfp8>, !cir.ptr<!cir.vector<16 x !cir.mfp8>>
 
 // LLVM-SAME: <16 x i8> {{.*}}[[A:%.*]], <16 x i8> {{.*}}[[B:%.*]]) {{.*}} {
 // LLVM: [[VZIP_LO:%.*]] = shufflevector <16 x i8> [[A]], <16 x i8> [[B]], <16 x i32> <i32 0, i32 16, i32 1, i32 17, i32 2, i32 18, i32 3, i32 19, i32 4, i32 20, i32 5, i32 21, i32 6, i32 22, i32 7, i32 23>
@@ -1039,12 +1041,12 @@ return vuzp_p16(a, b);
 // LLVM-LABEL: @test_vuzp_mf8(
 // CIR-LABEL: @vuzp_mf8(
 mfloat8x8x2_t test_vuzp_mf8(mfloat8x8_t a, mfloat8x8_t b) {
-// CIR: [[A_CAST:%.*]] = cir.cast bitcast %{{.*}} : !cir.vector<8 x !s8i> -> !cir.vector<8 x !u8i>
-// CIR: [[B_CAST:%.*]] = cir.cast bitcast %{{.*}} : !cir.vector<8 x !s8i> -> !cir.vector<8 x !u8i>
-// CIR: [[LO:%.*]] = cir.vec.shuffle([[A_CAST]], [[B_CAST]] : !cir.vector<8 x !u8i>) [#cir.int<0> : !s32i, #cir.int<2> : !s32i, #cir.int<4> : !s32i, #cir.int<6> : !s32i, #cir.int<8> : !s32i, #cir.int<10> : !s32i, #cir.int<12> : !s32i, #cir.int<14> : !s32i] : !cir.vector<8 x !u8i>
-// CIR: cir.store [[LO]], %{{.*}} : !cir.vector<8 x !u8i>, !cir.ptr<!cir.vector<8 x !u8i>>
-// CIR: [[HI:%.*]] = cir.vec.shuffle([[A_CAST]], [[B_CAST]] : !cir.vector<8 x !u8i>) [#cir.int<1> : !s32i, #cir.int<3> : !s32i, #cir.int<5> : !s32i, #cir.int<7> : !s32i, #cir.int<9> : !s32i, #cir.int<11> : !s32i, #cir.int<13> : !s32i, #cir.int<15> : !s32i] : !cir.vector<8 x !u8i>
-// CIR: cir.store [[HI]], %{{.*}} : !cir.vector<8 x !u8i>, !cir.ptr<!cir.vector<8 x !u8i>>
+// CIR: [[A_CAST:%.*]] = cir.cast bitcast %{{.*}} : !cir.vector<8 x !s8i> -> !cir.vector<8 x !cir.mfp8>
+// CIR: [[B_CAST:%.*]] = cir.cast bitcast %{{.*}} : !cir.vector<8 x !s8i> -> !cir.vector<8 x !cir.mfp8>
+// CIR: [[LO:%.*]] = cir.vec.shuffle([[A_CAST]], [[B_CAST]] : !cir.vector<8 x !cir.mfp8>) [#cir.int<0> : !s32i, #cir.int<2> : !s32i, #cir.int<4> : !s32i, #cir.int<6> : !s32i, #cir.int<8> : !s32i, #cir.int<10> : !s32i, #cir.int<12> : !s32i, #cir.int<14> : !s32i] : !cir.vector<8 x !cir.mfp8>
+// CIR: cir.store [[LO]], %{{.*}} : !cir.vector<8 x !cir.mfp8>, !cir.ptr<!cir.vector<8 x !cir.mfp8>>
+// CIR: [[HI:%.*]] = cir.vec.shuffle([[A_CAST]], [[B_CAST]] : !cir.vector<8 x !cir.mfp8>) [#cir.int<1> : !s32i, #cir.int<3> : !s32i, #cir.int<5> : !s32i, #cir.int<7> : !s32i, #cir.int<9> : !s32i, #cir.int<11> : !s32i, #cir.int<13> : !s32i, #cir.int<15> : !s32i] : !cir.vector<8 x !cir.mfp8>
+// CIR: cir.store [[HI]], %{{.*}} : !cir.vector<8 x !cir.mfp8>, !cir.ptr<!cir.vector<8 x !cir.mfp8>>
 
 // LLVM-SAME: <8 x i8> {{.*}}[[A:%.*]], <8 x i8> {{.*}}[[B:%.*]]) {{.*}} {
 // LLVM: [[VUZP_LO:%.*]] = shufflevector <8 x i8> [[A]], <8 x i8> [[B]], <8 x i32> <i32 0, i32 2, i32 4, i32 6, i32 8, i32 10, i32 12, i32 14>
@@ -1263,12 +1265,12 @@ return vuzpq_p16(a, b);
 // LLVM-LABEL: @test_vuzpq_mf8(
 // CIR-LABEL: @vuzpq_mf8(
 mfloat8x16x2_t test_vuzpq_mf8(mfloat8x16_t a, mfloat8x16_t b) {
-// CIR: [[A_CAST:%.*]] = cir.cast bitcast %{{.*}} : !cir.vector<16 x !s8i> -> !cir.vector<16 x !u8i>
-// CIR: [[B_CAST:%.*]] = cir.cast bitcast %{{.*}} : !cir.vector<16 x !s8i> -> !cir.vector<16 x !u8i>
-// CIR: [[LO:%.*]] = cir.vec.shuffle([[A_CAST]], [[B_CAST]] : !cir.vector<16 x !u8i>) [#cir.int<0> : !s32i, #cir.int<2> : !s32i, #cir.int<4> : !s32i, #cir.int<6> : !s32i, #cir.int<8> : !s32i, #cir.int<10> : !s32i, #cir.int<12> : !s32i, #cir.int<14> : !s32i, #cir.int<16> : !s32i, #cir.int<18> : !s32i, #cir.int<20> : !s32i, #cir.int<22> : !s32i, #cir.int<24> : !s32i, #cir.int<26> : !s32i, #cir.int<28> : !s32i, #cir.int<30> : !s32i] : !cir.vector<16 x !u8i>
-// CIR: cir.store [[LO]], %{{.*}} : !cir.vector<16 x !u8i>, !cir.ptr<!cir.vector<16 x !u8i>>
-// CIR: [[HI:%.*]] = cir.vec.shuffle([[A_CAST]], [[B_CAST]] : !cir.vector<16 x !u8i>) [#cir.int<1> : !s32i, #cir.int<3> : !s32i, #cir.int<5> : !s32i, #cir.int<7> : !s32i, #cir.int<9> : !s32i, #cir.int<11> : !s32i, #cir.int<13> : !s32i, #cir.int<15> : !s32i, #cir.int<17> : !s32i, #cir.int<19> : !s32i, #cir.int<21> : !s32i, #cir.int<23> : !s32i, #cir.int<25> : !s32i, #cir.int<27> : !s32i, #cir.int<29> : !s32i, #cir.int<31> : !s32i] : !cir.vector<16 x !u8i>
-// CIR: cir.store [[HI]], %{{.*}} : !cir.vector<16 x !u8i>, !cir.ptr<!cir.vector<16 x !u8i>>
+// CIR: [[A_CAST:%.*]] = cir.cast bitcast %{{.*}} : !cir.vector<16 x !s8i> -> !cir.vector<16 x !cir.mfp8>
+// CIR: [[B_CAST:%.*]] = cir.cast bitcast %{{.*}} : !cir.vector<16 x !s8i> -> !cir.vector<16 x !cir.mfp8>
+// CIR: [[LO:%.*]] = cir.vec.shuffle([[A_CAST]], [[B_CAST]] : !cir.vector<16 x !cir.mfp8>) [#cir.int<0> : !s32i, #cir.int<2> : !s32i, #cir.int<4> : !s32i, #cir.int<6> : !s32i, #cir.int<8> : !s32i, #cir.int<10> : !s32i, #cir.int<12> : !s32i, #cir.int<14> : !s32i, #cir.int<16> : !s32i, #cir.int<18> : !s32i, #cir.int<20> : !s32i, #cir.int<22> : !s32i, #cir.int<24> : !s32i, #cir.int<26> : !s32i, #cir.int<28> : !s32i, #cir.int<30> : !s32i] : !cir.vector<16 x !cir.mfp8>
+// CIR: cir.store [[LO]], %{{.*}} : !cir.vector<16 x !cir.mfp8>, !cir.ptr<!cir.vector<16 x !cir.mfp8>>
+// CIR: [[HI:%.*]] = cir.vec.shuffle([[A_CAST]], [[B_CAST]] : !cir.vector<16 x !cir.mfp8>) [#cir.int<1> : !s32i, #cir.int<3> : !s32i, #cir.int<5> : !s32i, #cir.int<7> : !s32i, #cir.int<9> : !s32i, #cir.int<11> : !s32i, #cir.int<13> : !s32i, #cir.int<15> : !s32i, #cir.int<17> : !s32i, #cir.int<19> : !s32i, #cir.int<21> : !s32i, #cir.int<23> : !s32i, #cir.int<25> : !s32i, #cir.int<27> : !s32i, #cir.int<29> : !s32i, #cir.int<31> : !s32i] : !cir.vector<16 x !cir.mfp8>
+// CIR: cir.store [[HI]], %{{.*}} : !cir.vector<16 x !cir.mfp8>, !cir.ptr<!cir.vector<16 x !cir.mfp8>>
 
 // LLVM-SAME: <16 x i8> {{.*}}[[A:%.*]], <16 x i8> {{.*}}[[B:%.*]]) {{.*}} {
 // LLVM: [[VUZP_LO:%.*]] = shufflevector <16 x i8> [[A]], <16 x i8> [[B]], <16 x i32> <i32 0, i32 2, i32 4, i32 6, i32 8, i32 10, i32 12, i32 14, i32 16, i32 18, i32 20, i32 22, i32 24, i32 26, i32 28, i32 30>
@@ -1524,7 +1526,7 @@ poly16x8_t test_vuzp1q_p16(poly16x8_t a, poly16x8_t b) {
 // LLVM-LABEL: @test_vuzp1_mf8(
 // CIR-LABEL: @vuzp1_mf8(
 mfloat8x8_t test_vuzp1_mf8(mfloat8x8_t a, mfloat8x8_t b) {
-// CIR: cir.vec.shuffle(%{{.*}}, %{{.*}} : !cir.vector<8 x !u8i>) [#cir.int<0> : !s64i, #cir.int<2> : !s64i, #cir.int<4> : !s64i, #cir.int<6> : !s64i, #cir.int<8> : !s64i, #cir.int<10> : !s64i, #cir.int<12> : !s64i, #cir.int<14> : !s64i] : !cir.vector<8 x !u8i>
+// CIR: cir.vec.shuffle(%{{.*}}, %{{.*}} : !cir.vector<8 x !cir.mfp8>) [#cir.int<0> : !s64i, #cir.int<2> : !s64i, #cir.int<4> : !s64i, #cir.int<6> : !s64i, #cir.int<8> : !s64i, #cir.int<10> : !s64i, #cir.int<12> : !s64i, #cir.int<14> : !s64i] : !cir.vector<8 x !cir.mfp8>
 
 // LLVM-SAME: <8 x i8>{{.*}}[[A:%.*]], <8 x i8>{{.*}}[[B:%.*]])
 // LLVM: [[VUZP:%.*]] = shufflevector <8 x i8> [[A]], <8 x i8> [[B]], <8 x i32> <i32 0, i32 2, i32 4, i32 6, i32 8, i32 10, i32 12, i32 14>
@@ -1535,7 +1537,7 @@ mfloat8x8_t test_vuzp1_mf8(mfloat8x8_t a, mfloat8x8_t b) {
 // LLVM-LABEL: @test_vuzp1q_mf8(
 // CIR-LABEL: @vuzp1q_mf8(
 mfloat8x16_t test_vuzp1q_mf8(mfloat8x16_t a, mfloat8x16_t b) {
-// CIR: cir.vec.shuffle(%{{.*}}, %{{.*}} : !cir.vector<16 x !u8i>) [#cir.int<0> : !s64i, #cir.int<2> : !s64i, #cir.int<4> : !s64i, #cir.int<6> : !s64i, #cir.int<8> : !s64i, #cir.int<10> : !s64i, #cir.int<12> : !s64i, #cir.int<14> : !s64i, #cir.int<16> : !s64i, #cir.int<18> : !s64i, #cir.int<20> : !s64i, #cir.int<22> : !s64i, #cir.int<24> : !s64i, #cir.int<26> : !s64i, #cir.int<28> : !s64i, #cir.int<30> : !s64i] : !cir.vector<16 x !u8i>
+// CIR: cir.vec.shuffle(%{{.*}}, %{{.*}} : !cir.vector<16 x !cir.mfp8>) [#cir.int<0> : !s64i, #cir.int<2> : !s64i, #cir.int<4> : !s64i, #cir.int<6> : !s64i, #cir.int<8> : !s64i, #cir.int<10> : !s64i, #cir.int<12> : !s64i, #cir.int<14> : !s64i, #cir.int<16> : !s64i, #cir.int<18> : !s64i, #cir.int<20> : !s64i, #cir.int<22> : !s64i, #cir.int<24> : !s64i, #cir.int<26> : !s64i, #cir.int<28> : !s64i, #cir.int<30> : !s64i] : !cir.vector<16 x !cir.mfp8>
 
 // LLVM-SAME: <16 x i8>{{.*}}[[A:%.*]], <16 x i8>{{.*}}[[B:%.*]])
 // LLVM: [[VUZP:%.*]] = shufflevector <16 x i8> [[A]], <16 x i8> [[B]], <16 x i32> <i32 0, i32 2, i32 4, i32 6, i32 8, i32 10, i32 12, i32 14, i32 16, i32 18, i32 20, i32 22, i32 24, i32 26, i32 28, i32 30>
@@ -1788,7 +1790,7 @@ poly16x8_t test_vuzp2q_p16(poly16x8_t a, poly16x8_t b) {
 // LLVM-LABEL: @test_vuzp2_mf8(
 // CIR-LABEL: @vuzp2_mf8(
 mfloat8x8_t test_vuzp2_mf8(mfloat8x8_t a, mfloat8x8_t b) {
-// CIR: cir.vec.shuffle(%{{.*}}, %{{.*}} : !cir.vector<8 x !u8i>) [#cir.int<1> : !s64i, #cir.int<3> : !s64i, #cir.int<5> : !s64i, #cir.int<7> : !s64i, #cir.int<9> : !s64i, #cir.int<11> : !s64i, #cir.int<13> : !s64i, #cir.int<15> : !s64i] : !cir.vector<8 x !u8i>
+// CIR: cir.vec.shuffle(%{{.*}}, %{{.*}} : !cir.vector<8 x !cir.mfp8>) [#cir.int<1> : !s64i, #cir.int<3> : !s64i, #cir.int<5> : !s64i, #cir.int<7> : !s64i, #cir.int<9> : !s64i, #cir.int<11> : !s64i, #cir.int<13> : !s64i, #cir.int<15> : !s64i] : !cir.vector<8 x !cir.mfp8>
 
 // LLVM-SAME: <8 x i8>{{.*}}[[A:%.*]], <8 x i8>{{.*}}[[B:%.*]])
 // LLVM: [[VUZP:%.*]] = shufflevector <8 x i8> [[A]], <8 x i8> [[B]], <8 x i32> <i32 1, i32 3, i32 5, i32 7, i32 9, i32 11, i32 13, i32 15>
@@ -1799,7 +1801,7 @@ mfloat8x8_t test_vuzp2_mf8(mfloat8x8_t a, mfloat8x8_t b) {
 // LLVM-LABEL: @test_vuzp2q_mf8(
 // CIR-LABEL: @vuzp2q_mf8(
 mfloat8x16_t test_vuzp2q_mf8(mfloat8x16_t a, mfloat8x16_t b) {
-// CIR: cir.vec.shuffle(%{{.*}}, %{{.*}} : !cir.vector<16 x !u8i>) [#cir.int<1> : !s64i, #cir.int<3> : !s64i, #cir.int<5> : !s64i, #cir.int<7> : !s64i, #cir.int<9> : !s64i, #cir.int<11> : !s64i, #cir.int<13> : !s64i, #cir.int<15> : !s64i, #cir.int<17> : !s64i, #cir.int<19> : !s64i, #cir.int<21> : !s64i, #cir.int<23> : !s64i, #cir.int<25> : !s64i, #cir.int<27> : !s64i, #cir.int<29> : !s64i, #cir.int<31> : !s64i] : !cir.vector<16 x !u8i>
+// CIR: cir.vec.shuffle(%{{.*}}, %{{.*}} : !cir.vector<16 x !cir.mfp8>) [#cir.int<1> : !s64i, #cir.int<3> : !s64i, #cir.int<5> : !s64i, #cir.int<7> : !s64i, #cir.int<9> : !s64i, #cir.int<11> : !s64i, #cir.int<13> : !s64i, #cir.int<15> : !s64i, #cir.int<17> : !s64i, #cir.int<19> : !s64i, #cir.int<21> : !s64i, #cir.int<23> : !s64i, #cir.int<25> : !s64i, #cir.int<27> : !s64i, #cir.int<29> : !s64i, #cir.int<31> : !s64i] : !cir.vector<16 x !cir.mfp8>
 
 // LLVM-SAME: <16 x i8>{{.*}}[[A:%.*]], <16 x i8>{{.*}}[[B:%.*]])
 // LLVM: [[VUZP:%.*]] = shufflevector <16 x i8> [[A]], <16 x i8> [[B]], <16 x i32> <i32 1, i32 3, i32 5, i32 7, i32 9, i32 11, i32 13, i32 15, i32 17, i32 19, i32 21, i32 23, i32 25, i32 27, i32 29, i32 31>
@@ -2081,7 +2083,7 @@ poly16x8_t test_vtrn1q_p16(poly16x8_t a, poly16x8_t b) {
 // LLVM-LABEL: @test_vtrn1_mf8(
 // CIR-LABEL: @vtrn1_mf8(
 mfloat8x8_t test_vtrn1_mf8(mfloat8x8_t a, mfloat8x8_t b) {
-// CIR: cir.vec.shuffle(%{{.*}}, %{{.*}} : !cir.vector<8 x !u8i>) [#cir.int<0> : !s64i, #cir.int<8> : !s64i, #cir.int<2> : !s64i, #cir.int<10> : !s64i, #cir.int<4> : !s64i, #cir.int<12> : !s64i, #cir.int<6> : !s64i, #cir.int<14> : !s64i] : !cir.vector<8 x !u8i>
+// CIR: cir.vec.shuffle(%{{.*}}, %{{.*}} : !cir.vector<8 x !cir.mfp8>) [#cir.int<0> : !s64i, #cir.int<8> : !s64i, #cir.int<2> : !s64i, #cir.int<10> : !s64i, #cir.int<4> : !s64i, #cir.int<12> : !s64i, #cir.int<6> : !s64i, #cir.int<14> : !s64i] : !cir.vector<8 x !cir.mfp8>
 
 // LLVM-SAME: <8 x i8>{{.*}}[[A:%.*]], <8 x i8>{{.*}}[[B:%.*]])
 // LLVM: [[SHUFFLE:%.*]] = shufflevector <8 x i8> [[A]], <8 x i8> [[B]], <8 x i32> <i32 0, i32 8, i32 2, i32 10, i32 4, i32 12, i32 6, i32 14>
@@ -2092,7 +2094,7 @@ mfloat8x8_t test_vtrn1_mf8(mfloat8x8_t a, mfloat8x8_t b) {
 // LLVM-LABEL: @test_vtrn1q_mf8(
 // CIR-LABEL: @vtrn1q_mf8(
 mfloat8x16_t test_vtrn1q_mf8(mfloat8x16_t a, mfloat8x16_t b) {
-// CIR: cir.vec.shuffle(%{{.*}}, %{{.*}} : !cir.vector<16 x !u8i>) [#cir.int<0> : !s64i, #cir.int<16> : !s64i, #cir.int<2> : !s64i, #cir.int<18> : !s64i, #cir.int<4> : !s64i, #cir.int<20> : !s64i, #cir.int<6> : !s64i, #cir.int<22> : !s64i, #cir.int<8> : !s64i, #cir.int<24> : !s64i, #cir.int<10> : !s64i, #cir.int<26> : !s64i, #cir.int<12> : !s64i, #cir.int<28> : !s64i, #cir.int<14> : !s64i, #cir.int<30> : !s64i] : !cir.vector<16 x !u8i>
+// CIR: cir.vec.shuffle(%{{.*}}, %{{.*}} : !cir.vector<16 x !cir.mfp8>) [#cir.int<0> : !s64i, #cir.int<16> : !s64i, #cir.int<2> : !s64i, #cir.int<18> : !s64i, #cir.int<4> : !s64i, #cir.int<20> : !s64i, #cir.int<6> : !s64i, #cir.int<22> : !s64i, #cir.int<8> : !s64i, #cir.int<24> : !s64i, #cir.int<10> : !s64i, #cir.int<26> : !s64i, #cir.int<12> : !s64i, #cir.int<28> : !s64i, #cir.int<14> : !s64i, #cir.int<30> : !s64i] : !cir.vector<16 x !cir.mfp8>
 
 // LLVM-SAME: <16 x i8>{{.*}}[[A:%.*]], <16 x i8>{{.*}}[[B:%.*]])
 // LLVM: [[SHUFFLE:%.*]] = shufflevector <16 x i8> [[A]], <16 x i8> [[B]], <16 x i32> <i32 0, i32 16, i32 2, i32 18, i32 4, i32 20, i32 6, i32 22, i32 8, i32 24, i32 10, i32 26, i32 12, i32 28, i32 14, i32 30>
@@ -2345,7 +2347,7 @@ poly16x8_t test_vtrn2q_p16(poly16x8_t a, poly16x8_t b) {
 // LLVM-LABEL: @test_vtrn2_mf8(
 // CIR-LABEL: @vtrn2_mf8(
 mfloat8x8_t test_vtrn2_mf8(mfloat8x8_t a, mfloat8x8_t b) {
-// CIR: cir.vec.shuffle(%{{.*}}, %{{.*}} : !cir.vector<8 x !u8i>) [#cir.int<1> : !s64i, #cir.int<9> : !s64i, #cir.int<3> : !s64i, #cir.int<11> : !s64i, #cir.int<5> : !s64i, #cir.int<13> : !s64i, #cir.int<7> : !s64i, #cir.int<15> : !s64i] : !cir.vector<8 x !u8i>
+// CIR: cir.vec.shuffle(%{{.*}}, %{{.*}} : !cir.vector<8 x !cir.mfp8>) [#cir.int<1> : !s64i, #cir.int<9> : !s64i, #cir.int<3> : !s64i, #cir.int<11> : !s64i, #cir.int<5> : !s64i, #cir.int<13> : !s64i, #cir.int<7> : !s64i, #cir.int<15> : !s64i] : !cir.vector<8 x !cir.mfp8>
 
 // LLVM-SAME: <8 x i8>{{.*}}[[A:%.*]], <8 x i8>{{.*}}[[B:%.*]])
 // LLVM: [[SHUFFLE:%.*]] = shufflevector <8 x i8> [[A]], <8 x i8> [[B]], <8 x i32> <i32 1, i32 9, i32 3, i32 11, i32 5, i32 13, i32 7, i32 15>
@@ -2356,7 +2358,7 @@ mfloat8x8_t test_vtrn2_mf8(mfloat8x8_t a, mfloat8x8_t b) {
 // LLVM-LABEL: @test_vtrn2q_mf8(
 // CIR-LABEL: @vtrn2q_mf8(
 mfloat8x16_t test_vtrn2q_mf8(mfloat8x16_t a, mfloat8x16_t b) {
-// CIR: cir.vec.shuffle(%{{.*}}, %{{.*}} : !cir.vector<16 x !u8i>) [#cir.int<1> : !s64i, #cir.int<17> : !s64i, #cir.int<3> : !s64i, #cir.int<19> : !s64i, #cir.int<5> : !s64i, #cir.int<21> : !s64i, #cir.int<7> : !s64i, #cir.int<23> : !s64i, #cir.int<9> : !s64i, #cir.int<25> : !s64i, #cir.int<11> : !s64i, #cir.int<27> : !s64i, #cir.int<13> : !s64i, #cir.int<29> : !s64i, #cir.int<15> : !s64i, #cir.int<31> : !s64i] : !cir.vector<16 x !u8i>
+// CIR: cir.vec.shuffle(%{{.*}}, %{{.*}} : !cir.vector<16 x !cir.mfp8>) [#cir.int<1> : !s64i, #cir.int<17> : !s64i, #cir.int<3> : !s64i, #cir.int<19> : !s64i, #cir.int<5> : !s64i, #cir.int<21> : !s64i, #cir.int<7> : !s64i, #cir.int<23> : !s64i, #cir.int<9> : !s64i, #cir.int<25> : !s64i, #cir.int<11> : !s64i, #cir.int<27> : !s64i, #cir.int<13> : !s64i, #cir.int<29> : !s64i, #cir.int<15> : !s64i, #cir.int<31> : !s64i] : !cir.vector<16 x !cir.mfp8>
 
 // LLVM-SAME: <16 x i8>{{.*}}[[A:%.*]], <16 x i8>{{.*}}[[B:%.*]])
 // LLVM: [[SHUFFLE:%.*]] = shufflevector <16 x i8> [[A]], <16 x i8> [[B]], <16 x i32> <i32 1, i32 17, i32 3, i32 19, i32 5, i32 21, i32 7, i32 23, i32 9, i32 25, i32 11, i32 27, i32 13, i32 29, i32 15, i32 31>
@@ -2534,12 +2536,12 @@ uint32x2x2_t test_vtrn_u32(uint32x2_t a, uint32x2_t b) {
 // LLVM-LABEL: @test_vtrn_mf8(
 // CIR-LABEL: @vtrn_mf8(
 mfloat8x8x2_t test_vtrn_mf8(mfloat8x8_t a, mfloat8x8_t b) {
-// CIR: [[A_CAST:%.*]] = cir.cast bitcast %{{.*}} : !cir.vector<8 x !s8i> -> !cir.vector<8 x !u8i>
-// CIR: [[B_CAST:%.*]] = cir.cast bitcast %{{.*}} : !cir.vector<8 x !s8i> -> !cir.vector<8 x !u8i>
-// CIR: [[LO:%.*]] = cir.vec.shuffle([[A_CAST]], [[B_CAST]] : !cir.vector<8 x !u8i>) [#cir.int<0> : !s32i, #cir.int<8> : !s32i, #cir.int<2> : !s32i, #cir.int<10> : !s32i, #cir.int<4> : !s32i, #cir.int<12> : !s32i, #cir.int<6> : !s32i, #cir.int<14> : !s32i] : !cir.vector<8 x !u8i>
-// CIR: cir.store [[LO]], %{{.*}} : !cir.vector<8 x !u8i>, !cir.ptr<!cir.vector<8 x !u8i>>
-// CIR: [[HI:%.*]] = cir.vec.shuffle([[A_CAST]], [[B_CAST]] : !cir.vector<8 x !u8i>) [#cir.int<1> : !s32i, #cir.int<9> : !s32i, #cir.int<3> : !s32i, #cir.int<11> : !s32i, #cir.int<5> : !s32i, #cir.int<13> : !s32i, #cir.int<7> : !s32i, #cir.int<15> : !s32i] : !cir.vector<8 x !u8i>
-// CIR: cir.store [[HI]], %{{.*}} : !cir.vector<8 x !u8i>, !cir.ptr<!cir.vector<8 x !u8i>>
+// CIR: [[A_CAST:%.*]] = cir.cast bitcast %{{.*}} : !cir.vector<8 x !s8i> -> !cir.vector<8 x !cir.mfp8>
+// CIR: [[B_CAST:%.*]] = cir.cast bitcast %{{.*}} : !cir.vector<8 x !s8i> -> !cir.vector<8 x !cir.mfp8>
+// CIR: [[LO:%.*]] = cir.vec.shuffle([[A_CAST]], [[B_CAST]] : !cir.vector<8 x !cir.mfp8>) [#cir.int<0> : !s32i, #cir.int<8> : !s32i, #cir.int<2> : !s32i, #cir.int<10> : !s32i, #cir.int<4> : !s32i, #cir.int<12> : !s32i, #cir.int<6> : !s32i, #cir.int<14> : !s32i] : !cir.vector<8 x !cir.mfp8>
+// CIR: cir.store [[LO]], %{{.*}} : !cir.vector<8 x !cir.mfp8>, !cir.ptr<!cir.vector<8 x !cir.mfp8>>
+// CIR: [[HI:%.*]] = cir.vec.shuffle([[A_CAST]], [[B_CAST]] : !cir.vector<8 x !cir.mfp8>) [#cir.int<1> : !s32i, #cir.int<9> : !s32i, #cir.int<3> : !s32i, #cir.int<11> : !s32i, #cir.int<5> : !s32i, #cir.int<13> : !s32i, #cir.int<7> : !s32i, #cir.int<15> : !s32i] : !cir.vector<8 x !cir.mfp8>
+// CIR: cir.store [[HI]], %{{.*}} : !cir.vector<8 x !cir.mfp8>, !cir.ptr<!cir.vector<8 x !cir.mfp8>>
 
 // LLVM-SAME: <8 x i8> {{.*}}[[A:%.*]], <8 x i8> {{.*}}[[B:%.*]]) {{.*}} {
 // LLVM: [[VTRN_LO:%.*]] = shufflevector <8 x i8> [[A]], <8 x i8> [[B]], <8 x i32> <i32 0, i32 8, i32 2, i32 10, i32 4, i32 12, i32 6, i32 14>
@@ -2720,12 +2722,12 @@ poly16x8x2_t test_vtrnq_p16(poly16x8_t a, poly16x8_t b) {
 // LLVM-LABEL: @test_vtrnq_mf8(
 // CIR-LABEL: @vtrnq_mf8(
 mfloat8x16x2_t test_vtrnq_mf8(mfloat8x16_t a, mfloat8x16_t b) {
-// CIR: [[A_CAST:%.*]] = cir.cast bitcast %{{.*}} : !cir.vector<16 x !s8i> -> !cir.vector<16 x !u8i>
-// CIR: [[B_CAST:%.*]] = cir.cast bitcast %{{.*}} : !cir.vector<16 x !s8i> -> !cir.vector<16 x !u8i>
-// CIR: [[LO:%.*]] = cir.vec.shuffle([[A_CAST]], [[B_CAST]] : !cir.vector<16 x !u8i>) [#cir.int<0> : !s32i, #cir.int<16> : !s32i, #cir.int<2> : !s32i, #cir.int<18> : !s32i, #cir.int<4> : !s32i, #cir.int<20> : !s32i, #cir.int<6> : !s32i, #cir.int<22> : !s32i, #cir.int<8> : !s32i, #cir.int<24> : !s32i, #cir.int<10> : !s32i, #cir.int<26> : !s32i, #cir.int<12> : !s32i, #cir.int<28> : !s32i, #cir.int<14> : !s32i, #cir.int<30> : !s32i] : !cir.vector<16 x !u8i>
-// CIR: cir.store [[LO]], %{{.*}} : !cir.vector<16 x !u8i>, !cir.ptr<!cir.vector<16 x !u8i>>
-// CIR: [[HI:%.*]] = cir.vec.shuffle([[A_CAST]], [[B_CAST]] : !cir.vector<16 x !u8i>) [#cir.int<1> : !s32i, #cir.int<17> : !s32i, #cir.int<3> : !s32i, #cir.int<19> : !s32i, #cir.int<5> : !s32i, #cir.int<21> : !s32i, #cir.int<7> : !s32i, #cir.int<23> : !s32i, #cir.int<9> : !s32i, #cir.int<25> : !s32i, #cir.int<11> : !s32i, #cir.int<27> : !s32i, #cir.int<13> : !s32i, #cir.int<29> : !s32i, #cir.int<15> : !s32i, #cir.int<31> : !s32i] : !cir.vector<16 x !u8i>
-// CIR: cir.store [[HI]], %{{.*}} : !cir.vector<16 x !u8i>, !cir.ptr<!cir.vector<16 x !u8i>>
+// CIR: [[A_CAST:%.*]] = cir.cast bitcast %{{.*}} : !cir.vector<16 x !s8i> -> !cir.vector<16 x !cir.mfp8>
+// CIR: [[B_CAST:%.*]] = cir.cast bitcast %{{.*}} : !cir.vector<16 x !s8i> -> !cir.vector<16 x !cir.mfp8>
+// CIR: [[LO:%.*]] = cir.vec.shuffle([[A_CAST]], [[B_CAST]] : !cir.vector<16 x !cir.mfp8>) [#cir.int<0> : !s32i, #cir.int<16> : !s32i, #cir.int<2> : !s32i, #cir.int<18> : !s32i, #cir.int<4> : !s32i, #cir.int<20> : !s32i, #cir.int<6> : !s32i, #cir.int<22> : !s32i, #cir.int<8> : !s32i, #cir.int<24> : !s32i, #cir.int<10> : !s32i, #cir.int<26> : !s32i, #cir.int<12> : !s32i, #cir.int<28> : !s32i, #cir.int<14> : !s32i, #cir.int<30> : !s32i] : !cir.vector<16 x !cir.mfp8>
+// CIR: cir.store [[LO]], %{{.*}} : !cir.vector<16 x !cir.mfp8>, !cir.ptr<!cir.vector<16 x !cir.mfp8>>
+// CIR: [[HI:%.*]] = cir.vec.shuffle([[A_CAST]], [[B_CAST]] : !cir.vector<16 x !cir.mfp8>) [#cir.int<1> : !s32i, #cir.int<17> : !s32i, #cir.int<3> : !s32i, #cir.int<19> : !s32i, #cir.int<5> : !s32i, #cir.int<21> : !s32i, #cir.int<7> : !s32i, #cir.int<23> : !s32i, #cir.int<9> : !s32i, #cir.int<25> : !s32i, #cir.int<11> : !s32i, #cir.int<27> : !s32i, #cir.int<13> : !s32i, #cir.int<29> : !s32i, #cir.int<15> : !s32i, #cir.int<31> : !s32i] : !cir.vector<16 x !cir.mfp8>
+// CIR: cir.store [[HI]], %{{.*}} : !cir.vector<16 x !cir.mfp8>, !cir.ptr<!cir.vector<16 x !cir.mfp8>>
 
 // LLVM-SAME: <16 x i8> {{.*}}[[A:%.*]], <16 x i8> {{.*}}[[B:%.*]]) {{.*}} {
 // LLVM: [[VTRN_LO:%.*]] = shufflevector <16 x i8> [[A]], <16 x i8> [[B]], <16 x i32> <i32 0, i32 16, i32 2, i32 18, i32 4, i32 20, i32 6, i32 22, i32 8, i32 24, i32 10, i32 26, i32 12, i32 28, i32 14, i32 30>
diff --git a/clang/test/CodeGen/AArch64/neon/store.c b/clang/test/CodeGen/AArch64/neon/store.c
index 221ba27e29c73a..1719c2b6c1934a 100644
--- a/clang/test/CodeGen/AArch64/neon/store.c
+++ b/clang/test/CodeGen/AArch64/neon/store.c
@@ -1,8 +1,10 @@
 // REQUIRES: aarch64-registered-target || arm-registered-target
 
+// FIXME: Remove -fno-clangir-call-conv-lowering from the RUN lines once
+// calling-convention lowering is implemented for the mfp8 types.
 // RUN:                   %clang_cc1_cg_arm64_neon           -emit-llvm %s -disable-O0-optnone | opt -S -passes=mem2reg,sroa,instcombine | FileCheck %s --check-prefixes=ALL,LLVM
-// RUN: %if cir-enabled %{%clang_cc1_cg_arm64_neon -fclangir -emit-llvm %s -disable-O0-optnone | opt -S -passes=mem2reg,sroa,instcombine | FileCheck %s --check-prefixes=ALL,LLVM %}
-// RUN: %if cir-enabled %{%clang_cc1_cg_arm64_neon -fclangir -emit-cir  %s -disable-O0-optnone |                               FileCheck %s --check-prefixes=ALL,CIR %}
+// RUN: %if cir-enabled %{%clang_cc1_cg_arm64_neon -fclangir -fno-clangir-call-conv-lowering -emit-llvm %s -disable-O0-optnone | opt -S -passes=mem2reg,sroa,instcombine | FileCheck %s --check-prefixes=ALL,LLVM %}
+// RUN: %if cir-enabled %{%clang_cc1_cg_arm64_neon -fclangir -fno-clangir-call-conv-lowering -emit-cir  %s -disable-O0-optnone |                               FileCheck %s --check-prefixes=ALL,CIR %}
 
 #include <arm_neon.h>
 
@@ -43,7 +45,7 @@ void test_vst1_f64(float64_t *a, float64x1_t b) {
 
 // ALL-LABEL: @test_vst1_mf8(
 void test_vst1_mf8(mfloat8_t *a, mfloat8x8_t val) {
-// CIR: cir.store align(1) {{.*}}, {{.*}} : !cir.vector<8 x !u8i>, !cir.ptr<!cir.vector<8 x !u8i>>
+// CIR: cir.store align(1) {{.*}}, {{.*}} : !cir.vector<8 x !cir.mfp8>, !cir.ptr<!cir.vector<8 x !cir.mfp8>>
 
 // LLVM-SAME: ptr {{.*}} [[A:%.*]], <8 x i8> {{.*}}[[B:%.*]])
 // LLVM: store <8 x i8> [[B]], ptr [[A]], align 1
@@ -113,7 +115,7 @@ void test_vst1q_f64(float64_t *a, float64x2_t b) {
 
 // ALL-LABEL: @test_vst1q_mf8(
 void test_vst1q_mf8(mfloat8_t *a, mfloat8x16_t val) {
-// CIR: cir.store align(1) {{.*}}, {{.*}} : !cir.vector<16 x !u8i>, !cir.ptr<!cir.vector<16 x !u8i>>
+// CIR: cir.store align(1) {{.*}}, {{.*}} : !cir.vector<16 x !cir.mfp8>, !cir.ptr<!cir.vector<16 x !cir.mfp8>>
 
 // LLVM-SAME: ptr {{.*}} [[A:%.*]], <16 x i8> {{.*}}[[B:%.*]])
 // LLVM: store <16 x i8> [[B]], ptr [[A]], align 1
@@ -349,8 +351,9 @@ void test_vst1_lane_f64(float64_t  *a, float64x1_t b) {
 
 // ALL-LABEL: @test_vst1_lane_mf8(
 void test_vst1_lane_mf8(mfloat8_t *a, mfloat8x8_t b) {
-// CIR: {{.*}} = cir.vec.extract {{.*}}[{{.*}} : !u64i] : !cir.vector<8 x !u8i>
-// CIR: cir.store align(1) {{.*}}, {{.*}} : !u8i, !cir.ptr<!u8i>
+// CIR: cir.cast bitcast {{.*}} : !cir.ptr<!cir.vector<8 x !cir.mfp8>> -> !cir.ptr<!cir.vector<8 x !s8i>>
+// CIR: {{.*}} = cir.vec.extract {{.*}}[{{.*}} : !u64i] : !cir.vector<8 x !s8i>
+// CIR: cir.store align(1) {{.*}}, {{.*}} : !s8i, !cir.ptr<!s8i>
 
 // LLVM-SAME: ptr {{.*}} [[A:%.*]], <8 x i8> {{.*}}[[B:%.*]])
 // LLVM: [[TMP1:%.*]] = extractelement <8 x i8> [[B]], i64 7
@@ -529,8 +532,9 @@ void test_vst1q_lane_f64(float64_t  *a, float64x2_t b) {
 
 // ALL-LABEL: @test_vst1q_lane_mf8(
 void test_vst1q_lane_mf8(mfloat8_t *a, mfloat8x16_t b) {
-// CIR: {{.*}} = cir.vec.extract {{.*}}[{{.*}} : !u64i] : !cir.vector<16 x !u8i>
-// CIR: cir.store align(1) {{.*}}, {{.*}} : !u8i, !cir.ptr<!u8i>
+// CIR: cir.cast bitcast {{.*}} : !cir.ptr<!cir.vector<16 x !cir.mfp8>> -> !cir.ptr<!cir.vector<16 x !s8i>>
+// CIR: {{.*}} = cir.vec.extract {{.*}}[{{.*}} : !u64i] : !cir.vector<16 x !s8i>
+// CIR: cir.store align(1) {{.*}}, {{.*}} : !s8i, !cir.ptr<!s8i>
 
 // LLVM-SAME: ptr {{.*}} [[A:%.*]], <16 x i8> {{.*}}[[B:%.*]])
 // LLVM: [[TMP1:%.*]] = extractelement <16 x i8> [[B]], i64 15
@@ -700,7 +704,7 @@ void test_vst1_f64_x4(float64_t *a, float64x1x4_t b) {
 
 // ALL-LABEL: @test_vst1_mf8_x2(
 void test_vst1_mf8_x2(mfloat8_t *a, mfloat8x8x2_t b) {
-// CIR: cir.call_llvm_intrinsic "aarch64.neon.st1x2" {{.*}} : (!cir.vector<8 x !u8i>, !cir.vector<8 x !u8i>, !cir.ptr<!void>) -> !void
+// CIR: cir.call_llvm_intrinsic "aarch64.neon.st1x2" {{.*}} : (!cir.vector<8 x !cir.mfp8>, !cir.vector<8 x !cir.mfp8>, !cir.ptr<!void>) -> !void
 
 // LLVM: call void @llvm.aarch64.neon.st1x2.v8i8.p0(<8 x i8> {{.*}}, <8 x i8> {{.*}}, ptr {{.*}})
 // LLVM: ret void
@@ -709,7 +713,7 @@ void test_vst1_mf8_x2(mfloat8_t *a, mfloat8x8x2_t b) {
 
 // ALL-LABEL: @test_vst1_mf8_x3(
 void test_vst1_mf8_x3(mfloat8_t *a, mfloat8x8x3_t b) {
-// CIR: cir.call_llvm_intrinsic "aarch64.neon.st1x3" {{.*}} : (!cir.vector<8 x !u8i>, !cir.vector<8 x !u8i>, !cir.vector<8 x !u8i>, !cir.ptr<!void>) -> !void
+// CIR: cir.call_llvm_intrinsic "aarch64.neon.st1x3" {{.*}} : (!cir.vector<8 x !cir.mfp8>, !cir.vector<8 x !cir.mfp8>, !cir.vector<8 x !cir.mfp8>, !cir.ptr<!void>) -> !void
 
 // LLVM: call void @llvm.aarch64.neon.st1x3.v8i8.p0(<8 x i8> {{.*}}, <8 x i8> {{.*}}, <8 x i8> {{.*}}, ptr {{.*}})
 // LLVM: ret void
@@ -718,7 +722,7 @@ void test_vst1_mf8_x3(mfloat8_t *a, mfloat8x8x3_t b) {
 
 // ALL-LABEL: @test_vst1_mf8_x4(
 void test_vst1_mf8_x4(mfloat8_t *a, mfloat8x8x4_t b) {
-// CIR: cir.call_llvm_intrinsic "aarch64.neon.st1x4" {{.*}} : (!cir.vector<8 x !u8i>, !cir.vector<8 x !u8i>, !cir.vector<8 x !u8i>, !cir.vector<8 x !u8i>, !cir.ptr<!void>) -> !void
+// CIR: cir.call_llvm_intrinsic "aarch64.neon.st1x4" {{.*}} : (!cir.vector<8 x !cir.mfp8>, !cir.vector<8 x !cir.mfp8>, !cir.vector<8 x !cir.mfp8>, !cir.vector<8 x !cir.mfp8>, !cir.ptr<!void>) -> !void
 
 // LLVM: call void @llvm.aarch64.neon.st1x4.v8i8.p0(<8 x i8> {{.*}}, <8 x i8> {{.*}}, <8 x i8> {{.*}}, <8 x i8> {{.*}}, ptr {{.*}})
 // LLVM: ret void
@@ -781,7 +785,7 @@ void test_vst1q_f64_x4(float64_t *a, float64x2x4_t b) {
 
 // ALL-LABEL: @test_vst1q_mf8_x2(
 void test_vst1q_mf8_x2(mfloat8_t *a, mfloat8x16x2_t b) {
-// CIR: cir.call_llvm_intrinsic "aarch64.neon.st1x2" {{.*}} : (!cir.vector<16 x !u8i>, !cir.vector<16 x !u8i>, !cir.ptr<!void>) -> !void
+// CIR: cir.call_llvm_intrinsic "aarch64.neon.st1x2" {{.*}} : (!cir.vector<16 x !cir.mfp8>, !cir.vector<16 x !cir.mfp8>, !cir.ptr<!void>) -> !void
 
 // LLVM: call void @llvm.aarch64.neon.st1x2.v16i8.p0(<16 x i8> {{.*}}, <16 x i8> {{.*}}, ptr {{.*}})
 // LLVM: ret void
@@ -790,7 +794,7 @@ void test_vst1q_mf8_x2(mfloat8_t *a, mfloat8x16x2_t b) {
 
 // ALL-LABEL: @test_vst1q_mf8_x3(
 void test_vst1q_mf8_x3(mfloat8_t *a, mfloat8x16x3_t b) {
-// CIR: cir.call_llvm_intrinsic "aarch64.neon.st1x3" {{.*}} : (!cir.vector<16 x !u8i>, !cir.vector<16 x !u8i>, !cir.vector<16 x !u8i>, !cir.ptr<!void>) -> !void
+// CIR: cir.call_llvm_intrinsic "aarch64.neon.st1x3" {{.*}} : (!cir.vector<16 x !cir.mfp8>, !cir.vector<16 x !cir.mfp8>, !cir.vector<16 x !cir.mfp8>, !cir.ptr<!void>) -> !void
 
 // LLVM: call void @llvm.aarch64.neon.st1x3.v16i8.p0(<16 x i8> {{.*}}, <16 x i8> {{.*}}, <16 x i8> {{.*}}, ptr {{.*}})
 // LLVM: ret void
@@ -799,7 +803,7 @@ void test_vst1q_mf8_x3(mfloat8_t *a, mfloat8x16x3_t b) {
 
 // ALL-LABEL: @test_vst1q_mf8_x4(
 void test_vst1q_mf8_x4(mfloat8_t *a, mfloat8x16x4_t b) {
-// CIR: cir.call_llvm_intrinsic "aarch64.neon.st1x4" {{.*}} : (!cir.vector<16 x !u8i>, !cir.vector<16 x !u8i>, !cir.vector<16 x !u8i>, !cir.vector<16 x !u8i>, !cir.ptr<!void>) -> !void
+// CIR: cir.call_llvm_intrinsic "aarch64.neon.st1x4" {{.*}} : (!cir.vector<16 x !cir.mfp8>, !cir.vector<16 x !cir.mfp8>, !cir.vector<16 x !cir.mfp8>, !cir.vector<16 x !cir.mfp8>, !cir.ptr<!void>) -> !void
 
 // LLVM: call void @llvm.aarch64.neon.st1x4.v16i8.p0(<16 x i8> {{.*}}, <16 x i8> {{.*}}, <16 x i8> {{.*}}, <16 x i8> {{.*}}, ptr {{.*}})
 // LLVM: ret void
@@ -1534,7 +1538,7 @@ void test_vst2_f64(float64_t *a, float64x1x2_t b) {
 
 // ALL-LABEL: @test_vst2_mf8(
 void test_vst2_mf8(mfloat8_t *a, mfloat8x8x2_t b) {
-// CIR: cir.call_llvm_intrinsic "aarch64.neon.st2" {{.*}} : (!cir.vector<8 x !u8i>, !cir.vector<8 x !u8i>, !cir.ptr<!void>) -> !void
+// CIR: cir.call_llvm_intrinsic "aarch64.neon.st2" {{.*}} : (!cir.vector<8 x !cir.mfp8>, !cir.vector<8 x !cir.mfp8>, !cir.ptr<!void>) -> !void
 
 // LLVM-SAME: ptr {{[a-z ]*}}[[A:%[a-z0-9_.]+]],
 // LLVM-DAG: [[V0:%.*]] = extractvalue {{.*}} [[B:%[a-z0-9_.]+]],{{( 0,)?}} 0{{$}}
@@ -1714,7 +1718,7 @@ void test_vst2q_f64(float64_t *a, float64x2x2_t b) {
 
 // ALL-LABEL: @test_vst2q_mf8(
 void test_vst2q_mf8(mfloat8_t *a, mfloat8x16x2_t b) {
-// CIR: cir.call_llvm_intrinsic "aarch64.neon.st2" {{.*}} : (!cir.vector<16 x !u8i>, !cir.vector<16 x !u8i>, !cir.ptr<!void>) -> !void
+// CIR: cir.call_llvm_intrinsic "aarch64.neon.st2" {{.*}} : (!cir.vector<16 x !cir.mfp8>, !cir.vector<16 x !cir.mfp8>, !cir.ptr<!void>) -> !void
 
 // LLVM-SAME: ptr {{[a-z ]*}}[[A:%[a-z0-9_.]+]],
 // LLVM-DAG: [[V0:%.*]] = extractvalue {{.*}} [[B:%[a-z0-9_.]+]],{{( 0,)?}} 0{{$}}
@@ -1894,7 +1898,7 @@ void test_vst2_lane_f64(float64_t  *a, float64x1x2_t b) {
 
 // ALL-LABEL: @test_vst2_lane_mf8(
 void test_vst2_lane_mf8(mfloat8_t *a, mfloat8x8x2_t b) {
-// CIR: cir.call_llvm_intrinsic "aarch64.neon.st2lane" {{.*}} : (!cir.vector<8 x !u8i>, !cir.vector<8 x !u8i>, !s64i, !cir.ptr<!void>) -> !void
+// CIR: cir.call_llvm_intrinsic "aarch64.neon.st2lane" {{.*}} : (!cir.vector<8 x !cir.mfp8>, !cir.vector<8 x !cir.mfp8>, !s64i, !cir.ptr<!void>) -> !void
 
 // LLVM-SAME: ptr {{[a-z ]*}}[[A:%[a-z0-9_.]+]],
 // LLVM-DAG: [[V0:%.*]] = extractvalue {{.*}} [[B:%[a-z0-9_.]+]],{{( 0,)?}} 0{{$}}
@@ -2074,7 +2078,7 @@ void test_vst2q_lane_f64(float64_t  *a, float64x2x2_t b) {
 
 // ALL-LABEL: @test_vst2q_lane_mf8(
 void test_vst2q_lane_mf8(mfloat8_t *a, mfloat8x16x2_t b) {
-// CIR: cir.call_llvm_intrinsic "aarch64.neon.st2lane" {{.*}} : (!cir.vector<16 x !u8i>, !cir.vector<16 x !u8i>, !s64i, !cir.ptr<!void>) -> !void
+// CIR: cir.call_llvm_intrinsic "aarch64.neon.st2lane" {{.*}} : (!cir.vector<16 x !cir.mfp8>, !cir.vector<16 x !cir.mfp8>, !s64i, !cir.ptr<!void>) -> !void
 
 // LLVM-SAME: ptr {{[a-z ]*}}[[A:%[a-z0-9_.]+]],
 // LLVM-DAG: [[V0:%.*]] = extractvalue {{.*}} [[B:%[a-z0-9_.]+]],{{( 0,)?}} 0{{$}}
@@ -2257,7 +2261,7 @@ void test_vst3_f64(float64_t *a, float64x1x3_t b) {
 
 // ALL-LABEL: @test_vst3_mf8(
 void test_vst3_mf8(mfloat8_t *a, mfloat8x8x3_t b) {
-// CIR: cir.call_llvm_intrinsic "aarch64.neon.st3" {{.*}} : (!cir.vector<8 x !u8i>, !cir.vector<8 x !u8i>, !cir.vector<8 x !u8i>, !cir.ptr<!void>) -> !void
+// CIR: cir.call_llvm_intrinsic "aarch64.neon.st3" {{.*}} : (!cir.vector<8 x !cir.mfp8>, !cir.vector<8 x !cir.mfp8>, !cir.vector<8 x !cir.mfp8>, !cir.ptr<!void>) -> !void
 
 // LLVM-SAME: ptr {{[a-z ]*}}[[A:%[a-z0-9_.]+]],
 // LLVM-DAG: [[V0:%.*]] = extractvalue {{.*}} [[B:%[a-z0-9_.]+]],{{( 0,)?}} 0{{$}}
@@ -2452,7 +2456,7 @@ void test_vst3q_f64(float64_t *a, float64x2x3_t b) {
 
 // ALL-LABEL: @test_vst3q_mf8(
 void test_vst3q_mf8(mfloat8_t *a, mfloat8x16x3_t b) {
-// CIR: cir.call_llvm_intrinsic "aarch64.neon.st3" {{.*}} : (!cir.vector<16 x !u8i>, !cir.vector<16 x !u8i>, !cir.vector<16 x !u8i>, !cir.ptr<!void>) -> !void
+// CIR: cir.call_llvm_intrinsic "aarch64.neon.st3" {{.*}} : (!cir.vector<16 x !cir.mfp8>, !cir.vector<16 x !cir.mfp8>, !cir.vector<16 x !cir.mfp8>, !cir.ptr<!void>) -> !void
 
 // LLVM-SAME: ptr {{[a-z ]*}}[[A:%[a-z0-9_.]+]],
 // LLVM-DAG: [[V0:%.*]] = extractvalue {{.*}} [[B:%[a-z0-9_.]+]],{{( 0,)?}} 0{{$}}
@@ -2647,7 +2651,7 @@ void test_vst3_lane_f64(float64_t  *a, float64x1x3_t b) {
 
 // ALL-LABEL: @test_vst3_lane_mf8(
 void test_vst3_lane_mf8(mfloat8_t *a, mfloat8x8x3_t b) {
-// CIR: cir.call_llvm_intrinsic "aarch64.neon.st3lane" {{.*}} : (!cir.vector<8 x !u8i>, !cir.vector<8 x !u8i>, !cir.vector<8 x !u8i>, !s64i, !cir.ptr<!void>) -> !void
+// CIR: cir.call_llvm_intrinsic "aarch64.neon.st3lane" {{.*}} : (!cir.vector<8 x !cir.mfp8>, !cir.vector<8 x !cir.mfp8>, !cir.vector<8 x !cir.mfp8>, !s64i, !cir.ptr<!void>) -> !void
 
 // LLVM-SAME: ptr {{[a-z ]*}}[[A:%[a-z0-9_.]+]],
 // LLVM-DAG: [[V0:%.*]] = extractvalue {{.*}} [[B:%[a-z0-9_.]+]],{{( 0,)?}} 0{{$}}
@@ -2842,7 +2846,7 @@ void test_vst3q_lane_f64(float64_t  *a, float64x2x3_t b) {
 
 // ALL-LABEL: @test_vst3q_lane_mf8(
 void test_vst3q_lane_mf8(mfloat8_t *a, mfloat8x16x3_t b) {
-// CIR: cir.call_llvm_intrinsic "aarch64.neon.st3lane" {{.*}} : (!cir.vector<16 x !u8i>, !cir.vector<16 x !u8i>, !cir.vector<16 x !u8i>, !s64i, !cir.ptr<!void>) -> !void
+// CIR: cir.call_llvm_intrinsic "aarch64.neon.st3lane" {{.*}} : (!cir.vector<16 x !cir.mfp8>, !cir.vector<16 x !cir.mfp8>, !cir.vector<16 x !cir.mfp8>, !s64i, !cir.ptr<!void>) -> !void
 
 // LLVM-SAME: ptr {{[a-z ]*}}[[A:%[a-z0-9_.]+]],
 // LLVM-DAG: [[V0:%.*]] = extractvalue {{.*}} [[B:%[a-z0-9_.]+]],{{( 0,)?}} 0{{$}}
@@ -3040,7 +3044,7 @@ void test_vst4_f64(float64_t *a, float64x1x4_t b) {
 
 // ALL-LABEL: @test_vst4_mf8(
 void test_vst4_mf8(mfloat8_t *a, mfloat8x8x4_t b) {
-// CIR: cir.call_llvm_intrinsic "aarch64.neon.st4" {{.*}} : (!cir.vector<8 x !u8i>, !cir.vector<8 x !u8i>, !cir.vector<8 x !u8i>, !cir.vector<8 x !u8i>, !cir.ptr<!void>) -> !void
+// CIR: cir.call_llvm_intrinsic "aarch64.neon.st4" {{.*}} : (!cir.vector<8 x !cir.mfp8>, !cir.vector<8 x !cir.mfp8>, !cir.vector<8 x !cir.mfp8>, !cir.vector<8 x !cir.mfp8>, !cir.ptr<!void>) -> !void
 
 // LLVM-SAME: ptr {{[a-z ]*}}[[A:%[a-z0-9_.]+]],
 // LLVM-DAG: [[V0:%.*]] = extractvalue {{.*}} [[B:%[a-z0-9_.]+]],{{( 0,)?}} 0{{$}}
@@ -3250,7 +3254,7 @@ void test_vst4q_f64(float64_t *a, float64x2x4_t b) {
 
 // ALL-LABEL: @test_vst4q_mf8(
 void test_vst4q_mf8(mfloat8_t *a, mfloat8x16x4_t b) {
-// CIR: cir.call_llvm_intrinsic "aarch64.neon.st4" {{.*}} : (!cir.vector<16 x !u8i>, !cir.vector<16 x !u8i>, !cir.vector<16 x !u8i>, !cir.vector<16 x !u8i>, !cir.ptr<!void>) -> !void
+// CIR: cir.call_llvm_intrinsic "aarch64.neon.st4" {{.*}} : (!cir.vector<16 x !cir.mfp8>, !cir.vector<16 x !cir.mfp8>, !cir.vector<16 x !cir.mfp8>, !cir.vector<16 x !cir.mfp8>, !cir.ptr<!void>) -> !void
 
 // LLVM-SAME: ptr {{[a-z ]*}}[[A:%[a-z0-9_.]+]],
 // LLVM-DAG: [[V0:%.*]] = extractvalue {{.*}} [[B:%[a-z0-9_.]+]],{{( 0,)?}} 0{{$}}
@@ -3460,7 +3464,7 @@ void test_vst4_lane_f64(float64_t  *a, float64x1x4_t b) {
 
 // ALL-LABEL: @test_vst4_lane_mf8(
 void test_vst4_lane_mf8(mfloat8_t *a, mfloat8x8x4_t b) {
-// CIR: cir.call_llvm_intrinsic "aarch64.neon.st4lane" {{.*}} : (!cir.vector<8 x !u8i>, !cir.vector<8 x !u8i>, !cir.vector<8 x !u8i>, !cir.vector<8 x !u8i>, !s64i, !cir.ptr<!void>) -> !void
+// CIR: cir.call_llvm_intrinsic "aarch64.neon.st4lane" {{.*}} : (!cir.vector<8 x !cir.mfp8>, !cir.vector<8 x !cir.mfp8>, !cir.vector<8 x !cir.mfp8>, !cir.vector<8 x !cir.mfp8>, !s64i, !cir.ptr<!void>) -> !void
 
 // LLVM-SAME: ptr {{[a-z ]*}}[[A:%[a-z0-9_.]+]],
 // LLVM-DAG: [[V0:%.*]] = extractvalue {{.*}} [[B:%[a-z0-9_.]+]],{{( 0,)?}} 0{{$}}
@@ -3670,7 +3674,7 @@ void test_vst4q_lane_f64(float64_t  *a, float64x2x4_t b) {
 
 // ALL-LABEL: @test_vst4q_lane_mf8(
 void test_vst4q_lane_mf8(mfloat8_t *a, mfloat8x16x4_t b) {
-// CIR: cir.call_llvm_intrinsic "aarch64.neon.st4lane" {{.*}} : (!cir.vector<16 x !u8i>, !cir.vector<16 x !u8i>, !cir.vector<16 x !u8i>, !cir.vector<16 x !u8i>, !s64i, !cir.ptr<!void>) -> !void
+// CIR: cir.call_llvm_intrinsic "aarch64.neon.st4lane" {{.*}} : (!cir.vector<16 x !cir.mfp8>, !cir.vector<16 x !cir.mfp8>, !cir.vector<16 x !cir.mfp8>, !cir.vector<16 x !cir.mfp8>, !s64i, !cir.ptr<!void>) -> !void
 
 // LLVM-SAME: ptr {{[a-z ]*}}[[A:%[a-z0-9_.]+]],
 // LLVM-DAG: [[V0:%.*]] = extractvalue {{.*}} [[B:%[a-z0-9_.]+]],{{( 0,)?}} 0{{$}}

>From 4cd1a7b0781378469bb5afab23da5be18f3fae85 Mon Sep 17 00:00:00 2001
From: Andy Kaylor <akaylor at nvidia.com>
Date: Mon, 23 Nov 2026 16:41:49 -0800
Subject: [PATCH 3/3] Add verifier support to accept only legal vectors of mfp8

---
 clang/lib/CIR/Dialect/IR/CIRTypes.cpp | 18 ++++++++++++++--
 clang/test/CIR/IR/invalid-vector.cir  | 30 +++++++++++++++++++++++++++
 clang/test/CIR/IR/vector.cir          |  6 ++++++
 clang/test/CIR/Lowering/mfp8.cir      | 17 ++++++++-------
 4 files changed, 61 insertions(+), 10 deletions(-)

diff --git a/clang/lib/CIR/Dialect/IR/CIRTypes.cpp b/clang/lib/CIR/Dialect/IR/CIRTypes.cpp
index 70233d0f8d83a4..75714e69badd7f 100644
--- a/clang/lib/CIR/Dialect/IR/CIRTypes.cpp
+++ b/clang/lib/CIR/Dialect/IR/CIRTypes.cpp
@@ -1694,6 +1694,10 @@ mlir::LogicalResult cir::VectorType::verify(
   case cir::VectorAbiKind::Generic:
     if (size.isScalable())
       return emitError() << "a scalable vector must have a vector kind";
+    // A generic mfp8 vector is an AArch64 NEON vector of 64 or 128 bits.
+    if (mlir::isa<cir::MFloat8Type>(elementType) &&
+        size.getFixedValue() != 8 && size.getFixedValue() != 16)
+      return emitError() << "a NEON mfp8 vector must have 8 or 16 elements";
     return success();
   case cir::VectorAbiKind::SVEData: {
     if (auto intTy = mlir::dyn_cast<cir::IntType>(elementType)) {
@@ -1701,8 +1705,18 @@ mlir::LogicalResult cir::VectorType::verify(
       if (!intTy.isBitInt() &&
           (width == 8 || width == 16 || width == 32 || width == 64))
         return success();
-    } else if (mlir::isa<cir::MFloat8Type, cir::FP16Type, cir::BF16Type,
-                         cir::SingleType, cir::DoubleType>(elementType)) {
+    } else if (mlir::isa<cir::MFloat8Type>(elementType)) {
+      // A scalable mfp8 vector holds one 128-bit granule per vscale. A
+      // fixed-length one holds a power-of-two number of bits from 128 to 2048.
+      uint64_t numElts = size.getKnownMinValue();
+      if (size.isScalable() ? numElts == 16
+                            : llvm::isPowerOf2_64(numElts) && numElts >= 16 &&
+                                  numElts <= 256)
+        return success();
+      return emitError() << "an SVE mfp8 vector must have [16] elements, or a "
+                            "power-of-two number of elements from 16 to 256";
+    } else if (mlir::isa<cir::FP16Type, cir::BF16Type, cir::SingleType,
+                         cir::DoubleType>(elementType)) {
       return success();
     }
     return emitError() << "an SVE data vector must have 8-, 16-, 32-, or "
diff --git a/clang/test/CIR/IR/invalid-vector.cir b/clang/test/CIR/IR/invalid-vector.cir
index dc0aa5be488161..f025365573f955 100644
--- a/clang/test/CIR/IR/invalid-vector.cir
+++ b/clang/test/CIR/IR/invalid-vector.cir
@@ -245,6 +245,36 @@ cir.func private @sve_data_f80(!cir.vector<[1] x !cir.long_double<!cir.f80>, sve
 
 // -----
 
+// expected-error @below {{a NEON mfp8 vector must have 8 or 16 elements}}
+cir.func private @neon_mfp8_4(!cir.vector<4 x !cir.mfp8>)
+
+// -----
+
+// expected-error @below {{a NEON mfp8 vector must have 8 or 16 elements}}
+cir.func private @neon_mfp8_32(!cir.vector<32 x !cir.mfp8>)
+
+// -----
+
+// expected-error @below {{an SVE mfp8 vector must have [16] elements, or a power-of-two number of elements from 16 to 256}}
+cir.func private @sve_mfp8_scalable_8(!cir.vector<[8] x !cir.mfp8, sve_data>)
+
+// -----
+
+// expected-error @below {{an SVE mfp8 vector must have [16] elements, or a power-of-two number of elements from 16 to 256}}
+cir.func private @sve_mfp8_fixed_8(!cir.vector<8 x !cir.mfp8, sve_data>)
+
+// -----
+
+// expected-error @below {{an SVE mfp8 vector must have [16] elements, or a power-of-two number of elements from 16 to 256}}
+cir.func private @sve_mfp8_fixed_48(!cir.vector<48 x !cir.mfp8, sve_data>)
+
+// -----
+
+// expected-error @below {{an SVE mfp8 vector must have [16] elements, or a power-of-two number of elements from 16 to 256}}
+cir.func private @sve_mfp8_fixed_512(!cir.vector<512 x !cir.mfp8, sve_data>)
+
+// -----
+
 // expected-error @below {{an SVE predicate vector must have '!cir.int<u, 1>' elements}}
 cir.func private @sve_pred_u8(!cir.vector<[16] x !cir.int<u, 8>, sve_predicate>)
 
diff --git a/clang/test/CIR/IR/vector.cir b/clang/test/CIR/IR/vector.cir
index 9b5b5455102b87..c821e9420956d1 100644
--- a/clang/test/CIR/IR/vector.cir
+++ b/clang/test/CIR/IR/vector.cir
@@ -273,6 +273,9 @@ cir.func @vec_sve_kinds(
     %fixed_pred: !cir.vector<8 x !cir.int<u, 8>, sve_predicate>,
     %mfp8_data: !cir.vector<[16] x !cir.mfp8, sve_data>,
     %fixed_mfp8: !cir.vector<16 x !cir.mfp8, sve_data>,
+    %fixed_mfp8_2048: !cir.vector<256 x !cir.mfp8, sve_data>,
+    %neon_mfp8_8: !cir.vector<8 x !cir.mfp8>,
+    %neon_mfp8_16: !cir.vector<16 x !cir.mfp8>,
     %generic: !cir.vector<16 x !s32i>) {
   cir.return
 }
@@ -285,6 +288,9 @@ cir.func @vec_sve_kinds(
 // CHECK-SAME: %{{.*}}: !cir.vector<8 x !u8i, sve_predicate>,
 // CHECK-SAME: %{{.*}}: !cir.vector<[16] x !cir.mfp8, sve_data>,
 // CHECK-SAME: %{{.*}}: !cir.vector<16 x !cir.mfp8, sve_data>,
+// CHECK-SAME: %{{.*}}: !cir.vector<256 x !cir.mfp8, sve_data>,
+// CHECK-SAME: %{{.*}}: !cir.vector<8 x !cir.mfp8>,
+// CHECK-SAME: %{{.*}}: !cir.vector<16 x !cir.mfp8>,
 // CHECK-SAME: %{{.*}}: !cir.vector<16 x !s32i>)
 
 }
diff --git a/clang/test/CIR/Lowering/mfp8.cir b/clang/test/CIR/Lowering/mfp8.cir
index ec44dbd9d63c42..12f6274daac1c4 100644
--- a/clang/test/CIR/Lowering/mfp8.cir
+++ b/clang/test/CIR/Lowering/mfp8.cir
@@ -5,7 +5,7 @@
 module {
   cir.global external @g = #cir.zero : !cir.mfp8
   cir.global external @gv = #cir.zero : !cir.vector<16 x !cir.mfp8>
-  cir.global external @gv2 = #cir.zero : !cir.vector<2 x !cir.mfp8>
+  cir.global external @gv2 = #cir.zero : !cir.vector<8 x !cir.mfp8>
 
   cir.func @zero_store() {
     %0 = cir.alloca "z" align(1) : !cir.ptr<!cir.mfp8>
@@ -36,9 +36,9 @@ module {
   cir.func @create() {
     %0 = cir.get_global @g : !cir.ptr<!cir.mfp8>
     %1 = cir.load align(1) %0 : !cir.ptr<!cir.mfp8>, !cir.mfp8
-    %2 = cir.vec.create(%1, %1 : !cir.mfp8, !cir.mfp8) : !cir.vector<2 x !cir.mfp8>
-    %3 = cir.get_global @gv2 : !cir.ptr<!cir.vector<2 x !cir.mfp8>>
-    cir.store align(2) %2, %3 : !cir.vector<2 x !cir.mfp8>, !cir.ptr<!cir.vector<2 x !cir.mfp8>>
+    %2 = cir.vec.create(%1, %1, %1, %1, %1, %1, %1, %1 : !cir.mfp8, !cir.mfp8, !cir.mfp8, !cir.mfp8, !cir.mfp8, !cir.mfp8, !cir.mfp8, !cir.mfp8) : !cir.vector<8 x !cir.mfp8>
+    %3 = cir.get_global @gv2 : !cir.ptr<!cir.vector<8 x !cir.mfp8>>
+    cir.store align(8) %2, %3 : !cir.vector<8 x !cir.mfp8>, !cir.ptr<!cir.vector<8 x !cir.mfp8>>
     cir.return
   }
 
@@ -54,7 +54,7 @@ module {
 
 // CHECK: @g = global <1 x i8> zeroinitializer
 // CHECK: @gv = global <16 x i8> zeroinitializer
-// CHECK: @gv2 = global <2 x i8> zeroinitializer
+// CHECK: @gv2 = global <8 x i8> zeroinitializer
 
 // CHECK-LABEL: define void @zero_store()
 // CHECK:         %[[Z:.*]] = alloca <1 x i8>, align 1
@@ -76,10 +76,11 @@ module {
 // CHECK-LABEL: define void @create()
 // CHECK:         %[[VAL:.*]] = load <1 x i8>, ptr @g, align 1
 // CHECK:         %[[ELT0:.*]] = bitcast <1 x i8> %[[VAL]] to i8
-// CHECK:         %[[V0:.*]] = insertelement <2 x i8> poison, i8 %[[ELT0]], i64 0
+// CHECK:         %[[V0:.*]] = insertelement <8 x i8> poison, i8 %[[ELT0]], i64 0
 // CHECK:         %[[ELT1:.*]] = bitcast <1 x i8> %[[VAL]] to i8
-// CHECK:         %[[V1:.*]] = insertelement <2 x i8> %[[V0]], i8 %[[ELT1]], i64 1
-// CHECK:         store <2 x i8> %[[V1]], ptr @gv2, align 2
+// CHECK:         %[[V1:.*]] = insertelement <8 x i8> %[[V0]], i8 %[[ELT1]], i64 1
+// CHECK:         %[[V7:.*]] = insertelement <8 x i8> %{{.*}}, i8 %{{.*}}, i64 7
+// CHECK:         store <8 x i8> %[[V7]], ptr @gv2, align 8
 
 // CHECK-LABEL: define void @splat()
 // CHECK:         %[[VAL:.*]] = load <1 x i8>, ptr @g, align 1



More information about the cfe-commits mailing list