mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Alexander Monakov <amonakov@ispras.ru>
To: "Alex Rønne Petersen" <alex@alexrp.com>
Cc: musl@lists.openwall.com
Subject: Re: [musl] [PATCH] configure: prevent compilers from turning a * b + c into fma(a, b, c)
Date: Thu, 29 Aug 2024 18:09:16 +0300 (MSK)	[thread overview]
Message-ID: <78a7c979-19a0-b9bb-95d1-3da2f75322f0@ispras.ru> (raw)
In-Reply-To: <CAH9TF6M7Xey=COOVGDvQovTyyqum_8k783RJjVUXqUKYsSxa=Q@mail.gmail.com>

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


On Thu, 29 Aug 2024, Alex Rønne Petersen wrote:

> That aside, while the motivating issue doesn't (easily) reproduce with
> vanilla Clang, it's nonetheless still the case that Clang folds
> multiple expressions in `fma()` into `llvm.fmuladd.*` intrinsic calls.
> While this might work out in some cases, we've still basically lost at
> the LLVM IR level; we're at the mercy of the target backend in regards
> to whether it gets lowered to an actual FMA instruction or split back
> to the ~original FMUL + FADD. And this isn't even considering what
> other nonsense the optimizer pipeline might get up to before that.

Thank you for uncovering what was happening in LLVM! I agree there's
a backend bug, but the point is moot since disabling FMA contraction
globally is the way to go, as discussed in the longer sub-thread.

Alexander

      reply	other threads:[~2024-08-29 15:09 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-28 15:28 Alex Rønne Petersen
2024-08-28 15:53 ` Alexander Monakov
2024-08-28 16:31   ` Alex Rønne Petersen
2024-08-28 20:15   ` Rich Felker
2024-08-28 20:32     ` Alexander Monakov
2024-08-28 20:47       ` Rich Felker
2024-08-28 21:11         ` Alexander Monakov
2024-08-29 13:37           ` Alex Rønne Petersen
2024-08-28 19:56 ` Alexander Monakov
2024-08-29 13:36   ` Alex Rønne Petersen
2024-08-29 15:09     ` Alexander Monakov [this message]

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=78a7c979-19a0-b9bb-95d1-3da2f75322f0@ispras.ru \
    --to=amonakov@ispras.ru \
    --cc=alex@alexrp.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).