Re:High Performance Correctly Rounded Math Libraries for 32-...
by BeeOnRope on Saturday August 28, 2021 @12:45AM
(#28335692)
What is a "per scope basis"?
Re:High Performance Correctly Rounded Math Libraries for 32-...
by jcranmer on Sunday August 29, 2021 @10:38AM
(#28347050)
You can change it between any pair of curly braces.
E.g.:
void foo(int N) {
for (int i = 0; i < N; i++) {
#pragma STDC FENV_ACCESS ON
// This applies only to the for loop...
}
// But not here, for example!
}
The dark underside of IEEE 754 is that full support for it also requires features that most languages don't provide access for: rounding mode and exception handling (aka sticky bits). In C/C++, using these features correctly requires STDC FENV_ACCESS support which is only in ICC and recent clang (neither GCC nor MSVC support it). And there's usually two hardware bits for handling denormals (flush-to-zero and denormals-are-zero) that aren't in IEEE 754, which tend to be on by default when you're compiling for some targets (most notably GPUs).
[1] https://software.intel.com/content/www/us/en/develop/documen... -- note fp-model=fast=[1|2]