2.9
[glibc/nacl-glibc.git] / sysdeps / ia64 / fpu / libm_cpu_defs.h
blob516128c404e7da8e22439c66885f521cea3d848f
1 /* file: libm_cpu_defs.h */
4 // Copyright (c) 2000 - 2004, Intel Corporation
5 // All rights reserved.
6 //
7 // Contributed 2000 by the Intel Numerics Group, Intel Corporation
8 //
9 // Redistribution and use in source and binary forms, with or without
10 // modification, are permitted provided that the following conditions are
11 // met:
13 // * Redistributions of source code must retain the above copyright
14 // notice, this list of conditions and the following disclaimer.
16 // * Redistributions in binary form must reproduce the above copyright
17 // notice, this list of conditions and the following disclaimer in the
18 // documentation and/or other materials provided with the distribution.
20 // * The name of Intel Corporation may not be used to endorse or promote
21 // products derived from this software without specific prior written
22 // permission.
25 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
27 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
28 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR ITS
29 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
32 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
33 // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY OR TORT (INCLUDING
34 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 // Intel Corporation is the author of this code, and requests that all
38 // problem reports or change requests be submitted to it directly at
39 // http://www.intel.com/software/products/opensource/libraries/num.htm.
42 #ifndef __LIBM_CPU_DEFS__H_INCLUDED__
43 #define __LIBM_CPU_DEFS__H_INCLUDED__
45 void __libm_sincos_pi4(double,double*,double*,int);
46 void __libm_y0y1(double , double *, double *);
47 void __libm_j0j1(double , double *, double *);
48 double __libm_j0(double);
49 double __libm_j1(double);
50 double __libm_jn(int,double);
51 double __libm_y0(double);
52 double __libm_y1(double);
53 double __libm_yn(int,double);
55 double __libm_copysign (double, double);
56 float __libm_copysignf (float, float);
57 long double __libm_copysignl (long double, long double);
59 extern double sqrt(double);
60 extern double fabs(double);
61 extern double log(double);
62 extern double log1p(double);
63 extern double sqrt(double);
64 extern double sin(double);
65 extern double exp(double);
66 extern double modf(double, double *);
67 extern double asinh(double);
68 extern double acosh(double);
69 extern double atanh(double);
70 extern double tanh(double);
71 extern double erf(double);
72 extern double erfc(double);
73 extern double j0(double);
74 extern double j1(double);
75 extern double jn(int, double);
76 extern double y0(double);
77 extern double y1(double);
78 extern double yn(int, double);
80 extern float fabsf(float);
81 extern float asinhf(float);
82 extern float acoshf(float);
83 extern float atanhf(float);
84 extern float tanhf(float);
85 extern float erff(float);
86 extern float erfcf(float);
87 extern float j0f(float);
88 extern float j1f(float);
89 extern float jnf(int, float);
90 extern float y0f(float);
91 extern float y1f(float);
92 extern float ynf(int, float);
94 extern long double log1pl(long double);
95 extern long double logl(long double);
96 extern long double sqrtl(long double);
97 extern long double expl(long double);
98 extern long double fabsl(long double);
100 #if !(defined(SIZE_LONG_INT_32) || defined(SIZE_LONG_INT_64))
101 #error long int size not established; define SIZE_LONG_INT_32 or SIZE_LONG_INT_64
102 #endif
104 #if (defined(SIZE_LONG_INT_32) && defined(SIZE_LONG_INT_64))
105 #error multiple long int size definitions; define SIZE_LONG_INT_32 or SIZE_LONG_INT_64
106 #endif
108 #if !(defined(SIZE_LONG_LONG_INT_32) || defined(SIZE_LONG_LONG_INT_64))
109 #error long long int size not established; define SIZE_LONG_LONG_INT_32 or SIZE_LONG_LONG_INT_64
110 #endif
112 #if (defined(SIZE_LONG_LONG_INT_32) && defined(SIZE_LONG_LONG_INT_64))
113 #error multiple long long int size definitions; define SIZE_LONG_LONG_INT_32 or SIZE_LONG_LONG_INT_64
114 #endif
116 #define HI_SIGNIFICAND_LESS(X, HI) ((X)->hi_significand < 0x ## HI)
117 #define f64abs(x) ((x) < 0.0 ? -(x) : (x))
119 #define FP80_DECLARE()
120 #define FP80_SET()
121 #define FP80_RESET()
123 #ifdef _LIBC
124 # include <math.h>
125 #else
127 static const unsigned INF[] = {
128 DOUBLE_HEX(7ff00000, 00000000),
129 DOUBLE_HEX(fff00000, 00000000)
132 static const double _zeroo = 0.0;
133 static const double _bigg = 1.0e300;
134 static const double _ponee = 1.0;
135 static const double _nonee = -1.0;
137 #define INVALID (_zeroo * *((double*)&INF[0]))
138 #define PINF *((double*)&INF[0])
139 #define NINF -PINF
140 #define PINF_DZ (_ponee/_zeroo)
141 #define X_TLOSS 1.41484755040568800000e+16
142 #endif
144 /* Set these appropriately to make thread Safe */
145 #define ERRNO_RANGE errno = ERANGE
146 #define ERRNO_DOMAIN errno = EDOM
148 #ifndef _LIBC
149 #if defined(__ICC) || defined(__ICL) || defined(__ECC) || defined(__ECL)
150 # pragma warning( disable : 68 ) /* #68: integer conversion resulted in a change of sign */
151 # pragma warning( disable : 186 ) /* #186: pointless comparison of unsigned integer with zero */
152 # pragma warning( disable : 1572 ) /* #1572: floating-point equality and inequality comparisons are unreliable */
153 #endif
154 #endif
156 #endif /*__LIBM_CPU_DEFS__H_INCLUDED__*/