[llvm] [NVVM] Move print functions from NVVMIntrinsicUtils.h to cpp file (PR #168997)

Durgadoss R via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 20 23:59:16 PST 2025


================
@@ -0,0 +1,61 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// This file implements functions associated with NVVM Intrinsics.
+//
+//===----------------------------------------------------------------------===//
+
+#include "llvm/IR/NVVMIntrinsicUtils.h"
+
+using namespace llvm;
+using namespace nvvm;
+
+void nvvm::printTcgen05MMAKind(raw_ostream &OS, const Constant *ImmArgVal) {
+  if (const auto *CI = dyn_cast<ConstantInt>(ImmArgVal)) {
+    uint64_t Val = CI->getZExtValue();
+    switch (static_cast<Tcgen05MMAKind>(Val)) {
+    case Tcgen05MMAKind::F16:
+      OS << "f16";
+      return;
+    case Tcgen05MMAKind::TF32:
+      OS << "tf32";
+      return;
+    case Tcgen05MMAKind::F8F6F4:
+      OS << "f8f6f4";
+      return;
+    case Tcgen05MMAKind::I8:
+      OS << "i8";
+      return;
+    }
+  }
+  llvm_unreachable(
+      "printTcgen05MMAKind called with invalid value for immediate argument");
----------------
durga4github wrote:

I assume the unit tests added as part of the pretty-print PR are running and passing as expected.


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


More information about the llvm-commits mailing list