[llvm] [X86] Lower scalar bf16 arithmetic on AVX10.2 via packed ops (PR #212245)

via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 28 08:11:32 PDT 2026


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 --diff_from_common_commit
``````````

: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 ca80ade65..315f76e9e 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -34531,8 +34531,8 @@ SDValue X86TargetLowering::LowerOperation(SDValue Op, SelectionDAG &DAG) const {
 ///
 /// Each operand is reinterpreted as f16 before building the vector. bf16 has no
 /// scalar register class of its own, but f16 does (FR16X), and bf16/f16 share
-/// the same bits and vector register class (VR128X). Going through f16 keeps the
-/// value in an XMM register: bf16->f16 bitcast, f16->v8f16 SCALAR_TO_VECTOR
+/// the same bits and vector register class (VR128X). Going through f16 keeps
+/// the value in an XMM register: bf16->f16 bitcast, f16->v8f16 SCALAR_TO_VECTOR
 /// (a free COPY_TO_REGCLASS), and v8f16->v8bf16 bitcast are all free. Feeding a
 /// scalar bf16 to SCALAR_TO_VECTOR directly would instead route through bf16's
 /// i16 soft-promote carrier, forcing xmm<->GPR vmovw roundtrips.

``````````

</details>


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


More information about the llvm-commits mailing list