math: use '#pragma STDC FENV_ACCESS ON' when fenv is accessed
This commit is contained in:
parent
c4359e0130
commit
033a9d6ad2
10 changed files with 11 additions and 0 deletions
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
int feupdateenv(const fenv_t *envp)
|
int feupdateenv(const fenv_t *envp)
|
||||||
{
|
{
|
||||||
|
#pragma STDC FENV_ACCESS ON
|
||||||
int ex = fetestexcept(FE_ALL_EXCEPT);
|
int ex = fetestexcept(FE_ALL_EXCEPT);
|
||||||
fesetenv(envp);
|
fesetenv(envp);
|
||||||
feraiseexcept(ex);
|
feraiseexcept(ex);
|
||||||
|
|
|
||||||
|
|
@ -89,6 +89,7 @@ static int getexp(long double x)
|
||||||
|
|
||||||
double fma(double x, double y, double z)
|
double fma(double x, double y, double z)
|
||||||
{
|
{
|
||||||
|
#pragma STDC FENV_ACCESS ON
|
||||||
long double hi, lo1, lo2, xy;
|
long double hi, lo1, lo2, xy;
|
||||||
int round, ez, exy;
|
int round, ez, exy;
|
||||||
|
|
||||||
|
|
@ -306,6 +307,7 @@ static inline struct dd dd_mul(double a, double b)
|
||||||
*/
|
*/
|
||||||
double fma(double x, double y, double z)
|
double fma(double x, double y, double z)
|
||||||
{
|
{
|
||||||
|
#pragma STDC FENV_ACCESS ON
|
||||||
double xs, ys, zs, adj;
|
double xs, ys, zs, adj;
|
||||||
struct dd xy, r;
|
struct dd xy, r;
|
||||||
int oround;
|
int oround;
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,7 @@
|
||||||
*/
|
*/
|
||||||
float fmaf(float x, float y, float z)
|
float fmaf(float x, float y, float z)
|
||||||
{
|
{
|
||||||
|
#pragma STDC FENV_ACCESS ON
|
||||||
double xy, result;
|
double xy, result;
|
||||||
uint32_t hr, lr;
|
uint32_t hr, lr;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -162,6 +162,7 @@ static inline struct dd dd_mul(long double a, long double b)
|
||||||
*/
|
*/
|
||||||
long double fmal(long double x, long double y, long double z)
|
long double fmal(long double x, long double y, long double z)
|
||||||
{
|
{
|
||||||
|
#pragma STDC FENV_ACCESS ON
|
||||||
long double xs, ys, zs, adj;
|
long double xs, ys, zs, adj;
|
||||||
struct dd xy, r;
|
struct dd xy, r;
|
||||||
int oround;
|
int oround;
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ raises inexact (with tonearest or upward rounding mode)
|
||||||
*/
|
*/
|
||||||
long long llrintl(long double x)
|
long long llrintl(long double x)
|
||||||
{
|
{
|
||||||
|
#pragma STDC FENV_ACCESS ON
|
||||||
int e;
|
int e;
|
||||||
|
|
||||||
e = fetestexcept(FE_INEXACT);
|
e = fetestexcept(FE_INEXACT);
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ as a double.
|
||||||
#if LONG_MAX < 1U<<53 && defined(FE_INEXACT)
|
#if LONG_MAX < 1U<<53 && defined(FE_INEXACT)
|
||||||
long lrint(double x)
|
long lrint(double x)
|
||||||
{
|
{
|
||||||
|
#pragma STDC FENV_ACCESS ON
|
||||||
int e;
|
int e;
|
||||||
|
|
||||||
e = fetestexcept(FE_INEXACT);
|
e = fetestexcept(FE_INEXACT);
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ raises inexact (with tonearest or upward rounding mode)
|
||||||
*/
|
*/
|
||||||
long lrintl(long double x)
|
long lrintl(long double x)
|
||||||
{
|
{
|
||||||
|
#pragma STDC FENV_ACCESS ON
|
||||||
int e;
|
int e;
|
||||||
|
|
||||||
e = fetestexcept(FE_INEXACT);
|
e = fetestexcept(FE_INEXACT);
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@
|
||||||
double nearbyint(double x)
|
double nearbyint(double x)
|
||||||
{
|
{
|
||||||
#ifdef FE_INEXACT
|
#ifdef FE_INEXACT
|
||||||
|
#pragma STDC FENV_ACCESS ON
|
||||||
int e;
|
int e;
|
||||||
|
|
||||||
e = fetestexcept(FE_INEXACT);
|
e = fetestexcept(FE_INEXACT);
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@
|
||||||
float nearbyintf(float x)
|
float nearbyintf(float x)
|
||||||
{
|
{
|
||||||
#ifdef FE_INEXACT
|
#ifdef FE_INEXACT
|
||||||
|
#pragma STDC FENV_ACCESS ON
|
||||||
int e;
|
int e;
|
||||||
|
|
||||||
e = fetestexcept(FE_INEXACT);
|
e = fetestexcept(FE_INEXACT);
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ long double nearbyintl(long double x)
|
||||||
long double nearbyintl(long double x)
|
long double nearbyintl(long double x)
|
||||||
{
|
{
|
||||||
#ifdef FE_INEXACT
|
#ifdef FE_INEXACT
|
||||||
|
#pragma STDC FENV_ACCESS ON
|
||||||
int e;
|
int e;
|
||||||
|
|
||||||
e = fetestexcept(FE_INEXACT);
|
e = fetestexcept(FE_INEXACT);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue