From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/14696 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH] mips: add single-instruction math functions Date: Wed, 18 Sep 2019 16:04:01 -0400 Message-ID: <20190918200401.GD9017@brightrain.aerifal.cx> References: <20190911103224.504A15C44C@mx7.valuehost.ru> <20190913183123.GI9017@brightrain.aerifal.cx> <965098322.20190918201804@mobile-stream.com> Reply-To: musl@lists.openwall.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="42886"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mutt/1.5.21 (2010-09-15) Cc: info@mobile-stream.com To: musl@lists.openwall.com Original-X-From: musl-return-14712-gllmg-musl=m.gmane.org@lists.openwall.com Wed Sep 18 22:04:16 2019 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.89) (envelope-from ) id 1iAgBU-000B3b-AJ for gllmg-musl@m.gmane.org; Wed, 18 Sep 2019 22:04:16 +0200 Original-Received: (qmail 17843 invoked by uid 550); 18 Sep 2019 20:04:14 -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 17825 invoked from network); 18 Sep 2019 20:04:13 -0000 Content-Disposition: inline In-Reply-To: <965098322.20190918201804@mobile-stream.com> Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:14696 Archived-At: On Wed, Sep 18, 2019 at 08:18:04PM +0300, info@mobile-stream.com wrote: > R> Why is this dependent on __mips_abs2008? > > There is also __mips_nan2008 (always set for hard-float R6 and > -mnan=2008). > > Binaries built with this option (implicit or not) are unusable on > -mnan=legacy system, this is enforced by kernel (unless booted with > some debugging option). > > The fabs code could be changed to also depend on __mips_nan2008 > (since these ISA features are paired) to prevent -mabs=2008 musl on > -mabs=legacy system (rather unrealistic). > > Why is it wrong to depend on fine-grained ISA features after all? It's not. The presence of a new instruction for non-arithmetic abs would be a fine-grained ISA feature. An incompatible change in an existing instruction is a *different ISA*, which needs a different ldsoname per musl policy of always allowing different ISAs to coexist in the same filesystem and have their own library ecosystems. I'm guessing we've hit a situation where people have been building binaries for an incompatible MIPS-family ISA reusing the same ldsoname, which is a huge mess we probably need to figure out how to deal with... > Why is it wrong to explicitly depend e.g. on __mips_dsp in the > strchr code fearing improper usage on a system without DSP ASE? Because it's an ISA level, not an incompatible ISA. With libc built for the baseline ISA level (or any ISA level not assuming dsp; actually it probably doesn't matter even if it does since I can't imagine the compiler generates dsp insns for anything in libc) you can run *both baseline non-dsp mips binaries, and ones using dsp features*. Note that this is the same situation as i386; as long as libc is built for a baseline (like i486; i386 is actually a misnomer) you can run both baseline binaries and ones built for i686 or whatever more recent ISA level you like using the same libc (and library ecosystem and filesystem). > powerpc64, s390x have similar ifdefs in their math code and IIUC > nothing prevents running (until SIGILL) statically-linked > _ARCH_PWR5X binary on an _ARCH_PWR5 system. You're looking at it the other way around. > Or some powerpc64 code depends on __VSX__. Is it wrong to depend on > __mips_msa? > > What is different with mips here? Reversal of direction of the incompatibility. Rich