[flang-commits] [flang] [flang] Warn when F128 is unsupported (#102147) (PR #106957)

Slava Zakharin via flang-commits flang-commits at lists.llvm.org
Tue Sep 3 13:30:23 PDT 2024


================
@@ -21,9 +22,25 @@ namespace Fortran::tools {
 
   const llvm::Triple &targetTriple{targetMachine.getTargetTriple()};
   // FIXME: Handle real(3) ?
-  if (targetTriple.getArch() != llvm::Triple::ArchType::x86_64)
+  if (targetTriple.getArch() != llvm::Triple::ArchType::x86_64) {
     targetCharacteristics.DisableType(
         Fortran::common::TypeCategory::Real, /*kind=*/10);
+  }
+
+  // Figure out if we can support F128: see
+  // flang/runtime/Float128Math/math-entries.h
+#ifdef FLANG_RUNTIME_F128_MATH_LIB
+  // we can use libquadmath wrappers
+  constexpr bool f128Support = true;
+#elif LDBL_MANT_DIG == 113
----------------
vzakhari wrote:

Ideally, this should be taken from the `TargetInfo::getLongDoubleFormat()`, so that `f128Support` does not depend on the host build compiler. I understand that there is no current use of `TargetInfo` in flang due to concerns about adding more dependencies on clang, but maybe we should put a TODO note here to clean it up later.

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


More information about the flang-commits mailing list