This is an archive of the discontinued LLVM Phabricator instance.

Add -fnative-half-arguments-and-returns
ClosedPublic

Authored by pirama on Mar 13 2016, 8:12 PM.

Details

Summary

r246764 handled fp16 arguments and returns for AAPCS, but skipped this
handling for OpenCL. Simlar to OpenCL, RenderScript also handles
fp16
type natively.

This patch adds the -fnative-half-arguments-and-returns command line
flag to allow such languages to skip this coercion of __fp16.

Diff Detail

Repository
rL LLVM

Event Timeline

pirama updated this revision to Diff 50564.Mar 13 2016, 8:12 PM
pirama retitled this revision from to Add -fnative-half-arguments-and-returns.
pirama updated this object.
pirama added reviewers: srhines, olista01.
pirama added a subscriber: cfe-commits.

Kristof, can you or someone at ARM (where this is clearly relevant) take a look here? The CL obviously looks fine to me, but I might not have all of the original context as to why this was so constrained to OpenCL. Thanks.

olista01 accepted this revision.Mar 18 2016, 8:24 AM
olista01 edited edge metadata.

LGTM

This revision is now accepted and ready to land.Mar 18 2016, 8:24 AM
This revision was automatically updated to reflect the committed changes.

Thanks for the review!

Has this commit been merged without being approved by all the reviewers?

cfe/trunk/lib/CodeGen/TargetInfo.cpp
5109

Even though this change seems to be fine for OpenCL, I don't understand the reason for it entirely.

pirama added inline comments.May 20 2016, 1:09 PM
cfe/trunk/lib/CodeGen/TargetInfo.cpp
5109

This commit adds a generic option to skip the promotion of half types to float or int32. RenderScript also handles half natively. A new option makes this skip more general than langugage-specific.