[PATCH] D69272: Restricted variant of '#pragma STDC FENV_ACCESS'

Melanie Blower via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 20 07:48:25 PST 2019


mibintc added a comment.

In D69272#1717021 <https://reviews.llvm.org/D69272#1717021>, @kpn wrote:

> Is there a way forward to support having the #pragma at the start of any block inside a function? The effect won't be restricted to that block, true, but the standard does say the #pragma is allowed.


Please clarify: I understand that the backend wants all floating point operations to be built using Floating Point Constrained Intrinsics if any operations use constrained intrinsic. But I thought that, if the constraint were only to apply to a block within the function, that the operations outside the block would be written with the default setting for rounding mode and exception behavior, and the operations inside the constrained block would be created with different settings.  Like this
float f( float a, float b) {
a*b ; // this operation is written with floating point constrained intrinsic, rounding mode nearest, exception behavior ignore
{
#pragma float_control ... // set exception behavior to strict
a*b; // this operation is written with floating point constrained intrinsic, rounding mode tonearest, exception behavior strict
}}


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D69272/new/

https://reviews.llvm.org/D69272





More information about the cfe-commits mailing list