Page MenuHomePhabricator

Allow __fp16 as a function arg or return type for AArch64

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



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.


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.



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.



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.