Page MenuHomePhabricator

Allow __fp16 as a function arg or return type for AArch64
ClosedPublic

Authored by olista01 on Jul 10 2014, 2:54 AM.

Details

Reviewers
t.p.northover
Summary

ACLE 2.0 [1] allows __fp16 to be used as a function argument or return type. This enables this for AArch64.

I have not enabled this for 32-bit ARM targets yet, as we are expecting to release an updated version of the 32-bit AAPCS soon, which changes the handling of __fp16 in a non backwards-compatible way.

[1] http://infocenter.arm.com/help/topic/com.arm.doc.ihi0053c/IHI0053C_acle_2_0.pdf

Diff Detail

Event Timeline

olista01 updated this revision to Diff 11254.Jul 10 2014, 2:54 AM
olista01 retitled this revision from to Allow __fp16 as a function arg or return type for AArch64.
olista01 updated this object.
olista01 edited the test plan for this revision. (Show Details)
olista01 set the repository for this revision to rL LLVM.
olista01 added a subscriber: Unknown Object (MLST).
t.p.northover accepted this revision.Jul 11 2014, 4:04 AM
t.p.northover added a reviewer: t.p.northover.
t.p.northover added a subscriber: t.p.northover.

Hi Oliver,

I think this looks reasonable.

Cheers.

Tim.

This revision is now accepted and ready to land.Jul 11 2014, 4:04 AM

Actually, I've just noticed that this only applies to AAPCS. Could you add the CallingConvention lines to DarwinPCS too? We'll want to support ACLE too.

Cheers.

Tim.

olista01 closed this revision.Jul 11 2014, 6:43 AM

Thanks, committed revision 212812.

Are you also going to review the dependent patch, D4456?

Are you also going to review the dependent patch, D4456?

I am thinking hard about it, but that's an ugly hack to put into Clang.

It would be better if we could use "half" unconditionally and fptrunc/fpext instead of the conversion intrinsics, but that brings its own problems (like InstCombine folding things down to real, non-trivial operations on "half").

I'm still not quite sure what the best solution is or how much work would be involved in the different approaches.

Cheers.

Tim.