This is an archive of the discontinued LLVM Phabricator instance.

Add NaCl to long double/fp128 mangling test
ClosedPublic

Authored by dschuff on Aug 10 2015, 4:22 PM.

Details

Summary

NaCl is a platform where long double is the same as double.
Its mangling is spelled with "long double" but its ABI lowering is the same
as double.

Diff Detail

Repository
rL LLVM

Event Timeline

dschuff updated this revision to Diff 31744.Aug 10 2015, 4:22 PM
dschuff retitled this revision from to Add NaCl to long double/fp128 mangling test.
dschuff updated this object.
dschuff added reviewers: rnk, chh.
dschuff added a subscriber: cfe-commits.

I'm not an expert in mangling, and I'm not 100% sure if this is right. The Itanium ABI's spec lists "long double" as the same as __float80. Should we use "double" in mangling instead?

rnk accepted this revision.Aug 10 2015, 4:24 PM
rnk edited edge metadata.

lgtm

Feel free to commit more test coverage like this with just post-commit review.

This revision is now accepted and ready to land.Aug 10 2015, 4:24 PM
rnk added a comment.Aug 10 2015, 4:26 PM

I'm not an expert in mangling, and I'm not 100% sure if this is right. The Itanium ABI's spec lists "long double" as the same as __float80. Should we use "double" in mangling instead?

If you can have different overloads between double and long double, we need a separate mangling.

Looks like all the other unix targets that use IEEEDouble as their format do this too, including all the NaCl compilers.

This revision was automatically updated to reflect the committed changes.
chh edited edge metadata.Aug 10 2015, 5:22 PM

If there were only two different types,
we should have mangled name 'd' for double and 'e' for long double,
even if their implementations are the same.

The problem came when g++ has float80 and float128 types,
and long double could be implemented as float80 or float128.
Then 'e' is used for float80, 'g' for float128,
and 'long double' has mangled name 'e' or 'g', depending on whether
it is float80 or float128.

Yes, so far I know only Android and powerpc use fp128 for long double on x86_64.