[PATCH] D71742: Added intrinsics for access to FP environment
Kevin P. Neal via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 23 06:12:10 PST 2019
kpn added a comment.
In D71742#1794638 <https://reviews.llvm.org/D71742#1794638>, @sepavloff wrote:
> In D71742#1793243 <https://reviews.llvm.org/D71742#1793243>, @kpn wrote:
>
> > I don't see the need. Changing the FP environment in a mixed environment program is the responsibility of the programmer, and standard calls already exist for this.
>
>
> This is about inlining. In the code like this:
>
> double f1(double x, double y) {
> return x + y;
> }
> double f2(double x, double y) {
> #pragma STDC FENV_ACCESS ON
> ...
> return f1(x, y);
> }
>
>
> compiler might inline call to `f1` in `f2`. However the inlined function `f1` expects default FP environment but is called in some other one.
Nothing here changes my statement. The compiler does _not_ change the FP environment because of the #pragma. So f1() here would behave the same whether it was inlined or not.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D71742/new/
https://reviews.llvm.org/D71742
More information about the llvm-commits
mailing list