mailing list of musl libc
 help / color / mirror / code / Atom feed
From: info@mobile-stream.com
To: Rich Felker <dalias@libc.org>
Cc: musl@lists.openwall.com
Subject: Re: [PATCH] mips: add single-instruction math functions
Date: Thu, 19 Sep 2019 21:26:18 +0300	[thread overview]
Message-ID: <14310266567.20190919212618@mobile-stream.com> (raw)
In-Reply-To: <20190919131437.GF9017@brightrain.aerifal.cx>


>> 2) -mabs=2008 application will work correctly with -mabs=legacy musl
>> on a -mabs=2008 system.

R> Are you sure? This seems to disagree with what you're saying below

Yes, assuming they all were built with the same -mnan= option.

The -mabs=2008 option has no ABI tag, it is just a compiler flag that controls how many instructions are used for |x| and -x.

I think there is some optimisation flag in gcc that does exactly the same without declaring __mips_abs2008.

Only -mnan=xxx consistency is enforced by the kernel basing on the corresponding bits in the ELF header and FCSR.

But yes, IIUC kernel assumes nan2008 binary is abs2008 too though this has no deep (or whatever) meaning on cores with hard-wired feature bits in FCSR.



R> musl supports multiple ecosystems in the same filesystem regardless of
R> whether a cpu does; that's the whole point of supporting even multiple
R> unrelated archs like mips and arm or x86 and riscv and why they all
R> have differing ldso names. For example you can be running the foreign
R> ISA via qemu-user with binfmt_misc or explicitly.

OK. Though qemu-user has -L option for things like this.



R> In that case, it seems like the kernel would refuse to load
R> -mabs=legacy binaries on nan2008 hardware, gratuitously due to

No, no. The kernel only knows -mnan=xxx status for binary.

All this mess is because architecture spec defines these features as distinct, compilers have independent options for them (gcc even has --with-nan= in ./configure but no --with-abs=), kernel code is written like it can change FCSR bits etc.

It reality these bits are always either both zero (non-existant on <= R3) or both set in hardware and only NAN2008 FCSR bit has reflection in the ELF header flags.



  parent reply	other threads:[~2019-09-19 18:26 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
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 [this message]
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=14310266567.20190919212618@mobile-stream.com \
    --to=info@mobile-stream.com \
    --cc=dalias@libc.org \
    --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).