Mercurial > flash_v2
comparison packages/language/c/libm/current/src/mathincl/fdlibm.h @ 2:443894e2e912 ecos-v1_2_1-release
Block commit of eCos version 1.2.1
| author | jlarmour |
|---|---|
| date | Tue, 11 May 1999 12:24:34 +0000 |
| parents | 3111d98ba7b3 |
| children | 01ce82f3e11a |
comparison
equal
deleted
inserted
replaced
| 1:72f549f0d891 | 2:443894e2e912 |
|---|---|
| 22 // | 22 // |
| 23 // The Original Code is eCos - Embedded Cygnus Operating System, released | 23 // The Original Code is eCos - Embedded Cygnus Operating System, released |
| 24 // September 30, 1998. | 24 // September 30, 1998. |
| 25 // | 25 // |
| 26 // The Initial Developer of the Original Code is Cygnus. Portions created | 26 // The Initial Developer of the Original Code is Cygnus. Portions created |
| 27 // by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. | 27 // by Cygnus are Copyright (C) 1998,1999 Cygnus Solutions. All Rights Reserved. |
| 28 // ------------------------------------------- | 28 // ------------------------------------------- |
| 29 // | 29 // |
| 30 //####COPYRIGHTEND#### | 30 //####COPYRIGHTEND#### |
| 31 //=========================================================================== | 31 //=========================================================================== |
| 32 //#####DESCRIPTIONBEGIN#### | 32 //#####DESCRIPTIONBEGIN#### |
| 33 // | 33 // |
| 34 // Author(s): jlarmour@cygnus.co.uk | 34 // Author(s): jlarmour |
| 35 // Contributors: jlarmour@cygnus.co.uk | 35 // Contributors: jlarmour |
| 36 // Date: 1998-02-13 | 36 // Date: 1999-02-09 |
| 37 // Purpose: | 37 // Purpose: |
| 38 // Description: Internal implementation-specific header for math library | 38 // Description: Internal implementation-specific header for math library |
| 39 // based on fdlibm | 39 // based on fdlibm |
| 40 // Usage: From within this package, #include "mathincl/fdlibm.h" | 40 // Usage: From within this package, #include "mathincl/fdlibm.h" |
| 41 // | 41 // |
| 42 //####DESCRIPTIONEND#### | 42 //####DESCRIPTIONEND#### |
| 43 // | 43 // |
| 44 //=========================================================================== | 44 //=========================================================================== |
| 45 | 45 |
| 69 #endif // if DBL_MAX_EXP == 1024 | 69 #endif // if DBL_MAX_EXP == 1024 |
| 70 | 70 |
| 71 | 71 |
| 72 // MACRO DEFINITIONS | 72 // MACRO DEFINITIONS |
| 73 | 73 |
| 74 | 74 #define CYG_LIBM_HI(__x) (*cyg_libm_hi(&__x)) |
| 75 #if (CYG_BYTEORDER == CYG_LSBFIRST) // little endian | 75 #define CYG_LIBM_LO(__x) (*cyg_libm_lo(&__x)) |
| 76 #define CYG_LIBM_HI(x) (*(1+(cyg_int32*)&(x))) | 76 #define CYG_LIBM_HIp(__x) (*cyg_libm_hi(__x)) |
| 77 #define CYG_LIBM_LO(x) (*(cyg_int32*)&(x)) | 77 #define CYG_LIBM_LOp(__x) (*cyg_libm_lo(__x)) |
| 78 #define CYG_LIBM_HIp(x) (*(1+(cyg_int32*)(x))) | |
| 79 #define CYG_LIBM_LOp(x) (*(cyg_int32*)(x)) | |
| 80 #else // big endian | |
| 81 #define CYG_LIBM_HI(x) (*(cyg_int32*)&(x)) | |
| 82 #define CYG_LIBM_LO(x) (*(1+(cyg_int32*)&(x))) | |
| 83 #define CYG_LIBM_HIp(x) (*(cyg_int32*)(x)) | |
| 84 #define CYG_LIBM_LOp(x) (*(1+(cyg_int32*)(x))) | |
| 85 #endif | |
| 86 | |
| 87 | 78 |
| 88 // REPLACEMENTS FOR STUFF FROM MATH.H DUE TO CONFIG OPTION | 79 // REPLACEMENTS FOR STUFF FROM MATH.H DUE TO CONFIG OPTION |
| 89 | 80 |
| 90 #ifdef CYGSYM_LIBM_NO_XOPEN_SVID_NAMESPACE_POLLUTION | 81 #ifdef CYGSYM_LIBM_NO_XOPEN_SVID_NAMESPACE_POLLUTION |
| 91 | 82 |
| 108 externC int | 99 externC int |
| 109 matherr( struct exception * ); // User-overridable error handling - see | 100 matherr( struct exception * ); // User-overridable error handling - see |
| 110 // <pkgconf/libm.h> for a discussion | 101 // <pkgconf/libm.h> for a discussion |
| 111 #endif // ifdef CYGSYM_LIBM_NO_XOPEN_SVID_NAMESPACE_POLLUTION | 102 #endif // ifdef CYGSYM_LIBM_NO_XOPEN_SVID_NAMESPACE_POLLUTION |
| 112 | 103 |
| 104 | |
| 105 // INLINE FUNCTIONS | |
| 106 | |
| 107 static __inline__ cyg_uint32 * | |
| 108 cyg_libm_hi(double *__x) | |
| 109 { | |
| 110 Cyg_libm_ieee_double_shape_type *__y; | |
| 111 __y = (Cyg_libm_ieee_double_shape_type *)__x; | |
| 112 return &__y->parts.msw; | |
| 113 } | |
| 114 | |
| 115 static __inline__ cyg_uint32 * | |
| 116 cyg_libm_lo(double *__x) | |
| 117 { | |
| 118 Cyg_libm_ieee_double_shape_type *__y; | |
| 119 __y = (Cyg_libm_ieee_double_shape_type *)__x; | |
| 120 return &__y->parts.lsw; | |
| 121 } | |
| 113 | 122 |
| 114 | 123 |
| 115 // FUNCTION PROTOTYPES | 124 // FUNCTION PROTOTYPES |
| 116 | 125 |
| 117 // IEEE-754 style elementary functions */ | 126 // IEEE-754 style elementary functions */ |
