New bitmap method SetRGBConversionFunction which can be used to
[tangerine.git] / workbench / libs / mathieeedoubtrans / mathieeedoubtrans_intern.h
blobc15876b247967d001cf09df7802b7d20b564d92c
1 /*
2 Copyright © 1995-2003, The AROS Development Team. All rights reserved.
3 $Id$
4 */
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 */
11 #define double QUAD
13 /* This is a short file that contains a few things every mathieeedoubtrans
14 function needs */
16 #ifndef AROS_LIBCALL_H
17 # include <aros/libcall.h>
18 #endif
19 #ifndef PROTO_MATHIEEEDPTRANS_H
20 # include <proto/mathieeedoubtrans.h>
21 #endif
23 #ifndef EXEC_TYPES_H
24 # include <exec/types.h>
25 #endif
26 #ifndef EXEC_LIBRARIES_H
27 # include <exec/libraries.h>
28 #endif
29 #ifndef DOS_DOS_H
30 # include <dos/dos.h>
31 #endif
33 #include <proto/mathieeedoubbas.h>
34 #include <proto/exec.h>
36 #ifndef __MATHIEEE64BIT_DEFINES_H__
37 # include <aros/mathieee64bitdefines.h>
38 #endif
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 ExecBase * SysBase;
48 extern struct Library * MathIeeeDoubBasBase;
50 struct MathIeeeDoubTransBase
52 struct Library library;
53 struct ExecBase * sysbase;
54 BPTR seglist;
57 /* Internal prototypes */
58 QUAD intern_IEEEDPLd(struct MathIeeeDoubTransBase * MathIeeeDoubTransBase, QUAD fnum);
59 LONG intern_IEEEDPisodd(QUAD fnum);
63 #define MSTB(mstb) ((struct MathIeeeDoubTransBase*)mstb)
64 #undef SysBase
65 #define SysBase (MSTB(MathIeeeDoubTransBase) -> sysbase)
69 #define Zero_Bit 0x00000004 /* Flags of the 680xx CPU */
70 #define Negative_Bit 0x00000008
71 #define Overflow_Bit 0x00000002
74 #define IEEEDPMantisse_Mask_Hi 0x000FFFFF /* 62 bit for the mantisse */
75 #define IEEEDPMantisse_Mask_Lo 0xFFFFFFFF
76 #define IEEEDPExponent_Mask_Hi 0x7FF00000 /* 10 bit for the exponent */
77 #define IEEEDPExponent_Mask_Lo 0x00000000
78 #define IEEEDPSign_Mask_Hi 0x80000000 /* 1 bit for the sign */
79 #define IEEEDPSign_Mask_Lo 0x00000000
81 #define IEEEDPNAN_Hi 0x7FFFFFFF
82 #define IEEEDPNAN_Lo 0xFFFFFFFF
83 #define IEEEDPNAN_64 0x7FFFFFFFFFFFFFFFULL
85 #define IEEEDPPInfty_Hi 0x7FEFFFFF
86 #define IEEEDPPInfty_Lo 0xFFFFFFFF
87 #define IEEEDPPInfty_64 0x7FEFFFFFFFFFFFFFULL
89 #define IEEEDPMantisse_Mask_64 0x0007FFFFFFFFFFFFULL /* 51 bit for the mantisse */
90 #define IEEEDPExponent_Mask_64 0x7FF8000000000000ULL /* 12 bit for the exponent */
91 #define IEEEDPSign_Mask_64 0x8000000000000000ULL /* 1 bit for the sign */
93 #define IEEESPMantisse_Mask 0x007FFFFF /* 23 bit for the mantisse */
94 #define IEEESPExponent_Mask 0x7F800000 /* 8 bit for the exponent */
95 #define IEEESPSign_Mask 0x80000000 /* 1 bit for the sign */
97 #define pi_Hi 0x400921FB
98 #define pi_Lo 0x54442D18
99 #define pi_64 0x400921FB54442D18ULL
100 #define pi QuadData(pi_Hi, pi_Lo, pi_64)
102 #define pio2_Hi 0x3FF921FB
103 #define pio2_Lo 0x54442D18
104 #define pio2_64 0x3FF921FB54442D18ULL
105 #define pio2 QuadData(pio2_Hi, pio2_Lo, pio2_64)
107 #define pio2_hi_Hi 0x3FF921FB
108 #define pio2_hi_Lo 0x54442D18
109 #define pio2_hi_64 0x3FF921FB54442D18ULL
110 #define pio2_hi QuadData(pio2_hi_Hi, pio2_hi_Lo, pio2_hi_64)
112 #define neg_pio2_hi_Hi 0xBFF921FB
113 #define neg_pio2_hi_Lo 0x54442D18
114 #define neg_pio2_hi_64 0x3FF921FB54442D18ULL
115 #define neg_pio2_hi QuadData(neg_pio2_hi_Hi, neg_pio2_hi_Lo, neg_pio2_hi_64)
117 #define pio2_lo_Hi 0x3C91A626
118 #define pio2_lo_Lo 0x33145C07
119 #define pio2_lo_64 0x3C91A62633145C07ULL
120 #define pio2_lo QuadData(pio2_lo_Hi, pio2_lo_Lo, pio2_lo_64)
122 #define pio4_hi_Hi 0x3FE921FB
123 #define pio4_hi_Lo 0x54442D18
124 #define pio4_hi_64 0x3FE921FB54442D18ULL
125 #define pio4_hi QuadData(pio4_hi_Hi, pio4_hi_Lo, pio4_hi_64)
127 #define pS0_Hi 0x3FC55555
128 #define pS0_Lo 0x55555555
129 #define pS0_64 0x3FC5555555555555ULL
130 #define pS0 QuadData(pS0_Hi, pS0_Lo, pS0_64)
132 #define pS1_Hi 0xBFD4D612
133 #define pS1_Lo 0x03EB6F7D
134 #define pS1_64 0xBFD4D61203EB6F7DULL
135 #define pS1 QuadData(pS1_Hi, pS1_Lo, pS1_64)
137 #define pS2_Hi 0x3FC9C155
138 #define pS2_Lo 0x0E884455
139 #define pS2_64 0x3FC9C1550E884455ULL
140 #define pS2 QuadData(pS2_Hi, pS2_Lo, pS2_64)
142 #define pS3_Hi 0xBFA48228
143 #define pS3_Lo 0xB5688F3B
144 #define pS3_64 0xBFA48228B5688F3BULL
145 #define pS3 QuadData(pS3_Hi, pS3_Lo, pS3_64)
147 #define pS4_Hi 0x3F49EFE0
148 #define pS4_Lo 0x7501B288
149 #define pS4_64 0x3F49EFE07501B288ULL
150 #define pS4 QuadData(pS4_Hi, pS4_Lo, pS4_64)
152 #define pS5_Hi 0x3F023DE1
153 #define pS5_Lo 0x0DFDF709
154 #define pS5_64 0x3F023DE10DFDF709ULL
155 #define pS5 QuadData(pS5_Hi, pS5_Lo, pS5_64)
157 #define qS1_Hi 0xC0033A27
158 #define qS1_Lo 0x1C8A2D4B
159 #define qS1_64 0xC0033A271C8A2D4BULL
160 #define qS1 QuadData(qS1_Hi, qS1_Lo, qS1_64)
162 #define qS2_Hi 0x40002AE5
163 #define qS2_Lo 0x9C598AC8
164 #define qS2_64 0x40002AE59C598AC8ULL
165 #define qS2 QuadData(qS2_Hi, qS2_Lo, qS2_64)
167 #define qS3_Hi 0xBFE6066C
168 #define qS3_Lo 0x1B8D0159
169 #define qS3_64 0xBFE6066C1B8D0159ULL
170 #define qS3 QuadData(qS3_Hi, qS3_Lo, qS3_64)
172 #define qS4_Hi 0x3FB3B8C5
173 #define qS4_Lo 0xB12E9282
174 #define qS4_64 0x3FB3B8C5B12E9282ULL
175 #define qS4 QuadData(qS4_Hi, qS4_Lo, qS4_64)
178 #define zero_64 0x000000000000000ULL
179 #define zero QuadData(0x0, 0x0, 0ULL)
181 #define one_Hi 0x3ff00000
182 #define one_Lo 0x00000000
183 #define one_64 0x3ff0000000000000ULL
184 #define oneC QuadData(one_Hi, one_Lo, one_64)
186 #define two_Hi 0x40000000
187 #define two_Lo 0x00000000
188 #define two_64 0x4000000000000000ULL
189 #define two QuadData(two_Hi, two_Lo, two_64)
191 #define onehalf_Hi 0x3fe00000
192 #define onehalf_Lo 0x00000000
193 #define onehalf_64 0x3fe0000000000000ULL
194 #define onehalf QuadData(onehalf_Hi, onehalf_Lo, onehalf_64)
197 #define onethird_Hi 0x3fd55555
198 #define onethird_Lo 0x55555555
199 #define onethird_64 0x3fd5555555555555ULL
201 #define onefifth_Hi 0x3fc99999
202 #define onefifth_Lo 0x99999999
203 #define onefifth_64 0x3fc9999999999999ULL
205 /* Defines to calculate the cosine */
206 #define cosf1_Hi 0x3ff00000 /* 1 */
207 #define cosf1_Lo 0x00000000
208 #define cosf1_64 0x3ff0000000000000ULL
209 #define cosf1 QuadData(cosf1_Hi, cosf1_Lo, cosf1_64)
211 #define cosf2_Hi 0xbfe00000 /* -1/2! */
212 #define cosf2_Lo 0x00000000
213 #define cosf2_64 0xbfe0000000000000ULL
214 #define cosf2 QuadData(cosf2_Hi, cosf2_Lo, cosf2_64)
216 #define cosf3_Hi 0x3fa55555 /* 1/4! */
217 #define cosf3_Lo 0x55555555
218 #define cosf3_64 0x3fa5555555555555ULL
219 #define cosf3 QuadData(cosf3_Hi, cosf3_Lo, cosf3_64)
221 #define cosf4_Hi 0xbf56c16c /* -1/6! */
222 #define cosf4_Lo 0x16c16c16
223 #define cosf4_64 0xbf56c16c16c16c16ULL
224 #define cosf4 QuadData(cosf4_Hi, cosf4_Lo, cosf4_64)
226 #define cosf5_Hi 0x3efa01a0 /* 1/8! */
227 #define cosf5_Lo 0x1a01a01a
228 #define cosf5_64 0x3efa01a01a01a010ULL
229 #define cosf5 QuadData(cosf5_Hi, cosf5_Lo, cosf5_64)
231 #define cosf6_Hi 0xbe927e4f /* -1/10! */
232 #define cosf6_Lo 0xb7789f5c
233 #define cosf6_64 0xbe927e4fb7789f5cULL
234 #define cosf6 QuadData(cosf6_Hi, cosf6_Lo, cosf6_64)
236 #define cosf7_Hi 0x3e21eed8 /* 1/12! */
237 #define cosf7_Lo 0xeff8d897
238 #define cosf7_64 0x3e21eed8eff8d897ULL
239 #define cosf7 QuadData(cosf7_Hi, cosf7_Lo, cosf7_64)
241 #define cosf8_Hi 0xbda93974 /* -1/14! */
242 #define cosf8_Lo 0xa8c07c9d
243 #define cosf8_64 0xbda93974a8c07c9dULL
244 #define cosf8 QuadData(cosf8_Hi, cosf8_Lo, cosf8_64)
246 /* Defines to calculate the sine */
247 #define sinf1_Hi 0x3ff00000 /* 1 */
248 #define sinf1_Lo 0x00000000
249 #define sinf1_64 0x3ff0000000000000ULL
250 #define sinf1 QuadData(sinf1_Hi, sinf1_Lo, sinf1_64)
252 #define sinf2_Hi 0xbfc55555 /* -1/3! */
253 #define sinf2_Lo 0x55555555
254 #define sinf2_64 0xbfc5555555555555ULL
255 #define sinf2 QuadData(sinf2_Hi, sinf2_Lo, sinf2_64)
257 #define sinf3_Hi 0x3f811111 /* 1/5! */
258 #define sinf3_Lo 0x11111111
259 #define sinf3_64 0x3f81111111111111ULL
260 #define sinf3 QuadData(sinf3_Hi, sinf3_Lo, sinf3_64)
262 #define sinf4_Hi 0xbf2a01a0 /* -1/7! */
263 #define sinf4_Lo 0x1a01a01a
264 #define sinf4_64 0xbf2a01a01a01a01aULL
265 #define sinf4 QuadData(sinf4_Hi, sinf4_Lo, sinf4_64)
267 #define sinf5_Hi 0x3ec71de3 /* 1/9! */
268 #define sinf5_Lo 0xa556c733
269 #define sinf5_64 0x3ec71de3a556c733ULL
270 #define sinf5 QuadData(sinf5_Hi, sinf5_Lo, sinf5_64)
272 #define sinf6_Hi 0xbe5ae645 /* -1/11! */
273 #define sinf6_Lo 0x67f544e3
274 #define sinf6_64 0xbe5ae64567f544e3ULL
275 #define sinf6 QuadData(sinf6_Hi, sinf6_Lo, sinf6_64)
277 #define sinf7_Hi 0x3de61246 /* 1/13! */
278 #define sinf7_Lo 0x13a86d09
279 #define sinf7_64 0x3de6124613a86d09ULL
280 #define sinf7 QuadData(sinf7_Hi, sinf7_Lo, sinf7_64)
282 #define sinf8_Hi 0xbd6ae7f3 /* -1/15! */
283 #define sinf8_Lo 0xe733b81f
284 #define sinf8_64 0xbd6ae7f3e733b81fULL
285 #define sinf8 QuadData(sinf8_Hi, sinf8_Lo, sinf8_64)
288 #endif /* __MATHIEEEDOUBTRANS_INTERN_H__ */