On Thu, 29 May 2014 11:16:52 +0100 Julian Brown <jul...@codesourcery.com> wrote:
> On Thu, 19 Jul 2012 14:47:54 +0100 > Julian Brown <jul...@codesourcery.com> wrote: > > > On Thu, 19 Jul 2012 13:54:57 +0100 > > Paul Brook <p...@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. Ping? Julian