[flang-commits] [flang] [llvm] [Flang][Runtime] Add fast path for formatted real input (PR #229335)
via flang-commits
flang-commits at lists.llvm.org
Tue Oct 6 01:10:37 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 -- flang-rt/lib/runtime/edit-input.cpp flang-rt/lib/runtime/io-api.cpp flang/lib/Decimal/decimal-to-binary.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/flang-rt/lib/runtime/edit-input.cpp b/flang-rt/lib/runtime/edit-input.cpp
index 3d0feef91..8b717e957 100644
--- a/flang-rt/lib/runtime/edit-input.cpp
+++ b/flang-rt/lib/runtime/edit-input.cpp
@@ -564,8 +564,8 @@ static RT_API_ATTRS void RaiseFPExceptions(
#define RAISE(e) \
terminator.Crash( \
"not implemented yet: raising FP exception in device code: %s", #e);
-// Some environment (e.g. emscripten, musl) don't define FE_OVERFLOW as allowed
-// by c99 (but not c++11) :-/
+ // Some environment (e.g. emscripten, musl) don't define FE_OVERFLOW as
+ // allowed by c99 (but not c++11) :-/
if (flags & decimal::ConversionResultFlags::Overflow) {
RAISE(FE_OVERFLOW);
}
diff --git a/flang/lib/Decimal/decimal-to-binary.cpp b/flang/lib/Decimal/decimal-to-binary.cpp
index fa056a428..ab45e4b45 100644
--- a/flang/lib/Decimal/decimal-to-binary.cpp
+++ b/flang/lib/Decimal/decimal-to-binary.cpp
@@ -555,7 +555,8 @@ static RT_API_ATTRS bool TryClingerFastPath(const char *&p, const char *end,
static_cast<unsigned __int128>(mantissa) * pow5[exp10]};
auto lo{static_cast<std::uint64_t>(prod)};
auto hi{static_cast<std::uint64_t>(prod >> 64)};
- int highBit{hi != 0 ? 127 - __builtin_clzll(hi) : 63 - __builtin_clzll(lo)};
+ int highBit{
+ hi != 0 ? 127 - __builtin_clzll(hi) : 63 - __builtin_clzll(lo)};
int lowBit{lo != 0 ? __builtin_ctzll(lo) : 64 + __builtin_ctzll(hi)};
inexact = highBit - lowBit + 1 > 53;
} else { // exp10 < 0
@@ -566,7 +567,8 @@ static RT_API_ATTRS bool TryClingerFastPath(const char *&p, const char *end,
if (isNegative) {
value = -value;
}
- result = {BinaryFloatingPointNumber<PREC>{value}, inexact ? Inexact : Exact};
+ result = {
+ BinaryFloatingPointNumber<PREC>{value}, inexact ? Inexact : Exact};
p = tail;
return true;
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/229335
More information about the flang-commits
mailing list