This is an archive of the discontinued LLVM Phabricator instance.

[flang][runtime] Use __float128 where possible & needed in runtime
ClosedPublic

Authored by klausler on Jun 3 2022, 4:03 PM.

Details

Summary

On targets with __float128 available and distinct from long double,
use it to support more kind=16 entry points. This affects mostly
x86-64 targets. This means that more runtime entry points are
defined for lowering to call.

Delete Common/long-double.h and its LONG_DOUBLE macro in favor of
testing the standard macro LDBL_MANT_DIG.

Diff Detail

Event Timeline

klausler created this revision.Jun 3 2022, 4:03 PM
Herald added a project: Restricted Project. · View Herald Transcript
klausler requested review of this revision.Jun 3 2022, 4:03 PM
vdonaldson accepted this revision.Jun 3 2022, 5:06 PM
This revision is now accepted and ready to land.Jun 3 2022, 5:06 PM
klausler updated this revision to Diff 434281.Jun 4 2022, 11:19 AM

Rebase to current head of tree.

klausler updated this revision to Diff 434289.Jun 4 2022, 2:37 PM

Fix non-GCC build issues from CI.

klausler updated this revision to Diff 434290.Jun 4 2022, 3:09 PM

Run clang-format.

klausler updated this revision to Diff 434292.Jun 4 2022, 3:56 PM

Iterate again to try to fix Windows build.

klausler updated this revision to Diff 434293.Jun 4 2022, 4:34 PM

Iterating again in search of an implementation that msvc, g++, and clang all like. Sorry about the spam. How's your Saturday going?

klausler updated this revision to Diff 434297.Jun 4 2022, 5:26 PM

Iterating again.

MehdiChinoune added inline comments.
flang/runtime/random.cpp
123–124

Shouldn't be:

#if LDBL_MANT_DIG == 64
       Generate<CppTypeFor<TypeCategory::Real, 10>, 64>(harvest);
       return;
+#endif
klausler updated this revision to Diff 434331.Jun 5 2022, 9:18 AM

Add #if test to protect MSVC from seeing 80-bit long double usage already protected by an "if constexpr".