This is an archive of the discontinued LLVM Phabricator instance.

[X86][PowerPC] Support -mlong-double-128
ClosedPublic

Authored by MaskRay on Jul 6 2019, 12:06 AM.

Details

Summary

This patch makes the driver option -mlong-double-128 available for X86
and PowerPC. The CC1 option -mlong-double-128 is available on all targets
for users to test on unsupported targets.

On PowerPC, -mlong-double-128 uses the IBM extended double format
because we don't support -mabi=ieeelongdouble.

Diff Detail

Event Timeline

MaskRay created this revision.Jul 6 2019, 12:06 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 6 2019, 12:06 AM
MaskRay updated this revision to Diff 208260.Jul 6 2019, 12:46 AM

Add a driver test

MaskRay updated this revision to Diff 208266.Jul 6 2019, 3:47 AM

Small adjustment to PPC.cpp to make -mlong-double-128 -mabi=ieeelongdouble simpler

MaskRay marked an inline comment as done.Jul 6 2019, 4:12 AM
MaskRay added a subscriber: ABataev.
MaskRay added inline comments.
test/OpenMP/nvptx_unsupported_type_codegen.cpp
79

@ABataev The mangling scheme of __float128 is broken on x86 before this patch. For some reason the two lines no longer apply.. I assume you can fix this test properly :)

ABataev added inline comments.Jul 6 2019, 5:06 AM
test/OpenMP/nvptx_unsupported_type_codegen.cpp
79

You mean, these lines are not generated anymore? If so, it means that you broke compatibility between the host and device codegen with this patch.

MaskRay marked an inline comment as done.Jul 6 2019, 5:19 AM
MaskRay added inline comments.
test/OpenMP/nvptx_unsupported_type_codegen.cpp
79

The two lines are not generated. Can you help fix the test? The mangling scheme of __float128 is incorrect without this patch. If the test relies on that, it should be fixed. I know little about openmp+nvidia to understand what's going on..

ABataev added inline comments.Jul 6 2019, 5:25 AM
test/OpenMP/nvptx_unsupported_type_codegen.cpp
79

Sure, will try to send additional changes next week, most probably on Monday. Does this work for you?

MaskRay marked an inline comment as done.Jul 6 2019, 6:00 AM
MaskRay added inline comments.
test/OpenMP/nvptx_unsupported_type_codegen.cpp
79

Thanks!

MaskRay updated this revision to Diff 208402.Jul 8 2019, 7:23 AM

Rebase after getMangledCodeOfLongDouble -> getLongDoubleMangling rename

ABataev added inline comments.Jul 8 2019, 3:18 PM
test/OpenMP/nvptx_unsupported_type_codegen.cpp
79

Hi, I have a fix for the problem revealed with your patch, will commit it tomorrow. After this, I hope, the problem with the test will disappear.

ABataev added inline comments.Jul 9 2019, 7:12 AM
test/OpenMP/nvptx_unsupported_type_codegen.cpp
79

I fixed the problem, try to update the patch, the test should pass with your changes.

MaskRay updated this revision to Diff 208704.Jul 9 2019, 8:45 AM

Rebase

The openmp issue was fixed by r365485

Ping:) It'll be great to have D64277 (-mlong-double-128) D64282 (libcall) D64283 (-mabi=ieeelongdouble) before 9.0.0 is branched.

rnk accepted this revision.Jul 11 2019, 4:24 PM

lgtm with suggestion

lib/Driver/ToolChains/Clang.cpp
4009–4011

There should be a shorthand for passing through the argument, A->render() or something.

This revision is now accepted and ready to land.Jul 11 2019, 4:24 PM
MaskRay updated this revision to Diff 209404.Jul 11 2019, 7:26 PM

Use A->render(Args, CmdArgs);

MaskRay marked an inline comment as done.Jul 11 2019, 7:28 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJul 11 2019, 7:32 PM