1 /* Private inline math functions for powerpc.
3 Free Software Foundation, Inc.
4 This file is part of the GNU C Library.
6 The GNU C Library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
11 The GNU C Library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with the GNU C Library; if not, write to the Free
18 Software Foundation, Inc., 51 Franklin St - Fifth Floor, Boston,
21 #ifndef _PPC_MATH_PRIVATE_H_
22 #define _PPC_MATH_PRIVATE_H_
26 #include <dl-procinfo.h>
28 # if __WORDSIZE == 64 || defined _ARCH_PWR4
29 # define __CPU_HAS_FSQRT 1
31 # define __CPU_HAS_FSQRT ((GLRO(dl_hwcap) & PPC_FEATURE_64) != 0)
34 # ifndef __LIBC_INTERNAL_MATH_INLINES
35 extern double __slow_ieee754_sqrt (double);
37 __ieee754_sqrt (double __x
)
41 /* If the CPU is 64-bit we can use the optional FP instructions. */
44 /* Volatile is required to prevent the compiler from moving the
45 fsqrt instruction above the branch. */
52 __z
= __slow_ieee754_sqrt(__x
);
57 extern float __slow_ieee754_sqrtf (float);
60 __ieee754_sqrtf (float __x
)
64 /* If the CPU is 64-bit we can use the optional FP instructions. */
67 /* Volatile is required to prevent the compiler from moving the
68 fsqrts instruction above the branch. */
75 __z
= __slow_ieee754_sqrtf(__x
);
79 #endif /* __LIBC_INTERNAL_MATH_INLINES */
81 #include <math/math_private.h>
83 #endif /* _PPC_MATH_PRIVATE_H_ */