mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: musl@lists.openwall.com
Cc: info@mobile-stream.com
Subject: Re: [PATCH] mips: add single-instruction math functions
Date: Wed, 18 Sep 2019 16:04:01 -0400	[thread overview]
Message-ID: <20190918200401.GD9017@brightrain.aerifal.cx> (raw)
In-Reply-To: <965098322.20190918201804@mobile-stream.com>

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


  reply	other threads:[~2019-09-18 20:04 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-11 10:05 info
2019-09-11 11:46 ` Rich Felker
2019-09-12 17:57 ` Rich Felker
2019-09-13 11:46   ` info
2019-09-13 18:31 ` Rich Felker
2019-09-13 18:56   ` Rich Felker
2019-09-13 19:12     ` James Y Knight
2019-09-13 20:01       ` Rich Felker
2019-09-13 20:23         ` Rich Felker
2019-09-18 13:07   ` info
2019-09-18 13:49     ` Rich Felker
2019-09-18 17:18   ` info
2019-09-18 20:04     ` Rich Felker [this message]
2019-09-19 12:54       ` info
2019-09-19 13:14         ` Rich Felker
2019-09-19 13:25           ` Rich Felker
2019-09-19 18:26           ` info
2019-09-19 19:10             ` Rich Felker
2019-10-14 14:18 ` Rich Felker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190918200401.GD9017@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --cc=info@mobile-stream.com \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).