1 |
148 |
jeremybenn |
#ifndef _MACHFASTMATH_H
|
2 |
|
|
#define _MACHFASTMATH_H
|
3 |
|
|
|
4 |
|
|
#if defined(__GNUC__) && __STDC__ - 0 > 0
|
5 |
|
|
|
6 |
|
|
#define __str1__(__x) #__x
|
7 |
|
|
#define __str2__(__x) __str1__(__x)
|
8 |
|
|
#define __U_L_PREFIX__ __str2__(__USER_LABEL_PREFIX__)
|
9 |
|
|
|
10 |
|
|
__extension__ double atan2(double, double)
|
11 |
|
|
__asm__(__U_L_PREFIX__ "_f_atan2");
|
12 |
|
|
__extension__ double exp(double)
|
13 |
|
|
__asm__(__U_L_PREFIX__ "_f_exp");
|
14 |
|
|
__extension__ double frexp(double, int*)
|
15 |
|
|
__asm__(__U_L_PREFIX__ "_f_frexp");
|
16 |
|
|
__extension__ double ldexp(double, int)
|
17 |
|
|
__asm__(__U_L_PREFIX__ "_f_ldexp");
|
18 |
|
|
__extension__ double log(double)
|
19 |
|
|
__asm__(__U_L_PREFIX__ "_f_log");
|
20 |
|
|
__extension__ double log10(double)
|
21 |
|
|
__asm__(__U_L_PREFIX__ "_f_log10");
|
22 |
|
|
__extension__ double pow(double, double)
|
23 |
|
|
__asm__(__U_L_PREFIX__ "_f_pow");
|
24 |
|
|
__extension__ double tan(double)
|
25 |
|
|
__asm__(__U_L_PREFIX__ "_f_tan");
|
26 |
|
|
|
27 |
|
|
#if !defined(__STRICT_ANSI__) || defined(__cplusplus) || __STDC_VERSION__ >= 199901L
|
28 |
|
|
|
29 |
|
|
|
30 |
|
|
__extension__ float atan2f(float, float)
|
31 |
|
|
__asm__(__U_L_PREFIX__ "_f_atan2f");
|
32 |
|
|
__extension__ float expf(float)
|
33 |
|
|
__asm__(__U_L_PREFIX__ "_f_expf");
|
34 |
|
|
__extension__ float frexpf(float, int*)
|
35 |
|
|
__asm__(__U_L_PREFIX__ "_f_frexpf");
|
36 |
|
|
__extension__ float ldexpf(float, int)
|
37 |
|
|
__asm__(__U_L_PREFIX__ "_f_ldexpf");
|
38 |
|
|
__extension__ long long llrint(double)
|
39 |
|
|
__asm__(__U_L_PREFIX__ "_f_llrint");
|
40 |
|
|
__extension__ long long llrintf(float)
|
41 |
|
|
__asm__(__U_L_PREFIX__ "_f_llrintf");
|
42 |
|
|
__extension__ long long llrintl(long double)
|
43 |
|
|
__asm__(__U_L_PREFIX__ "_f_llrintl");
|
44 |
|
|
__extension__ float logf(float)
|
45 |
|
|
__asm__(__U_L_PREFIX__ "_f_logf");
|
46 |
|
|
__extension__ float log10f(float)
|
47 |
|
|
__asm__(__U_L_PREFIX__ "_f_log10f");
|
48 |
|
|
__extension__ long lrint(double)
|
49 |
|
|
__asm__(__U_L_PREFIX__ "_f_lrint");
|
50 |
|
|
__extension__ long lrintf(float)
|
51 |
|
|
__asm__(__U_L_PREFIX__ "_f_lrintf");
|
52 |
|
|
__extension__ long lrintl(long double)
|
53 |
|
|
__asm__(__U_L_PREFIX__ "_f_lrintl");
|
54 |
|
|
__extension__ float powf(float, float)
|
55 |
|
|
__asm__(__U_L_PREFIX__ "_f_powf");
|
56 |
|
|
__extension__ double rint(double)
|
57 |
|
|
__asm__(__U_L_PREFIX__ "_f_rint");
|
58 |
|
|
__extension__ float rintf(float)
|
59 |
|
|
__asm__(__U_L_PREFIX__ "_f_rintf");
|
60 |
|
|
__extension__ long double rintl(long double)
|
61 |
|
|
__asm__(__U_L_PREFIX__ "_f_rintl");
|
62 |
|
|
__extension__ float tanf(float)
|
63 |
|
|
__asm__(__U_L_PREFIX__ "_f_tanf");
|
64 |
|
|
#endif
|
65 |
|
|
|
66 |
|
|
#else
|
67 |
|
|
|
68 |
|
|
double EXFUN(_f_atan2,(double, double));
|
69 |
|
|
double EXFUN(_f_exp,(double));
|
70 |
|
|
double EXFUN(_f_frexp,(double, int*));
|
71 |
|
|
double EXFUN(_f_ldexp,(double, int));
|
72 |
|
|
double EXFUN(_f_log,(double));
|
73 |
|
|
double EXFUN(_f_log10,(double));
|
74 |
|
|
double EXFUN(_f_pow,(double, double));
|
75 |
|
|
|
76 |
|
|
#define atan2(__y,__x) _f_atan2((__y),(__x))
|
77 |
|
|
#define exp(__x) _f_exp(__x)
|
78 |
|
|
#define frexp(__x,__p) _f_frexp((__x),(__p))
|
79 |
|
|
#define ldexp(__x,__e) _f_ldexp((__x),(__e))
|
80 |
|
|
#define log(__x) _f_log(__x)
|
81 |
|
|
#define log10(__x) _f_log10(__x)
|
82 |
|
|
#define pow(__x,__y) _f_pow((__x),(__y))
|
83 |
|
|
|
84 |
|
|
#ifndef __STRICT_ANSI__
|
85 |
|
|
|
86 |
|
|
float EXFUN(_f_atan2f,(float, float));
|
87 |
|
|
float EXFUN(_f_expf,(float));
|
88 |
|
|
float EXFUN(_f_frexpf,(float, int*));
|
89 |
|
|
float EXFUN(_f_ldexpf,(float, int));
|
90 |
|
|
long long EXFUN(_f_llrint,(double));
|
91 |
|
|
long long EXFUN(_f_llrintf,(float));
|
92 |
|
|
long long EXFUN(_f_llrintl,(long double));
|
93 |
|
|
float EXFUN(_f_logf,(float));
|
94 |
|
|
float EXFUN(_f_log10f,(float));
|
95 |
|
|
long EXFUN(_f_lrint,(double));
|
96 |
|
|
long EXFUN(_f_lrintf,(float));
|
97 |
|
|
long EXFUN(_f_lrintl,(long double));
|
98 |
|
|
float EXFUN(_f_powf,(float, float));
|
99 |
|
|
float EXFUN(_f_rint,(double));
|
100 |
|
|
double EXFUN(_f_rintf,(float));
|
101 |
|
|
long double EXFUN(_f_rintl,(long double));
|
102 |
|
|
|
103 |
|
|
#define atan2f(__y,__x) _f_atan2f((__y),(__x))
|
104 |
|
|
#define expf(__x) _f_expf(__x)
|
105 |
|
|
#define frexpf(__x,__p) _f_frexpf((__x),(__p))
|
106 |
|
|
#define ldexpf(__x,__e) _f_ldexpf((__x),(__e))
|
107 |
|
|
#define llrint(__x) _f_llrint((__x))
|
108 |
|
|
#define llrintf(__x) _f_llrintf((__x))
|
109 |
|
|
#define llrintl(__x) _f_llrintl((__x))
|
110 |
|
|
#define logf(__x) _f_logf(__x)
|
111 |
|
|
#define log10f(__x) _f_log10f(__x)
|
112 |
|
|
#define lrint(__x) _f_lrint((__x))
|
113 |
|
|
#define lrintf(__x) _f_lrintf((__x))
|
114 |
|
|
#define lrintl(__x) _f_lrintl((__x))
|
115 |
|
|
#define powf(__x,y) _f_powf((__x),(__y))
|
116 |
|
|
#define rint(__x) _f_rint((__x))
|
117 |
|
|
#define rintf(__x) _f_rintf((__x))
|
118 |
|
|
#define rintl(__x) _f_rintl((__x))
|
119 |
|
|
#endif
|
120 |
|
|
|
121 |
|
|
#endif /* GCC */
|
122 |
|
|
#endif /* _MACHFASTMATH_H */
|