From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/13330 Path: news.gmane.org!.POSTED!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: riscv port for review Date: Fri, 28 Sep 2018 10:28:14 -0400 Message-ID: <20180928142814.GU17995@brightrain.aerifal.cx> References: <20180928022404.GQ17995@brightrain.aerifal.cx> <20180928114324.GL10209@port70.net> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1538144782 1526 195.159.176.226 (28 Sep 2018 14:26:22 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 28 Sep 2018 14:26:22 +0000 (UTC) User-Agent: Mutt/1.5.21 (2010-09-15) To: musl@lists.openwall.com Original-X-From: musl-return-13346-gllmg-musl=m.gmane.org@lists.openwall.com Fri Sep 28 16:26:18 2018 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1g5tij-0000KL-UB for gllmg-musl@m.gmane.org; Fri, 28 Sep 2018 16:26:18 +0200 Original-Received: (qmail 5522 invoked by uid 550); 28 Sep 2018 14:28:27 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 5498 invoked from network); 28 Sep 2018 14:28:26 -0000 Content-Disposition: inline In-Reply-To: <20180928114324.GL10209@port70.net> Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:13330 Archived-At: On Fri, Sep 28, 2018 at 01:43:24PM +0200, Szabolcs Nagy wrote: > > diff --git a/src/math/riscv64/fmax.s b/src/math/riscv64/fmax.s > > new file mode 100644 > > index 0000000..40655d3 > > --- /dev/null > > +++ b/src/math/riscv64/fmax.s > > @@ -0,0 +1,5 @@ > > +.global fmax > > +.type fmax, %function > > +fmax: > > + fmax.d fa0, fa0, fa1 > > + ret > > this is ok, but note that > > riscv fmax is ieee-754-2018 maximumNumber(x,y) > iso c fmax (with ts 18661) is ieee-754-2008 maxNum(x,y) > > (see http://754r.ucbtest.org/drafts/ > and http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1778.pdf ) > > they only differ in snan handling, current iso c (and musl) > does not care about signaling nans, but that might change. > (glibc cares and gcc has flags to make it care.) Yes, for now I think it doesn't matter. > musl is moving away from asm to c code with gcc style inline > asm wherever possible (the drawback is the dependency on gcc > asm syntax and constraints, the benefit is that pcs and > prologue/epilogue are handled by the compiler so all sorts of > instrumentations like debug info, -fstack-protector-all, etc > just work). > > so i'd prefer to convert all these asm to c code. > (can be done after the port goes in) Indeed, I'd rather do this later as a fixup for all archs at once than try to work it out now as part of the riscv porting. They're logically separate tasks. Rich