This is an archive of the discontinued LLVM Phabricator instance.

Fix Calling Convention of __float128 and long double(128bits) in i386
Needs ReviewPublic

Authored by yubing on Aug 26 2020, 6:40 PM.

Details

Summary

This patch make __float128/long double(128bits) passed on the stack with 16-byte alignment, according to i386 System V ABI.

Diff Detail

Event Timeline

yubing created this revision.Aug 26 2020, 6:40 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 26 2020, 6:40 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
yubing requested review of this revision.Aug 26 2020, 6:40 PM
yubing edited the summary of this revision. (Show Details)Aug 26 2020, 7:05 PM
yubing updated this revision to Diff 288218.Aug 27 2020, 12:44 AM

Modify a testcase: clang/test/CodeGenCXX/float128-declarations.cpp

rjmccall added inline comments.Aug 27 2020, 1:11 AM
clang/lib/CodeGen/TargetInfo.cpp
1603

I don't think this should be restricted to just Linux. It's a fix for all OSes that support __float128, i.e. Haiku, Linux, OpenBSD, and Solaris.

It would be better to check the floating-point semantics rather than relying on the type size, since the type size could easily be rounded up to 128 for alignment reasons.

Should this also apply to structs containing __float128, the same way that SIMD does below?