This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RTABI half-precision conversion functions (ping)
- From: Julian Brown <julian at codesourcery dot com>
- Cc: Paul Brook <paul at codesourcery dot com>, <gcc-patches at gcc dot gnu dot org>, <ams at codesourcery dot com>, <ramana dot radhakrishnan at linaro dot org>, <rearnsha at arm dot com>
- Date: Thu, 29 May 2014 11:16:52 +0100
- Subject: Re: RTABI half-precision conversion functions (ping)
- Authentication-results: sourceware.org; auth=none
- References: <20120719132816 dot 2b51c0bc at octopus> <201207191354 dot 58297 dot paul at codesourcery dot com> <20120719144754 dot 514db0e3 at octopus>
On Thu, 19 Jul 2012 14:47:54 +0100
Julian Brown <julian@codesourcery.com> wrote:
> On Thu, 19 Jul 2012 13:54:57 +0100
> Paul Brook <paul@codesourcery.com> wrote:
>
> > > But, that means EABI-conformant callers are also perfectly
> > > entitled to sign-extend half-float values before calling our
> > > helper functions (although GCC itself won't do that). Using
> > > "unsigned int" and taking care to only examine the low-order bits
> > > of the value in the helper function itself serves to fix the
> > > latent bug, is compatible with existing code, allows us to be
> > > conformant with the eabi, and allows use of aliases to make the
> > > __gnu and __aeabi functions the same.
> >
> > As long as LTO never sees this mismatch we should be fine :-) AFAIK
> > we don't curently have any way of expressing the actual ABI.
>
> Let's not worry about that for now :-).
>
> > > The patch no longer applied as-is, so I've updated it (attached,
> > > re-tested). Note that there are no longer any target-independent
> > > changes (though I'm not certain that the symbol versions are still
> > > correct).
> > >
> > > OK to apply?
> >
> > I think this deserves a comment in the source. Otherwise it's
> > liable to get "fixed" in the future :-) Something allong the lines
> > of "While the EABI describes the arguments to the half-float helper
> > routines as 'short', it does not require that they be extended to
> > full register width. The normal ABI requres that the caller
> > sign/zero extend short values to 32 bit. We use unsigned int
> > arguments to prevent the gcc making assumptions about the high half
> > of the register."
>
> Here's a version with an explanatory comment. I also fixed a couple of
> minor formatting nits I noticed (they don't upset the diff too much, I
> don't think).
It looks like this one got forgotten about. Ping?
Context:
https://gcc.gnu.org/ml/gcc-patches/2012-07/msg00902.html
https://gcc.gnu.org/ml/gcc-patches/2012-07/msg00912.html
This is an EABI-conformance fix.
Thanks,
Julian