[clang] [llvm] [LoongArch] [CodeGen] Add options for Clang to generate LoongArch-specific frecipe & frsqrte instructions (PR #109917)

via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 24 23:50:52 PDT 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 3da5e82e31712792411945b655929a1680fb476c eff8b3b5fb826c4f061acd27f6217434782cce59 --extensions h,cpp -- clang/lib/Driver/ToolChains/Arch/LoongArch.cpp llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp llvm/lib/Target/LoongArch/LoongArchISelLowering.h
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp b/llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp
index bbff8d097a..0f948e8148 100644
--- a/llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp
+++ b/llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp
@@ -5918,10 +5918,11 @@ Register LoongArchTargetLowering::getExceptionSelectorRegister(
 // Target Optimization Hooks
 //===----------------------------------------------------------------------===//
 
-static int getEstimateRefinementSteps(EVT VT, const LoongArchSubtarget &Subtarget) {
-  // Feature FRECIPE instrucions relative accuracy is 2^-14. 
+static int getEstimateRefinementSteps(EVT VT,
+                                      const LoongArchSubtarget &Subtarget) {
+  // Feature FRECIPE instrucions relative accuracy is 2^-14.
   // IEEE float has 23 digits and double has 52 digits.
-  int RefinementSteps = VT.getScalarType() == MVT::f64 ? 2: 1;
+  int RefinementSteps = VT.getScalarType() == MVT::f64 ? 2 : 1;
   return RefinementSteps;
 }
 

``````````

</details>


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


More information about the cfe-commits mailing list