diff options
author | Jeff Johnston <jjohnstn@redhat.com> | 2007-12-19 22:20:25 +0000 |
---|---|---|
committer | Jeff Johnston <jjohnstn@redhat.com> | 2007-12-19 22:20:25 +0000 |
commit | 3cc8a378d117ead86181ed4d9b440d5a59b08779 (patch) | |
tree | d121480085cdb7b25e61b7b7c1126fa09e47ed93 /newlib/libc | |
parent | 73063e9364ec6dc9b2e909c295969190e9626e5f (diff) | |
download | newlib-3cc8a378d117ead86181ed4d9b440d5a59b08779.zip newlib-3cc8a378d117ead86181ed4d9b440d5a59b08779.tar.gz newlib-3cc8a378d117ead86181ed4d9b440d5a59b08779.tar.bz2 |
2007-12-19 Dave Korn <dave.korn@artimi.com>
Jeff Johnston <jjohnstn@redhhat.com>
* libc/include/_ansi.h: Add _LONG_LONG definition.
* libc/include/math.h (llrint, llrintf, rintl, lrintl, llrintl): Add
prototypes.
* libc/machine/i386/machine/fastmath.h: Add support for new i386
fast math versions of rint, lrint, and llrint family functions.
* libm/machine/i386/Makefile.am: Add new files.
* libm/machine/i386/Makefile.in: Regenerated.
* libm/machine/i386/f_llrint.c, libm/machine/i386/f_lrint.c,
libm/machine/i386/f_rint.c, libm/machine/i386/f_llrintf.c,
libm/machine/i386/f_lrintf.c, libm/machine/i386/f_rintf.c,
libm/machine/i386/f_llrintl.c, libm/machine/i386/f_lrintl.c,
libm/machine/i386/f_rintl.c: New files with fast math implementations.
Diffstat (limited to 'newlib/libc')
-rw-r--r-- | newlib/libc/include/_ansi.h | 4 | ||||
-rw-r--r-- | newlib/libc/include/math.h | 7 | ||||
-rw-r--r-- | newlib/libc/machine/i386/machine/fastmath.h | 54 |
3 files changed, 57 insertions, 8 deletions
diff --git a/newlib/libc/include/_ansi.h b/newlib/libc/include/_ansi.h index 07bfd88..b84f377 100644 --- a/newlib/libc/include/_ansi.h +++ b/newlib/libc/include/_ansi.h @@ -45,6 +45,9 @@ #ifndef _LONG_DOUBLE #define _LONG_DOUBLE long double #endif +#ifndef _LONG_LONG +#define _LONG_LONG long long +#endif #ifndef _PARAMS #define _PARAMS(paramlist) paramlist #endif @@ -62,6 +65,7 @@ #define _DEFUN_VOID(name) name() #define _CAST_VOID #define _LONG_DOUBLE double +#define _LONG_LONG long #ifndef _PARAMS #define _PARAMS(paramlist) () #endif diff --git a/newlib/libc/include/math.h b/newlib/libc/include/math.h index 9f9fe1b..3f7001a 100644 --- a/newlib/libc/include/math.h +++ b/newlib/libc/include/math.h @@ -226,6 +226,7 @@ extern double scalbln _PARAMS((double, long int)); extern double tgamma _PARAMS((double)); extern double nearbyint _PARAMS((double)); extern long int lrint _PARAMS((double)); +extern _LONG_LONG int llrint _PARAMS((double)); extern double round _PARAMS((double)); extern long int lround _PARAMS((double)); extern double trunc _PARAMS((double)); @@ -292,6 +293,7 @@ extern float scalblnf _PARAMS((float, long int)); extern float tgammaf _PARAMS((float)); extern float nearbyintf _PARAMS((float)); extern long int lrintf _PARAMS((float)); +extern _LONG_LONG llrintf _PARAMS((float)); extern float roundf _PARAMS((float)); extern long int lroundf _PARAMS((float)); extern float truncf _PARAMS((float)); @@ -330,6 +332,11 @@ extern float erfcf _PARAMS((float)); extern float hypotf _PARAMS((float, float)); #endif /* ! defined (_REENT_ONLY) */ +/* Other long double precision functions. */ +extern _LONG_DOUBLE rintl _PARAMS((_LONG_DOUBLE)); +extern long int lrintl _PARAMS((_LONG_DOUBLE)); +extern _LONG_LONG llrintl _PARAMS((_LONG_DOUBLE)); + #endif /* !defined (__STRICT_ANSI__) || defined(__cplusplus) || __STDC_VERSION__ >= 199901L */ #if !defined (__STRICT_ANSI__) || defined(__cplusplus) diff --git a/newlib/libc/machine/i386/machine/fastmath.h b/newlib/libc/machine/i386/machine/fastmath.h index 9a6753e..accfa87 100644 --- a/newlib/libc/machine/i386/machine/fastmath.h +++ b/newlib/libc/machine/i386/machine/fastmath.h @@ -26,6 +26,7 @@ __extension__ double tan(double) #if !defined(__STRICT_ANSI__) || defined(__cplusplus) || __STDC_VERSION__ >= 199901L + __extension__ float atan2f(float, float) __asm__(__U_L_PREFIX__ "_f_atan2f"); __extension__ float expf(float) @@ -34,12 +35,30 @@ __extension__ float frexpf(float, int*) __asm__(__U_L_PREFIX__ "_f_frexpf"); __extension__ float ldexpf(float, int) __asm__(__U_L_PREFIX__ "_f_ldexpf"); +__extension__ long long llrint(double) + __asm__(__U_L_PREFIX__ "_f_llrint"); +__extension__ long long llrintf(float) + __asm__(__U_L_PREFIX__ "_f_llrintf"); +__extension__ long long llrintl(long double) + __asm__(__U_L_PREFIX__ "_f_llrintl"); __extension__ float logf(float) __asm__(__U_L_PREFIX__ "_f_logf"); __extension__ float log10f(float) __asm__(__U_L_PREFIX__ "_f_log10f"); +__extension__ long lrint(double) + __asm__(__U_L_PREFIX__ "_f_lrint"); +__extension__ long lrintf(float) + __asm__(__U_L_PREFIX__ "_f_lrintf"); +__extension__ long lrintl(long double) + __asm__(__U_L_PREFIX__ "_f_lrintl"); __extension__ float powf(float, float) __asm__(__U_L_PREFIX__ "_f_powf"); +__extension__ double rint(double) + __asm__(__U_L_PREFIX__ "_f_rint"); +__extension__ float rintf(float) + __asm__(__U_L_PREFIX__ "_f_rintf"); +__extension__ long double rintl(long double) + __asm__(__U_L_PREFIX__ "_f_rintl"); __extension__ float tanf(float) __asm__(__U_L_PREFIX__ "_f_tanf"); #endif @@ -54,14 +73,6 @@ double EXFUN(_f_log,(double)); double EXFUN(_f_log10,(double)); double EXFUN(_f_pow,(double, double)); -float EXFUN(_f_atan2f,(float, float)); -float EXFUN(_f_expf,(float)); -float EXFUN(_f_frexpf,(float, int*)); -float EXFUN(_f_ldexpf,(float, int)); -float EXFUN(_f_logf,(float)); -float EXFUN(_f_log10f,(float)); -float EXFUN(_f_powf,(float, float)); - #define atan2(__y,__x) _f_atan2((__y),(__x)) #define exp(__x) _f_exp(__x) #define frexp(__x,__p) _f_frexp((__x),(__p)) @@ -71,13 +82,40 @@ float EXFUN(_f_powf,(float, float)); #define pow(__x,__y) _f_pow((__x),(__y)) #ifndef __STRICT_ANSI__ + +float EXFUN(_f_atan2f,(float, float)); +float EXFUN(_f_expf,(float)); +float EXFUN(_f_frexpf,(float, int*)); +float EXFUN(_f_ldexpf,(float, int)); +long long EXFUN(_f_llrint,(double)); +long long EXFUN(_f_llrintf,(float)); +long long EXFUN(_f_llrintl,(long double)); +float EXFUN(_f_logf,(float)); +float EXFUN(_f_log10f,(float)); +long EXFUN(_f_lrint,(double)); +long EXFUN(_f_lrintf,(float)); +long EXFUN(_f_lrintl,(long double)); +float EXFUN(_f_powf,(float, float)); +float EXFUN(_f_rint,(double)); +double EXFUN(_f_rintf,(float)); +long double EXFUN(_f_rintl,(long double)); + #define atan2f(__y,__x) _f_atan2f((__y),(__x)) #define expf(__x) _f_expf(__x) #define frexpf(__x,__p) _f_frexpf((__x),(__p)) #define ldexpf(__x,__e) _f_ldexpf((__x),(__e)) +#define llrint(__x) _f_llrint((__x)) +#define llrintf(__x) _f_llrintf((__x)) +#define llrintl(__x) _f_llrintl((__x)) #define logf(__x) _f_logf(__x) #define log10f(__x) _f_log10f(__x) +#define lrint(__x) _f_lrint((__x)) +#define lrintf(__x) _f_lrintf((__x)) +#define lrintl(__x) _f_lrintl((__x)) #define powf(__x,y) _f_powf((__x),(__y)) +#define rint(__x) _f_rint((__x)) +#define rintf(__x) _f_rintf((__x)) +#define rintl(__x) _f_rintl((__x)) #endif #endif /* GCC */ |