[flang-commits] [flang] 6ed2a6b - [Flang]: Use actual endianness for Integer<80> (#103928)

via flang-commits flang-commits at lists.llvm.org
Sun Aug 18 06:28:21 PDT 2024


Author: Daniel Chen
Date: 2024-08-18T09:28:17-04:00
New Revision: 6ed2a6bf0d26122210c8732d80431529784c4000

URL: https://github.com/llvm/llvm-project/commit/6ed2a6bf0d26122210c8732d80431529784c4000
DIFF: https://github.com/llvm/llvm-project/commit/6ed2a6bf0d26122210c8732d80431529784c4000.diff

LOG: [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.

Added: 
    

Modified: 
    flang/include/flang/Evaluate/integer.h
    flang/lib/Evaluate/integer.cpp

Removed: 
    


################################################################################
diff  --git a/flang/include/flang/Evaluate/integer.h b/flang/include/flang/Evaluate/integer.h
index 4c7d88328a71e7..e69876f07b63cb 100644
--- a/flang/include/flang/Evaluate/integer.h
+++ b/flang/include/flang/Evaluate/integer.h
@@ -1056,8 +1056,9 @@ extern template class Integer<16>;
 extern template class Integer<32>;
 extern template class Integer<64>;
 using X87IntegerContainer =
-    Integer<80, true, 16, std::uint16_t, std::uint32_t, 128>;
-extern template class Integer<80, true, 16, std::uint16_t, std::uint32_t, 128>;
+    Integer<80, isHostLittleEndian, 16, std::uint16_t, std::uint32_t, 128>;
+extern template class Integer<80, isHostLittleEndian, 16, std::uint16_t,
+    std::uint32_t, 128>;
 extern template class Integer<128>;
 } // namespace Fortran::evaluate::value
 #endif // FORTRAN_EVALUATE_INTEGER_H_

diff  --git a/flang/lib/Evaluate/integer.cpp b/flang/lib/Evaluate/integer.cpp
index b982a3a0796cc5..17a38fa17a67cc 100644
--- a/flang/lib/Evaluate/integer.cpp
+++ b/flang/lib/Evaluate/integer.cpp
@@ -14,7 +14,8 @@ template class Integer<8>;
 template class Integer<16>;
 template class Integer<32>;
 template class Integer<64>;
-template class Integer<80, true, 16, std::uint16_t, std::uint32_t, 128>;
+template class Integer<80, isHostLittleEndian, 16, std::uint16_t, std::uint32_t,
+    128>;
 template class Integer<128>;
 
 // Sanity checks against misconfiguration bugs


        


More information about the flang-commits mailing list