2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
5 #ifndef __MATHIEEEDOUBTRANS_INTERN_H__
6 #define __MATHIEEEDOUBTRANS_INTERN_H__
8 /* the following line is necessary so that the function headers are
9 created correctly and the functions can be compiled properly */
13 /* This is a short file that contains a few things every mathieeedoubtrans
16 #ifndef AROS_LIBCALL_H
17 # include <aros/libcall.h>
19 #ifndef PROTO_MATHIEEEDPTRANS_H
20 # include <proto/mathieeedoubtrans.h>
24 # include <exec/types.h>
26 #ifndef EXEC_LIBRARIES_H
27 # include <exec/libraries.h>
33 #include <proto/mathieeedoubbas.h>
34 #include <proto/exec.h>
36 #ifndef __MATHIEEE64BIT_DEFINES_H__
37 # include <aros/mathieee64bitdefines.h>
42 This is the MathIeeeDoubTransBase structure. It is documented here because
43 it is completely private. Applications should treat it as a struct
44 Library, and use the mathieeedoubtrans.library functions to get information.
47 extern struct Library
* MathIeeeDoubBasBase
;
49 struct MathIeeeDoubTransBase
51 struct Library library
;
52 struct ExecBase
* sysbase
;
56 /* Internal prototypes */
57 QUAD
intern_IEEEDPLd(struct MathIeeeDoubTransBase
* MathIeeeDoubTransBase
, QUAD fnum
);
58 LONG
intern_IEEEDPisodd(QUAD fnum
);
61 #define Zero_Bit 0x00000004 /* Flags of the 680xx CPU */
62 #define Negative_Bit 0x00000008
63 #define Overflow_Bit 0x00000002
66 #define IEEEDPMantisse_Mask_Hi 0x000FFFFF /* 62 bit for the mantisse */
67 #define IEEEDPMantisse_Mask_Lo 0xFFFFFFFF
68 #define IEEEDPExponent_Mask_Hi 0x7FF00000 /* 10 bit for the exponent */
69 #define IEEEDPExponent_Mask_Lo 0x00000000
70 #define IEEEDPSign_Mask_Hi 0x80000000 /* 1 bit for the sign */
71 #define IEEEDPSign_Mask_Lo 0x00000000
73 #define IEEEDPNAN_Hi 0x7FFFFFFF
74 #define IEEEDPNAN_Lo 0xFFFFFFFF
75 #define IEEEDPNAN_64 0x7FFFFFFFFFFFFFFFULL
77 #define IEEEDPPInfty_Hi 0x7FEFFFFF
78 #define IEEEDPPInfty_Lo 0xFFFFFFFF
79 #define IEEEDPPInfty_64 0x7FEFFFFFFFFFFFFFULL
81 #define IEEEDPMantisse_Mask_64 0x0007FFFFFFFFFFFFULL /* 51 bit for the mantisse */
82 #define IEEEDPExponent_Mask_64 0x7FF8000000000000ULL /* 12 bit for the exponent */
83 #define IEEEDPSign_Mask_64 0x8000000000000000ULL /* 1 bit for the sign */
85 #define IEEESPMantisse_Mask 0x007FFFFF /* 23 bit for the mantisse */
86 #define IEEESPExponent_Mask 0x7F800000 /* 8 bit for the exponent */
87 #define IEEESPSign_Mask 0x80000000 /* 1 bit for the sign */
89 #define pi_Hi 0x400921FB
90 #define pi_Lo 0x54442D18
91 #define pi_64 0x400921FB54442D18ULL
92 #define pi QuadData(pi_Hi, pi_Lo, pi_64)
94 #define pio2_Hi 0x3FF921FB
95 #define pio2_Lo 0x54442D18
96 #define pio2_64 0x3FF921FB54442D18ULL
97 #define pio2 QuadData(pio2_Hi, pio2_Lo, pio2_64)
99 #define pio2_hi_Hi 0x3FF921FB
100 #define pio2_hi_Lo 0x54442D18
101 #define pio2_hi_64 0x3FF921FB54442D18ULL
102 #define pio2_hi QuadData(pio2_hi_Hi, pio2_hi_Lo, pio2_hi_64)
104 #define neg_pio2_hi_Hi 0xBFF921FB
105 #define neg_pio2_hi_Lo 0x54442D18
106 #define neg_pio2_hi_64 0x3FF921FB54442D18ULL
107 #define neg_pio2_hi QuadData(neg_pio2_hi_Hi, neg_pio2_hi_Lo, neg_pio2_hi_64)
109 #define pio2_lo_Hi 0x3C91A626
110 #define pio2_lo_Lo 0x33145C07
111 #define pio2_lo_64 0x3C91A62633145C07ULL
112 #define pio2_lo QuadData(pio2_lo_Hi, pio2_lo_Lo, pio2_lo_64)
114 #define pio4_hi_Hi 0x3FE921FB
115 #define pio4_hi_Lo 0x54442D18
116 #define pio4_hi_64 0x3FE921FB54442D18ULL
117 #define pio4_hi QuadData(pio4_hi_Hi, pio4_hi_Lo, pio4_hi_64)
119 #define pS0_Hi 0x3FC55555
120 #define pS0_Lo 0x55555555
121 #define pS0_64 0x3FC5555555555555ULL
122 #define pS0 QuadData(pS0_Hi, pS0_Lo, pS0_64)
124 #define pS1_Hi 0xBFD4D612
125 #define pS1_Lo 0x03EB6F7D
126 #define pS1_64 0xBFD4D61203EB6F7DULL
127 #define pS1 QuadData(pS1_Hi, pS1_Lo, pS1_64)
129 #define pS2_Hi 0x3FC9C155
130 #define pS2_Lo 0x0E884455
131 #define pS2_64 0x3FC9C1550E884455ULL
132 #define pS2 QuadData(pS2_Hi, pS2_Lo, pS2_64)
134 #define pS3_Hi 0xBFA48228
135 #define pS3_Lo 0xB5688F3B
136 #define pS3_64 0xBFA48228B5688F3BULL
137 #define pS3 QuadData(pS3_Hi, pS3_Lo, pS3_64)
139 #define pS4_Hi 0x3F49EFE0
140 #define pS4_Lo 0x7501B288
141 #define pS4_64 0x3F49EFE07501B288ULL
142 #define pS4 QuadData(pS4_Hi, pS4_Lo, pS4_64)
144 #define pS5_Hi 0x3F023DE1
145 #define pS5_Lo 0x0DFDF709
146 #define pS5_64 0x3F023DE10DFDF709ULL
147 #define pS5 QuadData(pS5_Hi, pS5_Lo, pS5_64)
149 #define qS1_Hi 0xC0033A27
150 #define qS1_Lo 0x1C8A2D4B
151 #define qS1_64 0xC0033A271C8A2D4BULL
152 #define qS1 QuadData(qS1_Hi, qS1_Lo, qS1_64)
154 #define qS2_Hi 0x40002AE5
155 #define qS2_Lo 0x9C598AC8
156 #define qS2_64 0x40002AE59C598AC8ULL
157 #define qS2 QuadData(qS2_Hi, qS2_Lo, qS2_64)
159 #define qS3_Hi 0xBFE6066C
160 #define qS3_Lo 0x1B8D0159
161 #define qS3_64 0xBFE6066C1B8D0159ULL
162 #define qS3 QuadData(qS3_Hi, qS3_Lo, qS3_64)
164 #define qS4_Hi 0x3FB3B8C5
165 #define qS4_Lo 0xB12E9282
166 #define qS4_64 0x3FB3B8C5B12E9282ULL
167 #define qS4 QuadData(qS4_Hi, qS4_Lo, qS4_64)
170 #define zero_64 0x000000000000000ULL
171 #define zero QuadData(0x0, 0x0, 0ULL)
173 #define one_Hi 0x3ff00000
174 #define one_Lo 0x00000000
175 #define one_64 0x3ff0000000000000ULL
176 #define oneC QuadData(one_Hi, one_Lo, one_64)
178 #define two_Hi 0x40000000
179 #define two_Lo 0x00000000
180 #define two_64 0x4000000000000000ULL
181 #define two QuadData(two_Hi, two_Lo, two_64)
183 #define onehalf_Hi 0x3fe00000
184 #define onehalf_Lo 0x00000000
185 #define onehalf_64 0x3fe0000000000000ULL
186 #define onehalf QuadData(onehalf_Hi, onehalf_Lo, onehalf_64)
189 #define onethird_Hi 0x3fd55555
190 #define onethird_Lo 0x55555555
191 #define onethird_64 0x3fd5555555555555ULL
193 #define onefifth_Hi 0x3fc99999
194 #define onefifth_Lo 0x99999999
195 #define onefifth_64 0x3fc9999999999999ULL
197 /* Defines to calculate the cosine */
198 #define cosf1_Hi 0x3ff00000 /* 1 */
199 #define cosf1_Lo 0x00000000
200 #define cosf1_64 0x3ff0000000000000ULL
201 #define cosf1 QuadData(cosf1_Hi, cosf1_Lo, cosf1_64)
203 #define cosf2_Hi 0xbfe00000 /* -1/2! */
204 #define cosf2_Lo 0x00000000
205 #define cosf2_64 0xbfe0000000000000ULL
206 #define cosf2 QuadData(cosf2_Hi, cosf2_Lo, cosf2_64)
208 #define cosf3_Hi 0x3fa55555 /* 1/4! */
209 #define cosf3_Lo 0x55555555
210 #define cosf3_64 0x3fa5555555555555ULL
211 #define cosf3 QuadData(cosf3_Hi, cosf3_Lo, cosf3_64)
213 #define cosf4_Hi 0xbf56c16c /* -1/6! */
214 #define cosf4_Lo 0x16c16c16
215 #define cosf4_64 0xbf56c16c16c16c16ULL
216 #define cosf4 QuadData(cosf4_Hi, cosf4_Lo, cosf4_64)
218 #define cosf5_Hi 0x3efa01a0 /* 1/8! */
219 #define cosf5_Lo 0x1a01a01a
220 #define cosf5_64 0x3efa01a01a01a010ULL
221 #define cosf5 QuadData(cosf5_Hi, cosf5_Lo, cosf5_64)
223 #define cosf6_Hi 0xbe927e4f /* -1/10! */
224 #define cosf6_Lo 0xb7789f5c
225 #define cosf6_64 0xbe927e4fb7789f5cULL
226 #define cosf6 QuadData(cosf6_Hi, cosf6_Lo, cosf6_64)
228 #define cosf7_Hi 0x3e21eed8 /* 1/12! */
229 #define cosf7_Lo 0xeff8d897
230 #define cosf7_64 0x3e21eed8eff8d897ULL
231 #define cosf7 QuadData(cosf7_Hi, cosf7_Lo, cosf7_64)
233 #define cosf8_Hi 0xbda93974 /* -1/14! */
234 #define cosf8_Lo 0xa8c07c9d
235 #define cosf8_64 0xbda93974a8c07c9dULL
236 #define cosf8 QuadData(cosf8_Hi, cosf8_Lo, cosf8_64)
238 /* Defines to calculate the sine */
239 #define sinf1_Hi 0x3ff00000 /* 1 */
240 #define sinf1_Lo 0x00000000
241 #define sinf1_64 0x3ff0000000000000ULL
242 #define sinf1 QuadData(sinf1_Hi, sinf1_Lo, sinf1_64)
244 #define sinf2_Hi 0xbfc55555 /* -1/3! */
245 #define sinf2_Lo 0x55555555
246 #define sinf2_64 0xbfc5555555555555ULL
247 #define sinf2 QuadData(sinf2_Hi, sinf2_Lo, sinf2_64)
249 #define sinf3_Hi 0x3f811111 /* 1/5! */
250 #define sinf3_Lo 0x11111111
251 #define sinf3_64 0x3f81111111111111ULL
252 #define sinf3 QuadData(sinf3_Hi, sinf3_Lo, sinf3_64)
254 #define sinf4_Hi 0xbf2a01a0 /* -1/7! */
255 #define sinf4_Lo 0x1a01a01a
256 #define sinf4_64 0xbf2a01a01a01a01aULL
257 #define sinf4 QuadData(sinf4_Hi, sinf4_Lo, sinf4_64)
259 #define sinf5_Hi 0x3ec71de3 /* 1/9! */
260 #define sinf5_Lo 0xa556c733
261 #define sinf5_64 0x3ec71de3a556c733ULL
262 #define sinf5 QuadData(sinf5_Hi, sinf5_Lo, sinf5_64)
264 #define sinf6_Hi 0xbe5ae645 /* -1/11! */
265 #define sinf6_Lo 0x67f544e3
266 #define sinf6_64 0xbe5ae64567f544e3ULL
267 #define sinf6 QuadData(sinf6_Hi, sinf6_Lo, sinf6_64)
269 #define sinf7_Hi 0x3de61246 /* 1/13! */
270 #define sinf7_Lo 0x13a86d09
271 #define sinf7_64 0x3de6124613a86d09ULL
272 #define sinf7 QuadData(sinf7_Hi, sinf7_Lo, sinf7_64)
274 #define sinf8_Hi 0xbd6ae7f3 /* -1/15! */
275 #define sinf8_Lo 0xe733b81f
276 #define sinf8_64 0xbd6ae7f3e733b81fULL
277 #define sinf8 QuadData(sinf8_Hi, sinf8_Lo, sinf8_64)
280 #include <aros/m68k/libcall_cc.h>
283 #endif /* __MATHIEEEDOUBTRANS_INTERN_H__ */