Skip to content

Commit 6ed2a6b

Browse files
authored
[Flang]: Use actual endianness for Integer<80> (#103928)
This PR is to use the actual endianness of the platform when instantiate Integer<80> so that AIX (big-endian) will not get confused.
1 parent 29811a8 commit 6ed2a6b

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

flang/include/flang/Evaluate/integer.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,8 +1056,9 @@ extern template class Integer<16>;
10561056
extern template class Integer<32>;
10571057
extern template class Integer<64>;
10581058
using X87IntegerContainer =
1059-
Integer<80, true, 16, std::uint16_t, std::uint32_t, 128>;
1060-
extern template class Integer<80, true, 16, std::uint16_t, std::uint32_t, 128>;
1059+
Integer<80, isHostLittleEndian, 16, std::uint16_t, std::uint32_t, 128>;
1060+
extern template class Integer<80, isHostLittleEndian, 16, std::uint16_t,
1061+
std::uint32_t, 128>;
10611062
extern template class Integer<128>;
10621063
} // namespace Fortran::evaluate::value
10631064
#endif // FORTRAN_EVALUATE_INTEGER_H_

flang/lib/Evaluate/integer.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ template class Integer<8>;
1414
template class Integer<16>;
1515
template class Integer<32>;
1616
template class Integer<64>;
17-
template class Integer<80, true, 16, std::uint16_t, std::uint32_t, 128>;
17+
template class Integer<80, isHostLittleEndian, 16, std::uint16_t, std::uint32_t,
18+
128>;
1819
template class Integer<128>;
1920

2021
// Sanity checks against misconfiguration bugs

0 commit comments

Comments
 (0)