From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.2 Received: from mother.openwall.net (mother.openwall.net [195.42.179.200]) by inbox.vuxu.org (OpenSMTPD) with SMTP id 2c0342a7 for ; Tue, 14 Jan 2020 18:58:50 +0000 (UTC) Received: (qmail 16375 invoked by uid 550); 14 Jan 2020 18:58:48 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 16357 invoked from network); 14 Jan 2020 18:58:48 -0000 Date: Tue, 14 Jan 2020 13:58:35 -0500 From: Rich Felker To: musl@lists.openwall.com Message-ID: <20200114185835.GG30412@brightrain.aerifal.cx> References: <20200114185058.GV23985@port70.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200114185058.GV23985@port70.net> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: Rich Felker Subject: Re: [musl] Q: dealing with missing removal of excess precision On Tue, Jan 14, 2020 at 07:50:58PM +0100, Szabolcs Nagy wrote: > * Alexander Monakov [2020-01-14 21:17:55 +0300]: > > What to do with functions that return values with excess precision from asm? > > > > Many of the remaining x87-based asm implementations do not remove excess > > precision on return. This looks like a bug, but matches Glibc behavior. > > Moving such functions to C would either introduce removal of excess precision, > > or result in code that lies to the compiler by pretending that inline asm keeps > > values within precision of float/double, where in reality it might not. > > the intention is to remove excess precision so it's good that's happening. Agreed. It may be a slight performance regression but it's the right thing to do anyway. > otoh it would be nice if there was a way to tell the compiler not to > remove it (e.g. in case the asm already took care of it) even in c99 > standard mode. Perhaps this happens if the output constraint is tied to a float rather than a long double? Rich