[clang] [HLSL] Implement frexp() (PR #235154)

via cfe-commits cfe-commits at lists.llvm.org
Sun Nov 29 10:28:08 PST 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 h -- clang/lib/Headers/hlsl/hlsl_intrinsic_helpers.h clang/lib/Headers/hlsl/hlsl_intrinsics.h --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/clang/lib/Headers/hlsl/hlsl_intrinsic_helpers.h b/clang/lib/Headers/hlsl/hlsl_intrinsic_helpers.h
index 72944845e..62064620d 100644
--- a/clang/lib/Headers/hlsl/hlsl_intrinsic_helpers.h
+++ b/clang/lib/Headers/hlsl/hlsl_intrinsic_helpers.h
@@ -107,7 +107,7 @@ template <typename T> constexpr T fmod_impl(T X, T Y) {
 template <typename T> constexpr T frexp_impl(T X, out T Exp) {
   auto Bits = bit_cast<uint>(X);
   auto ExpBits = Bits & 0x7f800000u;
-  auto IsSpecial = (ExpBits - 1u) >= 0x7f7fffffu;  // true iff Bits 0 or inf
+  auto IsSpecial = (ExpBits - 1u) >= 0x7f7fffffu; // true iff Bits 0 or inf
   auto MantBits = (Bits & 0x007fffffu) | 0x3f000000u;
   T Mant = select(IsSpecial, abs(X), bit_cast<float>(MantBits));
   auto RawExp = (ExpBits >> 23u) - 126u;

``````````

</details>


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


More information about the cfe-commits mailing list