[PATCH] Fix AAPCS-VFP non-compliance when returning HFA from variadic function

Renato Golin renato.golin at linaro.org
Thu Jan 16 03:32:27 PST 2014


Hi Oliver,

I'm moving your patch to the correct list (llvm-commits, not cfe-commits)
and re-attaching the patch, for other reviews.


On 16 January 2014 09:57, Oliver Stannard <oliver.stannard at arm.com> wrote:

> However, clang currently does not do the necessary transformation
> to return the result in memory when using the AAPCS-VFP calling convention,
> and when the struct is a homogeneous aggregate of floating-point types.
>

Nice catch! The patch looks good to me as it is, and I agree it's very
important to fix this variadic bug, but I have a question regarding the ABI:

6.1.2.2 Result return
Any result whose type would satisfy the conditions for a VFP CPRC is
returned in the appropriate number of
consecutive VFP registers starting with the lowest numbered register (s0,
d0, q0).

A VFP CPRC (as per 6.1.2.1), has some restriction on sizes like: "A
Homogeneous Aggregate with a Base Type of a single- or double-precision
floating-point type with one to
four Elements.". Will the direct approach here account for that? Will it
check the number of elements and revert to the base standard when more than
4?

If not, I agree a fix would not be part of this patch, so in all cases,
this specific patch looks good.



> Note, that this change will
> break ABI backwards-compatibility with previous versions of clang/llvm.
>

That's ok, we're in between releases, that's what we do! ;)

cheers,
--renato
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140116/2b9b8451/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: arm-hfa-variadic-vfp-return.patch
Type: text/x-patch
Size: 2586 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140116/2b9b8451/attachment.bin>


More information about the llvm-commits mailing list