grub2: bring back build of aros-side grub2 tools
[AROS.git] / workbench / libs / mathieeedoubtrans / mathieeedoubtrans_intern.h
blob338303d77debb0b9268eafd146f08f9f1a8f93ff
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$
4 */
5 #ifndef __MATHIEEEDOUBTRANS_INTERN_H__
6 #define __MATHIEEEDOUBTRANS_INTERN_H__
8 /* This is a short file that contains a few things every mathieeedoubtrans
9 function needs */
11 #ifndef AROS_LIBCALL_H
12 # include <aros/libcall.h>
13 #endif
14 #ifndef PROTO_MATHIEEEDPTRANS_H
15 # include <proto/mathieeedoubtrans.h>
16 #endif
18 #ifndef EXEC_TYPES_H
19 # include <exec/types.h>
20 #endif
21 #ifndef EXEC_LIBRARIES_H
22 # include <exec/libraries.h>
23 #endif
24 #ifndef DOS_DOS_H
25 # include <dos/dos.h>
26 #endif
28 #include <proto/mathieeedoubbas.h>
29 #include <proto/exec.h>
31 #ifndef __MATHIEEE64BIT_DEFINES_H__
32 # include <aros/mathieee64bitdefines.h>
33 #endif
35 /* the following line is necessary so that the function headers are
36 created correctly and the functions can be compiled properly */
38 #ifdef double
39 #undef double
40 #endif
41 #define double QUAD
44 This is the MathIeeeDoubTransBase structure. It is documented here because
45 it is completely private. Applications should treat it as a struct
46 Library, and use the mathieeedoubtrans.library functions to get information.
49 extern struct Library * MathIeeeDoubBasBase;
51 struct MathIeeeDoubTransBase
53 struct Library library;
54 struct ExecBase * sysbase;
55 BPTR seglist;
58 /* Internal prototypes */
59 QUAD intern_IEEEDPLd(struct MathIeeeDoubTransBase * MathIeeeDoubTransBase, QUAD fnum);
60 LONG intern_IEEEDPisodd(QUAD fnum);
63 #define Zero_Bit 0x00000004 /* Flags of the 680xx CPU */
64 #define Negative_Bit 0x00000008
65 #define Overflow_Bit 0x00000002
68 #define IEEEDPMantisse_Mask_Hi 0x000FFFFF /* 62 bit for the mantisse */
69 #define IEEEDPMantisse_Mask_Lo 0xFFFFFFFF
70 #define IEEEDPExponent_Mask_Hi 0x7FF00000 /* 10 bit for the exponent */
71 #define IEEEDPExponent_Mask_Lo 0x00000000
72 #define IEEEDPSign_Mask_Hi 0x80000000 /* 1 bit for the sign */
73 #define IEEEDPSign_Mask_Lo 0x00000000
75 #define IEEEDPNAN_Hi 0x7FFFFFFF
76 #define IEEEDPNAN_Lo 0xFFFFFFFF
77 #define IEEEDPNAN_64 0x7FFFFFFFFFFFFFFFULL
79 #define IEEEDPPInfty_Hi 0x7FEFFFFF
80 #define IEEEDPPInfty_Lo 0xFFFFFFFF
81 #define IEEEDPPInfty_64 0x7FEFFFFFFFFFFFFFULL
83 #define IEEEDPMantisse_Mask_64 0x0007FFFFFFFFFFFFULL /* 51 bit for the mantisse */
84 #define IEEEDPExponent_Mask_64 0x7FF8000000000000ULL /* 12 bit for the exponent */
85 #define IEEEDPSign_Mask_64 0x8000000000000000ULL /* 1 bit for the sign */
87 #define IEEESPMantisse_Mask 0x007FFFFF /* 23 bit for the mantisse */
88 #define IEEESPExponent_Mask 0x7F800000 /* 8 bit for the exponent */
89 #define IEEESPSign_Mask 0x80000000 /* 1 bit for the sign */
91 #define pi_Hi 0x400921FB
92 #define pi_Lo 0x54442D18
93 #define pi_64 0x400921FB54442D18ULL
94 #define pi QuadData(pi_Hi, pi_Lo, pi_64)
96 #define pio2_Hi 0x3FF921FB
97 #define pio2_Lo 0x54442D18
98 #define pio2_64 0x3FF921FB54442D18ULL
99 #define pio2 QuadData(pio2_Hi, pio2_Lo, pio2_64)
101 #define pio2_hi_Hi 0x3FF921FB
102 #define pio2_hi_Lo 0x54442D18
103 #define pio2_hi_64 0x3FF921FB54442D18ULL
104 #define pio2_hi QuadData(pio2_hi_Hi, pio2_hi_Lo, pio2_hi_64)
106 #define neg_pio2_hi_Hi 0xBFF921FB
107 #define neg_pio2_hi_Lo 0x54442D18
108 #define neg_pio2_hi_64 0x3FF921FB54442D18ULL
109 #define neg_pio2_hi QuadData(neg_pio2_hi_Hi, neg_pio2_hi_Lo, neg_pio2_hi_64)
111 #define pio2_lo_Hi 0x3C91A626
112 #define pio2_lo_Lo 0x33145C07
113 #define pio2_lo_64 0x3C91A62633145C07ULL
114 #define pio2_lo QuadData(pio2_lo_Hi, pio2_lo_Lo, pio2_lo_64)
116 #define pio4_hi_Hi 0x3FE921FB
117 #define pio4_hi_Lo 0x54442D18
118 #define pio4_hi_64 0x3FE921FB54442D18ULL
119 #define pio4_hi QuadData(pio4_hi_Hi, pio4_hi_Lo, pio4_hi_64)
121 #define pS0_Hi 0x3FC55555
122 #define pS0_Lo 0x55555555
123 #define pS0_64 0x3FC5555555555555ULL
124 #define pS0 QuadData(pS0_Hi, pS0_Lo, pS0_64)
126 #define pS1_Hi 0xBFD4D612
127 #define pS1_Lo 0x03EB6F7D
128 #define pS1_64 0xBFD4D61203EB6F7DULL
129 #define pS1 QuadData(pS1_Hi, pS1_Lo, pS1_64)
131 #define pS2_Hi 0x3FC9C155
132 #define pS2_Lo 0x0E884455
133 #define pS2_64 0x3FC9C1550E884455ULL
134 #define pS2 QuadData(pS2_Hi, pS2_Lo, pS2_64)
136 #define pS3_Hi 0xBFA48228
137 #define pS3_Lo 0xB5688F3B
138 #define pS3_64 0xBFA48228B5688F3BULL
139 #define pS3 QuadData(pS3_Hi, pS3_Lo, pS3_64)
141 #define pS4_Hi 0x3F49EFE0
142 #define pS4_Lo 0x7501B288
143 #define pS4_64 0x3F49EFE07501B288ULL
144 #define pS4 QuadData(pS4_Hi, pS4_Lo, pS4_64)
146 #define pS5_Hi 0x3F023DE1
147 #define pS5_Lo 0x0DFDF709
148 #define pS5_64 0x3F023DE10DFDF709ULL
149 #define pS5 QuadData(pS5_Hi, pS5_Lo, pS5_64)
151 #define qS1_Hi 0xC0033A27
152 #define qS1_Lo 0x1C8A2D4B
153 #define qS1_64 0xC0033A271C8A2D4BULL
154 #define qS1 QuadData(qS1_Hi, qS1_Lo, qS1_64)
156 #define qS2_Hi 0x40002AE5
157 #define qS2_Lo 0x9C598AC8
158 #define qS2_64 0x40002AE59C598AC8ULL
159 #define qS2 QuadData(qS2_Hi, qS2_Lo, qS2_64)
161 #define qS3_Hi 0xBFE6066C
162 #define qS3_Lo 0x1B8D0159
163 #define qS3_64 0xBFE6066C1B8D0159ULL
164 #define qS3 QuadData(qS3_Hi, qS3_Lo, qS3_64)
166 #define qS4_Hi 0x3FB3B8C5
167 #define qS4_Lo 0xB12E9282
168 #define qS4_64 0x3FB3B8C5B12E9282ULL
169 #define qS4 QuadData(qS4_Hi, qS4_Lo, qS4_64)
172 #define zero_64 0x000000000000000ULL
173 #define zero QuadData(0x0, 0x0, 0ULL)
175 #define one_Hi 0x3ff00000
176 #define one_Lo 0x00000000
177 #define one_64 0x3ff0000000000000ULL
178 #define oneC QuadData(one_Hi, one_Lo, one_64)
180 #define two_Hi 0x40000000
181 #define two_Lo 0x00000000
182 #define two_64 0x4000000000000000ULL
183 #define two QuadData(two_Hi, two_Lo, two_64)
185 #define onehalf_Hi 0x3fe00000
186 #define onehalf_Lo 0x00000000
187 #define onehalf_64 0x3fe0000000000000ULL
188 #define onehalf QuadData(onehalf_Hi, onehalf_Lo, onehalf_64)
191 #define onethird_Hi 0x3fd55555
192 #define onethird_Lo 0x55555555
193 #define onethird_64 0x3fd5555555555555ULL
195 #define onefifth_Hi 0x3fc99999
196 #define onefifth_Lo 0x99999999
197 #define onefifth_64 0x3fc9999999999999ULL
199 /* Defines to calculate the cosine */
200 #define cosf1_Hi 0x3ff00000 /* 1 */
201 #define cosf1_Lo 0x00000000
202 #define cosf1_64 0x3ff0000000000000ULL
203 #define cosf1 QuadData(cosf1_Hi, cosf1_Lo, cosf1_64)
205 #define cosf2_Hi 0xbfe00000 /* -1/2! */
206 #define cosf2_Lo 0x00000000
207 #define cosf2_64 0xbfe0000000000000ULL
208 #define cosf2 QuadData(cosf2_Hi, cosf2_Lo, cosf2_64)
210 #define cosf3_Hi 0x3fa55555 /* 1/4! */
211 #define cosf3_Lo 0x55555555
212 #define cosf3_64 0x3fa5555555555555ULL
213 #define cosf3 QuadData(cosf3_Hi, cosf3_Lo, cosf3_64)
215 #define cosf4_Hi 0xbf56c16c /* -1/6! */
216 #define cosf4_Lo 0x16c16c16
217 #define cosf4_64 0xbf56c16c16c16c16ULL
218 #define cosf4 QuadData(cosf4_Hi, cosf4_Lo, cosf4_64)
220 #define cosf5_Hi 0x3efa01a0 /* 1/8! */
221 #define cosf5_Lo 0x1a01a01a
222 #define cosf5_64 0x3efa01a01a01a010ULL
223 #define cosf5 QuadData(cosf5_Hi, cosf5_Lo, cosf5_64)
225 #define cosf6_Hi 0xbe927e4f /* -1/10! */
226 #define cosf6_Lo 0xb7789f5c
227 #define cosf6_64 0xbe927e4fb7789f5cULL
228 #define cosf6 QuadData(cosf6_Hi, cosf6_Lo, cosf6_64)
230 #define cosf7_Hi 0x3e21eed8 /* 1/12! */
231 #define cosf7_Lo 0xeff8d897
232 #define cosf7_64 0x3e21eed8eff8d897ULL
233 #define cosf7 QuadData(cosf7_Hi, cosf7_Lo, cosf7_64)
235 #define cosf8_Hi 0xbda93974 /* -1/14! */
236 #define cosf8_Lo 0xa8c07c9d
237 #define cosf8_64 0xbda93974a8c07c9dULL
238 #define cosf8 QuadData(cosf8_Hi, cosf8_Lo, cosf8_64)
240 /* Defines to calculate the sine */
241 #define sinf1_Hi 0x3ff00000 /* 1 */
242 #define sinf1_Lo 0x00000000
243 #define sinf1_64 0x3ff0000000000000ULL
244 #define sinf1 QuadData(sinf1_Hi, sinf1_Lo, sinf1_64)
246 #define sinf2_Hi 0xbfc55555 /* -1/3! */
247 #define sinf2_Lo 0x55555555
248 #define sinf2_64 0xbfc5555555555555ULL
249 #define sinf2 QuadData(sinf2_Hi, sinf2_Lo, sinf2_64)
251 #define sinf3_Hi 0x3f811111 /* 1/5! */
252 #define sinf3_Lo 0x11111111
253 #define sinf3_64 0x3f81111111111111ULL
254 #define sinf3 QuadData(sinf3_Hi, sinf3_Lo, sinf3_64)
256 #define sinf4_Hi 0xbf2a01a0 /* -1/7! */
257 #define sinf4_Lo 0x1a01a01a
258 #define sinf4_64 0xbf2a01a01a01a01aULL
259 #define sinf4 QuadData(sinf4_Hi, sinf4_Lo, sinf4_64)
261 #define sinf5_Hi 0x3ec71de3 /* 1/9! */
262 #define sinf5_Lo 0xa556c733
263 #define sinf5_64 0x3ec71de3a556c733ULL
264 #define sinf5 QuadData(sinf5_Hi, sinf5_Lo, sinf5_64)
266 #define sinf6_Hi 0xbe5ae645 /* -1/11! */
267 #define sinf6_Lo 0x67f544e3
268 #define sinf6_64 0xbe5ae64567f544e3ULL
269 #define sinf6 QuadData(sinf6_Hi, sinf6_Lo, sinf6_64)
271 #define sinf7_Hi 0x3de61246 /* 1/13! */
272 #define sinf7_Lo 0x13a86d09
273 #define sinf7_64 0x3de6124613a86d09ULL
274 #define sinf7 QuadData(sinf7_Hi, sinf7_Lo, sinf7_64)
276 #define sinf8_Hi 0xbd6ae7f3 /* -1/15! */
277 #define sinf8_Lo 0xe733b81f
278 #define sinf8_64 0xbd6ae7f3e733b81fULL
279 #define sinf8 QuadData(sinf8_Hi, sinf8_Lo, sinf8_64)
281 #ifdef __mc68000
282 #include <aros/m68k/libcall_cc.h>
283 #endif
285 #endif /* __MATHIEEEDOUBTRANS_INTERN_H__ */