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

via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 19 21:09:03 PST 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff c7606710f93cf0ab655a5bcbbf873954051ba109 136a56c0c7677eb787c0c851a1e486403b73b7f7 --extensions cpp -- llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp b/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
index 452da9f64c..bc4fc4d3ca 100644
--- a/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
+++ b/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
@@ -94,15 +94,17 @@ static cl::opt<bool> UsePrecSqrtF32(
     cl::desc("NVPTX Specific: 0 use sqrt.approx, 1 use sqrt.rn."),
     cl::init(true));
 
-static cl::opt<bool> UseApproxExp2F32(
-    "nvptx-approx-exp2f32", cl::Hidden,
-    cl::desc("NVPTX Specific: whether to use ex2.approx for exp2f() (default = true)"),
-    cl::init(true));
-
-static cl::opt<bool> UseApproxLog2F32(
-    "nvptx-approx-log2f32",
-    cl::desc("NVPTX Specific: whether to use lg2.approx for log2f() (default = true)"),
-    cl::init(true));
+static cl::opt<bool>
+    UseApproxExp2F32("nvptx-approx-exp2f32", cl::Hidden,
+                     cl::desc("NVPTX Specific: whether to use ex2.approx for "
+                              "exp2f() (default = true)"),
+                     cl::init(true));
+
+static cl::opt<bool>
+    UseApproxLog2F32("nvptx-approx-log2f32",
+                     cl::desc("NVPTX Specific: whether to use lg2.approx for "
+                              "log2f() (default = true)"),
+                     cl::init(true));
 
 static cl::opt<bool> ForceMinByValParamAlign(
     "nvptx-force-min-byval-param-align", cl::Hidden,

``````````

</details>


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


More information about the llvm-commits mailing list