[llvm] [NVPTX] Fix PTX and SM conditions for narrow FP conversions (PR #168680)

Durgadoss R via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 19 01:57:49 PST 2025


================
@@ -177,6 +177,27 @@ class NVPTXSubtarget : public NVPTXGenSubtargetInfo {
            hasPTXWithAccelSMs(86, {100, 101});
   }
 
+  // Checks support for conversions involving e4m3x2 and e5m2x2.
+  bool hasFP8ConversionSupport() const {
+    if (PTXVersion >= 81)
+      return SmVersion >= 89;
+
+    if (PTXVersion >= 78)
+      return SmVersion >= 90;
+
+    return false;
+  }
+
+  // Checks support for conversions involving the following types:
+  // - e2m3x2/e3m2x2
+  // - e2m1x2
+  // - ue8m0x2
+  bool hasNarrowFPConversionSupport() const {
----------------
durga4github wrote:

optional:
I wonder if we should name it something like "subbyteFP" instead of "narrowFP".

Change as such LGTM

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


More information about the llvm-commits mailing list