mailing list of musl libc
 help / color / mirror / code / Atom feed
From: James Y Knight <jyknight@google.com>
To: musl@lists.openwall.com
Cc: Nikolaos Chatzikonstantinou <nchatz314@gmail.com>
Subject: Re: [musl] Re: Implementing csqrtl()
Date: Wed, 29 May 2024 11:13:12 -0400	[thread overview]
Message-ID: <CAA2zVHqZ1ijV2hEv2ue=pPTDUOwWnn4v4AbyQxbtpVJ8PH4u5w@mail.gmail.com> (raw)
In-Reply-To: <20240529125904.GC31267@brightrain.aerifal.cx>

[-- Attachment #1: Type: text/plain, Size: 1240 bytes --]

On Wed, May 29, 2024 at 8:58 AM Rich Felker <dalias@libc.org> wrote:

> existing
>
compilers all just wrongly reorder things with respect to fenv access
> and break it and don't care to fix this (probably because it would

hurt their benchmarks to fix it the right way).


FWIW (not that it changes the recommendation in this instance), Clang has
put a bunch of work into addressing this and other floating-point
compliance issues over the past decade. It *is* considered an important
thing to implement correctly, and I believe it generally is working on the
common architectures, since a few years ago. Unfortunately it's not yet
implemented on every architecture.

There is no impact on benchmarks by implementing fenv correctly, because,
per the C standard, it is undefined behavior to access the floating-point
status flags or to execute any code with non-default floating-point control
modes in effect unless "fenv_access" is enabled -- either using "#pragma
STDC FENV_ACCESS ON" in the code, or via an implementation-defined
mechanism to set the default to on (in clang, the command-line option
"-ffp-model=strict"). Because it's opt-in, only the code which actually
requires it takes the performance hit.

[-- Attachment #2: Type: text/html, Size: 1888 bytes --]

  reply	other threads:[~2024-05-29 15:13 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-04  9:35 [musl] " Nikolaos Chatzikonstantinou
2022-07-04 11:09 ` [musl] " Nikolaos Chatzikonstantinou
2022-07-05  9:37   ` Szabolcs Nagy
2022-07-05 14:28     ` Nikolaos Chatzikonstantinou
2022-07-05 15:35       ` Markus Wichmann
2022-07-05 16:14         ` Nikolaos Chatzikonstantinou
2024-05-29  1:38           ` Rich Felker
2024-05-28 20:48 ` Nikolaos Chatzikonstantinou
2024-05-29  0:38   ` Gabriel Ravier
2024-05-29  1:34     ` Rich Felker
     [not found]       ` <CAAQmekdsDO=KuJ4CuVjTnTU8Baz3++LdUr=TeKJ4bcLTfJ+1gA@mail.gmail.com>
2024-05-29 12:59         ` Rich Felker
2024-05-29 15:13           ` James Y Knight [this message]
2024-05-31 15:37             ` Szabolcs Nagy

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='CAA2zVHqZ1ijV2hEv2ue=pPTDUOwWnn4v4AbyQxbtpVJ8PH4u5w@mail.gmail.com' \
    --to=jyknight@google.com \
    --cc=musl@lists.openwall.com \
    --cc=nchatz314@gmail.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).