From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17258 invoked by alias); 29 May 2014 10:17:11 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 17236 invoked by uid 89); 29 May 2014 10:17:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00,MISSING_HEADERS autolearn=no version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 29 May 2014 10:17:09 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1WpxOR-00029p-5P from Julian_Brown@mentor.com ; Thu, 29 May 2014 03:17:03 -0700 Received: from SVR-IES-FEM-01.mgc.mentorg.com ([137.202.0.104]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Thu, 29 May 2014 03:17:03 -0700 Received: from octopus (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.2.247.3; Thu, 29 May 2014 11:17:00 +0100 Date: Thu, 29 May 2014 10:17:00 -0000 From: Julian Brown CC: Paul Brook , , , , Subject: Re: RTABI half-precision conversion functions (ping) Message-ID: <20140529111652.66742970@octopus> In-Reply-To: <20120719144754.514db0e3@octopus> References: <20120719132816.2b51c0bc@octopus> <201207191354.58297.paul@codesourcery.com> <20120719144754.514db0e3@octopus> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2014-05/txt/msg02531.txt.bz2 On Thu, 19 Jul 2012 14:47:54 +0100 Julian Brown wrote: > On Thu, 19 Jul 2012 13:54:57 +0100 > Paul Brook 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