[Questions] Is there any bit in gimple/rtl to indicate this IR support fast-math or not?

Matthias Kretz m.kretz@gsi.de
Wed Jul 14 06:39:30 GMT 2021


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
──────────────────────────────────────────────────────────────────────────


More information about the Gcc-patches mailing list