[llvm] [NVPTX] Add patterns for fma.relu.{f16|bf16} (PR #114977)

Artem Belevich via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 5 12:06:34 PST 2024


================
@@ -3917,3 +3917,24 @@ def atomic_thread_fence_seq_cst_cta :
 def atomic_thread_fence_acq_rel_cta :
   NVPTXInst<(outs), (ins), "fence.acq_rel.cta;", []>,
   Requires<[hasPTX<60>, hasSM<70>]>;
+
+def fpimm0 : FPImmLeaf<fAny, [{
+  return Imm.isExactlyValue(+0.0);
+}]>;
+
+def FMARELU_F16 :
+  NVPTXInst<(outs Int16Regs:$dst), (ins Int16Regs:$a, Int16Regs:$b, Int16Regs:$c),
+    "fma.rn.relu.f16 \t$dst, $a, $b, $c;", []>,
----------------
Artem-B wrote:

Next question is -- what do we want to do about `.ftz`?
We handle it for regular FMA instructions and it's probably needed here, too.

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


More information about the llvm-commits mailing list