Back to index

glibc  2.9
libm_cpu_defs.h
Go to the documentation of this file.
00001 /* file: libm_cpu_defs.h */
00002  
00003  
00004 // Copyright (c) 2000 - 2004, Intel Corporation
00005 // All rights reserved.
00006 //
00007 // Contributed 2000 by the Intel Numerics Group, Intel Corporation
00008 //
00009 // Redistribution and use in source and binary forms, with or without
00010 // modification, are permitted provided that the following conditions are
00011 // met:
00012 //
00013 // * Redistributions of source code must retain the above copyright
00014 // notice, this list of conditions and the following disclaimer.
00015 //
00016 // * Redistributions in binary form must reproduce the above copyright
00017 // notice, this list of conditions and the following disclaimer in the
00018 // documentation and/or other materials provided with the distribution.
00019 //
00020 // * The name of Intel Corporation may not be used to endorse or promote
00021 // products derived from this software without specific prior written
00022 // permission.
00023 
00024 //
00025 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00026 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00027 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
00028 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR ITS
00029 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00030 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00031 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00032 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
00033 // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY OR TORT (INCLUDING
00034 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00035 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00036 //
00037 // Intel Corporation is the author of this code, and requests that all
00038 // problem reports or change requests be submitted to it directly at
00039 // http://www.intel.com/software/products/opensource/libraries/num.htm.
00040 //
00041 
00042 #ifndef __LIBM_CPU_DEFS__H_INCLUDED__
00043 #define __LIBM_CPU_DEFS__H_INCLUDED__
00044 
00045 void __libm_sincos_pi4(double,double*,double*,int);
00046 void __libm_y0y1(double , double *, double *);
00047 void __libm_j0j1(double , double *, double *);
00048 double __libm_j0(double);
00049 double __libm_j1(double);
00050 double __libm_jn(int,double);
00051 double __libm_y0(double);
00052 double __libm_y1(double);
00053 double __libm_yn(int,double);
00054 
00055 double __libm_copysign (double, double);
00056 float __libm_copysignf (float, float);
00057 long double __libm_copysignl (long double, long double);
00058 
00059 extern double sqrt(double);
00060 extern double fabs(double);
00061 extern double log(double);
00062 extern double log1p(double);
00063 extern double sqrt(double);
00064 extern double sin(double);
00065 extern double exp(double);
00066 extern double modf(double, double *);
00067 extern double asinh(double);
00068 extern double acosh(double);
00069 extern double atanh(double);
00070 extern double tanh(double);
00071 extern double erf(double);
00072 extern double erfc(double);
00073 extern double j0(double);
00074 extern double j1(double);
00075 extern double jn(int, double);
00076 extern double y0(double);
00077 extern double y1(double);
00078 extern double yn(int, double);
00079 
00080 extern float  fabsf(float);
00081 extern float  asinhf(float);
00082 extern float  acoshf(float);
00083 extern float  atanhf(float);
00084 extern float  tanhf(float);
00085 extern float  erff(float);
00086 extern float  erfcf(float);
00087 extern float  j0f(float);
00088 extern float  j1f(float);
00089 extern float  jnf(int, float);
00090 extern float  y0f(float);
00091 extern float  y1f(float);
00092 extern float  ynf(int, float);
00093 
00094 extern long double log1pl(long double);
00095 extern long double logl(long double);
00096 extern long double sqrtl(long double);
00097 extern long double expl(long double);
00098 extern long double fabsl(long double);
00099 
00100 #if !(defined(SIZE_LONG_INT_32) || defined(SIZE_LONG_INT_64))
00101 #error long int size not established; define SIZE_LONG_INT_32 or SIZE_LONG_INT_64
00102 #endif
00103 
00104 #if (defined(SIZE_LONG_INT_32) && defined(SIZE_LONG_INT_64))
00105 #error multiple long int size definitions; define SIZE_LONG_INT_32 or SIZE_LONG_INT_64
00106 #endif
00107 
00108 #if !(defined(SIZE_LONG_LONG_INT_32) || defined(SIZE_LONG_LONG_INT_64))
00109 #error long long int size not established; define SIZE_LONG_LONG_INT_32 or SIZE_LONG_LONG_INT_64
00110 #endif
00111 
00112 #if (defined(SIZE_LONG_LONG_INT_32) && defined(SIZE_LONG_LONG_INT_64))
00113 #error multiple long long int size definitions; define SIZE_LONG_LONG_INT_32 or SIZE_LONG_LONG_INT_64
00114 #endif
00115 
00116 #define HI_SIGNIFICAND_LESS(X, HI) ((X)->hi_significand < 0x ## HI)
00117 #define f64abs(x) ((x) < 0.0 ? -(x) : (x))
00118 
00119 #define FP80_DECLARE()
00120 #define FP80_SET()
00121 #define FP80_RESET()
00122 
00123 #ifdef _LIBC
00124 # include <math.h>
00125 #else
00126 
00127 static const unsigned INF[] = {
00128     DOUBLE_HEX(7ff00000, 00000000),
00129     DOUBLE_HEX(fff00000, 00000000)
00130 };
00131 
00132 static const double _zeroo = 0.0;
00133 static const double _bigg = 1.0e300;
00134 static const double _ponee = 1.0;
00135 static const double _nonee = -1.0;
00136 
00137 #define INVALID    (_zeroo * *((double*)&INF[0]))
00138 #define PINF       *((double*)&INF[0])
00139 #define NINF       -PINF
00140 #define PINF_DZ    (_ponee/_zeroo)
00141 #define X_TLOSS    1.41484755040568800000e+16
00142 #endif
00143 
00144 /* Set these appropriately to make thread Safe */
00145 #define ERRNO_RANGE  errno = ERANGE
00146 #define ERRNO_DOMAIN errno = EDOM
00147 
00148 #ifndef _LIBC
00149 #if defined(__ICC) || defined(__ICL) || defined(__ECC) || defined(__ECL)
00150 # pragma warning( disable : 68 )   /* #68: integer conversion resulted in a change of sign */
00151 # pragma warning( disable : 186 )  /* #186: pointless comparison of unsigned integer with zero */
00152 # pragma warning( disable : 1572 ) /* #1572: floating-point equality and inequality comparisons are unreliable */
00153 #endif
00154 #endif
00155 
00156 #endif    /*__LIBM_CPU_DEFS__H_INCLUDED__*/