Skip to content

[flang][runtime] Add FLANG_RUNTIME_NO_REAL_3 flag to build #105856

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions flang/runtime/numeric.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,11 @@ inline RT_API_ATTRS CppTypeFor<TypeCategory::Integer, 4> SelectedRealKind(
#else
constexpr bool hasReal2{false};
#endif
#ifndef FLANG_RUNTIME_NO_REAL_3
constexpr bool hasReal3{true};
#else
constexpr bool hasReal3{false};
#endif
#if defined LDBL_MANT_DIG == 64 && !defined FLANG_RUNTIME_NO_REAL_10
constexpr bool hasReal10{true};
#else
Expand Down Expand Up @@ -171,9 +176,9 @@ inline RT_API_ATTRS CppTypeFor<TypeCategory::Integer, 4> SelectedRealKind(
}

if (r <= 4) {
kind = kind < 2 ? 2 : kind;
kind = kind < 2 ? (hasReal2 ? 2 : 4) : kind;
} else if (r <= 37) {
kind = kind < 3 ? (p == 3 ? 4 : 3) : kind;
kind = kind < 3 ? (hasReal3 && p != 3 ? 3 : 4) : kind;
} else if (r <= 307) {
kind = kind < 8 ? 8 : kind;
} else if (hasReal10 && r <= 4931) {
Expand Down
Loading