public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Matthias Kretz <m.kretz@gsi.de>
To: <gcc-help@gcc.gnu.org>, GCC Patches <gcc-patches@gcc.gnu.org>,
	GCC Development <gcc@gcc.gnu.org>
Subject: Re: [Questions] Is there any bit in gimple/rtl to indicate this IR support fast-math or not?
Date: Wed, 14 Jul 2021 08:39:30 +0200	[thread overview]
Message-ID: <43954837.W2eNPKTWaK@excalibur> (raw)
In-Reply-To: <CAMZc-by15chC-MK4RSkXJ53B8pajY80u4ixCs9zD=tF4DbOTPg@mail.gmail.com>

On Wednesday, 14 July 2021 07:18:29 CEST Hongtao Liu via Gcc-help wrote:
> On Wed, Jul 14, 2021 at 1:15 PM Hongtao Liu <crazylht@gmail.com> wrote:
> > Hi:
> >   The original problem was that some users wanted the cmdline option
> > 
> > -ffast-math not to act on intrinsic production code.

This sounds like the users want intrinsics to map *directly* to the 
corresponding instruction. If that's the case such users should use inline 
assembly, IMHO. If you compile a TU with -ffast-math then *all* floating-point 
operations are affected. Yes, more control over where to use fast-math and the 
ability to mix fast-math and no-fast-math without risking ODR violations would 
be great. But that's a larger issue, and one that would ideally be solved in 
WG14/WG21.

FWIW, this is what I'd do, i.e. turn off fast-math for the function in 
question:
https://godbolt.org/z/3cKq5hT1o

-- 
──────────────────────────────────────────────────────────────────────────
 Dr. Matthias Kretz                           https://mattkretz.github.io
 GSI Helmholtz Centre for Heavy Ion Research               https://gsi.de
 std::experimental::simd              https://github.com/VcDevel/std-simd
──────────────────────────────────────────────────────────────────────────

  reply	other threads:[~2021-07-14  6:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-14  5:15 Hongtao Liu
2021-07-14  5:18 ` Hongtao Liu
2021-07-14  6:39   ` Matthias Kretz [this message]
2021-07-14  7:04     ` Hongtao Liu
2021-07-14  7:39       ` Richard Biener
2021-07-14 16:45         ` Segher Boessenkool
     [not found] ` <47833128.jc7mZyZMxp@excalibur>
     [not found]   ` <CAFiYyc2t690=B77Mwb9=-T_TzQvZUj7RnFVDmuaWDJBN81DtHw@mail.gmail.com>
2021-07-16  8:57     ` [RFC] c-family: Add __builtin_noassoc Matthias Kretz
2021-07-16  9:31       ` Richard Biener
2021-07-16 12:00         ` Matthias Kretz
2021-07-19  7:16           ` Richard Biener

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=43954837.W2eNPKTWaK@excalibur \
    --to=m.kretz@gsi.de \
    --cc=gcc-help@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=gcc@gcc.gnu.org \
    /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.
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 read-only IMAP folder(s) and NNTP newsgroup(s).