[Mlir-commits] [mlir] [MLIR][XeVM] Add truncf and mma_mx op. (PR #180055)

Jianhui Li llvmlistbot at llvm.org
Wed Mar 18 13:00:50 PDT 2026


================
@@ -357,6 +357,22 @@ LogicalResult MMAMxOp::verify() {
   return success();
 }
 
+LogicalResult TruncfOp::verify() {
+  Type srcTy = getSrc().getType();
+  Type dstTy = getDst().getType();
+  if (isa<VectorType>(srcTy) && !isa<VectorType>(dstTy))
+    return emitOpError("both src and dst should be vector types or both should "
+                       "be scalar types");
+  if (isa<VectorType>(srcTy)) {
+    VectorType srcVecTy = dyn_cast<VectorType>(srcTy);
+    VectorType dstVecTy = dyn_cast<VectorType>(dstTy);
+    if (srcVecTy.getNumElements() != dstVecTy.getNumElements())
+      return emitOpError(
+          "src and dst vector types should have the same number of elements");
----------------
Jianhui-Li wrote:

nit: may check the bitwidth should be smaller after truncate

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


More information about the Mlir-commits mailing list