MotorWare f2806x Module API Documentation
float/IQmathLib.h
Go to the documentation of this file.
1 /* --COPYRIGHT--,BSD
2  * Copyright (c) 2012, Texas Instruments Incorporated
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the distribution.
15  *
16  * * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  * --/COPYRIGHT--*/
32 #ifndef _IQMATHLIB_H_
33 #define _IQMATHLIB_H_
34 
35 
36 // TI File $Revision: /main/3 $
37 // Checkin $Date: July 8, 2008 16:58:38 $
38 //###########################################################################
39 //
40 // FILE: IQmathLib.h
41 //
42 // TITLE: IQ Math library functions definitions.
43 //
44 //###########################################################################
45 //
46 // Ver | dd-mmm-yyyy | Who | Description of changes
47 // =====|=============|=======|==============================================
48 // 1.3 | 19 Nov 2001 | A. T. | Original Release.
49 // -----|-------------|-------|----------------------------------------------
50 // 1.4 | 17 May 2002 | A. T. | Added new functions and support for
51 // | | | intrinsics IQmpy, IQxmpy, IQsat.
52 // -----|-------------|-------|----------------------------------------------
53 // 1.4a| 12 Jun 2002 | A. T. | Fixed problem with _IQ() operation on
54 // | | | variables.
55 // -----|-------------|-------|----------------------------------------------
56 // 1.4b| 18 Jun 2002 | A. T. | Fixed bug with _IQtoIQN() and _IQNtoIQ()
57 // | | | operations.
58 // -----|-------------|-------|----------------------------------------------
59 // 1.4d| 30 Mar 2003 | DA/SD | 1. Added macro parameters in parentheses
60 // | | | in number of places where it matters
61 // | | | 2. Added macro definition to include header
62 // | | | file multiple times in the program.
63 // -----|-------------|-------|----------------------------------------------
64 // 1.4e| 17 Jun 2004 | AT/DA | Added IQexp function.
65 // | | | Added IQasin & IQacos functions (thanks DA).
66 // -----|-------------|-------|----------------------------------------------
67 // 1.4f| 10 Mar 2005 | AT | Fixed Bug In IQexp function.
68 // -----|-------------|-------|----------------------------------------------
69 // 1.5 | 30 Jan 2008 | LH | 1. Changed the definion of the _IQatan2PU(A,B)
70 // | | | macro for FLOAT_MATH so that a call to
71 // | | | divide will not occur.
72 // | | | 2. If MATH_TYPE == FLOAT_MATH, then include the
73 // | | | following standard headers: math.h
74 // | | | stdlib.h.
75 // | | | 3. Added missing #defines for the non-global
76 // | | | _IQatanN() function
77 // | | | 4. Adding missing definitions for absolute
78 // | | | value when MATH_TYPE == FLOAT_MATH
79 // | | | 5. Included limits.h and changed the definition
80 // | | | of MAX_IQ_NEG to LONG_MIN and MAX_IQ_POS
81 // | | | to LONG_MAX
82 // -----|-------------|-------|----------------------------------------------
83 // 1.5c| 8 June 2010 | LH | Changes made to improve porting between IQ and
84 // | | | and float.
85 // | | |
86 // | | | 1. Added left shift and right shift #defines
87 // | | | for multiplying and dividing by power of
88 // | | | 2 (up to 64) for IQ_MATH
89 // | | |
90 // | | | 2. Added corresponding multiply/divide #defines
91 // | | | for powers of 2 (up to 64) for FLOAT_MATH
92 // | | |
93 // | | | 3. FLOAT_MATH: Corrected the #defines for
94 // | | | conversion from IQ to Q15
95 // | | |
96 // | | | a) removed the L on the constant to avoid
97 // | | | the 64-bit float multiply call to the
98 // | | | runtime support library.
99 // | | | b) removed the conversion from float to
100 // | | | int before the multiply. This prevented
101 // | | | native floating point from being used.
102 // | | |
103 // | | | 4. FLOAT_MATH: Modified IQdiv and IQNdiv macros t
104 // | | | such that the arguments are cast to float before
105 // | | | he division.
106 // | | |
107 // | | | In some cases the IQ_MATH verion was used to
108 // | | | divide an _iq type by an int32, which works fine.
109 // | | |
110 // | | | This change will allow the FLOAT_TYPE macros to
111 // | | | to also be used with integer types, and not
112 // | | | just "_iq" (i.e. float) types.
113 // | | |
114 // | | | 5. FLOAT_MATH: Changed the definition of sat for float
115 // | | | math. This new definition uses compiler intrinsics and
116 // | | | requires codegen tools V5.2.2 or later
117 // | | | The previous definition can be uncommented
118 // | | | if needed for previous versions of the codegen tools
119 // | | | however it will not be efficient.
120 //###########################################################################
121 // $TI Release: Release 1.5c $
122 // $Release Date: June 8, 2010 $
123 //###########################################################################
124 //
125 // User needs to configure "MATH_TYPE" and "GLOBAL_Q" values:
126 //
127 //---------------------------------------------------------------------------
128 // Select math type, IQ_MATH or FLOAT_MATH:
129 //
130 
131 // **************************************************************************
132 // the includes
133 
138 
139 
140 
141 #ifdef __cplusplus
142 extern "C" {
143 #endif
144 
145 
146 // **************************************************************************
147 // the defines
148 
149 #define FLOAT_MATH 1
150 #define IQ_MATH 0
151 
152 #ifndef MATH_TYPE
153 #define MATH_TYPE FLOAT_MATH
154 #endif
155 
156 //---------------------------------------------------------------------------
157 // Select global Q value and scaling. The Q value is limited to the
158 // following range for all functions:
159 //
160 // 30 <= GLOBAL_Q <= 1
161 //
162 #ifndef GLOBAL_Q
163 #define GLOBAL_Q 24
164 #endif
165 
166 //---------------------------------------------------------------------------
167 // If using FLOAT_MATH, include standard headers to avoid conversion issues
168 //
169 #if MATH_TYPE == FLOAT_MATH
170 #include <math.h>
171 #include <stdlib.h>
172 #endif
173 #include <limits.h>
174 
175 //---------------------------------------------------------------------------
176 // Various Usefull Constant Definitions:
177 //
178 #define QG GLOBAL_Q
179 #define Q30 30
180 #define Q29 29
181 #define Q28 28
182 #define Q27 27
183 #define Q26 26
184 #define Q25 25
185 #define Q24 24
186 #define Q23 23
187 #define Q22 22
188 #define Q21 21
189 #define Q20 20
190 #define Q19 19
191 #define Q18 18
192 #define Q17 17
193 #define Q16 16
194 #define Q15 15
195 #define Q14 14
196 #define Q13 13
197 #define Q12 12
198 #define Q11 11
199 #define Q10 10
200 #define Q9 9
201 #define Q8 8
202 #define Q7 7
203 #define Q6 6
204 #define Q5 5
205 #define Q4 4
206 #define Q3 3
207 #define Q2 2
208 #define Q1 1
209 
210 #define MAX_IQ_POS LONG_MAX
211 #define MAX_IQ_NEG LONG_MIN
212 #define MIN_IQ_POS 1
213 #define MIN_IQ_NEG -1
214 
215 //###########################################################################
216 #if MATH_TYPE == IQ_MATH
217 //###########################################################################
218 // If IQ_MATH is used, the following IQmath library function definitions
219 // are used:
220 //===========================================================================
221 typedef long _iq;
222 typedef long _iq30;
223 typedef long _iq29;
224 typedef long _iq28;
225 typedef long _iq27;
226 typedef long _iq26;
227 typedef long _iq25;
228 typedef long _iq24;
229 typedef long _iq23;
230 typedef long _iq22;
231 typedef long _iq21;
232 typedef long _iq20;
233 typedef long _iq19;
234 typedef long _iq18;
235 typedef long _iq17;
236 typedef long _iq16;
237 typedef long _iq15;
238 typedef long _iq14;
239 typedef long _iq13;
240 typedef long _iq12;
241 typedef long _iq11;
242 typedef long _iq10;
243 typedef long _iq9;
244 typedef long _iq8;
245 typedef long _iq7;
246 typedef long _iq6;
247 typedef long _iq5;
248 typedef long _iq4;
249 typedef long _iq3;
250 typedef long _iq2;
251 typedef long _iq1;
252 //---------------------------------------------------------------------------
253 #define _IQmpy2(A) ((A)<<1)
254 #define _IQmpy4(A) ((A)<<2)
255 #define _IQmpy8(A) ((A)<<3)
256 #define _IQmpy16(A) ((A)<<4)
257 #define _IQmpy32(A) ((A)<<5)
258 #define _IQmpy64(A) ((A)<<6)
259 
260 #define _IQdiv2(A) ((A)>>1)
261 #define _IQdiv4(A) ((A)>>2)
262 #define _IQdiv8(A) ((A)>>3)
263 #define _IQdiv16(A) ((A)>>4)
264 #define _IQdiv32(A) ((A)>>5)
265 #define _IQdiv64(A) ((A)>>6)
266 //---------------------------------------------------------------------------
267 #define _IQ30(A) (long) ((A) * 1073741824.0L)
268 #define _IQ29(A) (long) ((A) * 536870912.0L)
269 #define _IQ28(A) (long) ((A) * 268435456.0L)
270 #define _IQ27(A) (long) ((A) * 134217728.0L)
271 #define _IQ26(A) (long) ((A) * 67108864.0L)
272 #define _IQ25(A) (long) ((A) * 33554432.0L)
273 #define _IQ24(A) (long) ((A) * 16777216.0L)
274 #define _IQ23(A) (long) ((A) * 8388608.0L)
275 #define _IQ22(A) (long) ((A) * 4194304.0L)
276 #define _IQ21(A) (long) ((A) * 2097152.0L)
277 #define _IQ20(A) (long) ((A) * 1048576.0L)
278 #define _IQ19(A) (long) ((A) * 524288.0L)
279 #define _IQ18(A) (long) ((A) * 262144.0L)
280 #define _IQ17(A) (long) ((A) * 131072.0L)
281 #define _IQ16(A) (long) ((A) * 65536.0L)
282 #define _IQ15(A) (long) ((A) * 32768.0L)
283 #define _IQ14(A) (long) ((A) * 16384.0L)
284 #define _IQ13(A) (long) ((A) * 8192.0L)
285 #define _IQ12(A) (long) ((A) * 4096.0L)
286 #define _IQ11(A) (long) ((A) * 2048.0L)
287 #define _IQ10(A) (long) ((A) * 1024.0L)
288 #define _IQ9(A) (long) ((A) * 512.0L)
289 #define _IQ8(A) (long) ((A) * 256.0L)
290 #define _IQ7(A) (long) ((A) * 128.0L)
291 #define _IQ6(A) (long) ((A) * 64.0L)
292 #define _IQ5(A) (long) ((A) * 32.0L)
293 #define _IQ4(A) (long) ((A) * 16.0L)
294 #define _IQ3(A) (long) ((A) * 8.0L)
295 #define _IQ2(A) (long) ((A) * 4.0L)
296 #define _IQ1(A) (long) ((A) * 2.0L)
297 
298 #if GLOBAL_Q == 30
299 #define _IQ(A) _IQ30(A)
300 #endif
301 #if GLOBAL_Q == 29
302 #define _IQ(A) _IQ29(A)
303 #endif
304 #if GLOBAL_Q == 28
305 #define _IQ(A) _IQ28(A)
306 #endif
307 #if GLOBAL_Q == 27
308 #define _IQ(A) _IQ27(A)
309 #endif
310 #if GLOBAL_Q == 26
311 #define _IQ(A) _IQ26(A)
312 #endif
313 #if GLOBAL_Q == 25
314 #define _IQ(A) _IQ25(A)
315 #endif
316 #if GLOBAL_Q == 24
317 #define _IQ(A) _IQ24(A)
318 #endif
319 #if GLOBAL_Q == 23
320 #define _IQ(A) _IQ23(A)
321 #endif
322 #if GLOBAL_Q == 22
323 #define _IQ(A) _IQ22(A)
324 #endif
325 #if GLOBAL_Q == 21
326 #define _IQ(A) _IQ21(A)
327 #endif
328 #if GLOBAL_Q == 20
329 #define _IQ(A) _IQ20(A)
330 #endif
331 #if GLOBAL_Q == 19
332 #define _IQ(A) _IQ19(A)
333 #endif
334 #if GLOBAL_Q == 18
335 #define _IQ(A) _IQ18(A)
336 #endif
337 #if GLOBAL_Q == 17
338 #define _IQ(A) _IQ17(A)
339 #endif
340 #if GLOBAL_Q == 16
341 #define _IQ(A) _IQ16(A)
342 #endif
343 #if GLOBAL_Q == 15
344 #define _IQ(A) _IQ15(A)
345 #endif
346 #if GLOBAL_Q == 14
347 #define _IQ(A) _IQ14(A)
348 #endif
349 #if GLOBAL_Q == 13
350 #define _IQ(A) _IQ13(A)
351 #endif
352 #if GLOBAL_Q == 12
353 #define _IQ(A) _IQ12(A)
354 #endif
355 #if GLOBAL_Q == 11
356 #define _IQ(A) _IQ11(A)
357 #endif
358 #if GLOBAL_Q == 10
359 #define _IQ(A) _IQ10(A)
360 #endif
361 #if GLOBAL_Q == 9
362 #define _IQ(A) _IQ9(A)
363 #endif
364 #if GLOBAL_Q == 8
365 #define _IQ(A) _IQ8(A)
366 #endif
367 #if GLOBAL_Q == 7
368 #define _IQ(A) _IQ7(A)
369 #endif
370 #if GLOBAL_Q == 6
371 #define _IQ(A) _IQ6(A)
372 #endif
373 #if GLOBAL_Q == 5
374 #define _IQ(A) _IQ5(A)
375 #endif
376 #if GLOBAL_Q == 4
377 #define _IQ(A) _IQ4(A)
378 #endif
379 #if GLOBAL_Q == 3
380 #define _IQ(A) _IQ3(A)
381 #endif
382 #if GLOBAL_Q == 2
383 #define _IQ(A) _IQ2(A)
384 #endif
385 #if GLOBAL_Q == 1
386 #define _IQ(A) _IQ1(A)
387 #endif
388 //---------------------------------------------------------------------------
389 extern float _IQ30toF(long A);
390 extern float _IQ29toF(long A);
391 extern float _IQ28toF(long A);
392 extern float _IQ27toF(long A);
393 extern float _IQ26toF(long A);
394 extern float _IQ25toF(long A);
395 extern float _IQ24toF(long A);
396 extern float _IQ23toF(long A);
397 extern float _IQ22toF(long A);
398 extern float _IQ21toF(long A);
399 extern float _IQ20toF(long A);
400 extern float _IQ19toF(long A);
401 extern float _IQ18toF(long A);
402 extern float _IQ17toF(long A);
403 extern float _IQ16toF(long A);
404 extern float _IQ15toF(long A);
405 extern float _IQ14toF(long A);
406 extern float _IQ13toF(long A);
407 extern float _IQ12toF(long A);
408 extern float _IQ11toF(long A);
409 extern float _IQ10toF(long A);
410 extern float _IQ9toF(long A);
411 extern float _IQ8toF(long A);
412 extern float _IQ7toF(long A);
413 extern float _IQ6toF(long A);
414 extern float _IQ5toF(long A);
415 extern float _IQ4toF(long A);
416 extern float _IQ3toF(long A);
417 extern float _IQ2toF(long A);
418 extern float _IQ1toF(long A);
419 
420 #if GLOBAL_Q == 30
421 #define _IQtoF(A) _IQ30toF(A)
422 #endif
423 #if GLOBAL_Q == 29
424 #define _IQtoF(A) _IQ29toF(A)
425 #endif
426 #if GLOBAL_Q == 28
427 #define _IQtoF(A) _IQ28toF(A)
428 #endif
429 #if GLOBAL_Q == 27
430 #define _IQtoF(A) _IQ27toF(A)
431 #endif
432 #if GLOBAL_Q == 26
433 #define _IQtoF(A) _IQ26toF(A)
434 #endif
435 #if GLOBAL_Q == 25
436 #define _IQtoF(A) _IQ25toF(A)
437 #endif
438 #if GLOBAL_Q == 24
439 #define _IQtoF(A) _IQ24toF(A)
440 #endif
441 #if GLOBAL_Q == 23
442 #define _IQtoF(A) _IQ23toF(A)
443 #endif
444 #if GLOBAL_Q == 22
445 #define _IQtoF(A) _IQ22toF(A)
446 #endif
447 #if GLOBAL_Q == 21
448 #define _IQtoF(A) _IQ21toF(A)
449 #endif
450 #if GLOBAL_Q == 20
451 #define _IQtoF(A) _IQ20toF(A)
452 #endif
453 #if GLOBAL_Q == 19
454 #define _IQtoF(A) _IQ19toF(A)
455 #endif
456 #if GLOBAL_Q == 18
457 #define _IQtoF(A) _IQ18toF(A)
458 #endif
459 #if GLOBAL_Q == 17
460 #define _IQtoF(A) _IQ17toF(A)
461 #endif
462 #if GLOBAL_Q == 16
463 #define _IQtoF(A) _IQ16toF(A)
464 #endif
465 #if GLOBAL_Q == 15
466 #define _IQtoF(A) _IQ15toF(A)
467 #endif
468 #if GLOBAL_Q == 14
469 #define _IQtoF(A) _IQ14toF(A)
470 #endif
471 #if GLOBAL_Q == 13
472 #define _IQtoF(A) _IQ13toF(A)
473 #endif
474 #if GLOBAL_Q == 12
475 #define _IQtoF(A) _IQ12toF(A)
476 #endif
477 #if GLOBAL_Q == 11
478 #define _IQtoF(A) _IQ11toF(A)
479 #endif
480 #if GLOBAL_Q == 10
481 #define _IQtoF(A) _IQ10toF(A)
482 #endif
483 #if GLOBAL_Q == 9
484 #define _IQtoF(A) _IQ9toF(A)
485 #endif
486 #if GLOBAL_Q == 8
487 #define _IQtoF(A) _IQ8toF(A)
488 #endif
489 #if GLOBAL_Q == 7
490 #define _IQtoF(A) _IQ7toF(A)
491 #endif
492 #if GLOBAL_Q == 6
493 #define _IQtoF(A) _IQ6toF(A)
494 #endif
495 #if GLOBAL_Q == 5
496 #define _IQtoF(A) _IQ5toF(A)
497 #endif
498 #if GLOBAL_Q == 4
499 #define _IQtoF(A) _IQ4toF(A)
500 #endif
501 #if GLOBAL_Q == 3
502 #define _IQtoF(A) _IQ3toF(A)
503 #endif
504 #if GLOBAL_Q == 2
505 #define _IQtoF(A) _IQ2toF(A)
506 #endif
507 #if GLOBAL_Q == 1
508 #define _IQtoF(A) _IQ1toF(A)
509 #endif
510 //---------------------------------------------------------------------------
511 #define _IQsat(A, Pos, Neg) __IQsat(A, Pos, Neg)
512 //---------------------------------------------------------------------------
513 #define _IQtoIQ30(A) ((long) (A) << (30 - GLOBAL_Q))
514 #define _IQ30toIQ(A) ((long) (A) >> (30 - GLOBAL_Q))
515 
516 #if (GLOBAL_Q >= 29)
517 #define _IQtoIQ29(A) ((long) (A) >> (GLOBAL_Q - 29))
518 #define _IQ29toIQ(A) ((long) (A) << (GLOBAL_Q - 29))
519 #else
520 #define _IQtoIQ29(A) ((long) (A) << (29 - GLOBAL_Q))
521 #define _IQ29toIQ(A) ((long) (A) >> (29 - GLOBAL_Q))
522 #endif
523 
524 #if (GLOBAL_Q >= 28)
525 #define _IQtoIQ28(A) ((long) (A) >> (GLOBAL_Q - 28))
526 #define _IQ28toIQ(A) ((long) (A) << (GLOBAL_Q - 28))
527 #else
528 #define _IQtoIQ28(A) ((long) (A) << (28 - GLOBAL_Q))
529 #define _IQ28toIQ(A) ((long) (A) >> (28 - GLOBAL_Q))
530 #endif
531 
532 #if (GLOBAL_Q >= 27)
533 #define _IQtoIQ27(A) ((long) (A) >> (GLOBAL_Q - 27))
534 #define _IQ27toIQ(A) ((long) (A) << (GLOBAL_Q - 27))
535 #else
536 #define _IQtoIQ27(A) ((long) (A) << (27 - GLOBAL_Q))
537 #define _IQ27toIQ(A) ((long) (A) >> (27 - GLOBAL_Q))
538 #endif
539 
540 #if (GLOBAL_Q >= 26)
541 #define _IQtoIQ26(A) ((long) (A) >> (GLOBAL_Q - 26))
542 #define _IQ26toIQ(A) ((long) (A) << (GLOBAL_Q - 26))
543 #else
544 #define _IQtoIQ26(A) ((long) (A) << (26 - GLOBAL_Q))
545 #define _IQ26toIQ(A) ((long) (A) >> (26 - GLOBAL_Q))
546 #endif
547 
548 #if (GLOBAL_Q >= 25)
549 #define _IQtoIQ25(A) ((long) (A) >> (GLOBAL_Q - 25))
550 #define _IQ25toIQ(A) ((long) (A) << (GLOBAL_Q - 25))
551 #else
552 #define _IQtoIQ25(A) ((long) (A) << (25 - GLOBAL_Q))
553 #define _IQ25toIQ(A) ((long) (A) >> (25 - GLOBAL_Q))
554 #endif
555 
556 #if (GLOBAL_Q >= 24)
557 #define _IQtoIQ24(A) ((long) (A) >> (GLOBAL_Q - 24))
558 #define _IQ24toIQ(A) ((long) (A) << (GLOBAL_Q - 24))
559 #else
560 #define _IQtoIQ24(A) ((long) (A) << (24 - GLOBAL_Q))
561 #define _IQ24toIQ(A) ((long) (A) >> (24 - GLOBAL_Q))
562 #endif
563 
564 #if (GLOBAL_Q >= 23)
565 #define _IQtoIQ23(A) ((long) (A) >> (GLOBAL_Q - 23))
566 #define _IQ23toIQ(A) ((long) (A) << (GLOBAL_Q - 23))
567 #else
568 #define _IQtoIQ23(A) ((long) (A) << (23 - GLOBAL_Q))
569 #define _IQ23toIQ(A) ((long) (A) >> (23 - GLOBAL_Q))
570 #endif
571 
572 #if (GLOBAL_Q >= 22)
573 #define _IQtoIQ22(A) ((long) (A) >> (GLOBAL_Q - 22))
574 #define _IQ22toIQ(A) ((long) (A) << (GLOBAL_Q - 22))
575 #else
576 #define _IQtoIQ22(A) ((long) (A) << (22 - GLOBAL_Q))
577 #define _IQ22toIQ(A) ((long) (A) >> (22 - GLOBAL_Q))
578 #endif
579 
580 #if (GLOBAL_Q >= 21)
581 #define _IQtoIQ21(A) ((long) (A) >> (GLOBAL_Q - 21))
582 #define _IQ21toIQ(A) ((long) (A) << (GLOBAL_Q - 21))
583 #else
584 #define _IQtoIQ21(A) ((long) (A) << (21 - GLOBAL_Q))
585 #define _IQ21toIQ(A) ((long) (A) >> (21 - GLOBAL_Q))
586 #endif
587 
588 #if (GLOBAL_Q >= 20)
589 #define _IQtoIQ20(A) ((long) (A) >> (GLOBAL_Q - 20))
590 #define _IQ20toIQ(A) ((long) (A) << (GLOBAL_Q - 20))
591 #else
592 #define _IQtoIQ20(A) ((long) (A) << (20 - GLOBAL_Q))
593 #define _IQ20toIQ(A) ((long) (A) >> (20 - GLOBAL_Q))
594 #endif
595 
596 #if (GLOBAL_Q >= 19)
597 #define _IQtoIQ19(A) ((long) (A) >> (GLOBAL_Q - 19))
598 #define _IQ19toIQ(A) ((long) (A) << (GLOBAL_Q - 19))
599 #else
600 #define _IQtoIQ19(A) ((long) (A) << (19 - GLOBAL_Q))
601 #define _IQ19toIQ(A) ((long) (A) >> (19 - GLOBAL_Q))
602 #endif
603 
604 #if (GLOBAL_Q >= 18)
605 #define _IQtoIQ18(A) ((long) (A) >> (GLOBAL_Q - 18))
606 #define _IQ18toIQ(A) ((long) (A) << (GLOBAL_Q - 18))
607 #else
608 #define _IQtoIQ18(A) ((long) (A) << (18 - GLOBAL_Q))
609 #define _IQ18toIQ(A) ((long) (A) >> (18 - GLOBAL_Q))
610 #endif
611 
612 #if (GLOBAL_Q >= 17)
613 #define _IQtoIQ17(A) ((long) (A) >> (GLOBAL_Q - 17))
614 #define _IQ17toIQ(A) ((long) (A) << (GLOBAL_Q - 17))
615 #else
616 #define _IQtoIQ17(A) ((long) (A) << (17 - GLOBAL_Q))
617 #define _IQ17toIQ(A) ((long) (A) >> (17 - GLOBAL_Q))
618 #endif
619 
620 #if (GLOBAL_Q >= 16)
621 #define _IQtoIQ16(A) ((long) (A) >> (GLOBAL_Q - 16))
622 #define _IQ16toIQ(A) ((long) (A) << (GLOBAL_Q - 16))
623 #else
624 #define _IQtoIQ16(A) ((long) (A) << (16 - GLOBAL_Q))
625 #define _IQ16toIQ(A) ((long) (A) >> (16 - GLOBAL_Q))
626 #endif
627 
628 #if (GLOBAL_Q >= 15)
629 #define _IQtoIQ15(A) ((long) (A) >> (GLOBAL_Q - 15))
630 #define _IQ15toIQ(A) ((long) (A) << (GLOBAL_Q - 15))
631 #define _IQtoQ15(A) ((long) (A) >> (GLOBAL_Q - 15))
632 #define _Q15toIQ(A) ((long) (A) << (GLOBAL_Q - 15))
633 #else
634 #define _IQtoIQ15(A) ((long) (A) << (15 - GLOBAL_Q))
635 #define _IQ15toIQ(A) ((long) (A) >> (15 - GLOBAL_Q))
636 #define _IQtoQ15(A) ((long) (A) << (15 - GLOBAL_Q))
637 #define _Q15toIQ(A) ((long) (A) >> (15 - GLOBAL_Q))
638 #endif
639 
640 #if (GLOBAL_Q >= 14)
641 #define _IQtoIQ14(A) ((long) (A) >> (GLOBAL_Q - 14))
642 #define _IQ14toIQ(A) ((long) (A) << (GLOBAL_Q - 14))
643 #define _IQtoQ14(A) ((long) (A) >> (GLOBAL_Q - 14))
644 #define _Q14toIQ(A) ((long) (A) << (GLOBAL_Q - 14))
645 #else
646 #define _IQtoIQ14(A) ((long) (A) << (14 - GLOBAL_Q))
647 #define _IQ14toIQ(A) ((long) (A) >> (14 - GLOBAL_Q))
648 #define _IQtoQ14(A) ((long) (A) << (14 - GLOBAL_Q))
649 #define _Q14toIQ(A) ((long) (A) >> (14 - GLOBAL_Q))
650 #endif
651 
652 #if (GLOBAL_Q >= 13)
653 #define _IQtoIQ13(A) ((long) (A) >> (GLOBAL_Q - 13))
654 #define _IQ13toIQ(A) ((long) (A) << (GLOBAL_Q - 13))
655 #define _IQtoQ13(A) ((long) (A) >> (GLOBAL_Q - 13))
656 #define _Q13toIQ(A) ((long) (A) << (GLOBAL_Q - 13))
657 #else
658 #define _IQtoIQ13(A) ((long) (A) << (13 - GLOBAL_Q))
659 #define _IQ13toIQ(A) ((long) (A) >> (13 - GLOBAL_Q))
660 #define _IQtoQ13(A) ((long) (A) << (13 - GLOBAL_Q))
661 #define _Q13toIQ(A) ((long) (A) >> (13 - GLOBAL_Q))
662 #endif
663 
664 #if (GLOBAL_Q >= 12)
665 #define _IQtoIQ12(A) ((long) (A) >> (GLOBAL_Q - 12))
666 #define _IQ12toIQ(A) ((long) (A) << (GLOBAL_Q - 12))
667 #define _IQtoQ12(A) ((long) (A) >> (GLOBAL_Q - 12))
668 #define _Q12toIQ(A) ((long) (A) << (GLOBAL_Q - 12))
669 #else
670 #define _IQtoIQ12(A) ((long) (A) << (12 - GLOBAL_Q))
671 #define _IQ12toIQ(A) ((long) (A) >> (12 - GLOBAL_Q))
672 #define _IQtoQ12(A) ((long) (A) << (12 - GLOBAL_Q))
673 #define _Q12toIQ(A) ((long) (A) >> (12 - GLOBAL_Q))
674 #endif
675 
676 #if (GLOBAL_Q >= 11)
677 #define _IQtoIQ11(A) ((long) (A) >> (GLOBAL_Q - 11))
678 #define _IQ11toIQ(A) ((long) (A) << (GLOBAL_Q - 11))
679 #define _IQtoQ11(A) ((long) (A) >> (GLOBAL_Q - 11))
680 #define _Q11toIQ(A) ((long) (A) << (GLOBAL_Q - 11))
681 #else
682 #define _IQtoIQ11(A) ((long) (A) << (11 - GLOBAL_Q))
683 #define _IQ11toIQ(A) ((long) (A) >> (11 - GLOBAL_Q))
684 #define _IQtoQ11(A) ((long) (A) << (11 - GLOBAL_Q))
685 #define _Q11toIQ(A) ((long) (A) >> (11 - GLOBAL_Q))
686 #endif
687 
688 #if (GLOBAL_Q >= 10)
689 #define _IQtoIQ10(A) ((long) (A) >> (GLOBAL_Q - 10))
690 #define _IQ10toIQ(A) ((long) (A) << (GLOBAL_Q - 10))
691 #define _IQtoQ10(A) ((long) (A) >> (GLOBAL_Q - 10))
692 #define _Q10toIQ(A) ((long) (A) << (GLOBAL_Q - 10))
693 #else
694 #define _IQtoIQ10(A) ((long) (A) << (10 - GLOBAL_Q))
695 #define _IQ10toIQ(A) ((long) (A) >> (10 - GLOBAL_Q))
696 #define _IQtoQ10(A) ((long) (A) << (10 - GLOBAL_Q))
697 #define _Q10toIQ(A) ((long) (A) >> (10 - GLOBAL_Q))
698 #endif
699 
700 #if (GLOBAL_Q >= 9)
701 #define _IQtoIQ9(A) ((long) (A) >> (GLOBAL_Q - 9))
702 #define _IQ9toIQ(A) ((long) (A) << (GLOBAL_Q - 9))
703 #define _IQtoQ9(A) ((long) (A) >> (GLOBAL_Q - 9))
704 #define _Q9toIQ(A) ((long) (A) << (GLOBAL_Q - 9))
705 #else
706 #define _IQtoIQ9(A) ((long) (A) << (9 - GLOBAL_Q))
707 #define _IQ9toIQ(A) ((long) (A) >> (9 - GLOBAL_Q))
708 #define _IQtoQ9(A) ((long) (A) << (9 - GLOBAL_Q))
709 #define _Q9toIQ(A) ((long) (A) >> (9 - GLOBAL_Q))
710 #endif
711 
712 #if (GLOBAL_Q >= 8)
713 #define _IQtoIQ8(A) ((long) (A) >> (GLOBAL_Q - 8))
714 #define _IQ8toIQ(A) ((long) (A) << (GLOBAL_Q - 8))
715 #define _IQtoQ8(A) ((long) (A) >> (GLOBAL_Q - 8))
716 #define _Q8toIQ(A) ((long) (A) << (GLOBAL_Q - 8))
717 #else
718 #define _IQtoIQ8(A) ((long) (A) << (8 - GLOBAL_Q))
719 #define _IQ8toIQ(A) ((long) (A) >> (8 - GLOBAL_Q))
720 #define _IQtoQ8(A) ((long) (A) << (8 - GLOBAL_Q))
721 #define _Q8toIQ(A) ((long) (A) >> (8 - GLOBAL_Q))
722 #endif
723 
724 #if (GLOBAL_Q >= 7)
725 #define _IQtoIQ7(A) ((long) (A) >> (GLOBAL_Q - 7))
726 #define _IQ7toIQ(A) ((long) (A) << (GLOBAL_Q - 7))
727 #define _IQtoQ7(A) ((long) (A) >> (GLOBAL_Q - 7))
728 #define _Q7toIQ(A) ((long) (A) << (GLOBAL_Q - 7))
729 #else
730 #define _IQtoIQ7(A) ((long) (A) << (7 - GLOBAL_Q))
731 #define _IQ7toIQ(A) ((long) (A) >> (7 - GLOBAL_Q))
732 #define _IQtoQ7(A) ((long) (A) << (7 - GLOBAL_Q))
733 #define _Q7toIQ(A) ((long) (A) >> (7 - GLOBAL_Q))
734 #endif
735 
736 #if (GLOBAL_Q >= 6)
737 #define _IQtoIQ6(A) ((long) (A) >> (GLOBAL_Q - 6))
738 #define _IQ6toIQ(A) ((long) (A) << (GLOBAL_Q - 6))
739 #define _IQtoQ6(A) ((long) (A) >> (GLOBAL_Q - 6))
740 #define _Q6toIQ(A) ((long) (A) << (GLOBAL_Q - 6))
741 #else
742 #define _IQtoIQ6(A) ((long) (A) << (6 - GLOBAL_Q))
743 #define _IQ6toIQ(A) ((long) (A) >> (6 - GLOBAL_Q))
744 #define _IQtoQ6(A) ((long) (A) << (6 - GLOBAL_Q))
745 #define _Q6toIQ(A) ((long) (A) >> (6 - GLOBAL_Q))
746 #endif
747 
748 #if (GLOBAL_Q >= 5)
749 #define _IQtoIQ5(A) ((long) (A) >> (GLOBAL_Q - 5))
750 #define _IQ5toIQ(A) ((long) (A) << (GLOBAL_Q - 5))
751 #define _IQtoQ5(A) ((long) (A) >> (GLOBAL_Q - 5))
752 #define _Q5toIQ(A) ((long) (A) << (GLOBAL_Q - 5))
753 #else
754 #define _IQtoIQ5(A) ((long) (A) << (5 - GLOBAL_Q))
755 #define _IQ5toIQ(A) ((long) (A) >> (5 - GLOBAL_Q))
756 #define _IQtoQ5(A) ((long) (A) << (5 - GLOBAL_Q))
757 #define _Q5toIQ(A) ((long) (A) >> (5 - GLOBAL_Q))
758 #endif
759 
760 #if (GLOBAL_Q >= 4)
761 #define _IQtoIQ4(A) ((long) (A) >> (GLOBAL_Q - 4))
762 #define _IQ4toIQ(A) ((long) (A) << (GLOBAL_Q - 4))
763 #define _IQtoQ4(A) ((long) (A) >> (GLOBAL_Q - 4))
764 #define _Q4toIQ(A) ((long) (A) << (GLOBAL_Q - 4))
765 #else
766 #define _IQtoIQ4(A) ((long) (A) << (4 - GLOBAL_Q))
767 #define _IQ4toIQ(A) ((long) (A) >> (4 - GLOBAL_Q))
768 #define _IQtoQ4(A) ((long) (A) << (4 - GLOBAL_Q))
769 #define _Q4toIQ(A) ((long) (A) >> (4 - GLOBAL_Q))
770 #endif
771 
772 #if (GLOBAL_Q >= 3)
773 #define _IQtoIQ3(A) ((long) (A) >> (GLOBAL_Q - 3))
774 #define _IQ3toIQ(A) ((long) (A) << (GLOBAL_Q - 3))
775 #define _IQtoQ3(A) ((long) (A) >> (GLOBAL_Q - 3))
776 #define _Q3toIQ(A) ((long) (A) << (GLOBAL_Q - 3))
777 #else
778 #define _IQtoIQ3(A) ((long) (A) << (3 - GLOBAL_Q))
779 #define _IQ3toIQ(A) ((long) (A) >> (3 - GLOBAL_Q))
780 #define _IQtoQ3(A) ((long) (A) << (3 - GLOBAL_Q))
781 #define _Q3toIQ(A) ((long) (A) >> (3 - GLOBAL_Q))
782 #endif
783 
784 #if (GLOBAL_Q >= 2)
785 #define _IQtoIQ2(A) ((long) (A) >> (GLOBAL_Q - 2))
786 #define _IQ2toIQ(A) ((long) (A) << (GLOBAL_Q - 2))
787 #define _IQtoQ2(A) ((long) (A) >> (GLOBAL_Q - 2))
788 #define _Q2toIQ(A) ((long) (A) << (GLOBAL_Q - 2))
789 #else
790 #define _IQtoIQ2(A) ((long) (A) << (2 - GLOBAL_Q))
791 #define _IQ2toIQ(A) ((long) (A) >> (2 - GLOBAL_Q))
792 #define _IQtoQ2(A) ((long) (A) << (2 - GLOBAL_Q))
793 #define _Q2toIQ(A) ((long) (A) >> (2 - GLOBAL_Q))
794 #endif
795 
796 #if (GLOBAL_Q >= 1)
797 #define _IQtoQ1(A) ((long) (A) >> (GLOBAL_Q - 1))
798 #define _Q1toIQ(A) ((long) (A) << (GLOBAL_Q - 1))
799 #else
800 #define _IQtoQ1(A) ((long) (A) << (1 - GLOBAL_Q))
801 #define _Q1toIQ(A) ((long) (A) >> (1 - GLOBAL_Q))
802 #endif
803 
804 #define _IQtoIQ1(A) ((long) (A) >> (GLOBAL_Q - 1))
805 #define _IQ1toIQ(A) ((long) (A) << (GLOBAL_Q - 1))
806 //---------------------------------------------------------------------------
807 #define _IQmpy(A,B) __IQmpy(A,B,GLOBAL_Q)
808 #define _IQ30mpy(A,B) __IQmpy(A,B,30)
809 #define _IQ29mpy(A,B) __IQmpy(A,B,29)
810 #define _IQ28mpy(A,B) __IQmpy(A,B,28)
811 #define _IQ27mpy(A,B) __IQmpy(A,B,27)
812 #define _IQ26mpy(A,B) __IQmpy(A,B,26)
813 #define _IQ25mpy(A,B) __IQmpy(A,B,25)
814 #define _IQ24mpy(A,B) __IQmpy(A,B,24)
815 #define _IQ23mpy(A,B) __IQmpy(A,B,23)
816 #define _IQ22mpy(A,B) __IQmpy(A,B,22)
817 #define _IQ21mpy(A,B) __IQmpy(A,B,21)
818 #define _IQ20mpy(A,B) __IQmpy(A,B,20)
819 #define _IQ19mpy(A,B) __IQmpy(A,B,19)
820 #define _IQ18mpy(A,B) __IQmpy(A,B,18)
821 #define _IQ17mpy(A,B) __IQmpy(A,B,17)
822 #define _IQ16mpy(A,B) __IQmpy(A,B,16)
823 #define _IQ15mpy(A,B) __IQmpy(A,B,15)
824 #define _IQ14mpy(A,B) __IQmpy(A,B,14)
825 #define _IQ13mpy(A,B) __IQmpy(A,B,13)
826 #define _IQ12mpy(A,B) __IQmpy(A,B,12)
827 #define _IQ11mpy(A,B) __IQmpy(A,B,11)
828 #define _IQ10mpy(A,B) __IQmpy(A,B,10)
829 #define _IQ9mpy(A,B) __IQmpy(A,B,9)
830 #define _IQ8mpy(A,B) __IQmpy(A,B,8)
831 #define _IQ7mpy(A,B) __IQmpy(A,B,7)
832 #define _IQ6mpy(A,B) __IQmpy(A,B,6)
833 #define _IQ5mpy(A,B) __IQmpy(A,B,5)
834 #define _IQ4mpy(A,B) __IQmpy(A,B,4)
835 #define _IQ3mpy(A,B) __IQmpy(A,B,3)
836 #define _IQ2mpy(A,B) __IQmpy(A,B,2)
837 #define _IQ1mpy(A,B) __IQmpy(A,B,1)
838 //---------------------------------------------------------------------------
839 extern long _IQ30rmpy(long A, long B);
840 extern long _IQ29rmpy(long A, long B);
841 extern long _IQ28rmpy(long A, long B);
842 extern long _IQ27rmpy(long A, long B);
843 extern long _IQ26rmpy(long A, long B);
844 extern long _IQ25rmpy(long A, long B);
845 extern long _IQ24rmpy(long A, long B);
846 extern long _IQ23rmpy(long A, long B);
847 extern long _IQ22rmpy(long A, long B);
848 extern long _IQ21rmpy(long A, long B);
849 extern long _IQ20rmpy(long A, long B);
850 extern long _IQ19rmpy(long A, long B);
851 extern long _IQ18rmpy(long A, long B);
852 extern long _IQ17rmpy(long A, long B);
853 extern long _IQ16rmpy(long A, long B);
854 extern long _IQ15rmpy(long A, long B);
855 extern long _IQ14rmpy(long A, long B);
856 extern long _IQ13rmpy(long A, long B);
857 extern long _IQ12rmpy(long A, long B);
858 extern long _IQ11rmpy(long A, long B);
859 extern long _IQ10rmpy(long A, long B);
860 extern long _IQ9rmpy(long A, long B);
861 extern long _IQ8rmpy(long A, long B);
862 extern long _IQ7rmpy(long A, long B);
863 extern long _IQ6rmpy(long A, long B);
864 extern long _IQ5rmpy(long A, long B);
865 extern long _IQ4rmpy(long A, long B);
866 extern long _IQ3rmpy(long A, long B);
867 extern long _IQ2rmpy(long A, long B);
868 extern long _IQ1rmpy(long A, long B);
869 
870 #if GLOBAL_Q == 30
871 #define _IQrmpy(A,B) _IQ30rmpy(A,B)
872 #endif
873 #if GLOBAL_Q == 29
874 #define _IQrmpy(A,B) _IQ29rmpy(A,B)
875 #endif
876 #if GLOBAL_Q == 28
877 #define _IQrmpy(A,B) _IQ28rmpy(A,B)
878 #endif
879 #if GLOBAL_Q == 27
880 #define _IQrmpy(A,B) _IQ27rmpy(A,B)
881 #endif
882 #if GLOBAL_Q == 26
883 #define _IQrmpy(A,B) _IQ26rmpy(A,B)
884 #endif
885 #if GLOBAL_Q == 25
886 #define _IQrmpy(A,B) _IQ25rmpy(A,B)
887 #endif
888 #if GLOBAL_Q == 24
889 #define _IQrmpy(A,B) _IQ24rmpy(A,B)
890 #endif
891 #if GLOBAL_Q == 23
892 #define _IQrmpy(A,B) _IQ23rmpy(A,B)
893 #endif
894 #if GLOBAL_Q == 22
895 #define _IQrmpy(A,B) _IQ22rmpy(A,B)
896 #endif
897 #if GLOBAL_Q == 21
898 #define _IQrmpy(A,B) _IQ21rmpy(A,B)
899 #endif
900 #if GLOBAL_Q == 20
901 #define _IQrmpy(A,B) _IQ20rmpy(A,B)
902 #endif
903 #if GLOBAL_Q == 19
904 #define _IQrmpy(A,B) _IQ19rmpy(A,B)
905 #endif
906 #if GLOBAL_Q == 18
907 #define _IQrmpy(A,B) _IQ18rmpy(A,B)
908 #endif
909 #if GLOBAL_Q == 17
910 #define _IQrmpy(A,B) _IQ17rmpy(A,B)
911 #endif
912 #if GLOBAL_Q == 16
913 #define _IQrmpy(A,B) _IQ16rmpy(A,B)
914 #endif
915 #if GLOBAL_Q == 15
916 #define _IQrmpy(A,B) _IQ15rmpy(A,B)
917 #endif
918 #if GLOBAL_Q == 14
919 #define _IQrmpy(A,B) _IQ14rmpy(A,B)
920 #endif
921 #if GLOBAL_Q == 13
922 #define _IQrmpy(A,B) _IQ13rmpy(A,B)
923 #endif
924 #if GLOBAL_Q == 12
925 #define _IQrmpy(A,B) _IQ12rmpy(A,B)
926 #endif
927 #if GLOBAL_Q == 11
928 #define _IQrmpy(A,B) _IQ11rmpy(A,B)
929 #endif
930 #if GLOBAL_Q == 10
931 #define _IQrmpy(A,B) _IQ10rmpy(A,B)
932 #endif
933 #if GLOBAL_Q == 9
934 #define _IQrmpy(A,B) _IQ9rmpy(A,B)
935 #endif
936 #if GLOBAL_Q == 8
937 #define _IQrmpy(A,B) _IQ8rmpy(A,B)
938 #endif
939 #if GLOBAL_Q == 7
940 #define _IQrmpy(A,B) _IQ7rmpy(A,B)
941 #endif
942 #if GLOBAL_Q == 6
943 #define _IQrmpy(A,B) _IQ6rmpy(A,B)
944 #endif
945 #if GLOBAL_Q == 5
946 #define _IQrmpy(A,B) _IQ5rmpy(A,B)
947 #endif
948 #if GLOBAL_Q == 4
949 #define _IQrmpy(A,B) _IQ4rmpy(A,B)
950 #endif
951 #if GLOBAL_Q == 3
952 #define _IQrmpy(A,B) _IQ3rmpy(A,B)
953 #endif
954 #if GLOBAL_Q == 2
955 #define _IQrmpy(A,B) _IQ2rmpy(A,B)
956 #endif
957 #if GLOBAL_Q == 1
958 #define _IQrmpy(A,B) _IQ1rmpy(A,B)
959 #endif
960 //---------------------------------------------------------------------------
961 extern long _IQ30rsmpy(long A, long B);
962 extern long _IQ29rsmpy(long A, long B);
963 extern long _IQ28rsmpy(long A, long B);
964 extern long _IQ27rsmpy(long A, long B);
965 extern long _IQ26rsmpy(long A, long B);
966 extern long _IQ25rsmpy(long A, long B);
967 extern long _IQ24rsmpy(long A, long B);
968 extern long _IQ23rsmpy(long A, long B);
969 extern long _IQ22rsmpy(long A, long B);
970 extern long _IQ21rsmpy(long A, long B);
971 extern long _IQ20rsmpy(long A, long B);
972 extern long _IQ19rsmpy(long A, long B);
973 extern long _IQ18rsmpy(long A, long B);
974 extern long _IQ17rsmpy(long A, long B);
975 extern long _IQ16rsmpy(long A, long B);
976 extern long _IQ15rsmpy(long A, long B);
977 extern long _IQ14rsmpy(long A, long B);
978 extern long _IQ13rsmpy(long A, long B);
979 extern long _IQ12rsmpy(long A, long B);
980 extern long _IQ11rsmpy(long A, long B);
981 extern long _IQ10rsmpy(long A, long B);
982 extern long _IQ9rsmpy(long A, long B);
983 extern long _IQ8rsmpy(long A, long B);
984 extern long _IQ7rsmpy(long A, long B);
985 extern long _IQ6rsmpy(long A, long B);
986 extern long _IQ5rsmpy(long A, long B);
987 extern long _IQ4rsmpy(long A, long B);
988 extern long _IQ3rsmpy(long A, long B);
989 extern long _IQ2rsmpy(long A, long B);
990 extern long _IQ1rsmpy(long A, long B);
991 
992 #if GLOBAL_Q == 30
993 #define _IQrsmpy(A,B) _IQ30rsmpy(A,B)
994 #endif
995 #if GLOBAL_Q == 29
996 #define _IQrsmpy(A,B) _IQ29rsmpy(A,B)
997 #endif
998 #if GLOBAL_Q == 28
999 #define _IQrsmpy(A,B) _IQ28rsmpy(A,B)
1000 #endif
1001 #if GLOBAL_Q == 27
1002 #define _IQrsmpy(A,B) _IQ27rsmpy(A,B)
1003 #endif
1004 #if GLOBAL_Q == 26
1005 #define _IQrsmpy(A,B) _IQ26rsmpy(A,B)
1006 #endif
1007 #if GLOBAL_Q == 25
1008 #define _IQrsmpy(A,B) _IQ25rsmpy(A,B)
1009 #endif
1010 #if GLOBAL_Q == 24
1011 #define _IQrsmpy(A,B) _IQ24rsmpy(A,B)
1012 #endif
1013 #if GLOBAL_Q == 23
1014 #define _IQrsmpy(A,B) _IQ23rsmpy(A,B)
1015 #endif
1016 #if GLOBAL_Q == 22
1017 #define _IQrsmpy(A,B) _IQ22rsmpy(A,B)
1018 #endif
1019 #if GLOBAL_Q == 21
1020 #define _IQrsmpy(A,B) _IQ21rsmpy(A,B)
1021 #endif
1022 #if GLOBAL_Q == 20
1023 #define _IQrsmpy(A,B) _IQ20rsmpy(A,B)
1024 #endif
1025 #if GLOBAL_Q == 19
1026 #define _IQrsmpy(A,B) _IQ19rsmpy(A,B)
1027 #endif
1028 #if GLOBAL_Q == 18
1029 #define _IQrsmpy(A,B) _IQ18rsmpy(A,B)
1030 #endif
1031 #if GLOBAL_Q == 17
1032 #define _IQrsmpy(A,B) _IQ17rsmpy(A,B)
1033 #endif
1034 #if GLOBAL_Q == 16
1035 #define _IQrsmpy(A,B) _IQ16rsmpy(A,B)
1036 #endif
1037 #if GLOBAL_Q == 15
1038 #define _IQrsmpy(A,B) _IQ15rsmpy(A,B)
1039 #endif
1040 #if GLOBAL_Q == 14
1041 #define _IQrsmpy(A,B) _IQ14rsmpy(A,B)
1042 #endif
1043 #if GLOBAL_Q == 13
1044 #define _IQrsmpy(A,B) _IQ13rsmpy(A,B)
1045 #endif
1046 #if GLOBAL_Q == 12
1047 #define _IQrsmpy(A,B) _IQ12rsmpy(A,B)
1048 #endif
1049 #if GLOBAL_Q == 11
1050 #define _IQrsmpy(A,B) _IQ11rsmpy(A,B)
1051 #endif
1052 #if GLOBAL_Q == 10
1053 #define _IQrsmpy(A,B) _IQ10rsmpy(A,B)
1054 #endif
1055 #if GLOBAL_Q == 9
1056 #define _IQrsmpy(A,B) _IQ9rsmpy(A,B)
1057 #endif
1058 #if GLOBAL_Q == 8
1059 #define _IQrsmpy(A,B) _IQ8rsmpy(A,B)
1060 #endif
1061 #if GLOBAL_Q == 7
1062 #define _IQrsmpy(A,B) _IQ7rsmpy(A,B)
1063 #endif
1064 #if GLOBAL_Q == 6
1065 #define _IQrsmpy(A,B) _IQ6rsmpy(A,B)
1066 #endif
1067 #if GLOBAL_Q == 5
1068 #define _IQrsmpy(A,B) _IQ5rsmpy(A,B)
1069 #endif
1070 #if GLOBAL_Q == 4
1071 #define _IQrsmpy(A,B) _IQ4rsmpy(A,B)
1072 #endif
1073 #if GLOBAL_Q == 3
1074 #define _IQrsmpy(A,B) _IQ3rsmpy(A,B)
1075 #endif
1076 #if GLOBAL_Q == 2
1077 #define _IQrsmpy(A,B) _IQ2rsmpy(A,B)
1078 #endif
1079 #if GLOBAL_Q == 1
1080 #define _IQrsmpy(A,B) _IQ1rsmpy(A,B)
1081 #endif
1082 //---------------------------------------------------------------------------
1083 extern long _IQ30div(long A, long B);
1084 extern long _IQ29div(long A, long B);
1085 extern long _IQ28div(long A, long B);
1086 extern long _IQ27div(long A, long B);
1087 extern long _IQ26div(long A, long B);
1088 extern long _IQ25div(long A, long B);
1089 extern long _IQ24div(long A, long B);
1090 extern long _IQ23div(long A, long B);
1091 extern long _IQ22div(long A, long B);
1092 extern long _IQ21div(long A, long B);
1093 extern long _IQ20div(long A, long B);
1094 extern long _IQ19div(long A, long B);
1095 extern long _IQ18div(long A, long B);
1096 extern long _IQ17div(long A, long B);
1097 extern long _IQ16div(long A, long B);
1098 extern long _IQ15div(long A, long B);
1099 extern long _IQ14div(long A, long B);
1100 extern long _IQ13div(long A, long B);
1101 extern long _IQ12div(long A, long B);
1102 extern long _IQ11div(long A, long B);
1103 extern long _IQ10div(long A, long B);
1104 extern long _IQ9div(long A, long B);
1105 extern long _IQ8div(long A, long B);
1106 extern long _IQ7div(long A, long B);
1107 extern long _IQ6div(long A, long B);
1108 extern long _IQ5div(long A, long B);
1109 extern long _IQ4div(long A, long B);
1110 extern long _IQ3div(long A, long B);
1111 extern long _IQ2div(long A, long B);
1112 extern long _IQ1div(long A, long B);
1113 
1114 #if GLOBAL_Q == 30
1115 #define _IQdiv(A,B) _IQ30div(A,B)
1116 #endif
1117 #if GLOBAL_Q == 29
1118 #define _IQdiv(A,B) _IQ29div(A,B)
1119 #endif
1120 #if GLOBAL_Q == 28
1121 #define _IQdiv(A,B) _IQ28div(A,B)
1122 #endif
1123 #if GLOBAL_Q == 27
1124 #define _IQdiv(A,B) _IQ27div(A,B)
1125 #endif
1126 #if GLOBAL_Q == 26
1127 #define _IQdiv(A,B) _IQ26div(A,B)
1128 #endif
1129 #if GLOBAL_Q == 25
1130 #define _IQdiv(A,B) _IQ25div(A,B)
1131 #endif
1132 #if GLOBAL_Q == 24
1133 #define _IQdiv(A,B) _IQ24div(A,B)
1134 #endif
1135 #if GLOBAL_Q == 23
1136 #define _IQdiv(A,B) _IQ23div(A,B)
1137 #endif
1138 #if GLOBAL_Q == 22
1139 #define _IQdiv(A,B) _IQ22div(A,B)
1140 #endif
1141 #if GLOBAL_Q == 21
1142 #define _IQdiv(A,B) _IQ21div(A,B)
1143 #endif
1144 #if GLOBAL_Q == 20
1145 #define _IQdiv(A,B) _IQ20div(A,B)
1146 #endif
1147 #if GLOBAL_Q == 19
1148 #define _IQdiv(A,B) _IQ19div(A,B)
1149 #endif
1150 #if GLOBAL_Q == 18
1151 #define _IQdiv(A,B) _IQ18div(A,B)
1152 #endif
1153 #if GLOBAL_Q == 17
1154 #define _IQdiv(A,B) _IQ17div(A,B)
1155 #endif
1156 #if GLOBAL_Q == 16
1157 #define _IQdiv(A,B) _IQ16div(A,B)
1158 #endif
1159 #if GLOBAL_Q == 15
1160 #define _IQdiv(A,B) _IQ15div(A,B)
1161 #endif
1162 #if GLOBAL_Q == 14
1163 #define _IQdiv(A,B) _IQ14div(A,B)
1164 #endif
1165 #if GLOBAL_Q == 13
1166 #define _IQdiv(A,B) _IQ13div(A,B)
1167 #endif
1168 #if GLOBAL_Q == 12
1169 #define _IQdiv(A,B) _IQ12div(A,B)
1170 #endif
1171 #if GLOBAL_Q == 11
1172 #define _IQdiv(A,B) _IQ11div(A,B)
1173 #endif
1174 #if GLOBAL_Q == 10
1175 #define _IQdiv(A,B) _IQ10div(A,B)
1176 #endif
1177 #if GLOBAL_Q == 9
1178 #define _IQdiv(A,B) _IQ9div(A,B)
1179 #endif
1180 #if GLOBAL_Q == 8
1181 #define _IQdiv(A,B) _IQ8div(A,B)
1182 #endif
1183 #if GLOBAL_Q == 7
1184 #define _IQdiv(A,B) _IQ7div(A,B)
1185 #endif
1186 #if GLOBAL_Q == 6
1187 #define _IQdiv(A,B) _IQ6div(A,B)
1188 #endif
1189 #if GLOBAL_Q == 5
1190 #define _IQdiv(A,B) _IQ5div(A,B)
1191 #endif
1192 #if GLOBAL_Q == 4
1193 #define _IQdiv(A,B) _IQ4div(A,B)
1194 #endif
1195 #if GLOBAL_Q == 3
1196 #define _IQdiv(A,B) _IQ3div(A,B)
1197 #endif
1198 #if GLOBAL_Q == 2
1199 #define _IQdiv(A,B) _IQ2div(A,B)
1200 #endif
1201 #if GLOBAL_Q == 1
1202 #define _IQdiv(A,B) _IQ1div(A,B)
1203 #endif
1204 //---------------------------------------------------------------------------
1205 extern long _IQ30sin(long A);
1206 extern long _IQ29sin(long A);
1207 extern long _IQ28sin(long A);
1208 extern long _IQ27sin(long A);
1209 extern long _IQ26sin(long A);
1210 extern long _IQ25sin(long A);
1211 extern long _IQ24sin(long A);
1212 extern long _IQ23sin(long A);
1213 extern long _IQ22sin(long A);
1214 extern long _IQ21sin(long A);
1215 extern long _IQ20sin(long A);
1216 extern long _IQ19sin(long A);
1217 extern long _IQ18sin(long A);
1218 extern long _IQ17sin(long A);
1219 extern long _IQ16sin(long A);
1220 extern long _IQ15sin(long A);
1221 extern long _IQ14sin(long A);
1222 extern long _IQ13sin(long A);
1223 extern long _IQ12sin(long A);
1224 extern long _IQ11sin(long A);
1225 extern long _IQ10sin(long A);
1226 extern long _IQ9sin(long A);
1227 extern long _IQ8sin(long A);
1228 extern long _IQ7sin(long A);
1229 extern long _IQ6sin(long A);
1230 extern long _IQ5sin(long A);
1231 extern long _IQ4sin(long A);
1232 extern long _IQ3sin(long A);
1233 extern long _IQ2sin(long A);
1234 extern long _IQ1sin(long A);
1235 
1236 #if GLOBAL_Q == 30
1237 #define _IQsin(A) _IQ30sin(A)
1238 #endif
1239 #if GLOBAL_Q == 29
1240 #define _IQsin(A) _IQ29sin(A)
1241 #endif
1242 #if GLOBAL_Q == 28
1243 #define _IQsin(A) _IQ28sin(A)
1244 #endif
1245 #if GLOBAL_Q == 27
1246 #define _IQsin(A) _IQ27sin(A)
1247 #endif
1248 #if GLOBAL_Q == 26
1249 #define _IQsin(A) _IQ26sin(A)
1250 #endif
1251 #if GLOBAL_Q == 25
1252 #define _IQsin(A) _IQ25sin(A)
1253 #endif
1254 #if GLOBAL_Q == 24
1255 #define _IQsin(A) _IQ24sin(A)
1256 #endif
1257 #if GLOBAL_Q == 23
1258 #define _IQsin(A) _IQ23sin(A)
1259 #endif
1260 #if GLOBAL_Q == 22
1261 #define _IQsin(A) _IQ22sin(A)
1262 #endif
1263 #if GLOBAL_Q == 21
1264 #define _IQsin(A) _IQ21sin(A)
1265 #endif
1266 #if GLOBAL_Q == 20
1267 #define _IQsin(A) _IQ20sin(A)
1268 #endif
1269 #if GLOBAL_Q == 19
1270 #define _IQsin(A) _IQ19sin(A)
1271 #endif
1272 #if GLOBAL_Q == 18
1273 #define _IQsin(A) _IQ18sin(A)
1274 #endif
1275 #if GLOBAL_Q == 17
1276 #define _IQsin(A) _IQ17sin(A)
1277 #endif
1278 #if GLOBAL_Q == 16
1279 #define _IQsin(A) _IQ16sin(A)
1280 #endif
1281 #if GLOBAL_Q == 15
1282 #define _IQsin(A) _IQ15sin(A)
1283 #endif
1284 #if GLOBAL_Q == 14
1285 #define _IQsin(A) _IQ14sin(A)
1286 #endif
1287 #if GLOBAL_Q == 13
1288 #define _IQsin(A) _IQ13sin(A)
1289 #endif
1290 #if GLOBAL_Q == 12
1291 #define _IQsin(A) _IQ12sin(A)
1292 #endif
1293 #if GLOBAL_Q == 11
1294 #define _IQsin(A) _IQ11sin(A)
1295 #endif
1296 #if GLOBAL_Q == 10
1297 #define _IQsin(A) _IQ10sin(A)
1298 #endif
1299 #if GLOBAL_Q == 9
1300 #define _IQsin(A) _IQ9sin(A)
1301 #endif
1302 #if GLOBAL_Q == 8
1303 #define _IQsin(A) _IQ8sin(A)
1304 #endif
1305 #if GLOBAL_Q == 7
1306 #define _IQsin(A) _IQ7sin(A)
1307 #endif
1308 #if GLOBAL_Q == 6
1309 #define _IQsin(A) _IQ6sin(A)
1310 #endif
1311 #if GLOBAL_Q == 5
1312 #define _IQsin(A) _IQ5sin(A)
1313 #endif
1314 #if GLOBAL_Q == 4
1315 #define _IQsin(A) _IQ4sin(A)
1316 #endif
1317 #if GLOBAL_Q == 3
1318 #define _IQsin(A) _IQ3sin(A)
1319 #endif
1320 #if GLOBAL_Q == 2
1321 #define _IQsin(A) _IQ2sin(A)
1322 #endif
1323 #if GLOBAL_Q == 1
1324 #define _IQsin(A) _IQ1sin(A)
1325 #endif
1326 //---------------------------------------------------------------------------
1327 extern long _IQ30sinPU(long A);
1328 extern long _IQ29sinPU(long A);
1329 extern long _IQ28sinPU(long A);
1330 extern long _IQ27sinPU(long A);
1331 extern long _IQ26sinPU(long A);
1332 extern long _IQ25sinPU(long A);
1333 extern long _IQ24sinPU(long A);
1334 extern long _IQ23sinPU(long A);
1335 extern long _IQ22sinPU(long A);
1336 extern long _IQ21sinPU(long A);
1337 extern long _IQ20sinPU(long A);
1338 extern long _IQ19sinPU(long A);
1339 extern long _IQ18sinPU(long A);
1340 extern long _IQ17sinPU(long A);
1341 extern long _IQ16sinPU(long A);
1342 extern long _IQ15sinPU(long A);
1343 extern long _IQ14sinPU(long A);
1344 extern long _IQ13sinPU(long A);
1345 extern long _IQ12sinPU(long A);
1346 extern long _IQ11sinPU(long A);
1347 extern long _IQ10sinPU(long A);
1348 extern long _IQ9sinPU(long A);
1349 extern long _IQ8sinPU(long A);
1350 extern long _IQ7sinPU(long A);
1351 extern long _IQ6sinPU(long A);
1352 extern long _IQ5sinPU(long A);
1353 extern long _IQ4sinPU(long A);
1354 extern long _IQ3sinPU(long A);
1355 extern long _IQ2sinPU(long A);
1356 extern long _IQ1sinPU(long A);
1357 
1358 #if GLOBAL_Q == 30
1359 #define _IQsinPU(A) _IQ30sinPU(A)
1360 #endif
1361 #if GLOBAL_Q == 29
1362 #define _IQsinPU(A) _IQ29sinPU(A)
1363 #endif
1364 #if GLOBAL_Q == 28
1365 #define _IQsinPU(A) _IQ28sinPU(A)
1366 #endif
1367 #if GLOBAL_Q == 27
1368 #define _IQsinPU(A) _IQ27sinPU(A)
1369 #endif
1370 #if GLOBAL_Q == 26
1371 #define _IQsinPU(A) _IQ26sinPU(A)
1372 #endif
1373 #if GLOBAL_Q == 25
1374 #define _IQsinPU(A) _IQ25sinPU(A)
1375 #endif
1376 #if GLOBAL_Q == 24
1377 #define _IQsinPU(A) _IQ24sinPU(A)
1378 #endif
1379 #if GLOBAL_Q == 23
1380 #define _IQsinPU(A) _IQ23sinPU(A)
1381 #endif
1382 #if GLOBAL_Q == 22
1383 #define _IQsinPU(A) _IQ22sinPU(A)
1384 #endif
1385 #if GLOBAL_Q == 21
1386 #define _IQsinPU(A) _IQ21sinPU(A)
1387 #endif
1388 #if GLOBAL_Q == 20
1389 #define _IQsinPU(A) _IQ20sinPU(A)
1390 #endif
1391 #if GLOBAL_Q == 19
1392 #define _IQsinPU(A) _IQ19sinPU(A)
1393 #endif
1394 #if GLOBAL_Q == 18
1395 #define _IQsinPU(A) _IQ18sinPU(A)
1396 #endif
1397 #if GLOBAL_Q == 17
1398 #define _IQsinPU(A) _IQ17sinPU(A)
1399 #endif
1400 #if GLOBAL_Q == 16
1401 #define _IQsinPU(A) _IQ16sinPU(A)
1402 #endif
1403 #if GLOBAL_Q == 15
1404 #define _IQsinPU(A) _IQ15sinPU(A)
1405 #endif
1406 #if GLOBAL_Q == 14
1407 #define _IQsinPU(A) _IQ14sinPU(A)
1408 #endif
1409 #if GLOBAL_Q == 13
1410 #define _IQsinPU(A) _IQ13sinPU(A)
1411 #endif
1412 #if GLOBAL_Q == 12
1413 #define _IQsinPU(A) _IQ12sinPU(A)
1414 #endif
1415 #if GLOBAL_Q == 11
1416 #define _IQsinPU(A) _IQ11sinPU(A)
1417 #endif
1418 #if GLOBAL_Q == 10
1419 #define _IQsinPU(A) _IQ10sinPU(A)
1420 #endif
1421 #if GLOBAL_Q == 9
1422 #define _IQsinPU(A) _IQ9sinPU(A)
1423 #endif
1424 #if GLOBAL_Q == 8
1425 #define _IQsinPU(A) _IQ8sinPU(A)
1426 #endif
1427 #if GLOBAL_Q == 7
1428 #define _IQsinPU(A) _IQ7sinPU(A)
1429 #endif
1430 #if GLOBAL_Q == 6
1431 #define _IQsinPU(A) _IQ6sinPU(A)
1432 #endif
1433 #if GLOBAL_Q == 5
1434 #define _IQsinPU(A) _IQ5sinPU(A)
1435 #endif
1436 #if GLOBAL_Q == 4
1437 #define _IQsinPU(A) _IQ4sinPU(A)
1438 #endif
1439 #if GLOBAL_Q == 3
1440 #define _IQsinPU(A) _IQ3sinPU(A)
1441 #endif
1442 #if GLOBAL_Q == 2
1443 #define _IQsinPU(A) _IQ2sinPU(A)
1444 #endif
1445 #if GLOBAL_Q == 1
1446 #define _IQsinPU(A) _IQ1sinPU(A)
1447 #endif
1448 //---------------------------------------------------------------------------
1449 extern long _IQ30asin(long A);
1450 extern long _IQ29asin(long A);
1451 extern long _IQ28asin(long A);
1452 extern long _IQ27asin(long A);
1453 extern long _IQ26asin(long A);
1454 extern long _IQ25asin(long A);
1455 extern long _IQ24asin(long A);
1456 extern long _IQ23asin(long A);
1457 extern long _IQ22asin(long A);
1458 extern long _IQ21asin(long A);
1459 extern long _IQ20asin(long A);
1460 extern long _IQ19asin(long A);
1461 extern long _IQ18asin(long A);
1462 extern long _IQ17asin(long A);
1463 extern long _IQ16asin(long A);
1464 extern long _IQ15asin(long A);
1465 extern long _IQ14asin(long A);
1466 extern long _IQ13asin(long A);
1467 extern long _IQ12asin(long A);
1468 extern long _IQ11asin(long A);
1469 extern long _IQ10asin(long A);
1470 extern long _IQ9asin(long A);
1471 extern long _IQ8asin(long A);
1472 extern long _IQ7asin(long A);
1473 extern long _IQ6asin(long A);
1474 extern long _IQ5asin(long A);
1475 extern long _IQ4asin(long A);
1476 extern long _IQ3asin(long A);
1477 extern long _IQ2asin(long A);
1478 extern long _IQ1asin(long A);
1479 
1480 #if GLOBAL_Q == 30
1481 #define _IQasin(A) _IQ30asin(A)
1482 #endif
1483 #if GLOBAL_Q == 29
1484 #define _IQasin(A) _IQ29asin(A)
1485 #endif
1486 #if GLOBAL_Q == 28
1487 #define _IQasin(A) _IQ28asin(A)
1488 #endif
1489 #if GLOBAL_Q == 27
1490 #define _IQasin(A) _IQ27asin(A)
1491 #endif
1492 #if GLOBAL_Q == 26
1493 #define _IQasin(A) _IQ26asin(A)
1494 #endif
1495 #if GLOBAL_Q == 25
1496 #define _IQasin(A) _IQ25asin(A)
1497 #endif
1498 #if GLOBAL_Q == 24
1499 #define _IQasin(A) _IQ24asin(A)
1500 #endif
1501 #if GLOBAL_Q == 23
1502 #define _IQasin(A) _IQ23asin(A)
1503 #endif
1504 #if GLOBAL_Q == 22
1505 #define _IQasin(A) _IQ22asin(A)
1506 #endif
1507 #if GLOBAL_Q == 21
1508 #define _IQasin(A) _IQ21asin(A)
1509 #endif
1510 #if GLOBAL_Q == 20
1511 #define _IQasin(A) _IQ20asin(A)
1512 #endif
1513 #if GLOBAL_Q == 19
1514 #define _IQasin(A) _IQ19asin(A)
1515 #endif
1516 #if GLOBAL_Q == 18
1517 #define _IQasin(A) _IQ18asin(A)
1518 #endif
1519 #if GLOBAL_Q == 17
1520 #define _IQasin(A) _IQ17asin(A)
1521 #endif
1522 #if GLOBAL_Q == 16
1523 #define _IQasin(A) _IQ16asin(A)
1524 #endif
1525 #if GLOBAL_Q == 15
1526 #define _IQasin(A) _IQ15asin(A)
1527 #endif
1528 #if GLOBAL_Q == 14
1529 #define _IQasin(A) _IQ14asin(A)
1530 #endif
1531 #if GLOBAL_Q == 13
1532 #define _IQasin(A) _IQ13asin(A)
1533 #endif
1534 #if GLOBAL_Q == 12
1535 #define _IQasin(A) _IQ12asin(A)
1536 #endif
1537 #if GLOBAL_Q == 11
1538 #define _IQasin(A) _IQ11asin(A)
1539 #endif
1540 #if GLOBAL_Q == 10
1541 #define _IQasin(A) _IQ10asin(A)
1542 #endif
1543 #if GLOBAL_Q == 9
1544 #define _IQasin(A) _IQ9asin(A)
1545 #endif
1546 #if GLOBAL_Q == 8
1547 #define _IQasin(A) _IQ8asin(A)
1548 #endif
1549 #if GLOBAL_Q == 7
1550 #define _IQasin(A) _IQ7asin(A)
1551 #endif
1552 #if GLOBAL_Q == 6
1553 #define _IQasin(A) _IQ6asin(A)
1554 #endif
1555 #if GLOBAL_Q == 5
1556 #define _IQasin(A) _IQ5asin(A)
1557 #endif
1558 #if GLOBAL_Q == 4
1559 #define _IQasin(A) _IQ4asin(A)
1560 #endif
1561 #if GLOBAL_Q == 3
1562 #define _IQasin(A) _IQ3asin(A)
1563 #endif
1564 #if GLOBAL_Q == 2
1565 #define _IQasin(A) _IQ2asin(A)
1566 #endif
1567 #if GLOBAL_Q == 1
1568 #define _IQasin(A) _IQ1asin(A)
1569 #endif
1570 //---------------------------------------------------------------------------
1571 extern long _IQ30cos(long A);
1572 extern long _IQ29cos(long A);
1573 extern long _IQ28cos(long A);
1574 extern long _IQ27cos(long A);
1575 extern long _IQ26cos(long A);
1576 extern long _IQ25cos(long A);
1577 extern long _IQ24cos(long A);
1578 extern long _IQ23cos(long A);
1579 extern long _IQ22cos(long A);
1580 extern long _IQ21cos(long A);
1581 extern long _IQ20cos(long A);
1582 extern long _IQ19cos(long A);
1583 extern long _IQ18cos(long A);
1584 extern long _IQ17cos(long A);
1585 extern long _IQ16cos(long A);
1586 extern long _IQ15cos(long A);
1587 extern long _IQ14cos(long A);
1588 extern long _IQ13cos(long A);
1589 extern long _IQ12cos(long A);
1590 extern long _IQ11cos(long A);
1591 extern long _IQ10cos(long A);
1592 extern long _IQ9cos(long A);
1593 extern long _IQ8cos(long A);
1594 extern long _IQ7cos(long A);
1595 extern long _IQ6cos(long A);
1596 extern long _IQ5cos(long A);
1597 extern long _IQ4cos(long A);
1598 extern long _IQ3cos(long A);
1599 extern long _IQ2cos(long A);
1600 extern long _IQ1cos(long A);
1601 
1602 #if GLOBAL_Q == 30
1603 #define _IQcos(A) _IQ30cos(A)
1604 #endif
1605 #if GLOBAL_Q == 29
1606 #define _IQcos(A) _IQ29cos(A)
1607 #endif
1608 #if GLOBAL_Q == 28
1609 #define _IQcos(A) _IQ28cos(A)
1610 #endif
1611 #if GLOBAL_Q == 27
1612 #define _IQcos(A) _IQ27cos(A)
1613 #endif
1614 #if GLOBAL_Q == 26
1615 #define _IQcos(A) _IQ26cos(A)
1616 #endif
1617 #if GLOBAL_Q == 25
1618 #define _IQcos(A) _IQ25cos(A)
1619 #endif
1620 #if GLOBAL_Q == 24
1621 #define _IQcos(A) _IQ24cos(A)
1622 #endif
1623 #if GLOBAL_Q == 23
1624 #define _IQcos(A) _IQ23cos(A)
1625 #endif
1626 #if GLOBAL_Q == 22
1627 #define _IQcos(A) _IQ22cos(A)
1628 #endif
1629 #if GLOBAL_Q == 21
1630 #define _IQcos(A) _IQ21cos(A)
1631 #endif
1632 #if GLOBAL_Q == 20
1633 #define _IQcos(A) _IQ20cos(A)
1634 #endif
1635 #if GLOBAL_Q == 19
1636 #define _IQcos(A) _IQ19cos(A)
1637 #endif
1638 #if GLOBAL_Q == 18
1639 #define _IQcos(A) _IQ18cos(A)
1640 #endif
1641 #if GLOBAL_Q == 17
1642 #define _IQcos(A) _IQ17cos(A)
1643 #endif
1644 #if GLOBAL_Q == 16
1645 #define _IQcos(A) _IQ16cos(A)
1646 #endif
1647 #if GLOBAL_Q == 15
1648 #define _IQcos(A) _IQ15cos(A)
1649 #endif
1650 #if GLOBAL_Q == 14
1651 #define _IQcos(A) _IQ14cos(A)
1652 #endif
1653 #if GLOBAL_Q == 13
1654 #define _IQcos(A) _IQ13cos(A)
1655 #endif
1656 #if GLOBAL_Q == 12
1657 #define _IQcos(A) _IQ12cos(A)
1658 #endif
1659 #if GLOBAL_Q == 11
1660 #define _IQcos(A) _IQ11cos(A)
1661 #endif
1662 #if GLOBAL_Q == 10
1663 #define _IQcos(A) _IQ10cos(A)
1664 #endif
1665 #if GLOBAL_Q == 9
1666 #define _IQcos(A) _IQ9cos(A)
1667 #endif
1668 #if GLOBAL_Q == 8
1669 #define _IQcos(A) _IQ8cos(A)
1670 #endif
1671 #if GLOBAL_Q == 7
1672 #define _IQcos(A) _IQ7cos(A)
1673 #endif
1674 #if GLOBAL_Q == 6
1675 #define _IQcos(A) _IQ6cos(A)
1676 #endif
1677 #if GLOBAL_Q == 5
1678 #define _IQcos(A) _IQ5cos(A)
1679 #endif
1680 #if GLOBAL_Q == 4
1681 #define _IQcos(A) _IQ4cos(A)
1682 #endif
1683 #if GLOBAL_Q == 3
1684 #define _IQcos(A) _IQ3cos(A)
1685 #endif
1686 #if GLOBAL_Q == 2
1687 #define _IQcos(A) _IQ2cos(A)
1688 #endif
1689 #if GLOBAL_Q == 1
1690 #define _IQcos(A) _IQ1cos(A)
1691 #endif
1692 //---------------------------------------------------------------------------
1693 extern long _IQ30cosPU(long A);
1694 extern long _IQ29cosPU(long A);
1695 extern long _IQ28cosPU(long A);
1696 extern long _IQ27cosPU(long A);
1697 extern long _IQ26cosPU(long A);
1698 extern long _IQ25cosPU(long A);
1699 extern long _IQ24cosPU(long A);
1700 extern long _IQ23cosPU(long A);
1701 extern long _IQ22cosPU(long A);
1702 extern long _IQ21cosPU(long A);
1703 extern long _IQ20cosPU(long A);
1704 extern long _IQ19cosPU(long A);
1705 extern long _IQ18cosPU(long A);
1706 extern long _IQ17cosPU(long A);
1707 extern long _IQ16cosPU(long A);
1708 extern long _IQ15cosPU(long A);
1709 extern long _IQ14cosPU(long A);
1710 extern long _IQ13cosPU(long A);
1711 extern long _IQ12cosPU(long A);
1712 extern long _IQ11cosPU(long A);
1713 extern long _IQ10cosPU(long A);
1714 extern long _IQ9cosPU(long A);
1715 extern long _IQ8cosPU(long A);
1716 extern long _IQ7cosPU(long A);
1717 extern long _IQ6cosPU(long A);
1718 extern long _IQ5cosPU(long A);
1719 extern long _IQ4cosPU(long A);
1720 extern long _IQ3cosPU(long A);
1721 extern long _IQ2cosPU(long A);
1722 extern long _IQ1cosPU(long A);
1723 
1724 #if GLOBAL_Q == 30
1725 #define _IQcosPU(A) _IQ30cosPU(A)
1726 #endif
1727 #if GLOBAL_Q == 29
1728 #define _IQcosPU(A) _IQ29cosPU(A)
1729 #endif
1730 #if GLOBAL_Q == 28
1731 #define _IQcosPU(A) _IQ28cosPU(A)
1732 #endif
1733 #if GLOBAL_Q == 27
1734 #define _IQcosPU(A) _IQ27cosPU(A)
1735 #endif
1736 #if GLOBAL_Q == 26
1737 #define _IQcosPU(A) _IQ26cosPU(A)
1738 #endif
1739 #if GLOBAL_Q == 25
1740 #define _IQcosPU(A) _IQ25cosPU(A)
1741 #endif
1742 #if GLOBAL_Q == 24
1743 #define _IQcosPU(A) _IQ24cosPU(A)
1744 #endif
1745 #if GLOBAL_Q == 23
1746 #define _IQcosPU(A) _IQ23cosPU(A)
1747 #endif
1748 #if GLOBAL_Q == 22
1749 #define _IQcosPU(A) _IQ22cosPU(A)
1750 #endif
1751 #if GLOBAL_Q == 21
1752 #define _IQcosPU(A) _IQ21cosPU(A)
1753 #endif
1754 #if GLOBAL_Q == 20
1755 #define _IQcosPU(A) _IQ20cosPU(A)
1756 #endif
1757 #if GLOBAL_Q == 19
1758 #define _IQcosPU(A) _IQ19cosPU(A)
1759 #endif
1760 #if GLOBAL_Q == 18
1761 #define _IQcosPU(A) _IQ18cosPU(A)
1762 #endif
1763 #if GLOBAL_Q == 17
1764 #define _IQcosPU(A) _IQ17cosPU(A)
1765 #endif
1766 #if GLOBAL_Q == 16
1767 #define _IQcosPU(A) _IQ16cosPU(A)
1768 #endif
1769 #if GLOBAL_Q == 15
1770 #define _IQcosPU(A) _IQ15cosPU(A)
1771 #endif
1772 #if GLOBAL_Q == 14
1773 #define _IQcosPU(A) _IQ14cosPU(A)
1774 #endif
1775 #if GLOBAL_Q == 13
1776 #define _IQcosPU(A) _IQ13cosPU(A)
1777 #endif
1778 #if GLOBAL_Q == 12
1779 #define _IQcosPU(A) _IQ12cosPU(A)
1780 #endif
1781 #if GLOBAL_Q == 11
1782 #define _IQcosPU(A) _IQ11cosPU(A)
1783 #endif
1784 #if GLOBAL_Q == 10
1785 #define _IQcosPU(A) _IQ10cosPU(A)
1786 #endif
1787 #if GLOBAL_Q == 9
1788 #define _IQcosPU(A) _IQ9cosPU(A)
1789 #endif
1790 #if GLOBAL_Q == 8
1791 #define _IQcosPU(A) _IQ8cosPU(A)
1792 #endif
1793 #if GLOBAL_Q == 7
1794 #define _IQcosPU(A) _IQ7cosPU(A)
1795 #endif
1796 #if GLOBAL_Q == 6
1797 #define _IQcosPU(A) _IQ6cosPU(A)
1798 #endif
1799 #if GLOBAL_Q == 5
1800 #define _IQcosPU(A) _IQ5cosPU(A)
1801 #endif
1802 #if GLOBAL_Q == 4
1803 #define _IQcosPU(A) _IQ4cosPU(A)
1804 #endif
1805 #if GLOBAL_Q == 3
1806 #define _IQcosPU(A) _IQ3cosPU(A)
1807 #endif
1808 #if GLOBAL_Q == 2
1809 #define _IQcosPU(A) _IQ2cosPU(A)
1810 #endif
1811 #if GLOBAL_Q == 1
1812 #define _IQcosPU(A) _IQ1cosPU(A)
1813 #endif
1814 //---------------------------------------------------------------------------
1815 extern long _IQ30acos(long A);
1816 extern long _IQ29acos(long A);
1817 extern long _IQ28acos(long A);
1818 extern long _IQ27acos(long A);
1819 extern long _IQ26acos(long A);
1820 extern long _IQ25acos(long A);
1821 extern long _IQ24acos(long A);
1822 extern long _IQ23acos(long A);
1823 extern long _IQ22acos(long A);
1824 extern long _IQ21acos(long A);
1825 extern long _IQ20acos(long A);
1826 extern long _IQ19acos(long A);
1827 extern long _IQ18acos(long A);
1828 extern long _IQ17acos(long A);
1829 extern long _IQ16acos(long A);
1830 extern long _IQ15acos(long A);
1831 extern long _IQ14acos(long A);
1832 extern long _IQ13acos(long A);
1833 extern long _IQ12acos(long A);
1834 extern long _IQ11acos(long A);
1835 extern long _IQ10acos(long A);
1836 extern long _IQ9acos(long A);
1837 extern long _IQ8acos(long A);
1838 extern long _IQ7acos(long A);
1839 extern long _IQ6acos(long A);
1840 extern long _IQ5acos(long A);
1841 extern long _IQ4acos(long A);
1842 extern long _IQ3acos(long A);
1843 extern long _IQ2acos(long A);
1844 extern long _IQ1acos(long A);
1845 
1846 #if GLOBAL_Q == 30
1847 #define _IQacos(A) _IQ30acos(A)
1848 #endif
1849 #if GLOBAL_Q == 29
1850 #define _IQacos(A) _IQ29acos(A)
1851 #endif
1852 #if GLOBAL_Q == 28
1853 #define _IQacos(A) _IQ28acos(A)
1854 #endif
1855 #if GLOBAL_Q == 27
1856 #define _IQacos(A) _IQ27acos(A)
1857 #endif
1858 #if GLOBAL_Q == 26
1859 #define _IQacos(A) _IQ26acos(A)
1860 #endif
1861 #if GLOBAL_Q == 25
1862 #define _IQacos(A) _IQ25acos(A)
1863 #endif
1864 #if GLOBAL_Q == 24
1865 #define _IQacos(A) _IQ24acos(A)
1866 #endif
1867 #if GLOBAL_Q == 23
1868 #define _IQacos(A) _IQ23acos(A)
1869 #endif
1870 #if GLOBAL_Q == 22
1871 #define _IQacos(A) _IQ22acos(A)
1872 #endif
1873 #if GLOBAL_Q == 21
1874 #define _IQacos(A) _IQ21acos(A)
1875 #endif
1876 #if GLOBAL_Q == 20
1877 #define _IQacos(A) _IQ20acos(A)
1878 #endif
1879 #if GLOBAL_Q == 19
1880 #define _IQacos(A) _IQ19acos(A)
1881 #endif
1882 #if GLOBAL_Q == 18
1883 #define _IQacos(A) _IQ18acos(A)
1884 #endif
1885 #if GLOBAL_Q == 17
1886 #define _IQacos(A) _IQ17acos(A)
1887 #endif
1888 #if GLOBAL_Q == 16
1889 #define _IQacos(A) _IQ16acos(A)
1890 #endif
1891 #if GLOBAL_Q == 15
1892 #define _IQacos(A) _IQ15acos(A)
1893 #endif
1894 #if GLOBAL_Q == 14
1895 #define _IQacos(A) _IQ14acos(A)
1896 #endif
1897 #if GLOBAL_Q == 13
1898 #define _IQacos(A) _IQ13acos(A)
1899 #endif
1900 #if GLOBAL_Q == 12
1901 #define _IQacos(A) _IQ12acos(A)
1902 #endif
1903 #if GLOBAL_Q == 11
1904 #define _IQacos(A) _IQ11acos(A)
1905 #endif
1906 #if GLOBAL_Q == 10
1907 #define _IQacos(A) _IQ10acos(A)
1908 #endif
1909 #if GLOBAL_Q == 9
1910 #define _IQacos(A) _IQ9acos(A)
1911 #endif
1912 #if GLOBAL_Q == 8
1913 #define _IQacos(A) _IQ8acos(A)
1914 #endif
1915 #if GLOBAL_Q == 7
1916 #define _IQacos(A) _IQ7acos(A)
1917 #endif
1918 #if GLOBAL_Q == 6
1919 #define _IQacos(A) _IQ6acos(A)
1920 #endif
1921 #if GLOBAL_Q == 5
1922 #define _IQacos(A) _IQ5acos(A)
1923 #endif
1924 #if GLOBAL_Q == 4
1925 #define _IQacos(A) _IQ4acos(A)
1926 #endif
1927 #if GLOBAL_Q == 3
1928 #define _IQacos(A) _IQ3acos(A)
1929 #endif
1930 #if GLOBAL_Q == 2
1931 #define _IQacos(A) _IQ2acos(A)
1932 #endif
1933 #if GLOBAL_Q == 1
1934 #define _IQacos(A) _IQ1acos(A)
1935 #endif
1936 //---------------------------------------------------------------------------
1937 extern long _IQ30atan2(long A, long B);
1938 extern long _IQ29atan2(long A, long B);
1939 extern long _IQ28atan2(long A, long B);
1940 extern long _IQ27atan2(long A, long B);
1941 extern long _IQ26atan2(long A, long B);
1942 extern long _IQ25atan2(long A, long B);
1943 extern long _IQ24atan2(long A, long B);
1944 extern long _IQ23atan2(long A, long B);
1945 extern long _IQ22atan2(long A, long B);
1946 extern long _IQ21atan2(long A, long B);
1947 extern long _IQ20atan2(long A, long B);
1948 extern long _IQ19atan2(long A, long B);
1949 extern long _IQ18atan2(long A, long B);
1950 extern long _IQ17atan2(long A, long B);
1951 extern long _IQ16atan2(long A, long B);
1952 extern long _IQ15atan2(long A, long B);
1953 extern long _IQ14atan2(long A, long B);
1954 extern long _IQ13atan2(long A, long B);
1955 extern long _IQ12atan2(long A, long B);
1956 extern long _IQ11atan2(long A, long B);
1957 extern long _IQ10atan2(long A, long B);
1958 extern long _IQ9atan2(long A, long B);
1959 extern long _IQ8atan2(long A, long B);
1960 extern long _IQ7atan2(long A, long B);
1961 extern long _IQ6atan2(long A, long B);
1962 extern long _IQ5atan2(long A, long B);
1963 extern long _IQ4atan2(long A, long B);
1964 extern long _IQ3atan2(long A, long B);
1965 extern long _IQ2atan2(long A, long B);
1966 extern long _IQ1atan2(long A, long B);
1967 
1968 #if GLOBAL_Q == 30
1969 #define _IQatan2(A,B) _IQ30atan2(A,B)
1970 #endif
1971 #if GLOBAL_Q == 29
1972 #define _IQatan2(A,B) _IQ29atan2(A,B)
1973 #endif
1974 #if GLOBAL_Q == 28
1975 #define _IQatan2(A,B) _IQ28atan2(A,B)
1976 #endif
1977 #if GLOBAL_Q == 27
1978 #define _IQatan2(A,B) _IQ27atan2(A,B)
1979 #endif
1980 #if GLOBAL_Q == 26
1981 #define _IQatan2(A,B) _IQ26atan2(A,B)
1982 #endif
1983 #if GLOBAL_Q == 25
1984 #define _IQatan2(A,B) _IQ25atan2(A,B)
1985 #endif
1986 #if GLOBAL_Q == 24
1987 #define _IQatan2(A,B) _IQ24atan2(A,B)
1988 #endif
1989 #if GLOBAL_Q == 23
1990 #define _IQatan2(A,B) _IQ23atan2(A,B)
1991 #endif
1992 #if GLOBAL_Q == 22
1993 #define _IQatan2(A,B) _IQ22atan2(A,B)
1994 #endif
1995 #if GLOBAL_Q == 21
1996 #define _IQatan2(A,B) _IQ21atan2(A,B)
1997 #endif
1998 #if GLOBAL_Q == 20
1999 #define _IQatan2(A,B) _IQ20atan2(A,B)
2000 #endif
2001 #if GLOBAL_Q == 19
2002 #define _IQatan2(A,B) _IQ19atan2(A,B)
2003 #endif
2004 #if GLOBAL_Q == 18
2005 #define _IQatan2(A,B) _IQ18atan2(A,B)
2006 #endif
2007 #if GLOBAL_Q == 17
2008 #define _IQatan2(A,B) _IQ17atan2(A,B)
2009 #endif
2010 #if GLOBAL_Q == 16
2011 #define _IQatan2(A,B) _IQ16atan2(A,B)
2012 #endif
2013 #if GLOBAL_Q == 15
2014 #define _IQatan2(A,B) _IQ15atan2(A,B)
2015 #endif
2016 #if GLOBAL_Q == 14
2017 #define _IQatan2(A,B) _IQ14atan2(A,B)
2018 #endif
2019 #if GLOBAL_Q == 13
2020 #define _IQatan2(A,B) _IQ13atan2(A,B)
2021 #endif
2022 #if GLOBAL_Q == 12
2023 #define _IQatan2(A,B) _IQ12atan2(A,B)
2024 #endif
2025 #if GLOBAL_Q == 11
2026 #define _IQatan2(A,B) _IQ11atan2(A,B)
2027 #endif
2028 #if GLOBAL_Q == 10
2029 #define _IQatan2(A,B) _IQ10atan2(A,B)
2030 #endif
2031 #if GLOBAL_Q == 9
2032 #define _IQatan2(A,B) _IQ9atan2(A,B)
2033 #endif
2034 #if GLOBAL_Q == 8
2035 #define _IQatan2(A,B) _IQ8atan2(A,B)
2036 #endif
2037 #if GLOBAL_Q == 7
2038 #define _IQatan2(A,B) _IQ7atan2(A,B)
2039 #endif
2040 #if GLOBAL_Q == 6
2041 #define _IQatan2(A,B) _IQ6atan2(A,B)
2042 #endif
2043 #if GLOBAL_Q == 5
2044 #define _IQatan2(A,B) _IQ5atan2(A,B)
2045 #endif
2046 #if GLOBAL_Q == 4
2047 #define _IQatan2(A,B) _IQ4atan2(A,B)
2048 #endif
2049 #if GLOBAL_Q == 3
2050 #define _IQatan2(A,B) _IQ3atan2(A,B)
2051 #endif
2052 #if GLOBAL_Q == 2
2053 #define _IQatan2(A,B) _IQ2atan2(A,B)
2054 #endif
2055 #if GLOBAL_Q == 1
2056 #define _IQatan2(A,B) _IQ1atan2(A,B)
2057 #endif
2058 //---------------------------------------------------------------------------
2059 extern long _IQ30atan2PU(long A, long B);
2060 extern long _IQ29atan2PU(long A, long B);
2061 extern long _IQ28atan2PU(long A, long B);
2062 extern long _IQ27atan2PU(long A, long B);
2063 extern long _IQ26atan2PU(long A, long B);
2064 extern long _IQ25atan2PU(long A, long B);
2065 extern long _IQ24atan2PU(long A, long B);
2066 extern long _IQ23atan2PU(long A, long B);
2067 extern long _IQ22atan2PU(long A, long B);
2068 extern long _IQ21atan2PU(long A, long B);
2069 extern long _IQ20atan2PU(long A, long B);
2070 extern long _IQ19atan2PU(long A, long B);
2071 extern long _IQ18atan2PU(long A, long B);
2072 extern long _IQ17atan2PU(long A, long B);
2073 extern long _IQ16atan2PU(long A, long B);
2074 extern long _IQ15atan2PU(long A, long B);
2075 extern long _IQ14atan2PU(long A, long B);
2076 extern long _IQ13atan2PU(long A, long B);
2077 extern long _IQ12atan2PU(long A, long B);
2078 extern long _IQ11atan2PU(long A, long B);
2079 extern long _IQ10atan2PU(long A, long B);
2080 extern long _IQ9atan2PU(long A, long B);
2081 extern long _IQ8atan2PU(long A, long B);
2082 extern long _IQ7atan2PU(long A, long B);
2083 extern long _IQ6atan2PU(long A, long B);
2084 extern long _IQ5atan2PU(long A, long B);
2085 extern long _IQ4atan2PU(long A, long B);
2086 extern long _IQ3atan2PU(long A, long B);
2087 extern long _IQ2atan2PU(long A, long B);
2088 extern long _IQ1atan2PU(long A, long B);
2089 
2090 #if GLOBAL_Q == 30
2091 #define _IQatan2PU(A,B) _IQ30atan2PU(A,B)
2092 #endif
2093 #if GLOBAL_Q == 29
2094 #define _IQatan2PU(A,B) _IQ29atan2PU(A,B)
2095 #endif
2096 #if GLOBAL_Q == 28
2097 #define _IQatan2PU(A,B) _IQ28atan2PU(A,B)
2098 #endif
2099 #if GLOBAL_Q == 27
2100 #define _IQatan2PU(A,B) _IQ27atan2PU(A,B)
2101 #endif
2102 #if GLOBAL_Q == 26
2103 #define _IQatan2PU(A,B) _IQ26atan2PU(A,B)
2104 #endif
2105 #if GLOBAL_Q == 25
2106 #define _IQatan2PU(A,B) _IQ25atan2PU(A,B)
2107 #endif
2108 #if GLOBAL_Q == 24
2109 #define _IQatan2PU(A,B) _IQ24atan2PU(A,B)
2110 #endif
2111 #if GLOBAL_Q == 23
2112 #define _IQatan2PU(A,B) _IQ23atan2PU(A,B)
2113 #endif
2114 #if GLOBAL_Q == 22
2115 #define _IQatan2PU(A,B) _IQ22atan2PU(A,B)
2116 #endif
2117 #if GLOBAL_Q == 21
2118 #define _IQatan2PU(A,B) _IQ21atan2PU(A,B)
2119 #endif
2120 #if GLOBAL_Q == 20
2121 #define _IQatan2PU(A,B) _IQ20atan2PU(A,B)
2122 #endif
2123 #if GLOBAL_Q == 19
2124 #define _IQatan2PU(A,B) _IQ19atan2PU(A,B)
2125 #endif
2126 #if GLOBAL_Q == 18
2127 #define _IQatan2PU(A,B) _IQ18atan2PU(A,B)
2128 #endif
2129 #if GLOBAL_Q == 17
2130 #define _IQatan2PU(A,B) _IQ17atan2PU(A,B)
2131 #endif
2132 #if GLOBAL_Q == 16
2133 #define _IQatan2PU(A,B) _IQ16atan2PU(A,B)
2134 #endif
2135 #if GLOBAL_Q == 15
2136 #define _IQatan2PU(A,B) _IQ15atan2PU(A,B)
2137 #endif
2138 #if GLOBAL_Q == 14
2139 #define _IQatan2PU(A,B) _IQ14atan2PU(A,B)
2140 #endif
2141 #if GLOBAL_Q == 13
2142 #define _IQatan2PU(A,B) _IQ13atan2PU(A,B)
2143 #endif
2144 #if GLOBAL_Q == 12
2145 #define _IQatan2PU(A,B) _IQ12atan2PU(A,B)
2146 #endif
2147 #if GLOBAL_Q == 11
2148 #define _IQatan2PU(A,B) _IQ11atan2PU(A,B)
2149 #endif
2150 #if GLOBAL_Q == 10
2151 #define _IQatan2PU(A,B) _IQ10atan2PU(A,B)
2152 #endif
2153 #if GLOBAL_Q == 9
2154 #define _IQatan2PU(A,B) _IQ9atan2PU(A,B)
2155 #endif
2156 #if GLOBAL_Q == 8
2157 #define _IQatan2PU(A,B) _IQ8atan2PU(A,B)
2158 #endif
2159 #if GLOBAL_Q == 7
2160 #define _IQatan2PU(A,B) _IQ7atan2PU(A,B)
2161 #endif
2162 #if GLOBAL_Q == 6
2163 #define _IQatan2PU(A,B) _IQ6atan2PU(A,B)
2164 #endif
2165 #if GLOBAL_Q == 5
2166 #define _IQatan2PU(A,B) _IQ5atan2PU(A,B)
2167 #endif
2168 #if GLOBAL_Q == 4
2169 #define _IQatan2PU(A,B) _IQ4atan2PU(A,B)
2170 #endif
2171 #if GLOBAL_Q == 3
2172 #define _IQatan2PU(A,B) _IQ3atan2PU(A,B)
2173 #endif
2174 #if GLOBAL_Q == 2
2175 #define _IQatan2PU(A,B) _IQ2atan2PU(A,B)
2176 #endif
2177 #if GLOBAL_Q == 1
2178 #define _IQatan2PU(A,B) _IQ1atan2PU(A,B)
2179 #endif
2180 //---------------------------------------------------------------------------
2181 #define _IQ30atan(A) _IQ30atan2(A,_IQ30(1.0))
2182 #define _IQ29atan(A) _IQ29atan2(A,_IQ29(1.0))
2183 #define _IQ28atan(A) _IQ28atan2(A,_IQ28(1.0))
2184 #define _IQ27atan(A) _IQ27atan2(A,_IQ27(1.0))
2185 #define _IQ26atan(A) _IQ26atan2(A,_IQ26(1.0))
2186 #define _IQ25atan(A) _IQ25atan2(A,_IQ25(1.0))
2187 #define _IQ24atan(A) _IQ24atan2(A,_IQ24(1.0))
2188 #define _IQ23atan(A) _IQ23atan2(A,_IQ23(1.0))
2189 #define _IQ22atan(A) _IQ22atan2(A,_IQ22(1.0))
2190 #define _IQ21atan(A) _IQ21atan2(A,_IQ21(1.0))
2191 #define _IQ20atan(A) _IQ20atan2(A,_IQ20(1.0))
2192 #define _IQ19atan(A) _IQ19atan2(A,_IQ19(1.0))
2193 #define _IQ18atan(A) _IQ18atan2(A,_IQ18(1.0))
2194 #define _IQ17atan(A) _IQ17atan2(A,_IQ17(1.0))
2195 #define _IQ16atan(A) _IQ16atan2(A,_IQ16(1.0))
2196 #define _IQ15atan(A) _IQ15atan2(A,_IQ15(1.0))
2197 #define _IQ14atan(A) _IQ14atan2(A,_IQ14(1.0))
2198 #define _IQ13atan(A) _IQ13atan2(A,_IQ13(1.0))
2199 #define _IQ12atan(A) _IQ12atan2(A,_IQ12(1.0))
2200 #define _IQ11atan(A) _IQ11atan2(A,_IQ11(1.0))
2201 #define _IQ10atan(A) _IQ10atan2(A,_IQ10(1.0))
2202 #define _IQ9atan(A) _IQ9atan2(A,_IQ9(1.0))
2203 #define _IQ8atan(A) _IQ8atan2(A,_IQ8(1.0))
2204 #define _IQ7atan(A) _IQ7atan2(A,_IQ7(1.0))
2205 #define _IQ6atan(A) _IQ6atan2(A,_IQ6(1.0))
2206 #define _IQ5atan(A) _IQ5atan2(A,_IQ5(1.0))
2207 #define _IQ4atan(A) _IQ4atan2(A,_IQ4(1.0))
2208 #define _IQ3atan(A) _IQ3atan2(A,_IQ3(1.0))
2209 #define _IQ2atan(A) _IQ2atan2(A,_IQ2(1.0))
2210 #define _IQ1atan(A) _IQ1atan2(A,_IQ1(1.0))
2211 #if GLOBAL_Q == 30
2212 #define _IQatan(A) _IQ30atan2(A,_IQ(1.0))
2213 #endif
2214 #if GLOBAL_Q == 29
2215 #define _IQatan(A) _IQ29atan2(A,_IQ(1.0))
2216 #endif
2217 #if GLOBAL_Q == 28
2218 #define _IQatan(A) _IQ28atan2(A,_IQ(1.0))
2219 #endif
2220 #if GLOBAL_Q == 27
2221 #define _IQatan(A) _IQ27atan2(A,_IQ(1.0))
2222 #endif
2223 #if GLOBAL_Q == 26
2224 #define _IQatan(A) _IQ26atan2(A,_IQ(1.0))
2225 #endif
2226 #if GLOBAL_Q == 25
2227 #define _IQatan(A) _IQ25atan2(A,_IQ(1.0))
2228 #endif
2229 #if GLOBAL_Q == 24
2230 #define _IQatan(A) _IQ24atan2(A,_IQ(1.0))
2231 #endif
2232 #if GLOBAL_Q == 23
2233 #define _IQatan(A) _IQ23atan2(A,_IQ(1.0))
2234 #endif
2235 #if GLOBAL_Q == 22
2236 #define _IQatan(A) _IQ22atan2(A,_IQ(1.0))
2237 #endif
2238 #if GLOBAL_Q == 21
2239 #define _IQatan(A) _IQ21atan2(A,_IQ(1.0))
2240 #endif
2241 #if GLOBAL_Q == 20
2242 #define _IQatan(A) _IQ20atan2(A,_IQ(1.0))
2243 #endif
2244 #if GLOBAL_Q == 19
2245 #define _IQatan(A) _IQ19atan2(A,_IQ(1.0))
2246 #endif
2247 #if GLOBAL_Q == 18
2248 #define _IQatan(A) _IQ18atan2(A,_IQ(1.0))
2249 #endif
2250 #if GLOBAL_Q == 17
2251 #define _IQatan(A) _IQ17atan2(A,_IQ(1.0))
2252 #endif
2253 #if GLOBAL_Q == 16
2254 #define _IQatan(A) _IQ16atan2(A,_IQ(1.0))
2255 #endif
2256 #if GLOBAL_Q == 15
2257 #define _IQatan(A) _IQ15atan2(A,_IQ(1.0))
2258 #endif
2259 #if GLOBAL_Q == 14
2260 #define _IQatan(A) _IQ14atan2(A,_IQ(1.0))
2261 #endif
2262 #if GLOBAL_Q == 13
2263 #define _IQatan(A) _IQ13atan2(A,_IQ(1.0))
2264 #endif
2265 #if GLOBAL_Q == 12
2266 #define _IQatan(A) _IQ12atan2(A,_IQ(1.0))
2267 #endif
2268 #if GLOBAL_Q == 11
2269 #define _IQatan(A) _IQ11atan2(A,_IQ(1.0))
2270 #endif
2271 #if GLOBAL_Q == 10
2272 #define _IQatan(A) _IQ10atan2(A,_IQ(1.0))
2273 #endif
2274 #if GLOBAL_Q == 9
2275 #define _IQatan(A) _IQ9atan2(A,_IQ(1.0))
2276 #endif
2277 #if GLOBAL_Q == 8
2278 #define _IQatan(A) _IQ8atan2(A,_IQ(1.0))
2279 #endif
2280 #if GLOBAL_Q == 7
2281 #define _IQatan(A) _IQ7atan2(A,_IQ(1.0))
2282 #endif
2283 #if GLOBAL_Q == 6
2284 #define _IQatan(A) _IQ6atan2(A,_IQ(1.0))
2285 #endif
2286 #if GLOBAL_Q == 5
2287 #define _IQatan(A) _IQ5atan2(A,_IQ(1.0))
2288 #endif
2289 #if GLOBAL_Q == 4
2290 #define _IQatan(A) _IQ4atan2(A,_IQ(1.0))
2291 #endif
2292 #if GLOBAL_Q == 3
2293 #define _IQatan(A) _IQ3atan2(A,_IQ(1.0))
2294 #endif
2295 #if GLOBAL_Q == 2
2296 #define _IQatan(A) _IQ2atan2(A,_IQ(1.0))
2297 #endif
2298 #if GLOBAL_Q == 1
2299 #define _IQatan(A) _IQ1atan2(A,_IQ(1.0))
2300 #endif
2301 //---------------------------------------------------------------------------
2302 extern long _IQ30sqrt(long A);
2303 extern long _IQ29sqrt(long A);
2304 extern long _IQ28sqrt(long A);
2305 extern long _IQ27sqrt(long A);
2306 extern long _IQ26sqrt(long A);
2307 extern long _IQ25sqrt(long A);
2308 extern long _IQ24sqrt(long A);
2309 extern long _IQ23sqrt(long A);
2310 extern long _IQ22sqrt(long A);
2311 extern long _IQ21sqrt(long A);
2312 extern long _IQ20sqrt(long A);
2313 extern long _IQ19sqrt(long A);
2314 extern long _IQ18sqrt(long A);
2315 extern long _IQ17sqrt(long A);
2316 extern long _IQ16sqrt(long A);
2317 extern long _IQ15sqrt(long A);
2318 extern long _IQ14sqrt(long A);
2319 extern long _IQ13sqrt(long A);
2320 extern long _IQ12sqrt(long A);
2321 extern long _IQ11sqrt(long A);
2322 extern long _IQ10sqrt(long A);
2323 extern long _IQ9sqrt(long A);
2324 extern long _IQ8sqrt(long A);
2325 extern long _IQ7sqrt(long A);
2326 extern long _IQ6sqrt(long A);
2327 extern long _IQ5sqrt(long A);
2328 extern long _IQ4sqrt(long A);
2329 extern long _IQ3sqrt(long A);
2330 extern long _IQ2sqrt(long A);
2331 extern long _IQ1sqrt(long A);
2332 
2333 #if GLOBAL_Q == 30
2334 #define _IQsqrt(A) _IQ30sqrt(A)
2335 #endif
2336 #if GLOBAL_Q == 29
2337 #define _IQsqrt(A) _IQ29sqrt(A)
2338 #endif
2339 #if GLOBAL_Q == 28
2340 #define _IQsqrt(A) _IQ28sqrt(A)
2341 #endif
2342 #if GLOBAL_Q == 27
2343 #define _IQsqrt(A) _IQ27sqrt(A)
2344 #endif
2345 #if GLOBAL_Q == 26
2346 #define _IQsqrt(A) _IQ26sqrt(A)
2347 #endif
2348 #if GLOBAL_Q == 25
2349 #define _IQsqrt(A) _IQ25sqrt(A)
2350 #endif
2351 #if GLOBAL_Q == 24
2352 #define _IQsqrt(A) _IQ24sqrt(A)
2353 #endif
2354 #if GLOBAL_Q == 23
2355 #define _IQsqrt(A) _IQ23sqrt(A)
2356 #endif
2357 #if GLOBAL_Q == 22
2358 #define _IQsqrt(A) _IQ22sqrt(A)
2359 #endif
2360 #if GLOBAL_Q == 21
2361 #define _IQsqrt(A) _IQ21sqrt(A)
2362 #endif
2363 #if GLOBAL_Q == 20
2364 #define _IQsqrt(A) _IQ20sqrt(A)
2365 #endif
2366 #if GLOBAL_Q == 19
2367 #define _IQsqrt(A) _IQ19sqrt(A)
2368 #endif
2369 #if GLOBAL_Q == 18
2370 #define _IQsqrt(A) _IQ18sqrt(A)
2371 #endif
2372 #if GLOBAL_Q == 17
2373 #define _IQsqrt(A) _IQ17sqrt(A)
2374 #endif
2375 #if GLOBAL_Q == 16
2376 #define _IQsqrt(A) _IQ16sqrt(A)
2377 #endif
2378 #if GLOBAL_Q == 15
2379 #define _IQsqrt(A) _IQ15sqrt(A)
2380 #endif
2381 #if GLOBAL_Q == 14
2382 #define _IQsqrt(A) _IQ14sqrt(A)
2383 #endif
2384 #if GLOBAL_Q == 13
2385 #define _IQsqrt(A) _IQ13sqrt(A)
2386 #endif
2387 #if GLOBAL_Q == 12
2388 #define _IQsqrt(A) _IQ12sqrt(A)
2389 #endif
2390 #if GLOBAL_Q == 11
2391 #define _IQsqrt(A) _IQ11sqrt(A)
2392 #endif
2393 #if GLOBAL_Q == 10
2394 #define _IQsqrt(A) _IQ10sqrt(A)
2395 #endif
2396 #if GLOBAL_Q == 9
2397 #define _IQsqrt(A) _IQ9sqrt(A)
2398 #endif
2399 #if GLOBAL_Q == 8
2400 #define _IQsqrt(A) _IQ8sqrt(A)
2401 #endif
2402 #if GLOBAL_Q == 7
2403 #define _IQsqrt(A) _IQ7sqrt(A)
2404 #endif
2405 #if GLOBAL_Q == 6
2406 #define _IQsqrt(A) _IQ6sqrt(A)
2407 #endif
2408 #if GLOBAL_Q == 5
2409 #define _IQsqrt(A) _IQ5sqrt(A)
2410 #endif
2411 #if GLOBAL_Q == 4
2412 #define _IQsqrt(A) _IQ4sqrt(A)
2413 #endif
2414 #if GLOBAL_Q == 3
2415 #define _IQsqrt(A) _IQ3sqrt(A)
2416 #endif
2417 #if GLOBAL_Q == 2
2418 #define _IQsqrt(A) _IQ2sqrt(A)
2419 #endif
2420 #if GLOBAL_Q == 1
2421 #define _IQsqrt(A) _IQ1sqrt(A)
2422 #endif
2423 //---------------------------------------------------------------------------
2424 extern long _IQ30isqrt(long A);
2425 extern long _IQ29isqrt(long A);
2426 extern long _IQ28isqrt(long A);
2427 extern long _IQ27isqrt(long A);
2428 extern long _IQ26isqrt(long A);
2429 extern long _IQ25isqrt(long A);
2430 extern long _IQ24isqrt(long A);
2431 extern long _IQ23isqrt(long A);
2432 extern long _IQ22isqrt(long A);
2433 extern long _IQ21isqrt(long A);
2434 extern long _IQ20isqrt(long A);
2435 extern long _IQ19isqrt(long A);
2436 extern long _IQ18isqrt(long A);
2437 extern long _IQ17isqrt(long A);
2438 extern long _IQ16isqrt(long A);
2439 extern long _IQ15isqrt(long A);
2440 extern long _IQ14isqrt(long A);
2441 extern long _IQ13isqrt(long A);
2442 extern long _IQ12isqrt(long A);
2443 extern long _IQ11isqrt(long A);
2444 extern long _IQ10isqrt(long A);
2445 extern long _IQ9isqrt(long A);
2446 extern long _IQ8isqrt(long A);
2447 extern long _IQ7isqrt(long A);
2448 extern long _IQ6isqrt(long A);
2449 extern long _IQ5isqrt(long A);
2450 extern long _IQ4isqrt(long A);
2451 extern long _IQ3isqrt(long A);
2452 extern long _IQ2isqrt(long A);
2453 extern long _IQ1isqrt(long A);
2454 
2455 #if GLOBAL_Q == 30
2456 #define _IQisqrt(A) _IQ30isqrt(A)
2457 #endif
2458 #if GLOBAL_Q == 29
2459 #define _IQisqrt(A) _IQ29isqrt(A)
2460 #endif
2461 #if GLOBAL_Q == 28
2462 #define _IQisqrt(A) _IQ28isqrt(A)
2463 #endif
2464 #if GLOBAL_Q == 27
2465 #define _IQisqrt(A) _IQ27isqrt(A)
2466 #endif
2467 #if GLOBAL_Q == 26
2468 #define _IQisqrt(A) _IQ26isqrt(A)
2469 #endif
2470 #if GLOBAL_Q == 25
2471 #define _IQisqrt(A) _IQ25isqrt(A)
2472 #endif
2473 #if GLOBAL_Q == 24
2474 #define _IQisqrt(A) _IQ24isqrt(A)
2475 #endif
2476 #if GLOBAL_Q == 23
2477 #define _IQisqrt(A) _IQ23isqrt(A)
2478 #endif
2479 #if GLOBAL_Q == 22
2480 #define _IQisqrt(A) _IQ22isqrt(A)
2481 #endif
2482 #if GLOBAL_Q == 21
2483 #define _IQisqrt(A) _IQ21isqrt(A)
2484 #endif
2485 #if GLOBAL_Q == 20
2486 #define _IQisqrt(A) _IQ20isqrt(A)
2487 #endif
2488 #if GLOBAL_Q == 19
2489 #define _IQisqrt(A) _IQ19isqrt(A)
2490 #endif
2491 #if GLOBAL_Q == 18
2492 #define _IQisqrt(A) _IQ18isqrt(A)
2493 #endif
2494 #if GLOBAL_Q == 17
2495 #define _IQisqrt(A) _IQ17isqrt(A)
2496 #endif
2497 #if GLOBAL_Q == 16
2498 #define _IQisqrt(A) _IQ16isqrt(A)
2499 #endif
2500 #if GLOBAL_Q == 15
2501 #define _IQisqrt(A) _IQ15isqrt(A)
2502 #endif
2503 #if GLOBAL_Q == 14
2504 #define _IQisqrt(A) _IQ14isqrt(A)
2505 #endif
2506 #if GLOBAL_Q == 13
2507 #define _IQisqrt(A) _IQ13isqrt(A)
2508 #endif
2509 #if GLOBAL_Q == 12
2510 #define _IQisqrt(A) _IQ12isqrt(A)
2511 #endif
2512 #if GLOBAL_Q == 11
2513 #define _IQisqrt(A) _IQ11isqrt(A)
2514 #endif
2515 #if GLOBAL_Q == 10
2516 #define _IQisqrt(A) _IQ10isqrt(A)
2517 #endif
2518 #if GLOBAL_Q == 9
2519 #define _IQisqrt(A) _IQ9isqrt(A)
2520 #endif
2521 #if GLOBAL_Q == 8
2522 #define _IQisqrt(A) _IQ8isqrt(A)
2523 #endif
2524 #if GLOBAL_Q == 7
2525 #define _IQisqrt(A) _IQ7isqrt(A)
2526 #endif
2527 #if GLOBAL_Q == 6
2528 #define _IQisqrt(A) _IQ6isqrt(A)
2529 #endif
2530 #if GLOBAL_Q == 5
2531 #define _IQisqrt(A) _IQ5isqrt(A)
2532 #endif
2533 #if GLOBAL_Q == 4
2534 #define _IQisqrt(A) _IQ4isqrt(A)
2535 #endif
2536 #if GLOBAL_Q == 3
2537 #define _IQisqrt(A) _IQ3isqrt(A)
2538 #endif
2539 #if GLOBAL_Q == 2
2540 #define _IQisqrt(A) _IQ2isqrt(A)
2541 #endif
2542 #if GLOBAL_Q == 1
2543 #define _IQisqrt(A) _IQ1isqrt(A)
2544 #endif
2545 //---------------------------------------------------------------------------
2546 extern long _IQ30exp(long A);
2547 extern long _IQ29exp(long A);
2548 extern long _IQ28exp(long A);
2549 extern long _IQ27exp(long A);
2550 extern long _IQ26exp(long A);
2551 extern long _IQ25exp(long A);
2552 extern long _IQ24exp(long A);
2553 extern long _IQ23exp(long A);
2554 extern long _IQ22exp(long A);
2555 extern long _IQ21exp(long A);
2556 extern long _IQ20exp(long A);
2557 extern long _IQ19exp(long A);
2558 extern long _IQ18exp(long A);
2559 extern long _IQ17exp(long A);
2560 extern long _IQ16exp(long A);
2561 extern long _IQ15exp(long A);
2562 extern long _IQ14exp(long A);
2563 extern long _IQ13exp(long A);
2564 extern long _IQ12exp(long A);
2565 extern long _IQ11exp(long A);
2566 extern long _IQ10exp(long A);
2567 extern long _IQ9exp(long A);
2568 extern long _IQ8exp(long A);
2569 extern long _IQ7exp(long A);
2570 extern long _IQ6exp(long A);
2571 extern long _IQ5exp(long A);
2572 extern long _IQ4exp(long A);
2573 extern long _IQ3exp(long A);
2574 extern long _IQ2exp(long A);
2575 extern long _IQ1exp(long A);
2576 
2577 #if GLOBAL_Q == 30
2578 #define _IQexp(A) _IQ30exp(A)
2579 #endif
2580 #if GLOBAL_Q == 29
2581 #define _IQexp(A) _IQ29exp(A)
2582 #endif
2583 #if GLOBAL_Q == 28
2584 #define _IQexp(A) _IQ28exp(A)
2585 #endif
2586 #if GLOBAL_Q == 27
2587 #define _IQexp(A) _IQ27exp(A)
2588 #endif
2589 #if GLOBAL_Q == 26
2590 #define _IQexp(A) _IQ26exp(A)
2591 #endif
2592 #if GLOBAL_Q == 25
2593 #define _IQexp(A) _IQ25exp(A)
2594 #endif
2595 #if GLOBAL_Q == 24
2596 #define _IQexp(A) _IQ24exp(A)
2597 #endif
2598 #if GLOBAL_Q == 23
2599 #define _IQexp(A) _IQ23exp(A)
2600 #endif
2601 #if GLOBAL_Q == 22
2602 #define _IQexp(A) _IQ22exp(A)
2603 #endif
2604 #if GLOBAL_Q == 21
2605 #define _IQexp(A) _IQ21exp(A)
2606 #endif
2607 #if GLOBAL_Q == 20
2608 #define _IQexp(A) _IQ20exp(A)
2609 #endif
2610 #if GLOBAL_Q == 19
2611 #define _IQexp(A) _IQ19exp(A)
2612 #endif
2613 #if GLOBAL_Q == 18
2614 #define _IQexp(A) _IQ18exp(A)
2615 #endif
2616 #if GLOBAL_Q == 17
2617 #define _IQexp(A) _IQ17exp(A)
2618 #endif
2619 #if GLOBAL_Q == 16
2620 #define _IQexp(A) _IQ16exp(A)
2621 #endif
2622 #if GLOBAL_Q == 15
2623 #define _IQexp(A) _IQ15exp(A)
2624 #endif
2625 #if GLOBAL_Q == 14
2626 #define _IQexp(A) _IQ14exp(A)
2627 #endif
2628 #if GLOBAL_Q == 13
2629 #define _IQexp(A) _IQ13exp(A)
2630 #endif
2631 #if GLOBAL_Q == 12
2632 #define _IQexp(A) _IQ12exp(A)
2633 #endif
2634 #if GLOBAL_Q == 11
2635 #define _IQexp(A) _IQ11exp(A)
2636 #endif
2637 #if GLOBAL_Q == 10
2638 #define _IQexp(A) _IQ10exp(A)
2639 #endif
2640 #if GLOBAL_Q == 9
2641 #define _IQexp(A) _IQ9exp(A)
2642 #endif
2643 #if GLOBAL_Q == 8
2644 #define _IQexp(A) _IQ8exp(A)
2645 #endif
2646 #if GLOBAL_Q == 7
2647 #define _IQexp(A) _IQ7exp(A)
2648 #endif
2649 #if GLOBAL_Q == 6
2650 #define _IQexp(A) _IQ6exp(A)
2651 #endif
2652 #if GLOBAL_Q == 5
2653 #define _IQexp(A) _IQ5exp(A)
2654 #endif
2655 #if GLOBAL_Q == 4
2656 #define _IQexp(A) _IQ4exp(A)
2657 #endif
2658 #if GLOBAL_Q == 3
2659 #define _IQexp(A) _IQ3exp(A)
2660 #endif
2661 #if GLOBAL_Q == 2
2662 #define _IQexp(A) _IQ2exp(A)
2663 #endif
2664 #if GLOBAL_Q == 1
2665 #define _IQexp(A) _IQ1exp(A)
2666 #endif
2667 //---------------------------------------------------------------------------
2668 extern long _IQ30int(long A);
2669 extern long _IQ29int(long A);
2670 extern long _IQ28int(long A);
2671 extern long _IQ27int(long A);
2672 extern long _IQ26int(long A);
2673 extern long _IQ25int(long A);
2674 extern long _IQ24int(long A);
2675 extern long _IQ23int(long A);
2676 extern long _IQ22int(long A);
2677 extern long _IQ21int(long A);
2678 extern long _IQ20int(long A);
2679 extern long _IQ19int(long A);
2680 extern long _IQ18int(long A);
2681 extern long _IQ17int(long A);
2682 extern long _IQ16int(long A);
2683 extern long _IQ15int(long A);
2684 extern long _IQ14int(long A);
2685 extern long _IQ13int(long A);
2686 extern long _IQ12int(long A);
2687 extern long _IQ11int(long A);
2688 extern long _IQ10int(long A);
2689 extern long _IQ9int(long A);
2690 extern long _IQ8int(long A);
2691 extern long _IQ7int(long A);
2692 extern long _IQ6int(long A);
2693 extern long _IQ5int(long A);
2694 extern long _IQ4int(long A);
2695 extern long _IQ3int(long A);
2696 extern long _IQ2int(long A);
2697 extern long _IQ1int(long A);
2698 
2699 #if GLOBAL_Q == 30
2700 #define _IQint(A) _IQ30int(A)
2701 #endif
2702 #if GLOBAL_Q == 29
2703 #define _IQint(A) _IQ29int(A)
2704 #endif
2705 #if GLOBAL_Q == 28
2706 #define _IQint(A) _IQ28int(A)
2707 #endif
2708 #if GLOBAL_Q == 27
2709 #define _IQint(A) _IQ27int(A)
2710 #endif
2711 #if GLOBAL_Q == 26
2712 #define _IQint(A) _IQ26int(A)
2713 #endif
2714 #if GLOBAL_Q == 25
2715 #define _IQint(A) _IQ25int(A)
2716 #endif
2717 #if GLOBAL_Q == 24
2718 #define _IQint(A) _IQ24int(A)
2719 #endif
2720 #if GLOBAL_Q == 23
2721 #define _IQint(A) _IQ23int(A)
2722 #endif
2723 #if GLOBAL_Q == 22
2724 #define _IQint(A) _IQ22int(A)
2725 #endif
2726 #if GLOBAL_Q == 21
2727 #define _IQint(A) _IQ21int(A)
2728 #endif
2729 #if GLOBAL_Q == 20
2730 #define _IQint(A) _IQ20int(A)
2731 #endif
2732 #if GLOBAL_Q == 19
2733 #define _IQint(A) _IQ19int(A)
2734 #endif
2735 #if GLOBAL_Q == 18
2736 #define _IQint(A) _IQ18int(A)
2737 #endif
2738 #if GLOBAL_Q == 17
2739 #define _IQint(A) _IQ17int(A)
2740 #endif
2741 #if GLOBAL_Q == 16
2742 #define _IQint(A) _IQ16int(A)
2743 #endif
2744 #if GLOBAL_Q == 15
2745 #define _IQint(A) _IQ15int(A)
2746 #endif
2747 #if GLOBAL_Q == 14
2748 #define _IQint(A) _IQ14int(A)
2749 #endif
2750 #if GLOBAL_Q == 13
2751 #define _IQint(A) _IQ13int(A)
2752 #endif
2753 #if GLOBAL_Q == 12
2754 #define _IQint(A) _IQ12int(A)
2755 #endif
2756 #if GLOBAL_Q == 11
2757 #define _IQint(A) _IQ11int(A)
2758 #endif
2759 #if GLOBAL_Q == 10
2760 #define _IQint(A) _IQ10int(A)
2761 #endif
2762 #if GLOBAL_Q == 9
2763 #define _IQint(A) _IQ9int(A)
2764 #endif
2765 #if GLOBAL_Q == 8
2766 #define _IQint(A) _IQ8int(A)
2767 #endif
2768 #if GLOBAL_Q == 7
2769 #define _IQint(A) _IQ7int(A)
2770 #endif
2771 #if GLOBAL_Q == 6
2772 #define _IQint(A) _IQ6int(A)
2773 #endif
2774 #if GLOBAL_Q == 5
2775 #define _IQint(A) _IQ5int(A)
2776 #endif
2777 #if GLOBAL_Q == 4
2778 #define _IQint(A) _IQ4int(A)
2779 #endif
2780 #if GLOBAL_Q == 3
2781 #define _IQint(A) _IQ3int(A)
2782 #endif
2783 #if GLOBAL_Q == 2
2784 #define _IQint(A) _IQ2int(A)
2785 #endif
2786 #if GLOBAL_Q == 1
2787 #define _IQint(A) _IQ1int(A)
2788 #endif
2789 //---------------------------------------------------------------------------
2790 extern long _IQ30frac(long A);
2791 extern long _IQ29frac(long A);
2792 extern long _IQ28frac(long A);
2793 extern long _IQ27frac(long A);
2794 extern long _IQ26frac(long A);
2795 extern long _IQ25frac(long A);
2796 extern long _IQ24frac(long A);
2797 extern long _IQ23frac(long A);
2798 extern long _IQ22frac(long A);
2799 extern long _IQ21frac(long A);
2800 extern long _IQ20frac(long A);
2801 extern long _IQ19frac(long A);
2802 extern long _IQ18frac(long A);
2803 extern long _IQ17frac(long A);
2804 extern long _IQ16frac(long A);
2805 extern long _IQ15frac(long A);
2806 extern long _IQ14frac(long A);
2807 extern long _IQ13frac(long A);
2808 extern long _IQ12frac(long A);
2809 extern long _IQ11frac(long A);
2810 extern long _IQ10frac(long A);
2811 extern long _IQ9frac(long A);
2812 extern long _IQ8frac(long A);
2813 extern long _IQ7frac(long A);
2814 extern long _IQ6frac(long A);
2815 extern long _IQ5frac(long A);
2816 extern long _IQ4frac(long A);
2817 extern long _IQ3frac(long A);
2818 extern long _IQ2frac(long A);
2819 extern long _IQ1frac(long A);
2820 
2821 #if GLOBAL_Q == 30
2822 #define _IQfrac(A) _IQ30frac(A)
2823 #endif
2824 #if GLOBAL_Q == 29
2825 #define _IQfrac(A) _IQ29frac(A)
2826 #endif
2827 #if GLOBAL_Q == 28
2828 #define _IQfrac(A) _IQ28frac(A)
2829 #endif
2830 #if GLOBAL_Q == 27
2831 #define _IQfrac(A) _IQ27frac(A)
2832 #endif
2833 #if GLOBAL_Q == 26
2834 #define _IQfrac(A) _IQ26frac(A)
2835 #endif
2836 #if GLOBAL_Q == 25
2837 #define _IQfrac(A) _IQ25frac(A)
2838 #endif
2839 #if GLOBAL_Q == 24
2840 #define _IQfrac(A) _IQ24frac(A)
2841 #endif
2842 #if GLOBAL_Q == 23
2843 #define _IQfrac(A) _IQ23frac(A)
2844 #endif
2845 #if GLOBAL_Q == 22
2846 #define _IQfrac(A) _IQ22frac(A)
2847 #endif
2848 #if GLOBAL_Q == 21
2849 #define _IQfrac(A) _IQ21frac(A)
2850 #endif
2851 #if GLOBAL_Q == 20
2852 #define _IQfrac(A) _IQ20frac(A)
2853 #endif
2854 #if GLOBAL_Q == 19
2855 #define _IQfrac(A) _IQ19frac(A)
2856 #endif
2857 #if GLOBAL_Q == 18
2858 #define _IQfrac(A) _IQ18frac(A)
2859 #endif
2860 #if GLOBAL_Q == 17
2861 #define _IQfrac(A) _IQ17frac(A)
2862 #endif
2863 #if GLOBAL_Q == 16
2864 #define _IQfrac(A) _IQ16frac(A)
2865 #endif
2866 #if GLOBAL_Q == 15
2867 #define _IQfrac(A) _IQ15frac(A)
2868 #endif
2869 #if GLOBAL_Q == 14
2870 #define _IQfrac(A) _IQ14frac(A)
2871 #endif
2872 #if GLOBAL_Q == 13
2873 #define _IQfrac(A) _IQ13frac(A)
2874 #endif
2875 #if GLOBAL_Q == 12
2876 #define _IQfrac(A) _IQ12frac(A)
2877 #endif
2878 #if GLOBAL_Q == 11
2879 #define _IQfrac(A) _IQ11frac(A)
2880 #endif
2881 #if GLOBAL_Q == 10
2882 #define _IQfrac(A) _IQ10frac(A)
2883 #endif
2884 #if GLOBAL_Q == 9
2885 #define _IQfrac(A) _IQ9frac(A)
2886 #endif
2887 #if GLOBAL_Q == 8
2888 #define _IQfrac(A) _IQ8frac(A)
2889 #endif
2890 #if GLOBAL_Q == 7
2891 #define _IQfrac(A) _IQ7frac(A)
2892 #endif
2893 #if GLOBAL_Q == 6
2894 #define _IQfrac(A) _IQ6frac(A)
2895 #endif
2896 #if GLOBAL_Q == 5
2897 #define _IQfrac(A) _IQ5frac(A)
2898 #endif
2899 #if GLOBAL_Q == 4
2900 #define _IQfrac(A) _IQ4frac(A)
2901 #endif
2902 #if GLOBAL_Q == 3
2903 #define _IQfrac(A) _IQ3frac(A)
2904 #endif
2905 #if GLOBAL_Q == 2
2906 #define _IQfrac(A) _IQ2frac(A)
2907 #endif
2908 #if GLOBAL_Q == 1
2909 #define _IQfrac(A) _IQ1frac(A)
2910 #endif
2911 //---------------------------------------------------------------------------
2912 #define _IQmpyIQX(A, IQA, B, IQB) __IQxmpy(A, B, (GLOBAL_Q + 32 - IQA - IQB))
2913 #define _IQ30mpyIQX(A, IQA, B, IQB) __IQxmpy(A, B, (30 + 32 - IQA - IQB))
2914 #define _IQ29mpyIQX(A, IQA, B, IQB) __IQxmpy(A, B, (29 + 32 - IQA - IQB))
2915 #define _IQ28mpyIQX(A, IQA, B, IQB) __IQxmpy(A, B, (28 + 32 - IQA - IQB))
2916 #define _IQ27mpyIQX(A, IQA, B, IQB) __IQxmpy(A, B, (27 + 32 - IQA - IQB))
2917 #define _IQ26mpyIQX(A, IQA, B, IQB) __IQxmpy(A, B, (26 + 32 - IQA - IQB))
2918 #define _IQ25mpyIQX(A, IQA, B, IQB) __IQxmpy(A, B, (25 + 32 - IQA - IQB))
2919 #define _IQ24mpyIQX(A, IQA, B, IQB) __IQxmpy(A, B, (24 + 32 - IQA - IQB))
2920 #define _IQ23mpyIQX(A, IQA, B, IQB) __IQxmpy(A, B, (23 + 32 - IQA - IQB))
2921 #define _IQ22mpyIQX(A, IQA, B, IQB) __IQxmpy(A, B, (22 + 32 - IQA - IQB))
2922 #define _IQ21mpyIQX(A, IQA, B, IQB) __IQxmpy(A, B, (21 + 32 - IQA - IQB))
2923 #define _IQ20mpyIQX(A, IQA, B, IQB) __IQxmpy(A, B, (20 + 32 - IQA - IQB))
2924 #define _IQ19mpyIQX(A, IQA, B, IQB) __IQxmpy(A, B, (19 + 32 - IQA - IQB))
2925 #define _IQ18mpyIQX(A, IQA, B, IQB) __IQxmpy(A, B, (18 + 32 - IQA - IQB))
2926 #define _IQ17mpyIQX(A, IQA, B, IQB) __IQxmpy(A, B, (17 + 32 - IQA - IQB))
2927 #define _IQ16mpyIQX(A, IQA, B, IQB) __IQxmpy(A, B, (16 + 32 - IQA - IQB))
2928 #define _IQ15mpyIQX(A, IQA, B, IQB) __IQxmpy(A, B, (15 + 32 - IQA - IQB))
2929 #define _IQ14mpyIQX(A, IQA, B, IQB) __IQxmpy(A, B, (14 + 32 - IQA - IQB))
2930 #define _IQ13mpyIQX(A, IQA, B, IQB) __IQxmpy(A, B, (13 + 32 - IQA - IQB))
2931 #define _IQ12mpyIQX(A, IQA, B, IQB) __IQxmpy(A, B, (12 + 32 - IQA - IQB))
2932 #define _IQ11mpyIQX(A, IQA, B, IQB) __IQxmpy(A, B, (11 + 32 - IQA - IQB))
2933 #define _IQ10mpyIQX(A, IQA, B, IQB) __IQxmpy(A, B, (10 + 32 - IQA - IQB))
2934 #define _IQ9mpyIQX(A, IQA, B, IQB) __IQxmpy(A, B, (9 + 32 - IQA - IQB))
2935 #define _IQ8mpyIQX(A, IQA, B, IQB) __IQxmpy(A, B, (8 + 32 - IQA - IQB))
2936 #define _IQ7mpyIQX(A, IQA, B, IQB) __IQxmpy(A, B, (7 + 32 - IQA - IQB))
2937 #define _IQ6mpyIQX(A, IQA, B, IQB) __IQxmpy(A, B, (6 + 32 - IQA - IQB))
2938 #define _IQ5mpyIQX(A, IQA, B, IQB) __IQxmpy(A, B, (5 + 32 - IQA - IQB))
2939 #define _IQ4mpyIQX(A, IQA, B, IQB) __IQxmpy(A, B, (4 + 32 - IQA - IQB))
2940 #define _IQ3mpyIQX(A, IQA, B, IQB) __IQxmpy(A, B, (3 + 32 - IQA - IQB))
2941 #define _IQ2mpyIQX(A, IQA, B, IQB) __IQxmpy(A, B, (2 + 32 - IQA - IQB))
2942 #define _IQ1mpyIQX(A, IQA, B, IQB) __IQxmpy(A, B, (1 + 32 - IQA - IQB))
2943 //---------------------------------------------------------------------------
2944 #define _IQmpyI32(A,B) ((A)*(B))
2945 #define _IQ30mpyI32(A,B) ((A)*(B))
2946 #define _IQ29mpyI32(A,B) ((A)*(B))
2947 #define _IQ28mpyI32(A,B) ((A)*(B))
2948 #define _IQ27mpyI32(A,B) ((A)*(B))
2949 #define _IQ26mpyI32(A,B) ((A)*(B))
2950 #define _IQ25mpyI32(A,B) ((A)*(B))
2951 #define _IQ24mpyI32(A,B) ((A)*(B))
2952 #define _IQ23mpyI32(A,B) ((A)*(B))
2953 #define _IQ22mpyI32(A,B) ((A)*(B))
2954 #define _IQ21mpyI32(A,B) ((A)*(B))
2955 #define _IQ20mpyI32(A,B) ((A)*(B))
2956 #define _IQ19mpyI32(A,B) ((A)*(B))
2957 #define _IQ18mpyI32(A,B) ((A)*(B))
2958 #define _IQ17mpyI32(A,B) ((A)*(B))
2959 #define _IQ16mpyI32(A,B) ((A)*(B))
2960 #define _IQ15mpyI32(A,B) ((A)*(B))
2961 #define _IQ14mpyI32(A,B) ((A)*(B))
2962 #define _IQ13mpyI32(A,B) ((A)*(B))
2963 #define _IQ12mpyI32(A,B) ((A)*(B))
2964 #define _IQ11mpyI32(A,B) ((A)*(B))
2965 #define _IQ10mpyI32(A,B) ((A)*(B))
2966 #define _IQ9mpyI32(A,B) ((A)*(B))
2967 #define _IQ8mpyI32(A,B) ((A)*(B))
2968 #define _IQ7mpyI32(A,B) ((A)*(B))
2969 #define _IQ6mpyI32(A,B) ((A)*(B))
2970 #define _IQ5mpyI32(A,B) ((A)*(B))
2971 #define _IQ4mpyI32(A,B) ((A)*(B))
2972 #define _IQ3mpyI32(A,B) ((A)*(B))
2973 #define _IQ2mpyI32(A,B) ((A)*(B))
2974 #define _IQ1mpyI32(A,B) ((A)*(B))
2975 //---------------------------------------------------------------------------
2976 extern long _IQ30mpyI32int(long A, long B);
2977 extern long _IQ29mpyI32int(long A, long B);
2978 extern long _IQ28mpyI32int(long A, long B);
2979 extern long _IQ27mpyI32int(long A, long B);
2980 extern long _IQ26mpyI32int(long A, long B);
2981 extern long _IQ25mpyI32int(long A, long B);
2982 extern long _IQ24mpyI32int(long A, long B);
2983 extern long _IQ23mpyI32int(long A, long B);
2984 extern long _IQ22mpyI32int(long A, long B);
2985 extern long _IQ21mpyI32int(long A, long B);
2986 extern long _IQ20mpyI32int(long A, long B);
2987 extern long _IQ19mpyI32int(long A, long B);
2988 extern long _IQ18mpyI32int(long A, long B);
2989 extern long _IQ17mpyI32int(long A, long B);
2990 extern long _IQ16mpyI32int(long A, long B);
2991 extern long _IQ15mpyI32int(long A, long B);
2992 extern long _IQ14mpyI32int(long A, long B);
2993 extern long _IQ13mpyI32int(long A, long B);
2994 extern long _IQ12mpyI32int(long A, long B);
2995 extern long _IQ11mpyI32int(long A, long B);
2996 extern long _IQ10mpyI32int(long A, long B);
2997 extern long _IQ9mpyI32int(long A, long B);
2998 extern long _IQ8mpyI32int(long A, long B);
2999 extern long _IQ7mpyI32int(long A, long B);
3000 extern long _IQ6mpyI32int(long A, long B);
3001 extern long _IQ5mpyI32int(long A, long B);
3002 extern long _IQ4mpyI32int(long A, long B);
3003 extern long _IQ3mpyI32int(long A, long B);
3004 extern long _IQ2mpyI32int(long A, long B);
3005 extern long _IQ1mpyI32int(long A, long B);
3006 
3007 #if GLOBAL_Q == 30
3008 #define _IQmpyI32int(A, B) _IQ30mpyI32int(A, B)
3009 #endif
3010 #if GLOBAL_Q == 29
3011 #define _IQmpyI32int(A, B) _IQ29mpyI32int(A, B)
3012 #endif
3013 #if GLOBAL_Q == 28
3014 #define _IQmpyI32int(A, B) _IQ28mpyI32int(A, B)
3015 #endif
3016 #if GLOBAL_Q == 27
3017 #define _IQmpyI32int(A, B) _IQ27mpyI32int(A, B)
3018 #endif
3019 #if GLOBAL_Q == 26
3020 #define _IQmpyI32int(A, B) _IQ26mpyI32int(A, B)
3021 #endif
3022 #if GLOBAL_Q == 25
3023 #define _IQmpyI32int(A, B) _IQ25mpyI32int(A, B)
3024 #endif
3025 #if GLOBAL_Q == 24
3026 #define _IQmpyI32int(A, B) _IQ24mpyI32int(A, B)
3027 #endif
3028 #if GLOBAL_Q == 23
3029 #define _IQmpyI32int(A, B) _IQ23mpyI32int(A, B)
3030 #endif
3031 #if GLOBAL_Q == 22
3032 #define _IQmpyI32int(A, B) _IQ22mpyI32int(A, B)
3033 #endif
3034 #if GLOBAL_Q == 21
3035 #define _IQmpyI32int(A, B) _IQ21mpyI32int(A, B)
3036 #endif
3037 #if GLOBAL_Q == 20
3038 #define _IQmpyI32int(A, B) _IQ20mpyI32int(A, B)
3039 #endif
3040 #if GLOBAL_Q == 19
3041 #define _IQmpyI32int(A, B) _IQ19mpyI32int(A, B)
3042 #endif
3043 #if GLOBAL_Q == 18
3044 #define _IQmpyI32int(A, B) _IQ18mpyI32int(A, B)
3045 #endif
3046 #if GLOBAL_Q == 17
3047 #define _IQmpyI32int(A, B) _IQ17mpyI32int(A, B)
3048 #endif
3049 #if GLOBAL_Q == 16
3050 #define _IQmpyI32int(A, B) _IQ16mpyI32int(A, B)
3051 #endif
3052 #if GLOBAL_Q == 15
3053 #define _IQmpyI32int(A, B) _IQ15mpyI32int(A, B)
3054 #endif
3055 #if GLOBAL_Q == 14
3056 #define _IQmpyI32int(A, B) _IQ14mpyI32int(A, B)
3057 #endif
3058 #if GLOBAL_Q == 13
3059 #define _IQmpyI32int(A, B) _IQ13mpyI32int(A, B)
3060 #endif
3061 #if GLOBAL_Q == 12
3062 #define _IQmpyI32int(A, B) _IQ12mpyI32int(A, B)
3063 #endif
3064 #if GLOBAL_Q == 11
3065 #define _IQmpyI32int(A, B) _IQ11mpyI32int(A, B)
3066 #endif
3067 #if GLOBAL_Q == 10
3068 #define _IQmpyI32int(A, B) _IQ10mpyI32int(A, B)
3069 #endif
3070 #if GLOBAL_Q == 9
3071 #define _IQmpyI32int(A, B) _IQ9mpyI32int(A, B)
3072 #endif
3073 #if GLOBAL_Q == 8
3074 #define _IQmpyI32int(A, B) _IQ8mpyI32int(A, B)
3075 #endif
3076 #if GLOBAL_Q == 7
3077 #define _IQmpyI32int(A, B) _IQ7mpyI32int(A, B)
3078 #endif
3079 #if GLOBAL_Q == 6
3080 #define _IQmpyI32int(A, B) _IQ6mpyI32int(A, B)
3081 #endif
3082 #if GLOBAL_Q == 5
3083 #define _IQmpyI32int(A, B) _IQ5mpyI32int(A, B)
3084 #endif
3085 #if GLOBAL_Q == 4
3086 #define _IQmpyI32int(A, B) _IQ4mpyI32int(A, B)
3087 #endif
3088 #if GLOBAL_Q == 3
3089 #define _IQmpyI32int(A, B) _IQ3mpyI32int(A, B)
3090 #endif
3091 #if GLOBAL_Q == 2
3092 #define _IQmpyI32int(A, B) _IQ2mpyI32int(A, B)
3093 #endif
3094 #if GLOBAL_Q == 1
3095 #define _IQmpyI32int(A, B) _IQ1mpyI32int(A, B)
3096 #endif
3097 //---------------------------------------------------------------------------
3098 extern long _IQ30mpyI32frac(long A, long B);
3099 extern long _IQ29mpyI32frac(long A, long B);
3100 extern long _IQ28mpyI32frac(long A, long B);
3101 extern long _IQ27mpyI32frac(long A, long B);
3102 extern long _IQ26mpyI32frac(long A, long B);
3103 extern long _IQ25mpyI32frac(long A, long B);
3104 extern long _IQ24mpyI32frac(long A, long B);
3105 extern long _IQ23mpyI32frac(long A, long B);
3106 extern long _IQ22mpyI32frac(long A, long B);
3107 extern long _IQ21mpyI32frac(long A, long B);
3108 extern long _IQ20mpyI32frac(long A, long B);
3109 extern long _IQ19mpyI32frac(long A, long B);
3110 extern long _IQ18mpyI32frac(long A, long B);
3111 extern long _IQ17mpyI32frac(long A, long B);
3112 extern long _IQ16mpyI32frac(long A, long B);
3113 extern long _IQ15mpyI32frac(long A, long B);
3114 extern long _IQ14mpyI32frac(long A, long B);
3115 extern long _IQ13mpyI32frac(long A, long B);
3116 extern long _IQ12mpyI32frac(long A, long B);
3117 extern long _IQ11mpyI32frac(long A, long B);
3118 extern long _IQ10mpyI32frac(long A, long B);
3119 extern long _IQ9mpyI32frac(long A, long B);
3120 extern long _IQ8mpyI32frac(long A, long B);
3121 extern long _IQ7mpyI32frac(long A, long B);
3122 extern long _IQ6mpyI32frac(long A, long B);
3123 extern long _IQ5mpyI32frac(long A, long B);
3124 extern long _IQ4mpyI32frac(long A, long B);
3125 extern long _IQ3mpyI32frac(long A, long B);
3126 extern long _IQ2mpyI32frac(long A, long B);
3127 extern long _IQ1mpyI32frac(long A, long B);
3128 
3129 #if GLOBAL_Q == 30
3130 #define _IQmpyI32frac(A, B) _IQ30mpyI32frac(A, B)
3131 #endif
3132 #if GLOBAL_Q == 29
3133 #define _IQmpyI32frac(A, B) _IQ29mpyI32frac(A, B)
3134 #endif
3135 #if GLOBAL_Q == 28
3136 #define _IQmpyI32frac(A, B) _IQ28mpyI32frac(A, B)
3137 #endif
3138 #if GLOBAL_Q == 27
3139 #define _IQmpyI32frac(A, B) _IQ27mpyI32frac(A, B)
3140 #endif
3141 #if GLOBAL_Q == 26
3142 #define _IQmpyI32frac(A, B) _IQ26mpyI32frac(A, B)
3143 #endif
3144 #if GLOBAL_Q == 25
3145 #define _IQmpyI32frac(A, B) _IQ25mpyI32frac(A, B)
3146 #endif
3147 #if GLOBAL_Q == 24
3148 #define _IQmpyI32frac(A, B) _IQ24mpyI32frac(A, B)
3149 #endif
3150 #if GLOBAL_Q == 23
3151 #define _IQmpyI32frac(A, B) _IQ23mpyI32frac(A, B)
3152 #endif
3153 #if GLOBAL_Q == 22
3154 #define _IQmpyI32frac(A, B) _IQ22mpyI32frac(A, B)
3155 #endif
3156 #if GLOBAL_Q == 21
3157 #define _IQmpyI32frac(A, B) _IQ21mpyI32frac(A, B)
3158 #endif
3159 #if GLOBAL_Q == 20
3160 #define _IQmpyI32frac(A, B) _IQ20mpyI32frac(A, B)
3161 #endif
3162 #if GLOBAL_Q == 19
3163 #define _IQmpyI32frac(A, B) _IQ19mpyI32frac(A, B)
3164 #endif
3165 #if GLOBAL_Q == 18
3166 #define _IQmpyI32frac(A, B) _IQ18mpyI32frac(A, B)
3167 #endif
3168 #if GLOBAL_Q == 17
3169 #define _IQmpyI32frac(A, B) _IQ17mpyI32frac(A, B)
3170 #endif
3171 #if GLOBAL_Q == 16
3172 #define _IQmpyI32frac(A, B) _IQ16mpyI32frac(A, B)
3173 #endif
3174 #if GLOBAL_Q == 15
3175 #define _IQmpyI32frac(A, B) _IQ15mpyI32frac(A, B)
3176 #endif
3177 #if GLOBAL_Q == 14
3178 #define _IQmpyI32frac(A, B) _IQ14mpyI32frac(A, B)
3179 #endif
3180 #if GLOBAL_Q == 13
3181 #define _IQmpyI32frac(A, B) _IQ13mpyI32frac(A, B)
3182 #endif
3183 #if GLOBAL_Q == 12
3184 #define _IQmpyI32frac(A, B) _IQ12mpyI32frac(A, B)
3185 #endif
3186 #if GLOBAL_Q == 11
3187 #define _IQmpyI32frac(A, B) _IQ11mpyI32frac(A, B)
3188 #endif
3189 #if GLOBAL_Q == 10
3190 #define _IQmpyI32frac(A, B) _IQ10mpyI32frac(A, B)
3191 #endif
3192 #if GLOBAL_Q == 9
3193 #define _IQmpyI32frac(A, B) _IQ9mpyI32frac(A, B)
3194 #endif
3195 #if GLOBAL_Q == 8
3196 #define _IQmpyI32frac(A, B) _IQ8mpyI32frac(A, B)
3197 #endif
3198 #if GLOBAL_Q == 7
3199 #define _IQmpyI32frac(A, B) _IQ7mpyI32frac(A, B)
3200 #endif
3201 #if GLOBAL_Q == 6
3202 #define _IQmpyI32frac(A, B) _IQ6mpyI32frac(A, B)
3203 #endif
3204 #if GLOBAL_Q == 5
3205 #define _IQmpyI32frac(A, B) _IQ5mpyI32frac(A, B)
3206 #endif
3207 #if GLOBAL_Q == 4
3208 #define _IQmpyI32frac(A, B) _IQ4mpyI32frac(A, B)
3209 #endif
3210 #if GLOBAL_Q == 3
3211 #define _IQmpyI32frac(A, B) _IQ3mpyI32frac(A, B)
3212 #endif
3213 #if GLOBAL_Q == 2
3214 #define _IQmpyI32frac(A, B) _IQ2mpyI32frac(A, B)
3215 #endif
3216 #if GLOBAL_Q == 1
3217 #define _IQmpyI32frac(A, B) _IQ1mpyI32frac(A, B)
3218 #endif
3219 //---------------------------------------------------------------------------
3220 extern long _IQ30mag(long A, long B);
3221 extern long _IQ29mag(long A, long B);
3222 extern long _IQ28mag(long A, long B);
3223 extern long _IQ27mag(long A, long B);
3224 extern long _IQ26mag(long A, long B);
3225 extern long _IQ25mag(long A, long B);
3226 extern long _IQ24mag(long A, long B);
3227 extern long _IQ23mag(long A, long B);
3228 extern long _IQ22mag(long A, long B);
3229 extern long _IQ21mag(long A, long B);
3230 extern long _IQ20mag(long A, long B);
3231 extern long _IQ19mag(long A, long B);
3232 extern long _IQ18mag(long A, long B);
3233 extern long _IQ17mag(long A, long B);
3234 extern long _IQ16mag(long A, long B);
3235 extern long _IQ15mag(long A, long B);
3236 extern long _IQ14mag(long A, long B);
3237 extern long _IQ13mag(long A, long B);
3238 extern long _IQ12mag(long A, long B);
3239 extern long _IQ11mag(long A, long B);
3240 extern long _IQ10mag(long A, long B);
3241 extern long _IQ9mag(long A, long B);
3242 extern long _IQ8mag(long A, long B);
3243 extern long _IQ7mag(long A, long B);
3244 extern long _IQ6mag(long A, long B);
3245 extern long _IQ5mag(long A, long B);
3246 extern long _IQ4mag(long A, long B);
3247 extern long _IQ3mag(long A, long B);
3248 extern long _IQ2mag(long A, long B);
3249 extern long _IQ1mag(long A, long B);
3250 
3251 #if GLOBAL_Q == 30
3252 #define _IQmag(A, B) _IQ30mag(A, B)
3253 #endif
3254 #if GLOBAL_Q == 29
3255 #define _IQmag(A, B) _IQ29mag(A, B)
3256 #endif
3257 #if GLOBAL_Q == 28
3258 #define _IQmag(A, B) _IQ28mag(A, B)
3259 #endif
3260 #if GLOBAL_Q == 27
3261 #define _IQmag(A, B) _IQ27mag(A, B)
3262 #endif
3263 #if GLOBAL_Q == 26
3264 #define _IQmag(A, B) _IQ26mag(A, B)
3265 #endif
3266 #if GLOBAL_Q == 25
3267 #define _IQmag(A, B) _IQ25mag(A, B)
3268 #endif
3269 #if GLOBAL_Q == 24
3270 #define _IQmag(A, B) _IQ24mag(A, B)
3271 #endif
3272 #if GLOBAL_Q == 23
3273 #define _IQmag(A, B) _IQ23mag(A, B)
3274 #endif
3275 #if GLOBAL_Q == 22
3276 #define _IQmag(A, B) _IQ22mag(A, B)
3277 #endif
3278 #if GLOBAL_Q == 21
3279 #define _IQmag(A, B) _IQ21mag(A, B)
3280 #endif
3281 #if GLOBAL_Q == 20
3282 #define _IQmag(A, B) _IQ20mag(A, B)
3283 #endif
3284 #if GLOBAL_Q == 19
3285 #define _IQmag(A, B) _IQ19mag(A, B)
3286 #endif
3287 #if GLOBAL_Q == 18
3288 #define _IQmag(A, B) _IQ18mag(A, B)
3289 #endif
3290 #if GLOBAL_Q == 17
3291 #define _IQmag(A, B) _IQ17mag(A, B)
3292 #endif
3293 #if GLOBAL_Q == 16
3294 #define _IQmag(A, B) _IQ16mag(A, B)
3295 #endif
3296 #if GLOBAL_Q == 15
3297 #define _IQmag(A, B) _IQ15mag(A, B)
3298 #endif
3299 #if GLOBAL_Q == 14
3300 #define _IQmag(A, B) _IQ14mag(A, B)
3301 #endif
3302 #if GLOBAL_Q == 13
3303 #define _IQmag(A, B) _IQ13mag(A, B)
3304 #endif
3305 #if GLOBAL_Q == 12
3306 #define _IQmag(A, B) _IQ12mag(A, B)
3307 #endif
3308 #if GLOBAL_Q == 11
3309 #define _IQmag(A, B) _IQ11mag(A, B)
3310 #endif
3311 #if GLOBAL_Q == 10
3312 #define _IQmag(A, B) _IQ10mag(A, B)
3313 #endif
3314 #if GLOBAL_Q == 9
3315 #define _IQmag(A, B) _IQ9mag(A, B)
3316 #endif
3317 #if GLOBAL_Q == 8
3318 #define _IQmag(A, B) _IQ8mag(A, B)
3319 #endif
3320 #if GLOBAL_Q == 7
3321 #define _IQmag(A, B) _IQ7mag(A, B)
3322 #endif
3323 #if GLOBAL_Q == 6
3324 #define _IQmag(A, B) _IQ6mag(A, B)
3325 #endif
3326 #if GLOBAL_Q == 5
3327 #define _IQmag(A, B) _IQ5mag(A, B)
3328 #endif
3329 #if GLOBAL_Q == 4
3330 #define _IQmag(A, B) _IQ4mag(A, B)
3331 #endif
3332 #if GLOBAL_Q == 3
3333 #define _IQmag(A, B) _IQ3mag(A, B)
3334 #endif
3335 #if GLOBAL_Q == 2
3336 #define _IQmag(A, B) _IQ2mag(A, B)
3337 #endif
3338 #if GLOBAL_Q == 1
3339 #define _IQmag(A, B) _IQ1mag(A, B)
3340 #endif
3341 //---------------------------------------------------------------------------
3342 extern long _atoIQN(const char *A, long q_value);
3343 #define _atoIQ(A) _atoIQN(A, GLOBAL_Q)
3344 #define _atoIQ30(A) _atoIQN(A, 30)
3345 #define _atoIQ29(A) _atoIQN(A, 29)
3346 #define _atoIQ28(A) _atoIQN(A, 28)
3347 #define _atoIQ27(A) _atoIQN(A, 27)
3348 #define _atoIQ26(A) _atoIQN(A, 26)
3349 #define _atoIQ25(A) _atoIQN(A, 25)
3350 #define _atoIQ24(A) _atoIQN(A, 24)
3351 #define _atoIQ23(A) _atoIQN(A, 23)
3352 #define _atoIQ22(A) _atoIQN(A, 22)
3353 #define _atoIQ21(A) _atoIQN(A, 21)
3354 #define _atoIQ20(A) _atoIQN(A, 20)
3355 #define _atoIQ19(A) _atoIQN(A, 19)
3356 #define _atoIQ18(A) _atoIQN(A, 18)
3357 #define _atoIQ17(A) _atoIQN(A, 17)
3358 #define _atoIQ16(A) _atoIQN(A, 16)
3359 #define _atoIQ15(A) _atoIQN(A, 15)
3360 #define _atoIQ14(A) _atoIQN(A, 14)
3361 #define _atoIQ13(A) _atoIQN(A, 13)
3362 #define _atoIQ12(A) _atoIQN(A, 12)
3363 #define _atoIQ11(A) _atoIQN(A, 11)
3364 #define _atoIQ10(A) _atoIQN(A, 10)
3365 #define _atoIQ9(A) _atoIQN(A, 9)
3366 #define _atoIQ8(A) _atoIQN(A, 8)
3367 #define _atoIQ7(A) _atoIQN(A, 7)
3368 #define _atoIQ6(A) _atoIQN(A, 6)
3369 #define _atoIQ5(A) _atoIQN(A, 5)
3370 #define _atoIQ4(A) _atoIQN(A, 4)
3371 #define _atoIQ3(A) _atoIQN(A, 3)
3372 #define _atoIQ2(A) _atoIQN(A, 2)
3373 #define _atoIQ1(A) _atoIQN(A, 1)
3374 //---------------------------------------------------------------------------
3375 extern int __IQNtoa(char *A, const char *B, long C, int D);
3376 extern int _IQ30toa(char *A, const char *B, long C);
3377 extern int _IQ29toa(char *A, const char *B, long C);
3378 extern int _IQ28toa(char *A, const char *B, long C);
3379 extern int _IQ27toa(char *A, const char *B, long C);
3380 extern int _IQ26toa(char *A, const char *B, long C);
3381 extern int _IQ25toa(char *A, const char *B, long C);
3382 extern int _IQ24toa(char *A, const char *B, long C);
3383 extern int _IQ23toa(char *A, const char *B, long C);
3384 extern int _IQ22toa(char *A, const char *B, long C);
3385 extern int _IQ21toa(char *A, const char *B, long C);
3386 extern int _IQ20toa(char *A, const char *B, long C);
3387 extern int _IQ19toa(char *A, const char *B, long C);
3388 extern int _IQ18toa(char *A, const char *B, long C);
3389 extern int _IQ17toa(char *A, const char *B, long C);
3390 extern int _IQ16toa(char *A, const char *B, long C);
3391 extern int _IQ15toa(char *A, const char *B, long C);
3392 extern int _IQ14toa(char *A, const char *B, long C);
3393 extern int _IQ13toa(char *A, const char *B, long C);
3394 extern int _IQ12toa(char *A, const char *B, long C);
3395 extern int _IQ11toa(char *A, const char *B, long C);
3396 extern int _IQ10toa(char *A, const char *B, long C);
3397 extern int _IQ9toa(char *A, const char *B, long C);
3398 extern int _IQ8toa(char *A, const char *B, long C);
3399 extern int _IQ7toa(char *A, const char *B, long C);
3400 extern int _IQ6toa(char *A, const char *B, long C);
3401 extern int _IQ5toa(char *A, const char *B, long C);
3402 extern int _IQ4toa(char *A, const char *B, long C);
3403 extern int _IQ3toa(char *A, const char *B, long C);
3404 extern int _IQ2toa(char *A, const char *B, long C);
3405 extern int _IQ1toa(char *A, const char *B, long C);
3406 
3407 
3408 #define _IQ30toa(A, B, C) __IQNtoa(A, B, C, 30);
3409 #define _IQ29toa(A, B, C) __IQNtoa(A, B, C, 29);
3410 #define _IQ28toa(A, B, C) __IQNtoa(A, B, C, 28);
3411 #define _IQ27toa(A, B, C) __IQNtoa(A, B, C, 27);
3412 #define _IQ26toa(A, B, C) __IQNtoa(A, B, C, 26);
3413 #define _IQ25toa(A, B, C) __IQNtoa(A, B, C, 25);
3414 #define _IQ24toa(A, B, C) __IQNtoa(A, B, C, 24);
3415 #define _IQ23toa(A, B, C) __IQNtoa(A, B, C, 23);
3416 #define _IQ21toa(A, B, C) __IQNtoa(A, B, C, 21);
3417 #define _IQ22toa(A, B, C) __IQNtoa(A, B, C, 22);
3418 #define _IQ20toa(A, B, C) __IQNtoa(A, B, C, 20);
3419 #define _IQ19toa(A, B, C) __IQNtoa(A, B, C, 19);
3420 #define _IQ18toa(A, B, C) __IQNtoa(A, B, C, 18);
3421 #define _IQ17toa(A, B, C) __IQNtoa(A, B, C, 17);
3422 #define _IQ16toa(A, B, C) __IQNtoa(A, B, C, 16);
3423 #define _IQ15toa(A, B, C) __IQNtoa(A, B, C, 15);
3424 #define _IQ14toa(A, B, C) __IQNtoa(A, B, C, 14);
3425 #define _IQ13toa(A, B, C) __IQNtoa(A, B, C, 13);
3426 #define _IQ12toa(A, B, C) __IQNtoa(A, B, C, 12);
3427 #define _IQ11toa(A, B, C) __IQNtoa(A, B, C, 11);
3428 #define _IQ10toa(A, B, C) __IQNtoa(A, B, C, 10);
3429 #define _IQ9toa(A, B, C) __IQNtoa(A, B, C, 9);
3430 #define _IQ8toa(A, B, C) __IQNtoa(A, B, C, 8);
3431 #define _IQ7toa(A, B, C) __IQNtoa(A, B, C, 7);
3432 #define _IQ6toa(A, B, C) __IQNtoa(A, B, C, 6);
3433 #define _IQ5toa(A, B, C) __IQNtoa(A, B, C, 5);
3434 #define _IQ4toa(A, B, C) __IQNtoa(A, B, C, 4);
3435 #define _IQ3toa(A, B, C) __IQNtoa(A, B, C, 3);
3436 #define _IQ2toa(A, B, C) __IQNtoa(A, B, C, 2);
3437 #define _IQ1toa(A, B, C) __IQNtoa(A, B, C, 1);
3438 
3439 
3440 #if GLOBAL_Q == 30
3441 #define _IQtoa(A, B, C) __IQNtoa(A, B, C, 30)
3442 #endif
3443 #if GLOBAL_Q == 29
3444 #define _IQtoa(A, B, C) __IQNtoa(A, B, C, 29)
3445 #endif
3446 #if GLOBAL_Q == 28
3447 #define _IQtoa(A, B, C) __IQNtoa(A, B, C, 28)
3448 #endif
3449 #if GLOBAL_Q == 27
3450 #define _IQtoa(A, B, C) __IQNtoa(A, B, C, 27)
3451 #endif
3452 #if GLOBAL_Q == 26
3453 #define _IQtoa(A, B, C) __IQNtoa(A, B, C, 26)
3454 #endif
3455 #if GLOBAL_Q == 25
3456 #define _IQtoa(A, B, C) __IQNtoa(A, B, C, 25)
3457 #endif
3458 #if GLOBAL_Q == 24
3459 #define _IQtoa(A, B, C) __IQNtoa(A, B, C, 24)
3460 #endif
3461 #if GLOBAL_Q == 23
3462 #define _IQtoa(A, B, C) __IQNtoa(A, B, C, 23)
3463 #endif
3464 #if GLOBAL_Q == 22
3465 #define _IQtoa(A, B, C) __IQNtoa(A, B, C, 22)
3466 #endif
3467 #if GLOBAL_Q == 21
3468 #define _IQtoa(A, B, C) __IQNtoa(A, B, C, 21)
3469 #endif
3470 #if GLOBAL_Q == 20
3471 #define _IQtoa(A, B, C) __IQNtoa(A, B, C, 20)
3472 #endif
3473 #if GLOBAL_Q == 19
3474 #define _IQtoa(A, B, C) __IQNtoa(A, B, C, 19)
3475 #endif
3476 #if GLOBAL_Q == 18
3477 #define _IQtoa(A, B, C) __IQNtoa(A, B, C, 18)
3478 #endif
3479 #if GLOBAL_Q == 17
3480 #define _IQtoa(A, B, C) __IQNtoa(A, B, C, 17)
3481 #endif
3482 #if GLOBAL_Q == 16
3483 #define _IQtoa(A, B, C) __IQNtoa(A, B, C, 16)
3484 #endif
3485 #if GLOBAL_Q == 15
3486 #define _IQtoa(A, B, C) __IQNtoa(A, B, C, 15)
3487 #endif
3488 #if GLOBAL_Q == 14
3489 #define _IQtoa(A, B, C) __IQNtoa(A, B, C, 14)
3490 #endif
3491 #if GLOBAL_Q == 13
3492 #define _IQtoa(A, B, C) __IQNtoa(A, B, C, 13)
3493 #endif
3494 #if GLOBAL_Q == 12
3495 #define _IQtoa(A, B, C) __IQNtoa(A, B, C, 12)
3496 #endif
3497 #if GLOBAL_Q == 11
3498 #define _IQtoa(A, B, C) __IQNtoa(A, B, C, 11)
3499 #endif
3500 #if GLOBAL_Q == 10
3501 #define _IQtoa(A, B, C) __IQNtoa(A, B, C, 10)
3502 #endif
3503 #if GLOBAL_Q == 9
3504 #define _IQtoa(A, B, C) __IQNtoa(A, B, C, 9)
3505 #endif
3506 #if GLOBAL_Q == 8
3507 #define _IQtoa(A, B, C) __IQNtoa(A, B, C, 8)
3508 #endif
3509 #if GLOBAL_Q == 7
3510 #define _IQtoa(A, B, C) __IQNtoa(A, B, C, 7)
3511 #endif
3512 #if GLOBAL_Q == 6
3513 #define _IQtoa(A, B, C) __IQNtoa(A, B, C, 6)
3514 #endif
3515 #if GLOBAL_Q == 5
3516 #define _IQtoa(A, B, C) __IQNtoa(A, B, C, 5)
3517 #endif
3518 #if GLOBAL_Q == 4
3519 #define _IQtoa(A, B, C) __IQNtoa(A, B, C, 4)
3520 #endif
3521 #if GLOBAL_Q == 3
3522 #define _IQtoa(A, B, C) __IQNtoa(A, B, C, 3)
3523 #endif
3524 #if GLOBAL_Q == 2
3525 #define _IQtoa(A, B, C) __IQNtoa(A, B, C, 2)
3526 #endif
3527 #if GLOBAL_Q == 1
3528 #define _IQtoa(A, B, C) __IQNtoa(A, B, C, 1)
3529 #endif
3530 //---------------------------------------------------------------------------
3531 #define _IQabs(A) labs(A)
3532 #define _IQ30abs(A) labs(A)
3533 #define _IQ29abs(A) labs(A)
3534 #define _IQ28abs(A) labs(A)
3535 #define _IQ27abs(A) labs(A)
3536 #define _IQ26abs(A) labs(A)
3537 #define _IQ25abs(A) labs(A)
3538 #define _IQ24abs(A) labs(A)
3539 #define _IQ23abs(A) labs(A)
3540 #define _IQ22abs(A) labs(A)
3541 #define _IQ21abs(A) labs(A)
3542 #define _IQ20abs(A) labs(A)
3543 #define _IQ19abs(A) labs(A)
3544 #define _IQ18abs(A) labs(A)
3545 #define _IQ17abs(A) labs(A)
3546 #define _IQ16abs(A) labs(A)
3547 #define _IQ15abs(A) labs(A)
3548 #define _IQ14abs(A) labs(A)
3549 #define _IQ13abs(A) labs(A)
3550 #define _IQ12abs(A) labs(A)
3551 #define _IQ11abs(A) labs(A)
3552 #define _IQ10abs(A) labs(A)
3553 #define _IQ9abs(A) labs(A)
3554 #define _IQ8abs(A) labs(A)
3555 #define _IQ7abs(A) labs(A)
3556 #define _IQ6abs(A) labs(A)
3557 #define _IQ5abs(A) labs(A)
3558 #define _IQ4abs(A) labs(A)
3559 #define _IQ3abs(A) labs(A)
3560 #define _IQ2abs(A) labs(A)
3561 #define _IQ1abs(A) labs(A)
3562 //###########################################################################
3563 #else // MATH_TYPE == FLOAT_MATH
3564 //###########################################################################
3565 // If FLOAT_MATH is used, the IQmath library function are replaced by
3566 // equivalent floating point operations:
3567 //===========================================================================
3568 typedef float _iq;
3569 typedef float _iq30;
3570 typedef float _iq29;
3571 typedef float _iq28;
3572 typedef float _iq27;
3573 typedef float _iq26;
3574 typedef float _iq25;
3575 typedef float _iq24;
3576 typedef float _iq23;
3577 typedef float _iq22;
3578 typedef float _iq21;
3579 typedef float _iq20;
3580 typedef float _iq19;
3581 typedef float _iq18;
3582 typedef float _iq17;
3583 typedef float _iq16;
3584 typedef float _iq15;
3585 typedef float _iq14;
3586 typedef float _iq13;
3587 typedef float _iq12;
3588 typedef float _iq11;
3589 typedef float _iq10;
3590 typedef float _iq9;
3591 typedef float _iq8;
3592 typedef float _iq7;
3593 typedef float _iq6;
3594 typedef float _iq5;
3595 typedef float _iq4;
3596 typedef float _iq3;
3597 typedef float _iq2;
3598 typedef float _iq1;
3599 
3600 //---------------------------------------------------------------------------
3601 #define _IQmpy2(A) ((A)*2.0)
3602 #define _IQmpy4(A) ((A)*4.0)
3603 #define _IQmpy8(A) ((A)*8.0)
3604 #define _IQmpy16(A) ((A)*16.0)
3605 #define _IQmpy32(A) ((A)*32.0)
3606 #define _IQmpy64(A) ((A)*64.0)
3607 
3608 #define _IQdiv2(A) ((A)*0.5)
3609 #define _IQdiv4(A) ((A)*0.25)
3610 #define _IQdiv8(A) ((A)*0.125)
3611 #define _IQdiv16(A) ((A)*0.0625)
3612 #define _IQdiv32(A) ((A)*0.03125)
3613 #define _IQdiv64(A) ((A)*0.015625)
3614 //---------------------------------------------------------------------------
3615 #define _IQ(A) (A)
3616 #define _IQ30(A) (A)
3617 #define _IQ29(A) (A)
3618 #define _IQ28(A) (A)
3619 #define _IQ27(A) (A)
3620 #define _IQ26(A) (A)
3621 #define _IQ25(A) (A)
3622 #define _IQ24(A) (A)
3623 #define _IQ23(A) (A)
3624 #define _IQ22(A) (A)
3625 #define _IQ21(A) (A)
3626 #define _IQ20(A) (A)
3627 #define _IQ19(A) (A)
3628 #define _IQ18(A) (A)
3629 #define _IQ17(A) (A)
3630 #define _IQ16(A) (A)
3631 #define _IQ15(A) (A)
3632 #define _IQ14(A) (A)
3633 #define _IQ13(A) (A)
3634 #define _IQ12(A) (A)
3635 #define _IQ10(A) (A)
3636 #define _IQ9(A) (A)
3637 #define _IQ8(A) (A)
3638 #define _IQ7(A) (A)
3639 #define _IQ6(A) (A)
3640 #define _IQ5(A) (A)
3641 #define _IQ4(A) (A)
3642 #define _IQ3(A) (A)
3643 #define _IQ2(A) (A)
3644 #define _IQ1(A) (A)
3645 //---------------------------------------------------------------------------
3646 #define _IQtoF(A) (A)
3647 #define _IQ30toF(A) (A)
3648 #define _IQ29toF(A) (A)
3649 #define _IQ28toF(A) (A)
3650 #define _IQ27toF(A) (A)
3651 #define _IQ26toF(A) (A)
3652 #define _IQ25toF(A) (A)
3653 #define _IQ24toF(A) (A)
3654 #define _IQ23toF(A) (A)
3655 #define _IQ22toF(A) (A)
3656 #define _IQ21toF(A) (A)
3657 #define _IQ20toF(A) (A)
3658 #define _IQ19toF(A) (A)
3659 #define _IQ18toF(A) (A)
3660 #define _IQ17toF(A) (A)
3661 #define _IQ16toF(A) (A)
3662 #define _IQ15toF(A) (A)
3663 #define _IQ14toF(A) (A)
3664 #define _IQ13toF(A) (A)
3665 #define _IQ12toF(A) (A)
3666 #define _IQ11toF(A) (A)
3667 #define _IQ10toF(A) (A)
3668 #define _IQ9toF(A) (A)
3669 #define _IQ8toF(A) (A)
3670 #define _IQ7toF(A) (A)
3671 #define _IQ6toF(A) (A)
3672 #define _IQ5toF(A) (A)
3673 #define _IQ4toF(A) (A)
3674 #define _IQ3toF(A) (A)
3675 #define _IQ2toF(A) (A)
3676 #define _IQ1toF(A) (A)
3677 //---------------------------------------------------------------------------
3678 //extern float _satf(float A, float Pos, float Neg);
3679 //#define _IQsat(A, Pos, Neg) _satf(A, Pos, Neg)
3680 //
3681 
3682 // TODO fix this so it uses the correct math tools like the statement below
3683 #define _IQsat(A, Pos, Neg) (fmaxf(((fminf((A),(Pos)))),(Neg)))
3684 
3685 // The following define requires codegen tools V5.2.2 or later
3686 //
3687 //#define _IQsat(A, Pos, Neg) (__fmax(((__fmin((A),(Pos)))),(Neg)))
3688 //---------------------------------------------------------------------------
3689 #define _IQtoIQ30(A) (A)
3690 #define _IQtoIQ29(A) (A)
3691 #define _IQtoIQ28(A) (A)
3692 #define _IQtoIQ27(A) (A)
3693 #define _IQtoIQ26(A) (A)
3694 #define _IQtoIQ25(A) (A)
3695 #define _IQtoIQ24(A) (A)
3696 #define _IQtoIQ23(A) (A)
3697 #define _IQtoIQ22(A) (A)
3698 #define _IQtoIQ21(A) (A)
3699 #define _IQtoIQ20(A) (A)
3700 #define _IQtoIQ19(A) (A)
3701 #define _IQtoIQ18(A) (A)
3702 #define _IQtoIQ17(A) (A)
3703 #define _IQtoIQ16(A) (A)
3704 #define _IQtoIQ15(A) (A)
3705 #define _IQtoIQ14(A) (A)
3706 #define _IQtoIQ13(A) (A)
3707 #define _IQtoIQ12(A) (A)
3708 #define _IQtoIQ11(A) (A)
3709 #define _IQtoIQ10(A) (A)
3710 #define _IQtoIQ9(A) (A)
3711 #define _IQtoIQ8(A) (A)
3712 #define _IQtoIQ7(A) (A)
3713 #define _IQtoIQ6(A) (A)
3714 #define _IQtoIQ5(A) (A)
3715 #define _IQtoIQ4(A) (A)
3716 #define _IQtoIQ3(A) (A)
3717 #define _IQtoIQ2(A) (A)
3718 #define _IQtoIQ1(A) (A)
3719 //---------------------------------------------------------------------------
3720 #define _IQ30toIQ(A) (A)
3721 #define _IQ29toIQ(A) (A)
3722 #define _IQ28toIQ(A) (A)
3723 #define _IQ27toIQ(A) (A)
3724 #define _IQ26toIQ(A) (A)
3725 #define _IQ25toIQ(A) (A)
3726 #define _IQ24toIQ(A) (A)
3727 #define _IQ23toIQ(A) (A)
3728 #define _IQ22toIQ(A) (A)
3729 #define _IQ21toIQ(A) (A)
3730 #define _IQ20toIQ(A) (A)
3731 #define _IQ19toIQ(A) (A)
3732 #define _IQ18toIQ(A) (A)
3733 #define _IQ17toIQ(A) (A)
3734 #define _IQ16toIQ(A) (A)
3735 #define _IQ15toIQ(A) (A)
3736 #define _IQ14toIQ(A) (A)
3737 #define _IQ13toIQ(A) (A)
3738 #define _IQ12toIQ(A) (A)
3739 #define _IQ11toIQ(A) (A)
3740 #define _IQ10toIQ(A) (A)
3741 #define _IQ9toIQ(A) (A)
3742 #define _IQ8toIQ(A) (A)
3743 #define _IQ7toIQ(A) (A)
3744 #define _IQ6toIQ(A) (A)
3745 #define _IQ5toIQ(A) (A)
3746 #define _IQ4toIQ(A) (A)
3747 #define _IQ3toIQ(A) (A)
3748 #define _IQ2toIQ(A) (A)
3749 #define _IQ1toIQ(A) (A)
3750 //---------------------------------------------------------------------------
3751 #define _IQtoQ15(A) (int) ((A) * 32768.0)
3752 #define _IQtoQ14(A) (int) ((A) * 16384.0)
3753 #define _IQtoQ13(A) (int) ((A) * 8192.0)
3754 #define _IQtoQ12(A) (int) ((A) * 4096.0)
3755 #define _IQtoQ11(A) (int) ((A) * 2048.0)
3756 #define _IQtoQ10(A) (int) ((A) * 1024.0)
3757 #define _IQtoQ9(A) (int) ((A) * 512.0)
3758 #define _IQtoQ8(A) (int) ((A) * 256.0)
3759 #define _IQtoQ7(A) (int) ((A) * 128.0)
3760 #define _IQtoQ6(A) (int) ((A) * 64.0)
3761 #define _IQtoQ5(A) (int) ((A) * 32.0)
3762 #define _IQtoQ4(A) (int) ((A) * 16.0)
3763 #define _IQtoQ3(A) (int) ((A) * 8.0)
3764 #define _IQtoQ2(A) (int) ((A) * 4.0)
3765 #define _IQtoQ1(A) (int) ((A) * 2.0)
3766 
3767 //---------------------------------------------------------------------------
3768 #define _Q15toIQ(A) (((float) (A)) * 0.000030518)
3769 #define _Q14toIQ(A) (((float) (A)) * 0.000061035)
3770 #define _Q13toIQ(A) (((float) (A)) * 0.000122070)
3771 #define _Q12toIQ(A) (((float) (A)) * 0.000244141)
3772 #define _Q11toIQ(A) (((float) (A)) * 0.000488281)
3773 #define _Q10toIQ(A) (((float) (A)) * 0.000976563)
3774 #define _Q9toIQ(A) (((float) (A)) * 0.001953125)
3775 #define _Q8toIQ(A) (((float) (A)) * 0.003906250)
3776 #define _Q7toIQ(A) (((float) (A)) * 0.007812500)
3777 #define _Q6toIQ(A) (((float) (A)) * 0.015625000)
3778 #define _Q5toIQ(A) (((float) (A)) * 0.031250000)
3779 #define _Q4toIQ(A) (((float) (A)) * 0.062500000)
3780 #define _Q3toIQ(A) (((float) (A)) * 0.125000000)
3781 #define _Q2toIQ(A) (((float) (A)) * 0.250000000)
3782 #define _Q1toIQ(A) (((float) (A)) * 0.500000000)
3783 //---------------------------------------------------------------------------
3784 #define _IQmpy(A,B) ((A) * (B))
3785 #define _IQ30mpy(A,B) ((A) * (B))
3786 #define _IQ29mpy(A,B) ((A) * (B))
3787 #define _IQ28mpy(A,B) ((A) * (B))
3788 #define _IQ27mpy(A,B) ((A) * (B))
3789 #define _IQ26mpy(A,B) ((A) * (B))
3790 #define _IQ25mpy(A,B) ((A) * (B))
3791 #define _IQ24mpy(A,B) ((A) * (B))
3792 #define _IQ23mpy(A,B) ((A) * (B))
3793 #define _IQ22mpy(A,B) ((A) * (B))
3794 #define _IQ21mpy(A,B) ((A) * (B))
3795 #define _IQ20mpy(A,B) ((A) * (B))
3796 #define _IQ19mpy(A,B) ((A) * (B))
3797 #define _IQ18mpy(A,B) ((A) * (B))
3798 #define _IQ17mpy(A,B) ((A) * (B))
3799 #define _IQ16mpy(A,B) ((A) * (B))
3800 #define _IQ15mpy(A,B) ((A) * (B))
3801 #define _IQ14mpy(A,B) ((A) * (B))
3802 #define _IQ13mpy(A,B) ((A) * (B))
3803 #define _IQ12mpy(A,B) ((A) * (B))
3804 #define _IQ11mpy(A,B) ((A) * (B))
3805 #define _IQ10mpy(A,B) ((A) * (B))
3806 #define _IQ9mpy(A,B) ((A) * (B))
3807 #define _IQ8mpy(A,B) ((A) * (B))
3808 #define _IQ7mpy(A,B) ((A) * (B))
3809 #define _IQ6mpy(A,B) ((A) * (B))
3810 #define _IQ5mpy(A,B) ((A) * (B))
3811 #define _IQ4mpy(A,B) ((A) * (B))
3812 #define _IQ3mpy(A,B) ((A) * (B))
3813 #define _IQ2mpy(A,B) ((A) * (B))
3814 #define _IQ1mpy(A,B) ((A) * (B))
3815 //---------------------------------------------------------------------------
3816 #define _IQrmpy(A,B) ((A) * (B))
3817 #define _IQ30rmpy(A,B) ((A) * (B))
3818 #define _IQ29rmpy(A,B) ((A) * (B))
3819 #define _IQ28rmpy(A,B) ((A) * (B))
3820 #define _IQ27rmpy(A,B) ((A) * (B))
3821 #define _IQ26rmpy(A,B) ((A) * (B))
3822 #define _IQ25rmpy(A,B) ((A) * (B))
3823 #define _IQ24rmpy(A,B) ((A) * (B))
3824 #define _IQ23rmpy(A,B) ((A) * (B))
3825 #define _IQ22rmpy(A,B) ((A) * (B))
3826 #define _IQ21rmpy(A,B) ((A) * (B))
3827 #define _IQ20rmpy(A,B) ((A) * (B))
3828 #define _IQ19rmpy(A,B) ((A) * (B))
3829 #define _IQ18rmpy(A,B) ((A) * (B))
3830 #define _IQ17rmpy(A,B) ((A) * (B))
3831 #define _IQ16rmpy(A,B) ((A) * (B))
3832 #define _IQ15rmpy(A,B) ((A) * (B))
3833 #define _IQ14rmpy(A,B) ((A) * (B))
3834 #define _IQ13rmpy(A,B) ((A) * (B))
3835 #define _IQ12rmpy(A,B) ((A) * (B))
3836 #define _IQ11rmpy(A,B) ((A) * (B))
3837 #define _IQ10rmpy(A,B) ((A) * (B))
3838 #define _IQ9rmpy(A,B) ((A) * (B))
3839 #define _IQ8rmpy(A,B) ((A) * (B))
3840 #define _IQ7rmpy(A,B) ((A) * (B))
3841 #define _IQ6rmpy(A,B) ((A) * (B))
3842 #define _IQ5rmpy(A,B) ((A) * (B))
3843 #define _IQ4rmpy(A,B) ((A) * (B))
3844 #define _IQ3rmpy(A,B) ((A) * (B))
3845 #define _IQ2rmpy(A,B) ((A) * (B))
3846 #define _IQ1rmpy(A,B) ((A) * (B))
3847 //---------------------------------------------------------------------------
3848 #define _IQrsmpy(A,B) ((A) * (B))
3849 #define _IQ30rsmpy(A,B) ((A) * (B))
3850 #define _IQ29rsmpy(A,B) ((A) * (B))
3851 #define _IQ28rsmpy(A,B) ((A) * (B))
3852 #define _IQ27rsmpy(A,B) ((A) * (B))
3853 #define _IQ26rsmpy(A,B) ((A) * (B))
3854 #define _IQ25rsmpy(A,B) ((A) * (B))
3855 #define _IQ24rsmpy(A,B) ((A) * (B))
3856 #define _IQ23rsmpy(A,B) ((A) * (B))
3857 #define _IQ22rsmpy(A,B) ((A) * (B))
3858 #define _IQ21rsmpy(A,B) ((A) * (B))
3859 #define _IQ20rsmpy(A,B) ((A) * (B))
3860 #define _IQ19rsmpy(A,B) ((A) * (B))
3861 #define _IQ18rsmpy(A,B) ((A) * (B))
3862 #define _IQ17rsmpy(A,B) ((A) * (B))
3863 #define _IQ16rsmpy(A,B) ((A) * (B))
3864 #define _IQ15rsmpy(A,B) ((A) * (B))
3865 #define _IQ14rsmpy(A,B) ((A) * (B))
3866 #define _IQ13rsmpy(A,B) ((A) * (B))
3867 #define _IQ12rsmpy(A,B) ((A) * (B))
3868 #define _IQ11rsmpy(A,B) ((A) * (B))
3869 #define _IQ10rsmpy(A,B) ((A) * (B))
3870 #define _IQ9rsmpy(A,B) ((A) * (B))
3871 #define _IQ8rsmpy(A,B) ((A) * (B))
3872 #define _IQ7rsmpy(A,B) ((A) * (B))
3873 #define _IQ6rsmpy(A,B) ((A) * (B))
3874 #define _IQ5rsmpy(A,B) ((A) * (B))
3875 #define _IQ4rsmpy(A,B) ((A) * (B))
3876 #define _IQ3rsmpy(A,B) ((A) * (B))
3877 #define _IQ2rsmpy(A,B) ((A) * (B))
3878 #define _IQ1rsmpy(A,B) ((A) * (B))
3879 //---------------------------------------------------------------------------
3880 #define _IQdiv(A,B) ((float)(A) / (float)(B))
3881 #define _IQ30div(A,B) ((float)(A) / (float)(B))
3882 #define _IQ29div(A,B) ((float)(A) / (float)(B))
3883 #define _IQ28div(A,B) ((float)(A) / (float)(B))
3884 #define _IQ27div(A,B) ((float)(A) / (float)(B))
3885 #define _IQ26div(A,B) ((float)(A) / (float)(B))
3886 #define _IQ25div(A,B) ((float)(A) / (float)(B))
3887 #define _IQ24div(A,B) ((float)(A) / (float)(B))
3888 #define _IQ23div(A,B) ((float)(A) / (float)(B))
3889 #define _IQ22div(A,B) ((float)(A) / (float)(B))
3890 #define _IQ21div(A,B) ((float)(A) / (float)(B))
3891 #define _IQ20div(A,B) ((float)(A) / (float)(B))
3892 #define _IQ19div(A,B) ((float)(A) / (float)(B))
3893 #define _IQ18div(A,B) ((float)(A) / (float)(B))
3894 #define _IQ17div(A,B) ((float)(A) / (float)(B))
3895 #define _IQ16div(A,B) ((float)(A) / (float)(B))
3896 #define _IQ15div(A,B) ((float)(A) / (float)(B))
3897 #define _IQ14div(A,B) ((float)(A) / (float)(B))
3898 #define _IQ13div(A,B) ((float)(A) / (float)(B))
3899 #define _IQ12div(A,B) ((float)(A) / (float)(B))
3900 #define _IQ11div(A,B) ((float)(A) / (float)(B))
3901 #define _IQ10div(A,B) ((float)(A) / (float)(B))
3902 #define _IQ9div(A,B) ((float)(A) / (float)(B))
3903 #define _IQ8div(A,B) ((float)(A) / (float)(B))
3904 #define _IQ7div(A,B) ((float)(A) / (float)(B))
3905 #define _IQ6div(A,B) ((float)(A) / (float)(B))
3906 #define _IQ5div(A,B) ((float)(A) / (float)(B))
3907 #define _IQ4div(A,B) ((float)(A) / (float)(B))
3908 #define _IQ3div(A,B) ((float)(A) / (float)(B))
3909 #define _IQ2div(A,B) ((float)(A) / (float)(B))
3910 #define _IQ1div(A,B) ((float)(A) / (float)(B))
3911 //---------------------------------------------------------------------------
3912 #define _IQsin(A) sin(A)
3913 #define _IQ30sin(A) sin(A)
3914 #define _IQ29sin(A) sin(A)
3915 #define _IQ28sin(A) sin(A)
3916 #define _IQ27sin(A) sin(A)
3917 #define _IQ26sin(A) sin(A)
3918 #define _IQ25sin(A) sin(A)
3919 #define _IQ24sin(A) sin(A)
3920 #define _IQ23sin(A) sin(A)
3921 #define _IQ22sin(A) sin(A)
3922 #define _IQ21sin(A) sin(A)
3923 #define _IQ20sin(A) sin(A)
3924 #define _IQ19sin(A) sin(A)
3925 #define _IQ18sin(A) sin(A)
3926 #define _IQ17sin(A) sin(A)
3927 #define _IQ16sin(A) sin(A)
3928 #define _IQ15sin(A) sin(A)
3929 #define _IQ14sin(A) sin(A)
3930 #define _IQ13sin(A) sin(A)
3931 #define _IQ12sin(A) sin(A)
3932 #define _IQ11sin(A) sin(A)
3933 #define _IQ10sin(A) sin(A)
3934 #define _IQ9sin(A) sin(A)
3935 #define _IQ8sin(A) sin(A)
3936 #define _IQ7sin(A) sin(A)
3937 #define _IQ6sin(A) sin(A)
3938 #define _IQ5sin(A) sin(A)
3939 #define _IQ4sin(A) sin(A)
3940 #define _IQ3sin(A) sin(A)
3941 #define _IQ2sin(A) sin(A)
3942 #define _IQ1sin(A) sin(A)
3943 //---------------------------------------------------------------------------
3944 #define _IQsinPU(A) sin((A)*6.283185307)
3945 #define _IQ30sinPU(A) sin((A)*6.283185307)
3946 #define _IQ29sinPU(A) sin((A)*6.283185307)
3947 #define _IQ28sinPU(A) sin((A)*6.283185307)
3948 #define _IQ27sinPU(A) sin((A)*6.283185307)
3949 #define _IQ26sinPU(A) sin((A)*6.283185307)
3950 #define _IQ25sinPU(A) sin((A)*6.283185307)
3951 #define _IQ24sinPU(A) sin((A)*6.283185307)
3952 #define _IQ23sinPU(A) sin((A)*6.283185307)
3953 #define _IQ22sinPU(A) sin((A)*6.283185307)
3954 #define _IQ21sinPU(A) sin((A)*6.283185307)
3955 #define _IQ20sinPU(A) sin((A)*6.283185307)
3956 #define _IQ19sinPU(A) sin((A)*6.283185307)
3957 #define _IQ18sinPU(A) sin((A)*6.283185307)
3958 #define _IQ17sinPU(A) sin((A)*6.283185307)
3959 #define _IQ16sinPU(A) sin((A)*6.283185307)
3960 #define _IQ15sinPU(A) sin((A)*6.283185307)
3961 #define _IQ14sinPU(A) sin((A)*6.283185307)
3962 #define _IQ13sinPU(A) sin((A)*6.283185307)
3963 #define _IQ12sinPU(A) sin((A)*6.283185307)
3964 #define _IQ11sinPU(A) sin((A)*6.283185307)
3965 #define _IQ10sinPU(A) sin((A)*6.283185307)
3966 #define _IQ9sinPU(A) sin((A)*6.283185307)
3967 #define _IQ8sinPU(A) sin((A)*6.283185307)
3968 #define _IQ7sinPU(A) sin((A)*6.283185307)
3969 #define _IQ6sinPU(A) sin((A)*6.283185307)
3970 #define _IQ5sinPU(A) sin((A)*6.283185307)
3971 #define _IQ4sinPU(A) sin((A)*6.283185307)
3972 #define _IQ3sinPU(A) sin((A)*6.283185307)
3973 #define _IQ2sinPU(A) sin((A)*6.283185307)
3974 #define _IQ1sinPU(A) sin((A)*6.283185307)
3975 //---------------------------------------------------------------------------
3976 #define _IQasin(A) asin(A)
3977 #define _IQ29asin(A) asin(A)
3978 #define _IQ28asin(A) asin(A)
3979 #define _IQ27asin(A) asin(A)
3980 #define _IQ26asin(A) asin(A)
3981 #define _IQ25asin(A) asin(A)
3982 #define _IQ24asin(A) asin(A)
3983 #define _IQ23asin(A) asin(A)
3984 #define _IQ22asin(A) asin(A)
3985 #define _IQ21asin(A) asin(A)
3986 #define _IQ20asin(A) asin(A)
3987 #define _IQ19asin(A) asin(A)
3988 #define _IQ18asin(A) asin(A)
3989 #define _IQ17asin(A) asin(A)
3990 #define _IQ16asin(A) asin(A)
3991 #define _IQ15asin(A) asin(A)
3992 #define _IQ14asin(A) asin(A)
3993 #define _IQ13asin(A) asin(A)
3994 #define _IQ12asin(A) asin(A)
3995 #define _IQ11asin(A) asin(A)
3996 #define _IQ10asin(A) asin(A)
3997 #define _IQ9asin(A) asin(A)
3998 #define _IQ8asin(A) asin(A)
3999 #define _IQ7asin(A) asin(A)
4000 #define _IQ6asin(A) asin(A)
4001 #define _IQ5asin(A) asin(A)
4002 #define _IQ4asin(A) asin(A)
4003 #define _IQ3asin(A) asin(A)
4004 #define _IQ2asin(A) asin(A)
4005 #define _IQ1asin(A) asin(A)
4006 //---------------------------------------------------------------------------
4007 #define _IQcos(A) cos(A)
4008 #define _IQ30cos(A) cos(A)
4009 #define _IQ29cos(A) cos(A)
4010 #define _IQ28cos(A) cos(A)
4011 #define _IQ27cos(A) cos(A)
4012 #define _IQ26cos(A) cos(A)
4013 #define _IQ25cos(A) cos(A)
4014 #define _IQ24cos(A) cos(A)
4015 #define _IQ23cos(A) cos(A)
4016 #define _IQ22cos(A) cos(A)
4017 #define _IQ21cos(A) cos(A)
4018 #define _IQ20cos(A) cos(A)
4019 #define _IQ19cos(A) cos(A)
4020 #define _IQ18cos(A) cos(A)
4021 #define _IQ17cos(A) cos(A)
4022 #define _IQ16cos(A) cos(A)
4023 #define _IQ15cos(A) cos(A)
4024 #define _IQ14cos(A) cos(A)
4025 #define _IQ13cos(A) cos(A)
4026 #define _IQ12cos(A) cos(A)
4027 #define _IQ11cos(A) cos(A)
4028 #define _IQ10cos(A) cos(A)
4029 #define _IQ9cos(A) cos(A)
4030 #define _IQ8cos(A) cos(A)
4031 #define _IQ7cos(A) cos(A)
4032 #define _IQ6cos(A) cos(A)
4033 #define _IQ5cos(A) cos(A)
4034 #define _IQ4cos(A) cos(A)
4035 #define _IQ3cos(A) cos(A)
4036 #define _IQ2cos(A) cos(A)
4037 #define _IQ1cos(A) cos(A)
4038 //---------------------------------------------------------------------------
4039 #define _IQcosPU(A) cos((A)*6.283185307)
4040 #define _IQ30cosPU(A) cos((A)*6.283185307)
4041 #define _IQ29cosPU(A) cos((A)*6.283185307)
4042 #define _IQ28cosPU(A) cos((A)*6.283185307)
4043 #define _IQ27cosPU(A) cos((A)*6.283185307)
4044 #define _IQ26cosPU(A) cos((A)*6.283185307)
4045 #define _IQ25cosPU(A) cos((A)*6.283185307)
4046 #define _IQ24cosPU(A) cos((A)*6.283185307)
4047 #define _IQ23cosPU(A) cos((A)*6.283185307)
4048 #define _IQ22cosPU(A) cos((A)*6.283185307)
4049 #define _IQ21cosPU(A) cos((A)*6.283185307)
4050 #define _IQ20cosPU(A) cos((A)*6.283185307)
4051 #define _IQ19cosPU(A) cos((A)*6.283185307)
4052 #define _IQ18cosPU(A) cos((A)*6.283185307)
4053 #define _IQ17cosPU(A) cos((A)*6.283185307)
4054 #define _IQ16cosPU(A) cos((A)*6.283185307)
4055 #define _IQ15cosPU(A) cos((A)*6.283185307)
4056 #define _IQ14cosPU(A) cos((A)*6.283185307)
4057 #define _IQ13cosPU(A) cos((A)*6.283185307)
4058 #define _IQ12cosPU(A) cos((A)*6.283185307)
4059 #define _IQ11cosPU(A) cos((A)*6.283185307)
4060 #define _IQ10cosPU(A) cos((A)*6.283185307)
4061 #define _IQ9cosPU(A) cos((A)*6.283185307)
4062 #define _IQ8cosPU(A) cos((A)*6.283185307)
4063 #define _IQ7cosPU(A) cos((A)*6.283185307)
4064 #define _IQ6cosPU(A) cos((A)*6.283185307)
4065 #define _IQ5cosPU(A) cos((A)*6.283185307)
4066 #define _IQ4cosPU(A) cos((A)*6.283185307)
4067 #define _IQ3cosPU(A) cos((A)*6.283185307)
4068 #define _IQ2cosPU(A) cos((A)*6.283185307)
4069 #define _IQ1cosPU(A) cos((A)*6.283185307)
4070 //---------------------------------------------------------------------------
4071 #define _IQacos(A) acos(A)
4072 #define _IQ29acos(A) acos(A)
4073 #define _IQ28acos(A) acos(A)
4074 #define _IQ27acos(A) acos(A)
4075 #define _IQ26acos(A) acos(A)
4076 #define _IQ25acos(A) acos(A)
4077 #define _IQ24acos(A) acos(A)
4078 #define _IQ23acos(A) acos(A)
4079 #define _IQ22acos(A) acos(A)
4080 #define _IQ21acos(A) acos(A)
4081 #define _IQ20acos(A) acos(A)
4082 #define _IQ19acos(A) acos(A)
4083 #define _IQ18acos(A) acos(A)
4084 #define _IQ17acos(A) acos(A)
4085 #define _IQ16acos(A) acos(A)
4086 #define _IQ15acos(A) acos(A)
4087 #define _IQ14acos(A) acos(A)
4088 #define _IQ13acos(A) acos(A)
4089 #define _IQ12acos(A) acos(A)
4090 #define _IQ11acos(A) acos(A)
4091 #define _IQ10acos(A) acos(A)
4092 #define _IQ9acos(A) acos(A)
4093 #define _IQ8acos(A) acos(A)
4094 #define _IQ7acos(A) acos(A)
4095 #define _IQ6acos(A) acos(A)
4096 #define _IQ5acos(A) acos(A)
4097 #define _IQ4acos(A) acos(A)
4098 #define _IQ3acos(A) acos(A)
4099 #define _IQ2acos(A) acos(A)
4100 #define _IQ1acos(A) acos(A)
4101 //---------------------------------------------------------------------------
4102 #define _IQatan(A) atan(A)
4103 #define _IQ30atan(A) atan(A)
4104 #define _IQ29atan(A) atan(A)
4105 #define _IQ28atan(A) atan(A)
4106 #define _IQ27atan(A) atan(A)
4107 #define _IQ26atan(A) atan(A)
4108 #define _IQ25atan(A) atan(A)
4109 #define _IQ24atan(A) atan(A)
4110 #define _IQ23atan(A) atan(A)
4111 #define _IQ22atan(A) atan(A)
4112 #define _IQ21atan(A) atan(A)
4113 #define _IQ20atan(A) atan(A)
4114 #define _IQ19atan(A) atan(A)
4115 #define _IQ18atan(A) atan(A)
4116 #define _IQ17atan(A) atan(A)
4117 #define _IQ16atan(A) atan(A)
4118 #define _IQ15atan(A) atan(A)
4119 #define _IQ14atan(A) atan(A)
4120 #define _IQ13atan(A) atan(A)
4121 #define _IQ12atan(A) atan(A)
4122 #define _IQ11atan(A) atan(A)
4123 #define _IQ10atan(A) atan(A)
4124 #define _IQ9atan(A) atan(A)
4125 #define _IQ8atan(A) atan(A)
4126 #define _IQ7atan(A) atan(A)
4127 #define _IQ6atan(A) atan(A)
4128 #define _IQ5atan(A) atan(A)
4129 #define _IQ4atan(A) atan(A)
4130 #define _IQ3atan(A) atan(A)
4131 #define _IQ2atan(A) atan(A)
4132 #define _IQ1atan(A) atan(A)
4133 //---------------------------------------------------------------------------
4134 #define _IQatan2(A,B) atan2(A,B)
4135 #define _IQ30atan2(A,B) atan2(A,B)
4136 #define _IQ29atan2(A,B) atan2(A,B)
4137 #define _IQ28atan2(A,B) atan2(A,B)
4138 #define _IQ27atan2(A,B) atan2(A,B)
4139 #define _IQ26atan2(A,B) atan2(A,B)
4140 #define _IQ25atan2(A,B) atan2(A,B)
4141 #define _IQ24atan2(A,B) atan2(A,B)
4142 #define _IQ23atan2(A,B) atan2(A,B)
4143 #define _IQ22atan2(A,B) atan2(A,B)
4144 #define _IQ21atan2(A,B) atan2(A,B)
4145 #define _IQ20atan2(A,B) atan2(A,B)
4146 #define _IQ19atan2(A,B) atan2(A,B)
4147 #define _IQ18atan2(A,B) atan2(A,B)
4148 #define _IQ17atan2(A,B) atan2(A,B)
4149 #define _IQ16atan2(A,B) atan2(A,B)
4150 #define _IQ15atan2(A,B) atan2(A,B)
4151 #define _IQ14atan2(A,B) atan2(A,B)
4152 #define _IQ13atan2(A,B) atan2(A,B)
4153 #define _IQ12atan2(A,B) atan2(A,B)
4154 #define _IQ11atan2(A,B) atan2(A,B)
4155 #define _IQ10atan2(A,B) atan2(A,B)
4156 #define _IQ9atan2(A,B) atan2(A,B)
4157 #define _IQ8atan2(A,B) atan2(A,B)
4158 #define _IQ7atan2(A,B) atan2(A,B)
4159 #define _IQ6atan2(A,B) atan2(A,B)
4160 #define _IQ5atan2(A,B) atan2(A,B)
4161 #define _IQ4atan2(A,B) atan2(A,B)
4162 #define _IQ3atan2(A,B) atan2(A,B)
4163 #define _IQ2atan2(A,B) atan2(A,B)
4164 #define _IQ1atan2(A,B) atan2(A,B)
4165 //---------------------------------------------------------------------------
4166 #define _IQatan2PU(A,B) ((atan2(A,B)*(1.0/6.283185307)) >= 0.0 ? (atan2(A,B)*(1.0/6.283185307)):1.0 + (atan2(A,B)*(1.0/6.283185307)))
4167 #define _IQ30atan2PU(A,B) ((atan2(A,B)*(1.0/6.283185307)) >= 0.0 ? (atan2(A,B)*(1.0/6.283185307)):1.0 + (atan2(A,B)*(1.0/6.283185307)))
4168 #define _IQ29atan2PU(A,B) ((atan2(A,B)*(1.0/6.283185307)) >= 0.0 ? (atan2(A,B)*(1.0/6.283185307)):1.0 + (atan2(A,B)*(1.0/6.283185307)))
4169 #define _IQ28atan2PU(A,B) ((atan2(A,B)*(1.0/6.283185307)) >= 0.0 ? (atan2(A,B)*(1.0/6.283185307)):1.0 + (atan2(A,B)*(1.0/6.283185307)))
4170 #define _IQ27atan2PU(A,B) ((atan2(A,B)*(1.0/6.283185307)) >= 0.0 ? (atan2(A,B)*(1.0/6.283185307)):1.0 + (atan2(A,B)*(1.0/6.283185307)))
4171 #define _IQ26atan2PU(A,B) ((atan2(A,B)*(1.0/6.283185307)) >= 0.0 ? (atan2(A,B)*(1.0/6.283185307)):1.0 + (atan2(A,B)*(1.0/6.283185307)))
4172 #define _IQ25atan2PU(A,B) ((atan2(A,B)*(1.0/6.283185307)) >= 0.0 ? (atan2(A,B)*(1.0/6.283185307)):1.0 + (atan2(A,B)*(1.0/6.283185307)))
4173 #define _IQ24atan2PU(A,B) ((atan2(A,B)*(1.0/6.283185307)) >= 0.0 ? (atan2(A,B)*(1.0/6.283185307)):1.0 + (atan2(A,B)*(1.0/6.283185307)))
4174 #define _IQ23atan2PU(A,B) ((atan2(A,B)*(1.0/6.283185307)) >= 0.0 ? (atan2(A,B)*(1.0/6.283185307)):1.0 + (atan2(A,B)*(1.0/6.283185307)))
4175 #define _IQ22atan2PU(A,B) ((atan2(A,B)*(1.0/6.283185307)) >= 0.0 ? (atan2(A,B)*(1.0/6.283185307)):1.0 + (atan2(A,B)*(1.0/6.283185307)))
4176 #define _IQ21atan2PU(A,B) ((atan2(A,B)*(1.0/6.283185307)) >= 0.0 ? (atan2(A,B)*(1.0/6.283185307)):1.0 + (atan2(A,B)*(1.0/6.283185307)))
4177 #define _IQ20atan2PU(A,B) ((atan2(A,B)*(1.0/6.283185307)) >= 0.0 ? (atan2(A,B)*(1.0/6.283185307)):1.0 + (atan2(A,B)*(1.0/6.283185307)))
4178 #define _IQ19atan2PU(A,B) ((atan2(A,B)*(1.0/6.283185307)) >= 0.0 ? (atan2(A,B)*(1.0/6.283185307)):1.0 + (atan2(A,B)*(1.0/6.283185307)))
4179 #define _IQ18atan2PU(A,B) ((atan2(A,B)*(1.0/6.283185307)) >= 0.0 ? (atan2(A,B)*(1.0/6.283185307)):1.0 + (atan2(A,B)*(1.0/6.283185307)))
4180 #define _IQ17atan2PU(A,B) ((atan2(A,B)*(1.0/6.283185307)) >= 0.0 ? (atan2(A,B)*(1.0/6.283185307)):1.0 + (atan2(A,B)*(1.0/6.283185307)))
4181 #define _IQ16atan2PU(A,B) ((atan2(A,B)*(1.0/6.283185307)) >= 0.0 ? (atan2(A,B)*(1.0/6.283185307)):1.0 + (atan2(A,B)*(1.0/6.283185307)))
4182 #define _IQ15atan2PU(A,B) ((atan2(A,B)*(1.0/6.283185307)) >= 0.0 ? (atan2(A,B)*(1.0/6.283185307)):1.0 + (atan2(A,B)*(1.0/6.283185307)))
4183 #define _IQ14atan2PU(A,B) ((atan2(A,B)*(1.0/6.283185307)) >= 0.0 ? (atan2(A,B)*(1.0/6.283185307)):1.0 + (atan2(A,B)*(1.0/6.283185307)))
4184 #define _IQ13atan2PU(A,B) ((atan2(A,B)*(1.0/6.283185307)) >= 0.0 ? (atan2(A,B)*(1.0/6.283185307)):1.0 + (atan2(A,B)*(1.0/6.283185307)))
4185 #define _IQ12atan2PU(A,B) ((atan2(A,B)*(1.0/6.283185307)) >= 0.0 ? (atan2(A,B)*(1.0/6.283185307)):1.0 + (atan2(A,B)*(1.0/6.283185307)))
4186 #define _IQ11atan2PU(A,B) ((atan2(A,B)*(1.0/6.283185307)) >= 0.0 ? (atan2(A,B)*(1.0/6.283185307)):1.0 + (atan2(A,B)*(1.0/6.283185307)))
4187 #define _IQ10atan2PU(A,B) ((atan2(A,B)*(1.0/6.283185307)) >= 0.0 ? (atan2(A,B)*(1.0/6.283185307)):1.0 + (atan2(A,B)*(1.0/6.283185307)))
4188 #define _IQ9atan2PU(A,B) ((atan2(A,B)*(1.0/6.283185307)) >= 0.0 ? (atan2(A,B)*(1.0/6.283185307)):1.0 + (atan2(A,B)*(1.0/6.283185307)))
4189 #define _IQ8atan2PU(A,B) ((atan2(A,B)*(1.0/6.283185307)) >= 0.0 ? (atan2(A,B)*(1.0/6.283185307)):1.0 + (atan2(A,B)*(1.0/6.283185307)))
4190 #define _IQ7atan2PU(A,B) ((atan2(A,B)*(1.0/6.283185307)) >= 0.0 ? (atan2(A,B)*(1.0/6.283185307)):1.0 + (atan2(A,B)*(1.0/6.283185307)))
4191 #define _IQ6atan2PU(A,B) ((atan2(A,B)*(1.0/6.283185307)) >= 0.0 ? (atan2(A,B)*(1.0/6.283185307)):1.0 + (atan2(A,B)*(1.0/6.283185307)))
4192 #define _IQ5atan2PU(A,B) ((atan2(A,B)*(1.0/6.283185307)) >= 0.0 ? (atan2(A,B)*(1.0/6.283185307)):1.0 + (atan2(A,B)*(1.0/6.283185307)))
4193 #define _IQ4atan2PU(A,B) ((atan2(A,B)*(1.0/6.283185307)) >= 0.0 ? (atan2(A,B)*(1.0/6.283185307)):1.0 + (atan2(A,B)*(1.0/6.283185307)))
4194 #define _IQ3atan2PU(A,B) ((atan2(A,B)*(1.0/6.283185307)) >= 0.0 ? (atan2(A,B)*(1.0/6.283185307)):1.0 + (atan2(A,B)*(1.0/6.283185307)))
4195 #define _IQ2atan2PU(A,B) ((atan2(A,B)*(1.0/6.283185307)) >= 0.0 ? (atan2(A,B)*(1.0/6.283185307)):1.0 + (atan2(A,B)*(1.0/6.283185307)))
4196 #define _IQ1atan2PU(A,B) ((atan2(A,B)*(1.0/6.283185307)) >= 0.0 ? (atan2(A,B)*(1.0/6.283185307)):1.0 + (atan2(A,B)*(1.0/6.283185307)))
4197 //---------------------------------------------------------------------------
4198 #define _IQsqrt(A) sqrt(A)
4199 #define _IQ30sqrt(A) sqrt(A)
4200 #define _IQ29sqrt(A) sqrt(A)
4201 #define _IQ28sqrt(A) sqrt(A)
4202 #define _IQ27sqrt(A) sqrt(A)
4203 #define _IQ26sqrt(A) sqrt(A)
4204 #define _IQ25sqrt(A) sqrt(A)
4205 #define _IQ24sqrt(A) sqrt(A)
4206 #define _IQ23sqrt(A) sqrt(A)
4207 #define _IQ22sqrt(A) sqrt(A)
4208 #define _IQ21sqrt(A) sqrt(A)
4209 #define _IQ20sqrt(A) sqrt(A)
4210 #define _IQ19sqrt(A) sqrt(A)
4211 #define _IQ18sqrt(A) sqrt(A)
4212 #define _IQ17sqrt(A) sqrt(A)
4213 #define _IQ16sqrt(A) sqrt(A)
4214 #define _IQ15sqrt(A) sqrt(A)
4215 #define _IQ14sqrt(A) sqrt(A)
4216 #define _IQ13sqrt(A) sqrt(A)
4217 #define _IQ12sqrt(A) sqrt(A)
4218 #define _IQ11sqrt(A) sqrt(A)
4219 #define _IQ10sqrt(A) sqrt(A)
4220 #define _IQ9sqrt(A) sqrt(A)
4221 #define _IQ8sqrt(A) sqrt(A)
4222 #define _IQ7sqrt(A) sqrt(A)
4223 #define _IQ6sqrt(A) sqrt(A)
4224 #define _IQ5sqrt(A) sqrt(A)
4225 #define _IQ4sqrt(A) sqrt(A)
4226 #define _IQ3sqrt(A) sqrt(A)
4227 #define _IQ2sqrt(A) sqrt(A)
4228 #define _IQ1sqrt(A) sqrt(A)
4229 //---------------------------------------------------------------------------
4230 #define _IQisqrt(A) (1.0/sqrt(A))
4231 #define _IQ30isqrt(A) (1.0/sqrt(A))
4232 #define _IQ29isqrt(A) (1.0/sqrt(A))
4233 #define _IQ28isqrt(A) (1.0/sqrt(A))
4234 #define _IQ27isqrt(A) (1.0/sqrt(A))
4235 #define _IQ26isqrt(A) (1.0/sqrt(A))
4236 #define _IQ25isqrt(A) (1.0/sqrt(A))
4237 #define _IQ24isqrt(A) (1.0/sqrt(A))
4238 #define _IQ23isqrt(A) (1.0/sqrt(A))
4239 #define _IQ22isqrt(A) (1.0/sqrt(A))
4240 #define _IQ21isqrt(A) (1.0/sqrt(A))
4241 #define _IQ20isqrt(A) (1.0/sqrt(A))
4242 #define _IQ19isqrt(A) (1.0/sqrt(A))
4243 #define _IQ18isqrt(A) (1.0/sqrt(A))
4244 #define _IQ17isqrt(A) (1.0/sqrt(A))
4245 #define _IQ16isqrt(A) (1.0/sqrt(A))
4246 #define _IQ15isqrt(A) (1.0/sqrt(A))
4247 #define _IQ14isqrt(A) (1.0/sqrt(A))
4248 #define _IQ13isqrt(A) (1.0/sqrt(A))
4249 #define _IQ12isqrt(A) (1.0/sqrt(A))
4250 #define _IQ11isqrt(A) (1.0/sqrt(A))
4251 #define _IQ10isqrt(A) (1.0/sqrt(A))
4252 #define _IQ9isqrt(A) (1.0/sqrt(A))
4253 #define _IQ8isqrt(A) (1.0/sqrt(A))
4254 #define _IQ7isqrt(A) (1.0/sqrt(A))
4255 #define _IQ6isqrt(A) (1.0/sqrt(A))
4256 #define _IQ5isqrt(A) (1.0/sqrt(A))
4257 #define _IQ4isqrt(A) (1.0/sqrt(A))
4258 #define _IQ3isqrt(A) (1.0/sqrt(A))
4259 #define _IQ2isqrt(A) (1.0/sqrt(A))
4260 #define _IQ1isqrt(A) (1.0/sqrt(A))
4261 //---------------------------------------------------------------------------
4262 #define _IQexp(A) exp(A)
4263 #define _IQ30exp(A) exp(A)
4264 #define _IQ29exp(A) exp(A)
4265 #define _IQ28exp(A) exp(A)
4266 #define _IQ27exp(A) exp(A)
4267 #define _IQ26exp(A) exp(A)
4268 #define _IQ25exp(A) exp(A)
4269 #define _IQ24exp(A) exp(A)
4270 #define _IQ23exp(A) exp(A)
4271 #define _IQ22exp(A) exp(A)
4272 #define _IQ21exp(A) exp(A)
4273 #define _IQ20exp(A) exp(A)
4274 #define _IQ19exp(A) exp(A)
4275 #define _IQ18exp(A) exp(A)
4276 #define _IQ17exp(A) exp(A)
4277 #define _IQ16exp(A) exp(A)
4278 #define _IQ15exp(A) exp(A)
4279 #define _IQ14exp(A) exp(A)
4280 #define _IQ13exp(A) exp(A)
4281 #define _IQ12exp(A) exp(A)
4282 #define _IQ11exp(A) exp(A)
4283 #define _IQ10exp(A) exp(A)
4284 #define _IQ9exp(A) exp(A)
4285 #define _IQ8exp(A) exp(A)
4286 #define _IQ7exp(A) exp(A)
4287 #define _IQ6exp(A) exp(A)
4288 #define _IQ5exp(A) exp(A)
4289 #define _IQ4exp(A) exp(A)
4290 #define _IQ3exp(A) exp(A)
4291 #define _IQ2exp(A) exp(A)
4292 #define _IQ1exp(A) exp(A)
4293 //---------------------------------------------------------------------------
4294 #define _IQint(A) ((long) (A))
4295 #define _IQ30int(A) ((long) (A))
4296 #define _IQ29int(A) ((long) (A))
4297 #define _IQ28int(A) ((long) (A))
4298 #define _IQ27int(A) ((long) (A))
4299 #define _IQ26int(A) ((long) (A))
4300 #define _IQ25int(A) ((long) (A))
4301 #define _IQ24int(A) ((long) (A))
4302 #define _IQ23int(A) ((long) (A))
4303 #define _IQ22int(A) ((long) (A))
4304 #define _IQ21int(A) ((long) (A))
4305 #define _IQ20int(A) ((long) (A))
4306 #define _IQ19int(A) ((long) (A))
4307 #define _IQ18int(A) ((long) (A))
4308 #define _IQ17int(A) ((long) (A))
4309 #define _IQ16int(A) ((long) (A))
4310 #define _IQ15int(A) ((long) (A))
4311 #define _IQ14int(A) ((long) (A))
4312 #define _IQ13int(A) ((long) (A))
4313 #define _IQ12int(A) ((long) (A))
4314 #define _IQ11int(A) ((long) (A))
4315 #define _IQ10int(A) ((long) (A))
4316 #define _IQ9int(A) ((long) (A))
4317 #define _IQ8int(A) ((long) (A))
4318 #define _IQ7int(A) ((long) (A))
4319 #define _IQ6int(A) ((long) (A))
4320 #define _IQ5int(A) ((long) (A))
4321 #define _IQ4int(A) ((long) (A))
4322 #define _IQ3int(A) ((long) (A))
4323 #define _IQ2int(A) ((long) (A))
4324 #define _IQ1int(A) ((long) (A))
4325 //---------------------------------------------------------------------------
4326 #define _IQfrac(A) ((A) - (float)((long) (A)))
4327 #define _IQ30frac(A) ((A) - (float)((long) (A)))
4328 #define _IQ29frac(A) ((A) - (float)((long) (A)))
4329 #define _IQ28frac(A) ((A) - (float)((long) (A)))
4330 #define _IQ27frac(A) ((A) - (float)((long) (A)))
4331 #define _IQ26frac(A) ((A) - (float)((long) (A)))
4332 #define _IQ25frac(A) ((A) - (float)((long) (A)))
4333 #define _IQ24frac(A) ((A) - (float)((long) (A)))
4334 #define _IQ23frac(A) ((A) - (float)((long) (A)))
4335 #define _IQ22frac(A) ((A) - (float)((long) (A)))
4336 #define _IQ21frac(A) ((A) - (float)((long) (A)))
4337 #define _IQ20frac(A) ((A) - (float)((long) (A)))
4338 #define _IQ19frac(A) ((A) - (float)((long) (A)))
4339 #define _IQ18frac(A) ((A) - (float)((long) (A)))
4340 #define _IQ17frac(A) ((A) - (float)((long) (A)))
4341 #define _IQ16frac(A) ((A) - (float)((long) (A)))
4342 #define _IQ15frac(A) ((A) - (float)((long) (A)))
4343 #define _IQ14frac(A) ((A) - (float)((long) (A)))
4344 #define _IQ13frac(A) ((A) - (float)((long) (A)))
4345 #define _IQ12frac(A) ((A) - (float)((long) (A)))
4346 #define _IQ11frac(A) ((A) - (float)((long) (A)))
4347 #define _IQ10frac(A) ((A) - (float)((long) (A)))
4348 #define _IQ9frac(A) ((A) - (float)((long) (A)))
4349 #define _IQ8frac(A) ((A) - (float)((long) (A)))
4350 #define _IQ7frac(A) ((A) - (float)((long) (A)))
4351 #define _IQ6frac(A) ((A) - (float)((long) (A)))
4352 #define _IQ5frac(A) ((A) - (float)((long) (A)))
4353 #define _IQ4frac(A) ((A) - (float)((long) (A)))
4354 #define _IQ3frac(A) ((A) - (float)((long) (A)))
4355 #define _IQ2frac(A) ((A) - (float)((long) (A)))
4356 #define _IQ1frac(A) ((A) - (float)((long) (A)))
4357 //---------------------------------------------------------------------------
4358 #define _IQmpyIQX(A, IQA, B, IQB) ((A)*(B))
4359 #define _IQ30mpyIQX(A, IQA, B, IQB) ((A)*(B))
4360 #define _IQ29mpyIQX(A, IQA, B, IQB) ((A)*(B))
4361 #define _IQ28mpyIQX(A, IQA, B, IQB) ((A)*(B))
4362 #define _IQ27mpyIQX(A, IQA, B, IQB) ((A)*(B))
4363 #define _IQ26mpyIQX(A, IQA, B, IQB) ((A)*(B))
4364 #define _IQ25mpyIQX(A, IQA, B, IQB) ((A)*(B))
4365 #define _IQ24mpyIQX(A, IQA, B, IQB) ((A)*(B))
4366 #define _IQ23mpyIQX(A, IQA, B, IQB) ((A)*(B))
4367 #define _IQ22mpyIQX(A, IQA, B, IQB) ((A)*(B))
4368 #define _IQ21mpyIQX(A, IQA, B, IQB) ((A)*(B))
4369 #define _IQ20mpyIQX(A, IQA, B, IQB) ((A)*(B))
4370 #define _IQ19mpyIQX(A, IQA, B, IQB) ((A)*(B))
4371 #define _IQ18mpyIQX(A, IQA, B, IQB) ((A)*(B))
4372 #define _IQ17mpyIQX(A, IQA, B, IQB) ((A)*(B))
4373 #define _IQ16mpyIQX(A, IQA, B, IQB) ((A)*(B))
4374 #define _IQ15mpyIQX(A, IQA, B, IQB) ((A)*(B))
4375 #define _IQ14mpyIQX(A, IQA, B, IQB) ((A)*(B))
4376 #define _IQ13mpyIQX(A, IQA, B, IQB) ((A)*(B))
4377 #define _IQ12mpyIQX(A, IQA, B, IQB) ((A)*(B))
4378 #define _IQ11mpyIQX(A, IQA, B, IQB) ((A)*(B))
4379 #define _IQ10mpyIQX(A, IQA, B, IQB) ((A)*(B))
4380 #define _IQ9mpyIQX(A, IQA, B, IQB) ((A)*(B))
4381 #define _IQ8mpyIQX(A, IQA, B, IQB) ((A)*(B))
4382 #define _IQ7mpyIQX(A, IQA, B, IQB) ((A)*(B))
4383 #define _IQ6mpyIQX(A, IQA, B, IQB) ((A)*(B))
4384 #define _IQ5mpyIQX(A, IQA, B, IQB) ((A)*(B))
4385 #define _IQ4mpyIQX(A, IQA, B, IQB) ((A)*(B))
4386 #define _IQ3mpyIQX(A, IQA, B, IQB) ((A)*(B))
4387 #define _IQ2mpyIQX(A, IQA, B, IQB) ((A)*(B))
4388 #define _IQ1mpyIQX(A, IQA, B, IQB) ((A)*(B))
4389 //---------------------------------------------------------------------------
4390 #define _IQmpyI32(A,B) ((A) * (float) (B))
4391 #define _IQ30mpyI32(A,B) ((A) * (float) (B))
4392 #define _IQ29mpyI32(A,B) ((A) * (float) (B))
4393 #define _IQ28mpyI32(A,B) ((A) * (float) (B))
4394 #define _IQ27mpyI32(A,B) ((A) * (float) (B))
4395 #define _IQ26mpyI32(A,B) ((A) * (float) (B))
4396 #define _IQ25mpyI32(A,B) ((A) * (float) (B))
4397 #define _IQ24mpyI32(A,B) ((A) * (float) (B))
4398 #define _IQ23mpyI32(A,B) ((A) * (float) (B))
4399 #define _IQ22mpyI32(A,B) ((A) * (float) (B))
4400 #define _IQ21mpyI32(A,B) ((A) * (float) (B))
4401 #define _IQ20mpyI32(A,B) ((A) * (float) (B))
4402 #define _IQ19mpyI32(A,B) ((A) * (float) (B))
4403 #define _IQ18mpyI32(A,B) ((A) * (float) (B))
4404 #define _IQ17mpyI32(A,B) ((A) * (float) (B))
4405 #define _IQ16mpyI32(A,B) ((A) * (float) (B))
4406 #define _IQ15mpyI32(A,B) ((A) * (float) (B))
4407 #define _IQ14mpyI32(A,B) ((A) * (float) (B))
4408 #define _IQ13mpyI32(A,B) ((A) * (float) (B))
4409 #define _IQ12mpyI32(A,B) ((A) * (float) (B))
4410 #define _IQ11mpyI32(A,B) ((A) * (float) (B))
4411 #define _IQ10mpyI32(A,B) ((A) * (float) (B))
4412 #define _IQ9mpyI32(A,B) ((A) * (float) (B))
4413 #define _IQ8mpyI32(A,B) ((A) * (float) (B))
4414 #define _IQ7mpyI32(A,B) ((A) * (float) (B))
4415 #define _IQ6mpyI32(A,B) ((A) * (float) (B))
4416 #define _IQ5mpyI32(A,B) ((A) * (float) (B))
4417 #define _IQ4mpyI32(A,B) ((A) * (float) (B))
4418 #define _IQ3mpyI32(A,B) ((A) * (float) (B))
4419 #define _IQ2mpyI32(A,B) ((A) * (float) (B))
4420 #define _IQ1mpyI32(A,B) ((A) * (float) (B))
4421 //---------------------------------------------------------------------------
4422 #define _IQmpyI32int(A,B) ((long) ((A) * (float) (B)))
4423 #define _IQ30mpyI32int(A,B) ((long) ((A) * (float) (B)))
4424 #define _IQ29mpyI32int(A,B) ((long) ((A) * (float) (B)))
4425 #define _IQ28mpyI32int(A,B) ((long) ((A) * (float) (B)))
4426 #define _IQ27mpyI32int(A,B) ((long) ((A) * (float) (B)))
4427 #define _IQ26mpyI32int(A,B) ((long) ((A) * (float) (B)))
4428 #define _IQ25mpyI32int(A,B) ((long) ((A) * (float) (B)))
4429 #define _IQ24mpyI32int(A,B) ((long) ((A) * (float) (B)))
4430 #define _IQ23mpyI32int(A,B) ((long) ((A) * (float) (B)))
4431 #define _IQ22mpyI32int(A,B) ((long) ((A) * (float) (B)))
4432 #define _IQ21mpyI32int(A,B) ((long) ((A) * (float) (B)))
4433 #define _IQ20mpyI32int(A,B) ((long) ((A) * (float) (B)))
4434 #define _IQ19mpyI32int(A,B) ((long) ((A) * (float) (B)))
4435 #define _IQ18mpyI32int(A,B) ((long) ((A) * (float) (B)))
4436 #define _IQ17mpyI32int(A,B) ((long) ((A) * (float) (B)))
4437 #define _IQ16mpyI32int(A,B) ((long) ((A) * (float) (B)))
4438 #define _IQ15mpyI32int(A,B) ((long) ((A) * (float) (B)))
4439 #define _IQ14mpyI32int(A,B) ((long) ((A) * (float) (B)))
4440 #define _IQ13mpyI32int(A,B) ((long) ((A) * (float) (B)))
4441 #define _IQ12mpyI32int(A,B) ((long) ((A) * (float) (B)))
4442 #define _IQ11mpyI32int(A,B) ((long) ((A) * (float) (B)))
4443 #define _IQ10mpyI32int(A,B) ((long) ((A) * (float) (B)))
4444 #define _IQ9mpyI32int(A,B) ((long) ((A) * (float) (B)))
4445 #define _IQ8mpyI32int(A,B) ((long) ((A) * (float) (B)))
4446 #define _IQ7mpyI32int(A,B) ((long) ((A) * (float) (B)))
4447 #define _IQ6mpyI32int(A,B) ((long) ((A) * (float) (B)))
4448 #define _IQ5mpyI32int(A,B) ((long) ((A) * (float) (B)))
4449 #define _IQ4mpyI32int(A,B) ((long) ((A) * (float) (B)))
4450 #define _IQ3mpyI32int(A,B) ((long) ((A) * (float) (B)))
4451 #define _IQ2mpyI32int(A,B) ((long) ((A) * (float) (B)))
4452 #define _IQ1mpyI32int(A,B) ((long) ((A) * (float) (B)))
4453 //---------------------------------------------------------------------------
4454 #define _IQmpyI32frac(A,B) ((A) - (float)((long) ((A) * (float) (B))))
4455 #define _IQ30mpyI32frac(A,B) ((A) - (float)((long) ((A) * (float) (B))))
4456 #define _IQ29mpyI32frac(A,B) ((A) - (float)((long) ((A) * (float) (B))))
4457 #define _IQ28mpyI32frac(A,B) ((A) - (float)((long) ((A) * (float) (B))))
4458 #define _IQ27mpyI32frac(A,B) ((A) - (float)((long) ((A) * (float) (B))))
4459 #define _IQ26mpyI32frac(A,B) ((A) - (float)((long) ((A) * (float) (B))))
4460 #define _IQ25mpyI32frac(A,B) ((A) - (float)((long) ((A) * (float) (B))))
4461 #define _IQ24mpyI32frac(A,B) ((A) - (float)((long) ((A) * (float) (B))))
4462 #define _IQ23mpyI32frac(A,B) ((A) - (float)((long) ((A) * (float) (B))))
4463 #define _IQ22mpyI32frac(A,B) ((A) - (float)((long) ((A) * (float) (B))))
4464 #define _IQ21mpyI32frac(A,B) ((A) - (float)((long) ((A) * (float) (B))))
4465 #define _IQ20mpyI32frac(A,B) ((A) - (float)((long) ((A) * (float) (B))))
4466 #define _IQ19mpyI32frac(A,B) ((A) - (float)((long) ((A) * (float) (B))))
4467 #define _IQ18mpyI32frac(A,B) ((A) - (float)((long) ((A) * (float) (B))))
4468 #define _IQ17mpyI32frac(A,B) ((A) - (float)((long) ((A) * (float) (B))))
4469 #define _IQ16mpyI32frac(A,B) ((A) - (float)((long) ((A) * (float) (B))))
4470 #define _IQ15mpyI32frac(A,B) ((A) - (float)((long) ((A) * (float) (B))))
4471 #define _IQ14mpyI32frac(A,B) ((A) - (float)((long) ((A) * (float) (B))))
4472 #define _IQ13mpyI32frac(A,B) ((A) - (float)((long) ((A) * (float) (B))))
4473 #define _IQ12mpyI32frac(A,B) ((A) - (float)((long) ((A) * (float) (B))))
4474 #define _IQ11mpyI32frac(A,B) ((A) - (float)((long) ((A) * (float) (B))))
4475 #define _IQ10mpyI32frac(A,B) ((A) - (float)((long) ((A) * (float) (B))))
4476 #define _IQ9mpyI32frac(A,B) ((A) - (float)((long) ((A) * (float) (B))))
4477 #define _IQ8mpyI32frac(A,B) ((A) - (float)((long) ((A) * (float) (B))))
4478 #define _IQ7mpyI32frac(A,B) ((A) - (float)((long) ((A) * (float) (B))))
4479 #define _IQ6mpyI32frac(A,B) ((A) - (float)((long) ((A) * (float) (B))))
4480 #define _IQ5mpyI32frac(A,B) ((A) - (float)((long) ((A) * (float) (B))))
4481 #define _IQ4mpyI32frac(A,B) ((A) - (float)((long) ((A) * (float) (B))))
4482 #define _IQ3mpyI32frac(A,B) ((A) - (float)((long) ((A) * (float) (B))))
4483 #define _IQ2mpyI32frac(A,B) ((A) - (float)((long) ((A) * (float) (B))))
4484 #define _IQ1mpyI32frac(A,B) ((A) - (float)((long) ((A) * (float) (B))))
4485 //---------------------------------------------------------------------------
4486 #define _IQmag(A,B) sqrt((A)*(A) + (B)*(B))
4487 #define _IQ30mag(A,B) sqrt((A)*(A) + (B)*(B))
4488 #define _IQ29mag(A,B) sqrt((A)*(A) + (B)*(B))
4489 #define _IQ28mag(A,B) sqrt((A)*(A) + (B)*(B))
4490 #define _IQ27mag(A,B) sqrt((A)*(A) + (B)*(B))
4491 #define _IQ26mag(A,B) sqrt((A)*(A) + (B)*(B))
4492 #define _IQ25mag(A,B) sqrt((A)*(A) + (B)*(B))
4493 #define _IQ24mag(A,B) sqrt((A)*(A) + (B)*(B))
4494 #define _IQ23mag(A,B) sqrt((A)*(A) + (B)*(B))
4495 #define _IQ22mag(A,B) sqrt((A)*(A) + (B)*(B))
4496 #define _IQ21mag(A,B) sqrt((A)*(A) + (B)*(B))
4497 #define _IQ20mag(A,B) sqrt((A)*(A) + (B)*(B))
4498 #define _IQ19mag(A,B) sqrt((A)*(A) + (B)*(B))
4499 #define _IQ18mag(A,B) sqrt((A)*(A) + (B)*(B))
4500 #define _IQ17mag(A,B) sqrt((A)*(A) + (B)*(B))
4501 #define _IQ16mag(A,B) sqrt((A)*(A) + (B)*(B))
4502 #define _IQ15mag(A,B) sqrt((A)*(A) + (B)*(B))
4503 #define _IQ14mag(A,B) sqrt((A)*(A) + (B)*(B))
4504 #define _IQ13mag(A,B) sqrt((A)*(A) + (B)*(B))
4505 #define _IQ12mag(A,B) sqrt((A)*(A) + (B)*(B))
4506 #define _IQ11mag(A,B) sqrt((A)*(A) + (B)*(B))
4507 #define _IQ10mag(A,B) sqrt((A)*(A) + (B)*(B))
4508 #define _IQ9mag(A,B) sqrt((A)*(A) + (B)*(B))
4509 #define _IQ8mag(A,B) sqrt((A)*(A) + (B)*(B))
4510 #define _IQ7mag(A,B) sqrt((A)*(A) + (B)*(B))
4511 #define _IQ6mag(A,B) sqrt((A)*(A) + (B)*(B))
4512 #define _IQ5mag(A,B) sqrt((A)*(A) + (B)*(B))
4513 #define _IQ4mag(A,B) sqrt((A)*(A) + (B)*(B))
4514 #define _IQ3mag(A,B) sqrt((A)*(A) + (B)*(B))
4515 #define _IQ2mag(A,B) sqrt((A)*(A) + (B)*(B))
4516 #define _IQ1mag(A,B) sqrt((A)*(A) + (B)*(B))
4517 //---------------------------------------------------------------------------
4518 #define _atoIQ(A) atof(A)
4519 #define _atoIQ30(A) atof(A)
4520 #define _atoIQ29(A) atof(A)
4521 #define _atoIQ28(A) atof(A)
4522 #define _atoIQ27(A) atof(A)
4523 #define _atoIQ26(A) atof(A)
4524 #define _atoIQ25(A) atof(A)
4525 #define _atoIQ24(A) atof(A)
4526 #define _atoIQ23(A) atof(A)
4527 #define _atoIQ22(A) atof(A)
4528 #define _atoIQ21(A) atof(A)
4529 #define _atoIQ20(A) atof(A)
4530 #define _atoIQ19(A) atof(A)
4531 #define _atoIQ18(A) atof(A)
4532 #define _atoIQ17(A) atof(A)
4533 #define _atoIQ16(A) atof(A)
4534 #define _atoIQ15(A) atof(A)
4535 #define _atoIQ14(A) atof(A)
4536 #define _atoIQ13(A) atof(A)
4537 #define _atoIQ12(A) atof(A)
4538 #define _atoIQ11(A) atof(A)
4539 #define _atoIQ10(A) atof(A)
4540 #define _atoIQ9(A) atof(A)
4541 #define _atoIQ8(A) atof(A)
4542 #define _atoIQ7(A) atof(A)
4543 #define _atoIQ6(A) atof(A)
4544 #define _atoIQ5(A) atof(A)
4545 #define _atoIQ4(A) atof(A)
4546 #define _atoIQ3(A) atof(A)
4547 #define _atoIQ2(A) atof(A)
4548 #define _atoIQ1(A) atof(A)
4549 //---------------------------------------------------------------------------
4550 #define _IQtoa(A, B, C) sprintf(A, B, C)
4551 #define _IQ30toa(A, B, C) sprintf(A, B, C)
4552 #define _IQ29toa(A, B, C) sprintf(A, B, C)
4553 #define _IQ28toa(A, B, C) sprintf(A, B, C)
4554 #define _IQ27toa(A, B, C) sprintf(A, B, C)
4555 #define _IQ26toa(A, B, C) sprintf(A, B, C)
4556 #define _IQ25toa(A, B, C) sprintf(A, B, C)
4557 #define _IQ24toa(A, B, C) sprintf(A, B, C)
4558 #define _IQ23toa(A, B, C) sprintf(A, B, C)
4559 #define _IQ22toa(A, B, C) sprintf(A, B, C)
4560 #define _IQ21toa(A, B, C) sprintf(A, B, C)
4561 #define _IQ20toa(A, B, C) sprintf(A, B, C)
4562 #define _IQ19toa(A, B, C) sprintf(A, B, C)
4563 #define _IQ18toa(A, B, C) sprintf(A, B, C)
4564 #define _IQ17toa(A, B, C) sprintf(A, B, C)
4565 #define _IQ16toa(A, B, C) sprintf(A, B, C)
4566 #define _IQ15toa(A, B, C) sprintf(A, B, C)
4567 #define _IQ14toa(A, B, C) sprintf(A, B, C)
4568 #define _IQ13toa(A, B, C) sprintf(A, B, C)
4569 #define _IQ12toa(A, B, C) sprintf(A, B, C)
4570 #define _IQ11toa(A, B, C) sprintf(A, B, C)
4571 #define _IQ10toa(A, B, C) sprintf(A, B, C)
4572 #define _IQ9toa(A, B, C) sprintf(A, B, C)
4573 #define _IQ8toa(A, B, C) sprintf(A, B, C)
4574 #define _IQ7toa(A, B, C) sprintf(A, B, C)
4575 #define _IQ6toa(A, B, C) sprintf(A, B, C)
4576 #define _IQ5toa(A, B, C) sprintf(A, B, C)
4577 #define _IQ4toa(A, B, C) sprintf(A, B, C)
4578 #define _IQ3toa(A, B, C) sprintf(A, B, C)
4579 #define _IQ2toa(A, B, C) sprintf(A, B, C)
4580 #define _IQ1toa(A, B, C) sprintf(A, B, C)
4581 //---------------------------------------------------------------------------
4582 #define _IQabs(A) fabsf(A)
4583 #define _IQ30abs(A) fabs(A)
4584 #define _IQ29abs(A) fabs(A)
4585 #define _IQ28abs(A) fabs(A)
4586 #define _IQ27abs(A) fabs(A)
4587 #define _IQ26abs(A) fabs(A)
4588 #define _IQ25abs(A) fabs(A)
4589 #define _IQ24abs(A) fabs(A)
4590 #define _IQ23abs(A) fabs(A)
4591 #define _IQ22abs(A) fabs(A)
4592 #define _IQ21abs(A) fabs(A)
4593 #define _IQ20abs(A) fabs(A)
4594 #define _IQ19abs(A) fabs(A)
4595 #define _IQ18abs(A) fabs(A)
4596 #define _IQ17abs(A) fabs(A)
4597 #define _IQ16abs(A) fabs(A)
4598 #define _IQ15abs(A) fabs(A)
4599 #define _IQ14abs(A) fabs(A)
4600 #define _IQ13abs(A) fabs(A)
4601 #define _IQ12abs(A) fabs(A)
4602 #define _IQ11abs(A) fabs(A)
4603 #define _IQ10abs(A) fabs(A)
4604 #define _IQ9abs(A) fabs(A)
4605 #define _IQ8abs(A) fabs(A)
4606 #define _IQ7abs(A) fabs(A)
4607 #define _IQ6abs(A) fabs(A)
4608 #define _IQ5abs(A) fabs(A)
4609 #define _IQ4abs(A) fabs(A)
4610 #define _IQ3abs(A) fabs(A)
4611 #define _IQ2abs(A) fabs(A)
4612 #define _IQ1abs(A) fabs(A)
4613 //###########################################################################
4614 #endif // No more.
4615 //###########################################################################
4616 
4617 #ifdef __cplusplus
4618 }
4619 #endif // extern "C"
4620 
4622 #endif /* __IQMATHLIB_H_INCLUDED__ */
#define _IQ17atan2(A, B)
#define _IQ21sin(A)
#define _IQ29isqrt(A)
#define _IQ18toa(A, B, C)
#define _IQ30div(A, B)
#define _IQ29sin(A)
#define _IQ10div(A, B)
#define _IQ27isqrt(A)
#define _IQ7isqrt(A)
float _iq3
long _atoIQN(const char *A, long q_value)
#define _IQ27atan2PU(A, B)
#define _IQ21div(A, B)
#define _IQ8sin(A)
#define _IQ8mag(A, B)
#define _IQ3isqrt(A)
#define _IQ1rsmpy(A, B)
#define _IQ26atan2PU(A, B)
#define _IQ30toa(A, B, C)
#define _IQ9div(A, B)
#define _IQ22mpyI32int(A, B)
#define _IQ22atan2PU(A, B)
#define _IQ12toa(A, B, C)
#define _IQ22sin(A)
#define _IQ7cosPU(A)
#define _IQ3asin(A)
#define _IQ14rsmpy(A, B)
#define _IQ15exp(A)
#define _IQ14cos(A)
#define _IQ17cos(A)
#define _IQ17acos(A)
#define _IQ25frac(A)
#define _IQ14int(A)
#define _IQ6atan2(A, B)
#define _IQ2cosPU(A)
#define _IQ23atan2PU(A, B)
#define _IQ14exp(A)
#define _IQ13rsmpy(A, B)
#define _IQ29mpyI32int(A, B)
#define _IQ23mpyI32int(A, B)
#define _IQ3atan2PU(A, B)
#define _IQ28sqrt(A)
#define _IQ12rsmpy(A, B)
#define _IQ21atan2(A, B)
#define _IQ15sqrt(A)
#define _IQ5asin(A)
#define _IQ22mpyI32frac(A, B)
#define _IQ24mpyI32int(A, B)
#define _IQ5acos(A)
#define _IQ2cos(A)
#define _IQ6frac(A)
#define _IQ1int(A)
#define _IQ29rsmpy(A, B)
#define _IQ19cosPU(A)
#define _IQ4sqrt(A)
#define _IQ23acos(A)
#define _IQ5sqrt(A)
#define _IQ15atan2PU(A, B)
#define _IQ17mag(A, B)
#define _IQ20cos(A)
#define _IQ26sinPU(A)
#define _IQ18atan2PU(A, B)
#define _IQ7sin(A)
#define _IQ17asin(A)
#define _IQ2acos(A)
#define _IQ25acos(A)
#define _IQ28mag(A, B)
#define _IQ25isqrt(A)
#define _IQ23rmpy(A, B)
#define _IQ19sinPU(A)
#define _IQ22cos(A)
#define _IQ30mpyI32int(A, B)
#define _IQ14cosPU(A)
#define _IQ2mpyI32int(A, B)
#define _IQ10exp(A)
#define _IQ21mpyI32frac(A, B)
#define _IQ21toa(A, B, C)
#define _IQ24sinPU(A)
#define _IQ7toa(A, B, C)
#define _IQ19rmpy(A, B)
#define _IQ14toa(A, B, C)
#define _IQ10mpyI32frac(A, B)
#define _IQ8div(A, B)
#define _IQ23int(A)
#define _IQ1cos(A)
#define _IQ28toa(A, B, C)
#define _IQ3cos(A)
#define _IQ16asin(A)
#define _IQ9exp(A)
#define _IQ26rmpy(A, B)
#define _IQ6sqrt(A)
#define _IQ4atan2PU(A, B)
#define _IQ20acos(A)
#define _IQ20frac(A)
#define _IQ5rmpy(A, B)
#define _IQ22toF(A)
#define _IQ23isqrt(A)
#define _IQ6acos(A)
#define _IQ8cos(A)
#define _IQ9sinPU(A)
#define _IQ6div(A, B)
#define _IQ21frac(A)
#define _IQ13mpyI32int(A, B)
#define _IQ28isqrt(A)
#define _IQ30cos(A)
#define _IQ26toF(A)
#define _IQ11toF(A)
#define _IQ21exp(A)
#define _IQ16toa(A, B, C)
#define _IQ22rmpy(A, B)
#define _IQ23mag(A, B)
#define _IQ3rmpy(A, B)
#define _IQ18cos(A)
#define _IQ10atan2(A, B)
#define _IQ28mpyI32frac(A, B)
#define _IQ24sqrt(A)
#define _IQ12cos(A)
#define _IQ10rsmpy(A, B)
#define _IQ19acos(A)
#define _IQ30sin(A)
#define _IQ20atan2(A, B)
#define _IQ24exp(A)
#define _IQ2exp(A)
#define _IQ2atan2(A, B)
#define _IQ14sqrt(A)
float _iq7
#define _IQ14isqrt(A)
#define _IQ22sqrt(A)
#define _IQ23mpyI32frac(A, B)
#define _IQ4sinPU(A)
#define _IQ21sinPU(A)
#define _IQ24mpyI32frac(A, B)
#define _IQ10cosPU(A)
#define _IQ14div(A, B)
#define _IQ28sinPU(A)
#define _IQ9cos(A)
#define _IQ2rmpy(A, B)
#define _IQ13asin(A)
#define _IQ16int(A)
#define _IQ24frac(A)
#define _IQ20cosPU(A)
float _iq21
float _iq15
#define _IQ14rmpy(A, B)
#define _IQ16toF(A)
#define _IQ10sqrt(A)
#define _IQ28mpyI32int(A, B)
#define _IQ16cosPU(A)
#define _IQ7rmpy(A, B)
#define _IQ24atan2PU(A, B)
#define _IQ24atan2(A, B)
#define _IQ25toa(A, B, C)
#define _IQ22cosPU(A)
#define _IQ19toF(A)
#define _IQ1mag(A, B)
#define _IQ11mpyI32int(A, B)
#define _IQ6mpyI32int(A, B)
#define _IQ27cos(A)
#define _IQ27toa(A, B, C)
#define _IQ16sin(A)
#define _IQ27sin(A)
#define _IQ1div(A, B)
#define _IQ28exp(A)
#define _IQ20sqrt(A)
#define _IQ8int(A)
#define _IQ24cosPU(A)
#define _IQ7div(A, B)
#define _IQ15div(A, B)
#define _IQ1mpyI32int(A, B)
#define _IQ24rmpy(A, B)
#define _IQ15toa(A, B, C)
#define _IQ2asin(A)
#define _IQ12div(A, B)
#define _IQ6sin(A)
#define _IQ13rmpy(A, B)
#define _IQ10mpyI32int(A, B)
#define _IQ10int(A)
#define _IQ5isqrt(A)
#define _IQ14toF(A)
#define _IQ26mpyI32int(A, B)
#define _IQ25atan2PU(A, B)
#define _IQ15atan2(A, B)
#define _IQ18sinPU(A)
float _iq13
#define _IQ20toF(A)
#define _IQ19mag(A, B)
float _iq30
long _IQ30asin(long A)
#define _IQ27atan2(A, B)
#define _IQ24toF(A)
#define _IQ16isqrt(A)
#define _IQ3rsmpy(A, B)
#define _IQ19exp(A)
#define _IQ23asin(A)
#define _IQ11cosPU(A)
#define _IQ22toa(A, B, C)
#define _IQ14asin(A)
#define _IQ12acos(A)
float _iq20
#define _IQ20isqrt(A)
#define _IQ5mag(A, B)
#define _IQ25toF(A)
#define _IQ8rsmpy(A, B)
#define _IQ6mag(A, B)
#define _IQ26sqrt(A)
int __IQNtoa(char *A, const char *B, long C, int D)
#define _IQ18frac(A)
#define _IQ25atan2(A, B)
#define _IQ15mpyI32frac(A, B)
#define _IQ3mpyI32int(A, B)
#define _IQ29acos(A)
#define _IQ15rmpy(A, B)
#define _IQ26int(A)
#define _IQ20atan2PU(A, B)
#define _IQ30rmpy(A, B)
#define _IQ12int(A)
#define _IQ18rsmpy(A, B)
#define _IQ12mpyI32frac(A, B)
#define _IQ16cos(A)
#define _IQ27asin(A)
#define _IQ17mpyI32frac(A, B)
#define _IQ6cos(A)
#define _IQ9asin(A)
#define _IQ1atan2PU(A, B)
#define _IQ24asin(A)
#define _IQ16mag(A, B)
#define _IQ26sin(A)
float _iq8
#define _IQ30rsmpy(A, B)
#define _IQ1atan2(A, B)
#define _IQ13toa(A, B, C)
#define _IQ9mpyI32int(A, B)
#define _IQ15sin(A)
#define _IQ22asin(A)
#define _IQ21int(A)
#define _IQ22mag(A, B)
#define _IQ15asin(A)
#define _IQ16atan2(A, B)
#define _IQ6isqrt(A)
#define _IQ15mpyI32int(A, B)
#define _IQ11rmpy(A, B)
#define _IQ20div(A, B)
#define _IQ5div(A, B)
#define _IQ12sinPU(A)
#define _IQ3frac(A)
#define _IQ21rsmpy(A, B)
#define _IQ7frac(A)
#define _IQ29toa(A, B, C)
#define _IQ2div(A, B)
#define _IQ25sinPU(A)
#define _IQ1frac(A)
#define _IQ6toF(A)
#define _IQ18mag(A, B)
#define _IQ24rsmpy(A, B)
#define _IQ20rmpy(A, B)
#define _IQ8acos(A)
float _iq19
#define _IQ20mpyI32frac(A, B)
#define _IQ15int(A)
#define _IQ21rmpy(A, B)
#define _IQ10sinPU(A)
#define _IQ19asin(A)
#define _IQ19mpyI32frac(A, B)
#define _IQ29sinPU(A)
#define _IQ4cos(A)
#define _IQ8atan2(A, B)
#define _IQ14acos(A)
#define _IQ25cosPU(A)
#define _IQ18isqrt(A)
#define _IQ30int(A)
#define _IQ21toF(A)
#define _IQ14mpyI32frac(A, B)
#define _IQ11exp(A)
#define _IQ21cos(A)
#define _IQ18cosPU(A)
#define _IQ11toa(A, B, C)
#define _IQ30atan2PU(A, B)
#define _IQ11sqrt(A)
#define _IQ11isqrt(A)
#define _IQ13toF(A)
#define _IQ24toa(A, B, C)
#define _IQ21acos(A)
#define _IQ30frac(A)
#define _IQ27cosPU(A)
#define _IQ30mpyI32frac(A, B)
#define _IQ5toa(A, B, C)
#define _IQ22atan2(A, B)
#define _IQ18sqrt(A)
#define _IQ6rmpy(A, B)
#define _IQ28frac(A)
#define _IQ12mpyI32int(A, B)
#define _IQ25int(A)
#define _IQ8sqrt(A)
#define _IQ11atan2(A, B)
#define _IQ4mpyI32frac(A, B)
#define _IQ29mag(A, B)
#define _IQ23atan2(A, B)
#define _IQ19int(A)
#define _IQ8mpyI32frac(A, B)
#define _IQ9isqrt(A)
#define _IQ16exp(A)
#define _IQ20mpyI32int(A, B)
#define _IQ12sqrt(A)
#define _IQ26frac(A)
#define _IQ1isqrt(A)
#define _IQ5sin(A)
#define _IQ22div(A, B)
#define _IQ17int(A)
#define _IQ17sinPU(A)
#define _IQ27rsmpy(A, B)
#define _IQ15isqrt(A)
#define _IQ1asin(A)
#define _IQ3toF(A)
#define _IQ12rmpy(A, B)
#define _IQ13sin(A)
#define _IQ1toa(A, B, C)
float _iq2
#define _IQ7atan2(A, B)
#define _IQ2toF(A)
#define _IQ29cos(A)
#define _IQ11div(A, B)
#define _IQ7cos(A)
#define _IQ22isqrt(A)
float _iq4
float _iq
#define _IQ8isqrt(A)
#define _IQ29sqrt(A)
#define _IQ30toF(A)
#define _IQ26asin(A)
#define _IQ2mag(A, B)
#define _IQ13div(A, B)
#define _IQ12frac(A)
#define _IQ8asin(A)
#define _IQ8rmpy(A, B)
#define _IQ2int(A)
#define _IQ24cos(A)
#define _IQ24sin(A)
#define _IQ9cosPU(A)
float _iq26
#define _IQ10toF(A)
#define _IQ29toF(A)
#define _IQ20toa(A, B, C)
#define _IQ9frac(A)
#define _IQ2sqrt(A)
#define _IQ24mag(A, B)
#define _IQ3mag(A, B)
#define _IQ1exp(A)
#define _IQ26div(A, B)
#define _IQ4atan2(A, B)
#define _IQ29exp(A)
#define _IQ15cos(A)
#define _IQ3sqrt(A)
#define _IQ19toa(A, B, C)
#define _IQ28atan2PU(A, B)
#define _IQ12sin(A)
#define _IQ29atan2PU(A, B)
float _iq27
#define _IQ7sqrt(A)
#define _IQ19div(A, B)
#define _IQ25rmpy(A, B)
#define _IQ21mag(A, B)
#define _IQ28cosPU(A)
#define _IQ8mpyI32int(A, B)
#define _IQ2frac(A)
#define _IQ4toF(A)
#define _IQ10asin(A)
#define _IQ17div(A, B)
#define _IQ22acos(A)
#define _IQ25mpyI32int(A, B)
#define _IQ4exp(A)
#define _IQ20sinPU(A)
#define _IQ19sqrt(A)
#define _IQ18int(A)
#define _IQ25exp(A)
#define _IQ6atan2PU(A, B)
#define _IQ5sinPU(A)
#define _IQ3sin(A)
#define _IQ12cosPU(A)
#define _IQ13cosPU(A)
#define _IQ28acos(A)
#define _IQ19isqrt(A)
#define _IQ26atan2(A, B)
#define _IQ18toF(A)
#define _IQ17isqrt(A)
#define _IQ16mpyI32int(A, B)
#define _IQ21sqrt(A)
#define _IQ23sinPU(A)
#define _IQ28toF(A)
#define _IQ22sinPU(A)
#define _IQ21mpyI32int(A, B)
#define _IQ13cos(A)
#define _IQ9atan2(A, B)
#define _IQ1mpyI32frac(A, B)
float _iq1
#define _IQ3acos(A)
#define _IQ5atan2(A, B)
float _iq11
#define _IQ16rmpy(A, B)
#define _IQ30cosPU(A)
#define _IQ4rmpy(A, B)
#define _IQ15acos(A)
#define _IQ14mpyI32int(A, B)
#define _IQ11mpyI32frac(A, B)
#define _IQ7int(A)
#define _IQ12toF(A)
#define _IQ4cosPU(A)
#define _IQ19rsmpy(A, B)
#define _IQ25asin(A)
#define _IQ13int(A)
#define _IQ4asin(A)
#define _IQ8sinPU(A)
#define _IQ20mag(A, B)
#define _IQ5mpyI32frac(A, B)
#define _IQ5toF(A)
float _iq25
#define _IQ24int(A)
#define _IQ27int(A)
#define _IQ4acos(A)
#define _IQ2isqrt(A)
#define _IQ12asin(A)
float _iq10
#define _IQ24isqrt(A)
#define _IQ7mpyI32frac(A, B)
#define _IQ10cos(A)
#define _IQ12exp(A)
#define _IQ30isqrt(A)
#define _IQ23frac(A)
#define _IQ13sqrt(A)
#define _IQ1sqrt(A)
#define _IQ4isqrt(A)
#define _IQ23cosPU(A)
#define _IQ26toa(A, B, C)
#define _IQ20sin(A)
#define _IQ14mag(A, B)
#define _IQ19sin(A)
#define _IQ24acos(A)
#define _IQ8cosPU(A)
#define _IQ19mpyI32int(A, B)
#define _IQ23toF(A)
#define _IQ10mag(A, B)
#define _IQ19cos(A)
#define _IQ20asin(A)
#define _IQ2mpyI32frac(A, B)
#define _IQ6int(A)
#define _IQ7rsmpy(A, B)
#define _IQ30mag(A, B)
#define _IQ10atan2PU(A, B)
#define _IQ27div(A, B)
#define _IQ11acos(A)
#define _IQ21atan2PU(A, B)
float _iq17
#define _IQ18rmpy(A, B)
#define _IQ23rsmpy(A, B)
#define _IQ20int(A)
#define _IQ7exp(A)
#define _IQ13exp(A)
#define _IQ13atan2(A, B)
#define _IQ3toa(A, B, C)
#define _IQ28rsmpy(A, B)
#define _IQ17exp(A)
float _iq12
#define _IQ27mpyI32int(A, B)
#define _IQ16acos(A)
#define _IQ3mpyI32frac(A, B)
#define _IQ7asin(A)
#define _IQ17rmpy(A, B)
#define _IQ5cos(A)
#define _IQ21asin(A)
#define _IQ27sinPU(A)
#define _IQ21isqrt(A)
#define _IQ11frac(A)
#define _IQ13frac(A)
#define _IQ26acos(A)
float _iq24
#define _IQ6exp(A)
#define _IQ5mpyI32int(A, B)
float _iq14
#define _IQ13mpyI32frac(A, B)
#define _IQ4div(A, B)
#define _IQ3exp(A)
#define _IQ28rmpy(A, B)
#define _IQ22rsmpy(A, B)
#define _IQ21cosPU(A)
#define _IQ11int(A)
#define _IQ18mpyI32int(A, B)
#define _IQ1cosPU(A)
#define _IQ22int(A)
#define _IQ10frac(A)
#define _IQ19atan2PU(A, B)
#define _IQ18div(A, B)
#define _IQ9rmpy(A, B)
#define _IQ15cosPU(A)
#define _IQ8frac(A)
#define _IQ2sin(A)
#define _IQ14sin(A)
#define _IQ28atan2(A, B)
#define _IQ9toF(A)
#define _IQ30sqrt(A)
#define _IQ5int(A)
#define _IQ10rmpy(A, B)
#define _IQ12atan2(A, B)
#define _IQ25cos(A)
#define _IQ15mag(A, B)
#define _IQ10isqrt(A)
#define _IQ8atan2PU(A, B)
#define _IQ16atan2PU(A, B)
#define _IQ17cosPU(A)
#define _IQ6cosPU(A)
#define _IQ2atan2PU(A, B)
#define _IQ26exp(A)
#define _IQ9sqrt(A)
#define _IQ29asin(A)
#define _IQ28div(A, B)
#define _IQ13mag(A, B)
#define _IQ2sinPU(A)
#define _IQ9rsmpy(A, B)
#define _IQ22exp(A)
#define _IQ27mag(A, B)
#define _IQ8toF(A)
#define _IQ26mpyI32frac(A, B)
#define _IQ17frac(A)
#define _IQ26isqrt(A)
#define _IQ4frac(A)
#define _IQ17sin(A)
#define _IQ29int(A)
#define _IQ5exp(A)
#define _IQ11asin(A)
#define _IQ7mpyI32int(A, B)
#define _IQ29div(A, B)
#define _IQ14atan2(A, B)
#define _IQ26mag(A, B)
#define _IQ10sin(A)
#define _IQ11cos(A)
#define _IQ6asin(A)
float _iq18
#define _IQ11mag(A, B)
#define _IQ10acos(A)
#define _IQ19frac(A)
#define _IQ26rsmpy(A, B)
long _IQ30acos(long A)
#define _IQ7atan2PU(A, B)
#define _IQ8toa(A, B, C)
#define _IQ25mpyI32frac(A, B)
#define _IQ3div(A, B)
#define _IQ22frac(A)
#define _IQ16sqrt(A)
#define _IQ18atan2(A, B)
#define _IQ5cosPU(A)
#define _IQ28cos(A)
#define _IQ27mpyI32frac(A, B)
#define _IQ18acos(A)
#define _IQ4mag(A, B)
#define _IQ17rsmpy(A, B)
#define _IQ9atan2PU(A, B)
#define _IQ4rsmpy(A, B)
#define _IQ5atan2PU(A, B)
#define _IQ17atan2PU(A, B)
#define _IQ13isqrt(A)
#define _IQ28int(A)
#define _IQ16mpyI32frac(A, B)
#define _IQ9mpyI32frac(A, B)
#define _IQ9sin(A)
float _iq22
#define _IQ23div(A, B)
#define _IQ12atan2PU(A, B)
#define _IQ23sqrt(A)
#define _IQ5frac(A)
#define _IQ17toa(A, B, C)
#define _IQ11sin(A)
#define _IQ11sinPU(A)
#define _IQ4toa(A, B, C)
#define _IQ27toF(A)
#define _IQ9mag(A, B)
#define _IQ26cos(A)
#define _IQ7mag(A, B)
#define _IQ18exp(A)
#define _IQ20exp(A)
#define _IQ25sin(A)
#define _IQ23toa(A, B, C)
#define _IQ1acos(A)
#define _IQ2toa(A, B, C)
#define _IQ16div(A, B)
#define _IQ17sqrt(A)
#define _IQ29mpyI32frac(A, B)
#define _IQ2rsmpy(A, B)
#define _IQ1rmpy(A, B)
#define _IQ9int(A)
#define _IQ12isqrt(A)
#define _IQ4sin(A)
#define _IQ30sinPU(A)
#define _IQ6rsmpy(A, B)
#define _IQ4int(A)
#define _IQ6sinPU(A)
#define _IQ11atan2PU(A, B)
#define _IQ20rsmpy(A, B)
#define _IQ8exp(A)
#define _IQ7acos(A)
#define _IQ10toa(A, B, C)
#define _IQ18sin(A)
#define _IQ16sinPU(A)
#define _IQ25mag(A, B)
float _iq9
#define _IQ16rsmpy(A, B)
#define _IQ28sin(A)
#define _IQ27acos(A)
#define _IQ30exp(A)
#define _IQ27frac(A)
#define _IQ3int(A)
#define _IQ13sinPU(A)
#define _IQ19atan2(A, B)
#define _IQ14frac(A)
#define _IQ23exp(A)
#define _IQ7toF(A)
float _iq28
#define _IQ14atan2PU(A, B)
#define _IQ29rmpy(A, B)
#define _IQ14sinPU(A)
#define _IQ1toF(A)
#define _IQ15frac(A)
float _iq23
#define _IQ18mpyI32frac(A, B)
#define _IQ29cosPU(A)
float _iq29
#define _IQ27rmpy(A, B)
float _iq16
#define _IQ25div(A, B)
#define _IQ18asin(A)
#define _IQ29atan2(A, B)
#define _IQ11rsmpy(A, B)
#define _IQ27sqrt(A)
#define _IQ16frac(A)
#define _IQ3cosPU(A)
#define _IQ3sinPU(A)
#define _IQ17mpyI32int(A, B)
#define _IQ3atan2(A, B)
#define _IQ13acos(A)
#define _IQ30atan2(A, B)
#define _IQ15rsmpy(A, B)
#define _IQ28asin(A)
#define _IQ5rsmpy(A, B)
#define _IQ25sqrt(A)
#define _IQ9acos(A)
#define _IQ1sinPU(A)
#define _IQ24div(A, B)
#define _IQ15toF(A)
#define _IQ17toF(A)
#define _IQ6toa(A, B, C)
#define _IQ15sinPU(A)
#define _IQ9toa(A, B, C)
#define _IQ4mpyI32int(A, B)
#define _IQ6mpyI32frac(A, B)
float _iq6
#define _IQ27exp(A)
#define _IQ12mag(A, B)
#define _IQ25rsmpy(A, B)
#define _IQ23cos(A)
#define _IQ1sin(A)
#define _IQ13atan2PU(A, B)
float _iq5
#define _IQ29frac(A)
#define _IQ26cosPU(A)
#define _IQ7sinPU(A)
#define _IQ23sin(A)