about summary refs log tree commit diff
path: root/ports/sysdeps/alpha/fpu/math_private.h
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2012-07-01 13:06:41 +0000
committerJoseph Myers <joseph@codesourcery.com>2012-07-01 13:06:41 +0000
commite64ac02c24b43659048622714afdc92fedf561fa (patch)
tree37162878b72d302de351788bec4c9360c9d55f1d /ports/sysdeps/alpha/fpu/math_private.h
parenta20c2b3c87aebc7d4b090c622d36480263b80042 (diff)
downloadglibc-e64ac02c24b43659048622714afdc92fedf561fa.tar.gz
glibc-e64ac02c24b43659048622714afdc92fedf561fa.tar.xz
glibc-e64ac02c24b43659048622714afdc92fedf561fa.zip
Move all files into ports/ subdirectory in preparation for merge with glibc glibc-2.16-ports-before-merge
Diffstat (limited to 'ports/sysdeps/alpha/fpu/math_private.h')
-rw-r--r--ports/sysdeps/alpha/fpu/math_private.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/ports/sysdeps/alpha/fpu/math_private.h b/ports/sysdeps/alpha/fpu/math_private.h
new file mode 100644
index 0000000000..4f270f7a3f
--- /dev/null
+++ b/ports/sysdeps/alpha/fpu/math_private.h
@@ -0,0 +1,47 @@
+#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
+#ifndef __isnanl
+# define __isnanl __isnanl
+#endif
+
+#include_next <math_private.h>
+
+#ifdef __alpha_fix__
+extern __always_inline double
+__ieee754_sqrt (double d)
+{
+  double ret;
+# ifdef _IEEE_FP_INEXACT
+  asm ("sqrtt/suid %1,%0" : "=f"(ret) : "f"(d));
+# else
+  asm ("sqrtt/sud %1,%0" : "=f"(ret) : "f"(d));
+# endif
+  return ret;
+}
+
+extern __always_inline float
+__ieee754_sqrtf (float d)
+{
+  float ret;
+# ifdef _IEEE_FP_INEXACT
+  asm ("sqrts/suid %1,%0" : "=f"(ret) : "f"(d));
+# else
+  asm ("sqrts/sud %1,%0" : "=f"(ret) : "f"(d));
+# endif
+  return ret;
+}
+#endif /* FIX */
+
+#endif /* ALPHA_MATH_PRIVATE_H */