2012-03-19 00:27:13 +00:00
|
|
|
#ifndef ALPHA_MATH_PRIVATE_H
|
|
|
|
#define ALPHA_MATH_PRIVATE_H 1
|
|
|
|
|
|
|
|
/* In bits/mathinline.h we define __isnan et al.
|
|
|
|
In sysdeps/alpha/fpu/s_isnan.c we move the identifier out of the way
|
|
|
|
via macro hackery. In both cases, tell math/math_private.h that
|
|
|
|
we have a local copy of the function. */
|
|
|
|
|
|
|
|
#ifndef __isnan
|
|
|
|
# define __isnan __isnan
|
|
|
|
#endif
|
|
|
|
#ifndef __isnanf
|
|
|
|
# define __isnanf __isnanf
|
|
|
|
#endif
|
|
|
|
|
2014-07-03 15:56:55 +00:00
|
|
|
/* Generic code forces values to memory; we don't need to do that. */
|
|
|
|
#define math_opt_barrier(x) \
|
|
|
|
({ __typeof (x) __x = (x); __asm ("" : "+frm" (__x)); __x; })
|
|
|
|
#define math_force_eval(x) \
|
|
|
|
({ __typeof (x) __x = (x); __asm __volatile__ ("" : : "frm" (__x)); })
|
|
|
|
|
2012-03-19 00:27:13 +00:00
|
|
|
#include_next <math_private.h>
|
|
|
|
|
2012-05-30 22:49:01 +00:00
|
|
|
#ifdef __alpha_fix__
|
|
|
|
extern __always_inline double
|
|
|
|
__ieee754_sqrt (double d)
|
|
|
|
{
|
|
|
|
double ret;
|
|
|
|
# ifdef _IEEE_FP_INEXACT
|
2017-04-14 12:30:57 +00:00
|
|
|
asm ("sqrtt/suid %1,%0" : "=&f"(ret) : "f"(d));
|
2012-05-30 22:49:01 +00:00
|
|
|
# else
|
2017-04-14 12:30:57 +00:00
|
|
|
asm ("sqrtt/sud %1,%0" : "=&f"(ret) : "f"(d));
|
2012-05-30 22:49:01 +00:00
|
|
|
# endif
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
extern __always_inline float
|
|
|
|
__ieee754_sqrtf (float d)
|
|
|
|
{
|
|
|
|
float ret;
|
|
|
|
# ifdef _IEEE_FP_INEXACT
|
2017-04-14 12:30:57 +00:00
|
|
|
asm ("sqrts/suid %1,%0" : "=&f"(ret) : "f"(d));
|
2012-05-30 22:49:01 +00:00
|
|
|
# else
|
2017-04-14 12:30:57 +00:00
|
|
|
asm ("sqrts/sud %1,%0" : "=&f"(ret) : "f"(d));
|
2012-05-30 22:49:01 +00:00
|
|
|
# endif
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
#endif /* FIX */
|
|
|
|
|
2012-03-19 00:27:13 +00:00
|
|
|
#endif /* ALPHA_MATH_PRIVATE_H */
|