Page MenuHomePhabricator

Support _Float128 and F128 literal in C mode
Needs ReviewPublic

Authored by MaskRay on Oct 7 2021, 8:55 PM.

Details

Summary

This adds F128 literal on top of D40673.

Note: rC321948 added some __builtin_*f128 functions.

Diff Detail

Event Timeline

MaskRay created this revision.Oct 7 2021, 8:55 PM
MaskRay requested review of this revision.Oct 7 2021, 8:55 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 7 2021, 8:55 PM

Are we sure this is wise? We know that any future standard C++ type can't be the same as __float128 (without changing the latter) because __float128 mangles the same as 128-bit long double. So by making __float128 the same as _Float128 in C, we're causing the relationship between __float128 and the "corresponding" standard types to differ between C and C++.

I know GCC went in the direction that has this complication. Do we know whether they figured their way out?

MaskRay added a subscriber: zatrazz.Oct 8 2021, 1:50 PM

This is to make more glibc files compilable with Clang. (@zatrazz)

Are we sure this is wise? We know that any future standard C++ type can't be the same as __float128 (without changing the latter) because __float128 mangles the same as 128-bit long double. So by making __float128 the same as _Float128 in C, we're causing the relationship between __float128 and the "corresponding" standard types to differ between C and C++.

No, but it's hard to change now. Introducing a GCC incompatible scheme probably does more harm than being compatible with them now...

I know GCC went in the direction that has this complication. Do we know whether they figured their way out?

qiucf added a subscriber: qiucf.Oct 27 2021, 1:28 AM