[llvm] [DRAFT] Added hanlding for AVX512DQ+AVX512VL+AVX512F to lowerFPToIntToFP (PR #160582)

via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 24 11:57:25 PDT 2025


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 origin/main HEAD --extensions cpp -- llvm/lib/Target/X86/X86ISelLowering.cpp
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

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

``````````diff
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index c34a892d4..4a28f0de0 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -19920,23 +19920,24 @@ static SDValue lowerFPToIntToFP(SDValue CastToFP, const SDLoc &DL,
   bool IsUnsigned = CastToInt.getOpcode() == ISD::FP_TO_UINT;
 
   if (Subtarget.hasAVX512()) {
-    if (Subtarget.hasVLX())  {
-      // AVX512VL could handle for FP_TO_UINT/UINT_TO_FP (f64/32 <-> i32) AVX512F as well but Width = 512
+    if (Subtarget.hasVLX()) {
+      // AVX512VL could handle for FP_TO_UINT/UINT_TO_FP (f64/32 <-> i32)
+      // AVX512F as well but Width = 512
       if (IntVT == MVT::i32) {
-        ToIntOpcode = IsUnsigned ? X86ISD::CVTTP2UI : X86ISD::CVTTP2SI;  
-        ToFPOpcode = IsUnsigned ? X86ISD::CVTUI2P : X86ISD::CVTSI2P;  
+        ToIntOpcode = IsUnsigned ? X86ISD::CVTTP2UI : X86ISD::CVTTP2SI;
+        ToFPOpcode = IsUnsigned ? X86ISD::CVTUI2P : X86ISD::CVTSI2P;
       } else {
         ToIntOpcode = CastToInt.getOpcode();
         ToFPOpcode = IsUnsigned ? ISD::UINT_TO_FP : ISD::SINT_TO_FP;
-      } 
+      }
     } else if (Subtarget.hasDQI() && IntVT == MVT::i64) {
       // AVX512DQ + AVX512VL could handle f64/32 <-> i64 SINT & UINT
-      ToIntOpcode = CastToInt.getOpcode(); 
+      ToIntOpcode = CastToInt.getOpcode();
       ToFPOpcode = IsUnsigned ? ISD::UINT_TO_FP : ISD::SINT_TO_FP;
     } else {
       // AVX512F
       Width = 512;
-      ToIntOpcode = CastToInt.getOpcode(); 
+      ToIntOpcode = CastToInt.getOpcode();
       ToFPOpcode = IsUnsigned ? ISD::UINT_TO_FP : ISD::SINT_TO_FP;
     }
   } else {
@@ -19953,7 +19954,6 @@ static SDValue lowerFPToIntToFP(SDValue CastToFP, const SDLoc &DL,
   MVT VecIntVT = MVT::getVectorVT(IntVT, Width / IntSize);
   MVT VecVT = MVT::getVectorVT(VT, Width / VTSize);
 
-
   // sint_to_fp (fp_to_sint X) --> extelt (sint_to_fp (fp_to_sint (s2v X))), 0
   //
   // We are not defining the high elements (for example, zero them) because

``````````

</details>


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


More information about the llvm-commits mailing list