[llvm] [NVPTX] Support llvm.exp2 for f32 and vector of f32 (PR #120519)

Alex MacLean via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 18 20:54:56 PST 2024


================
@@ -518,6 +518,19 @@ multiclass F3_fma_component<string OpcStr, SDNode OpNode> {
                Requires<[hasBF16Math, noFMA]>;
 }
 
+// Template for operations which take one f32 operand.  Provides two
+// instructions: <OpcStr>.f32, and <OpcStr>.ftz.f32 (flush subnormal inputs and
+// results to zero).
+multiclass F1<string OpcStr, SDNode OpNode> {
+   def f32_ftz : NVPTXInst<(outs Float32Regs:$dst), (ins Float32Regs:$a),
+                           !strconcat(OpcStr, ".ftz.f32 \t$dst, $a;"),
+                           [(set Float32Regs:$dst, (OpNode Float32Regs:$a))]>,
----------------
AlexMaclean wrote:

Please use `f32:` for DAG patterns

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


More information about the llvm-commits mailing list