[llvm-dev] Floating point semantic modes

Kaylor, Andrew via llvm-dev llvm-dev at lists.llvm.org
Wed Jan 29 12:21:21 PST 2020

No, the fp-model options are intentionally umbrella/convenience options that set everything. So, -fp-model=strict is intended to provide exactly the "fully strict" mode that I was incorrectly associating with FENV_ACCESS. That is, the FMFs are orthogonal to fenv_access, but no fp modes are orthogonal to fp-model.

You can, of course, override individual settings from the fp-model. For instance, "-fp-model=strict -fassociative-math" could be allowed.

-----Original Message-----
From: Cameron McInally <cameron.mcinally at nyu.edu> 
Sent: Wednesday, January 29, 2020 11:57 AM
To: Kaylor, Andrew <andrew.kaylor at intel.com>
Cc: Serge Pavlov <sepavloff at gmail.com>; cfe-dev at lists.llvm.org; LLVM Developers Mailing List <llvm-dev at lists.llvm.org>; Ristow, Warren <warren.ristow at sony.com>; Ulrich Weigand (Ulrich.Weigand at de.ibm.com) <Ulrich.Weigand at de.ibm.com>; Kevin Neal <Kevin.Neal at sas.com>; Blower, Melanie I <melanie.blower at intel.com>; hfinkel at anl.gov; Sanjay Patel <spatel at rotateright.com>; Wang, Pengfei <pengfei.wang at intel.com>
Subject: Re: Floating point semantic modes

On Wed, Jan 29, 2020 at 1:51 PM Kaylor, Andrew <andrew.kaylor at intel.com> wrote:
> Yes, you’re probably right about this. I was originally thinking of FENV_ACCESS as a fully strict mode of operation, but what you’re suggesting aligns with what Cameron suggested and even some of my own reasoning on other points. So, let me amend my previous proposal to say:
>   Patch in progress. I think ON should force the following:
>     except_behavior { strict }
>     fenv_access { on }
>     rounding_mode { dynamic }
>   Other modes should be unchanged.

Does that apply to -ffp-model=strict too?

If FMFs are really orthogonal to -ffp-model=, then we shouldn't be setting default values for the FMFs.

>except_behavior { strict }
>fenv_access { on }
>rounding_mode { dynamic }
>contract { off }
>denormal_fp_math { IEEE }
>denormal_fp32_math { IEEE }
>support_math_errno { on }
>no_honor_nans { off }
>no_honor_infinities { off }
>no_signed_zeros { off }
>allow_reciprocal { off }
>allow_approximate_fns { off }
>allow_reassociation { off }

More information about the llvm-dev mailing list