[llvm] [SPARC] Use fzero/fzeros to materialize FP zeros when we have VIS (PR #135712)

Sergei Barannikov via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 14 18:21:25 PDT 2025


================
@@ -277,3 +277,16 @@ def UMULXHI  : VISInst<0b000010110, "umulxhi", I64Regs>;
 def XMULX    : VISInst<0b100010101, "xmulx",   I64Regs>;
 def XMULXHI  : VISInst<0b100010110, "xmulxhi", I64Regs>;
 } // Predicates = [IsVIS3]
+
+// FP immediate patterns.
+def fpimm0 : PatLeaf<(fpimm), [{return N->isExactlyValue(+0.0);}]>;
----------------
s-barannikov wrote:

Should be `FPImmLeaf`, see the comment near `ImmLeaf` for why it is better.
(It is also GISel friendly, if that is ever going to be supported.)


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


More information about the llvm-commits mailing list