[llvm] [NVPTX] Support exp2 and log2 for f32/f16/bf16 and vectors (PR #120519)

Alex MacLean via llvm-commits llvm-commits at lists.llvm.org
Sat Dec 21 13:11:54 PST 2024


================
@@ -1193,6 +1206,10 @@ defm FNEG_H: F2_Support_Half<"neg", fneg>;
 
 defm FSQRT : F2<"sqrt.rn", fsqrt>;
 
+defm FEXP2 : F1<"ex2.approx", fexp2>;
----------------
AlexMaclean wrote:

Looks like we already have these instructions here: 

https://github.com/llvm/llvm-project/blob/fd784726db70a5155594c32ee839b8807fafd87d/llvm/lib/Target/NVPTX/NVPTXIntrinsics.td#L1252-L1268

Instead of creating a duplicate set, can you use patterns to rewrite these nodes to those existing instructins?

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


More information about the llvm-commits mailing list