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 f28f0042 for ; Thu, 16 Jan 2020 18:56:25 +0000 (UTC) Received: (qmail 26162 invoked by uid 550); 16 Jan 2020 18:56:23 -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 26139 invoked from network); 16 Jan 2020 18:56:22 -0000 X-Authentication-Warning: key0.esi.com.au: damianm owned process doing -bs Date: Fri, 17 Jan 2020 05:56:06 +1100 (AEDT) From: Damian McGuckin To: musl@lists.openwall.com In-Reply-To: <20200116161427.GO30412@brightrain.aerifal.cx> Message-ID: References: <20200116161427.GO30412@brightrain.aerifal.cx> User-Agent: Alpine 2.02 (LRH 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Subject: Re: [musl] Considering x86-64 fenv.s to C On Thu, 16 Jan 2020, Rich Felker wrote: > As an aside, rather than implementing x86-specific C versions of these, > I'd like to end up with a general framework where the arch just exposes > a header (fenv_arch.h?) defining some primitives, and the actual fenv > function logic is all shared C. I'm not sure what the right > generalization is though. It looks like all archs have a get/set > exception-flags (status word) operation, but the rest varies a bit. I will try and put together a summary of what things do and we can go from there. It will need input from somebody with way more expertise on ARM and RISC-V (and X87) than I. > Would you be interested in assessing what kind of abstraction makes > sense here? I think the abstraction might need to be consensus. Some of it is not even 'fenv' related. For example, some routines only ever return zero, while for other FPUs, the same routine can return a (-1) if the exception mask had an component (bit) which was not a valid exception. Regards - Damian Pacific Engineering Systems International, 277-279 Broadway, Glebe NSW 2037 Ph:+61-2-8571-0847 .. Fx:+61-2-9692-9623 | unsolicited email not wanted here Views & opinions here are mine and not those of any past or present employer