- Documented /N/M.
[tangerine.git] / compiler / arossupport / include / mathieee64bitdefines.h
blob9de523db31cd557a8acd85cec188545dea6c31d0
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Some shortcuts that provide the highest flexibility
6 for 64bit and 32bit Systems.
7 */
9 #ifndef __MATHIEEE64BIT_DEFINES_H__
10 #define __MATHIEEE64BIT_DEFINES_H__
14 #if defined(AROS_64BIT_TYPE)
15 # define Get_High32of64(val) ((QUAD)(val) >> 32L )
16 # define Set_High32of64(Dest,Src) Dest = ConvertTo64(Src,Get_Low32of64(Dest))
17 # define Get_Low32of64(val) ((QUAD)(val) & 0xFFFFFFFF)
18 # define Set_Low32of64(Dest,Src) Dest = ConvertTo64(Get_High32of64(Dest),Src)
19 # define ConvertTo64(HI,LO) ((((QUAD)(HI)) << 32L) | LO)
20 #else
21 # define Get_High32of64(val) ((val).high)
22 # define Set_High32of64(Dest,Src) ((Dest).high) = Src
23 # define Get_Low32of64(val) ((val).low)
24 # define Set_Low32of64(Dest,Src) ((Dest).low) = Src
25 # define ConvertTo64(HI,LO) {HI,LO}
26 #endif
28 #if defined AROS_64BIT_TYPE
29 #define QuadData(Const64_Hi, Const64_Lo, Const64) \
30 ConvertTo64(Const64_Hi, Const64_Lo)
31 #else
32 #define QuadData(Const64_Hi, Const64_Lo, Const64) \
33 {Const64_Hi, Const64_Lo}
34 #endif
38 /* XOR */
40 #if defined AROS_64BIT_TYPE
41 #define XOR64C(Dest64, Var1_64, Const64_Hi, Const64_Lo) \
42 Dest64 = Var1_64 ^ ConvertTo64(Const64_Hi, Const64_Lo)
43 #else
44 #define XOR64C(Dest64, Var1_64, Const64_Hi, Const64_Lo) \
45 { \
46 Set_High32of64(Dest64, Get_High32of64(Var1_64) ^ Const64_Hi); \
47 Set_Low32of64( Dest64, Get_Low32of64(Var1_64) ^ Const64_Lo); \
49 #endif
51 #if defined AROS_64BIT_TYPE
52 #define XOR64QC(Dest64, Const64_Hi, Const64_Lo) \
53 Dest64 ^= ConvertTo64(Const64_Hi, Const64_Lo)
54 #else
55 #define XOR64QC(Dest64, Const64_Hi, Const64_Lo) \
56 { \
57 Set_High32of64(Dest64, Get_High32of64(Dest64) ^ Const64_Hi); \
58 Set_Low32of64( Dest64, Get_Low32of64(Dest64) ^ Const64_Lo); \
60 #endif
62 /* NOT */
64 #if defined AROS_64BIT_TYPE
65 #define NOT64(Dest64, Src64) \
66 Dest64 = ~Src64 ;
67 #else
68 #define NOT64(Dest64, Src64) \
69 { \
70 Set_High32of64(Dest64, ~Get_High32of64(Src64)); \
71 Set_Low32of64( Dest64, ~Get_Low32of64 (Src64)); \
73 #endif
76 /* OR */
78 #if defined AROS_64BIT_TYPE
79 #define OR64(Dest64, Var1_64, Var2_64) \
80 Dest64 = Var1_64 | Var2_64 ;
81 #else
82 #define OR64(Dest64, Var1_64, Var2_64) \
83 { \
84 Set_High32of64(Dest64, (Get_High32of64(Var1_64) | Get_High32of64(Var2_64))); \
85 Set_Low32of64( Dest64, (Get_Low32of64 (Var1_64) | Get_Low32of64 (Var2_64))); \
87 #endif
89 #if defined AROS_64BIT_TYPE
90 #define OR64Q(Dest64, Var64) \
91 Dest64 |= Var64 ;
92 #else
93 #define OR64Q(Dest64, Var64) \
94 { \
95 Set_High32of64(Dest64, (Get_High32of64(Dest64) | Get_High32of64(Var64))); \
96 Set_Low32of64( Dest64, (Get_Low32of64 (Dest64) | Get_Low32of64 (Var64))); \
98 #endif
100 #if defined AROS_64BIT_TYPE
101 #define OR64C(Dest64, Var64, Const64_Hi, Const64_Lo) \
102 Dest64 = Var64 | ConvertTo64(Const64_Hi, Const64_Lo);
103 #else
104 #define OR64C(Dest64, Var64, Const64_Hi, Const64_Lo) \
106 Set_High32of64(Dest64, Get_High32of64(Var64) | Const64_Hi); \
107 Set_Low32of64( Dest64, Get_Low32of64(Var64) | Const64_Lo); \
109 #endif
111 #if defined AROS_64BIT_TYPE
112 #define OR64QC(Dest64, Const64_Hi, Const64_Lo) \
113 Dest64 |= ConvertTo64(Const64_Hi, Const64_Lo);
114 #else
115 #define OR64QC(Dest64, Const64_Hi, Const64_Lo) \
117 Set_High32of64(Dest64, Get_High32of64(Dest64) | Const64_Hi); \
118 Set_Low32of64( Dest64, Get_Low32of64(Dest64) | Const64_Lo); \
120 #endif
122 /* AND */
124 #if defined AROS_64BIT_TYPE
125 #define AND64C(Dest64, Var64, Const64_Hi, Const64_Lo) \
126 Dest64 = Var64 & ConvertTo64(Const64_Hi, Const64_Lo) ;
127 #else
128 #define AND64C(Dest64, Var64, Const64_Hi, Const64_Lo) \
130 Set_High32of64(Dest64, Get_High32of64(Var64) & Const64_Hi); \
131 Set_Low32of64( Dest64, Get_Low32of64(Var64) & Const64_Lo); \
133 #endif
135 #if defined AROS_64BIT_TYPE
136 #define AND64Q(Dest64, Var64) \
137 Dest64 &= Var64 ;
138 #else
139 #define AND64Q(Dest64, Var64) \
141 Set_High32of64(Dest64, (Get_High32of64(Dest64) & Get_High32of64(Var64))); \
142 Set_Low32of64( Dest64, (Get_Low32of64 (Dest64) & Get_Low32of64 (Var64))); \
144 #endif
146 #if defined AROS_64BIT_TYPE
147 #define AND64QC(Dest64, Const64_Hi, Const64_Lo) \
148 Dest64 &= ConvertTo64(Const64_Hi, Const64_Lo) ;
149 #else
150 #define AND64QC(Dest64, Const64_Hi, Const64_Lo) \
152 Set_High32of64(Dest64, Get_High32of64(Dest64) & Const64_Hi); \
153 Set_Low32of64( Dest64, Get_Low32of64(Dest64) & Const64_Lo); \
155 #endif
158 /* SHL (shift left n bits)*/
160 #if defined AROS_64BIT_TYPE
161 #define SHL64(Dest64, Src64, n) \
162 Dest64 = Src64 << (n);
163 #else
164 #define SHL64(Dest64, Src64, n) \
165 if( n < 32) \
167 Set_High32of64(Dest64, (Get_High32of64(Src64) << n) | \
168 (ULONG)(Get_Low32of64 (Src64)) >> (32-(n)) ); \
169 Set_Low32of64(Dest64, (Get_Low32of64 (Src64) << n) ); \
171 else \
172 if (n < 64) \
174 Set_High32of64(Dest64, (ULONG)Get_Low32of64(Src64) << ( (n)-32) );\
175 Set_Low32of64(Dest64, 0 ); \
177 else \
178 if (n > 64) \
180 Set_High32of64(Dest64, 0); \
181 Set_Low32of64(Dest64, 0); \
183 #endif
186 #if defined AROS_64BIT_TYPE
187 #define SHL32(Dest64, Src32, Shift) \
188 Dest64 = ((QUAD)Src32) << (Shift);
189 #else
190 #define SHL32(Dest64, Src32, Shift) \
191 if( Shift < 32) \
193 Set_High32of64(Dest64, (Src32 >> (32-(Shift)) ) ); \
194 Set_Low32of64 (Dest64, (Src32 << (Shift) ) ); \
196 else \
198 if (Shift < 64) \
200 Set_High32of64(Dest64, (Src32 << ((Shift)-32)) ); \
201 Set_Low32of64 (Dest64, 0 ); \
203 else \
204 Set_Value64C(Dest64, 0, 0); \
206 #endif
209 /* SHR (shifting to the right **signed/unsigned**) */
211 #if defined AROS_64BIT_TYPE
212 #define SHRU64(Dest64, Src64, Shift) \
213 Dest64 = (UQUAD)Src64 >> (Shift);
214 #else
215 #define SHRU64(Dest64, Src64, Shift) \
216 if( (Shift) < 32) \
218 Set_Low32of64 (Dest64,((ULONG)Get_Low32of64 (Src64) >> (Shift) )| \
219 ( Get_High32of64(Src64) <<(32-(Shift))) ); \
220 Set_High32of64(Dest64, (ULONG)Get_High32of64(Src64) >> (Shift) ); \
222 else \
224 if ((Shift) < 64) \
226 Set_Low32of64 (Dest64, (ULONG)Get_High32of64(Src64) >> ((Shift)-32) ); \
227 Set_High32of64(Dest64, 0); \
229 else \
231 Set_High32of64(Dest64, 0); \
232 Set_Low32of64(Dest64, 0); \
235 #endif
238 #if defined AROS_64BIT_TYPE
239 #define SHRU32(Dest32, Src64, Shift) \
240 Dest32 = (UQUAD)Src64 >> (Shift);
241 #else
242 #define SHRU32(Dest32, Src64, Shift) \
243 if( (Shift) < 32) \
245 Dest32 = (ULONG)Get_Low32of64(Src64) >> (Shift) | \
246 Get_High32of64(Src64) << (32-(Shift)) \
248 else \
250 if ((Shift) < 64) \
252 Dest32 = (ULONG)Get_High32of64(Src64) >> ((Shift)-32) ; \
254 else \
256 Dest32 = 0; \
259 #endif
262 /* SHR ** signed ** */
264 #if defined AROS_64BIT_TYPE
265 #define SHRS64(Dest64, Src64, n) \
266 Dest64 = (QUAD)Src64 >> n;
267 #else
268 #define SHRS64(Dest64, Src64, n) \
270 if( n < 32) \
272 Set_Low32of64 (Dest64, (ULONG)Get_Low32of64(Src64) >> (n) | \
273 Get_High32of64(Src64) << ((n)-32)); \
274 Set_High32of64(Dest64, ((LONG)Get_High32of64(Src64) >> (n)) ); \
276 else \
277 if (n < 64) \
279 Set_Low32of64 (Dest64, (LONG)Get_High32of64(Src64) >> ((n)-32) );\
280 Set_High32of64(Dest64, (LONG)Get_High32of64(Src64) >> 32 ); \
282 else \
284 Set_High32of64(Dest64, (LONG)Get_High32of64(Src64) >> 32 ); \
285 Set_Low32of64 (Dest64, (LONG)Get_High32of64(Src64) >> 32 ); \
288 #endif
290 /* Set_Value */
292 #if defined AROS_64BIT_TYPE
293 #define Set_Value64(Dest64, Var64) \
294 Dest64 = Var64
295 #else
296 #define Set_Value64(Dest64, Var64) \
298 Set_High32of64(Dest64, Get_High32of64(Var64)); \
299 Set_Low32of64(Dest64, Get_Low32of64(Var64)); \
301 #endif
303 #if defined AROS_64BIT_TYPE
304 #define Set_Value64C(Dest64, Const64_Hi, Const64_Lo) \
305 Dest64 = ConvertTo64(Const64_Hi, Const64_Lo)
306 #else
307 #define Set_Value64C(Dest64, Const64_Hi, Const64_Lo) \
309 Set_High32of64(Dest64, Const64_Hi);\
310 Set_Low32of64 (Dest64, Const64_Lo);\
312 #endif
314 #if defined AROS_64BIT_TYPE
315 #define Set_Value64from32(Dest64, Var32) \
316 Dest64 = (QUAD)Var32
317 #else
318 #define Set_Value64from32(Dest64, Var32) \
320 Set_Low32of64 (Dest64, Var32); \
321 Set_High32of64(Dest64, 0); \
323 #endif
326 /* Comparisons */
328 #if defined AROS_64BIT_TYPE
329 #define is_eq(Var1_64, Var2_64) \
330 (Var1_64 == Var2_64)
331 #else
332 #define is_eq(Var1_64, Var2_64) \
333 (Get_Low32of64(Var1_64) == Get_Low32of64(Var2_64) && \
334 Get_High32of64(Var1_64) == Get_High32of64(Var2_64))
335 #endif
337 #if defined AROS_64BIT_TYPE
338 #define is_eqC(Var1_64, Const64_Hi, Const64_Lo) \
339 (Var1_64 == ConvertTo64(Const64_Hi, Const64_Lo))
340 #else
341 #define is_eqC(Var64, Const64_Hi, Const64_Lo) \
342 (Get_Low32of64(Var64) == Const64_Lo && \
343 Get_High32of64(Var64) == Const64_Hi )
344 #endif
346 #if defined AROS_64BIT_TYPE
347 #define is_neq(Var1_64, Var2_64) \
348 (Var1_64 != Var2_64)
349 #else
350 #define is_neq(Var1_64, Var2_64) \
351 (Get_Low32of64 (Var1_64) != Get_Low32of64 (Var2_64) || \
352 Get_High32of64(Var1_64) != Get_High32of64(Var2_64) )
353 #endif
355 #if defined AROS_64BIT_TYPE
356 #define is_neqC(Var64, Const64_Hi, Const64_Lo) \
357 (Var64 != ConvertTo64(Const64_Hi, Const64_Lo))
358 #else
359 #define is_neqC(Var64, Const64_Hi, Const64_Lo) \
360 (Get_Low32of64(Var64) != Const64_Lo || \
361 Get_High32of64(Var64) != Const64_Hi )
362 #endif
364 #if defined AROS_64BIT_TYPE
365 #define is_greater(Var1_64, Var2_64 ) \
366 (Var1_64 > Var2_64)
367 #else
368 #define is_greater(Var1_64, Var2_64 ) \
369 ( (Get_High32of64(Var1_64) > Get_High32of64(Var2_64)) || \
370 (Get_High32of64(Var1_64) == Get_High32of64(Var2_64) && \
371 Get_Low32of64(Var1_64) > Get_Low32of64(Var2_64) ) )
372 #endif
374 #if defined AROS_64BIT_TYPE
375 #define is_greaterC(Var1_64, Const64_Hi, Const64_Lo ) \
376 (Var1_64 > ConvertTo64(Const64_Hi, Const64_Lo))
377 #else
378 #define is_greaterC(Var1_64, Const64_Hi, Const64_Lo ) \
379 ( (Get_High32of64(Var1_64) > Const64_Hi) || \
380 (Get_High32of64(Var1_64) == Const64_Hi && \
381 Get_Low32of64 (Var1_64) > Const64_Hi) )
382 #endif
384 #if defined AROS_64BIT_TYPE
385 #define is_geq(Var1_64, Var2_64 ) \
386 (Var1_64 >= Var2_64)
387 #else
388 #define is_geq(Var1_64, Var2_64 ) \
389 ( (Get_High32of64(Var1_64) >= Get_High32of64(Var2_64)) || \
390 (Get_High32of64(Var1_64) == Get_High32of64(Var2_64) && \
391 Get_High32of64(Var1_64) >= Get_High32of64(Var2_64) ) )
392 #endif
394 #if defined AROS_64BIT_TYPE
395 #define is_geqC(Var1_64, Const64_Hi, Const64_Lo ) \
396 (Var1_64 > ConvertTo64(Const64_Hi, Const64_Lo))
397 #else
398 #define is_geqC(Var1_64, Const64_Hi, Const64_Lo ) \
399 ( (Get_High32of64(Var1_64) >= Const64_Hi) || \
400 (Get_High32of64(Var1_64) == Const64_Hi && \
401 Get_Low32of64(Var1_64) >= Const64_Lo) )
402 #endif
404 #if defined AROS_64BIT_TYPE
405 #define is_less(Var1_64, Var2_64 ) \
406 (Var1_64 < Var2_64)
407 #else
408 #define is_less(Var1_64, Var2_64 ) \
409 ( ((ULONG)Get_High32of64(Var1_64) < (ULONG)Get_High32of64(Var2_64)) || \
410 ((ULONG)Get_High32of64(Var1_64) == (ULONG)Get_High32of64(Var2_64) && \
411 (ULONG)Get_Low32of64(Var1_64) < (ULONG)Get_Low32of64(Var2_64) ) )
412 #endif
414 #if defined AROS_64BIT_TYPE
415 #define is_lessC(Var1_64, Const64_Hi, Const64_Lo ) \
416 ((UQUAD)Var1_64 < (UQUAD)ConvertTo64(Const64_Hi, Const64_Lo))
417 #else
418 #define is_lessC(Var1_64, Const64_Hi, Const64_Lo ) \
419 ( ((ULONG)Get_High32of64(Var1_64) < (ULONG)Const64_Hi) || \
420 ((ULONG)Get_High32of64(Var1_64) == (ULONG)Const64_Hi && \
421 (ULONG)Get_Low32of64(Var1_64) < (ULONG)Const64_Lo) )
422 #endif
424 #if defined AROS_64BIT_TYPE
425 #define is_lessSC(Var1_64, Const64_Hi, Const64_Lo ) \
426 ((QUAD)Var1_64 < (QUAD)ConvertTo64(Const64_Hi, Const64_Lo) )
427 #else
428 #define is_lessSC(Var1_64, Const64_Hi, Const64_Lo ) \
429 ( ((LONG)Get_High32of64(Var1_64) < (LONG)Const64_Hi) || \
430 ((LONG)Get_High32of64(Var1_64) == (LONG)Const64_Hi && \
431 (LONG)Get_Low32of64(Var1_64) < (LONG)Const64_Lo) )
432 #endif
434 #if defined AROS_64BIT_TYPE
435 #define is_leq(Var1_64, Var2_64 ) \
436 ((UQUAD)Var1_64 <= (UQUAD)Var2_64)
437 #else
438 #define is_leq(Var1_64, Var2_64 ) \
439 /* first comparison has to be a "<" !!! */ \
440 ( ((ULONG)Get_High32of64(Var1_64) < (ULONG)Get_High32of64(Var2_64)) || \
441 ((ULONG)Get_High32of64(Var1_64) == (ULONG)Get_High32of64(Var2_64) && \
442 (ULONG) Get_Low32of64(Var1_64) <= (ULONG) Get_Low32of64(Var2_64) ) )
443 #endif
445 #if defined AROS_64BIT_TYPE
446 #define is_leqC(Var1_64, Const64_Hi, Const64_Lo ) \
447 ((UQUAD)Var1_64 <= (UQUAD)ConvertTo64(Const64_Hi, Const64_Lo))
448 #else
449 #define is_leqC(Var1_64, Const64_Hi, Const64_Lo ) \
450 /* first comparison has to be a "<" !!! */ \
451 ( ((ULONG)Get_High32of64(Var1_64) < (ULONG)Const64_Hi) || \
452 ((ULONG)Get_High32of64(Var1_64) == (ULONG)Const64_Hi && \
453 (ULONG)Get_Low32of64(Var1_64) <= (ULONG)Const64_Lo) )
454 #endif
456 #if defined AROS_64BIT_TYPE
457 #define is_leqSC(Var1_64, Const64_Hi, Const64_Lo ) \
458 ((QUAD)Var1_64 <= (QUAD)ConvertTo64(Const64_Hi, Const64_Lo))
459 #else
460 #define is_leqSC(Var1_64, Const64_Hi, Const64_Lo ) \
461 /* first comparison has to be a "<" !!! */ \
462 ( (( LONG)Get_High32of64(Var1_64) < ( LONG)Const64_Hi) || \
463 (( LONG)Get_High32of64(Var1_64) == ( LONG)Const64_Hi && \
464 (ULONG)Get_Low32of64(Var1_64) <= (ULONG)Const64_Lo) )
465 #endif
467 /* arithmetic */
469 #if defined AROS_64BIT_TYPE
470 #define ADD64(Dest64, Var1_64, Var2_64) \
471 Dest64 = Var1_64 + Var2_64;
472 #else
473 #define ADD64(Dest64, Var1_64, Var2_64) \
474 if ((LONG) Get_Low32of64(Var1_64) < 0 && \
475 (LONG) Get_Low32of64(Var2_64) < 0 ) \
477 Set_Low32of64 (Dest64, Get_Low32of64 (Var1_64) + Get_Low32of64 (Var2_64) ); \
478 Set_High32of64(Dest64, Get_High32of64(Var1_64) + Get_High32of64(Var2_64) + 1 ); \
480 else \
481 if ((LONG) Get_Low32of64(Var1_64) >= 0 && \
482 (LONG) Get_Low32of64(Var2_64) >= 0 ) \
484 Set_Low32of64 (Dest64, Get_Low32of64 (Var1_64) + Get_Low32of64 (Var2_64) ); \
485 Set_High32of64(Dest64, Get_High32of64(Var1_64) + Get_High32of64(Var2_64) ); \
487 else \
489 Set_Low32of64 (Dest64, Get_Low32of64 (Var1_64) + Get_Low32of64 (Var2_64) ); \
490 if ((LONG)Get_Low32of64(Dest64) >= 0 ) \
491 Set_High32of64(Dest64, Get_High32of64(Var1_64) + Get_High32of64(Var2_64) + 1 ); \
492 else \
493 Set_High32of64(Dest64, Get_High32of64(Var1_64) + Get_High32of64(Var2_64) ); \
495 #endif
497 #if defined AROS_64BIT_TYPE
498 #define ADD64Q(Dest64, Var64) \
499 Dest64 += Var64;
500 #else
501 #define ADD64Q(Dest64, Var64) \
502 if ((LONG) Get_Low32of64(Dest64) < 0 && \
503 (LONG) Get_Low32of64(Var64) < 0 ) \
505 Set_Low32of64 (Dest64, Get_Low32of64 (Dest64) + Get_Low32of64 (Var64) ); \
506 Set_High32of64(Dest64, Get_High32of64(Dest64) + Get_High32of64(Var64) + 1 ); \
508 else \
509 if ((LONG) Get_Low32of64(Dest64) >= 0 && \
510 (LONG) Get_Low32of64(Var64) >= 0 ) \
512 Set_Low32of64 (Dest64, Get_Low32of64 (Dest64) + Get_Low32of64 (Var64) ); \
513 Set_High32of64(Dest64, Get_High32of64(Dest64) + Get_High32of64(Var64) ); \
515 else \
517 Set_Low32of64 (Dest64, Get_Low32of64 (Dest64) + Get_Low32of64 (Var64) ); \
518 if ((LONG)Get_Low32of64(Dest64) >= 0 ) \
519 Set_High32of64(Dest64, Get_High32of64(Dest64) + Get_High32of64(Var64) + 1 ); \
520 else \
521 Set_High32of64(Dest64, Get_High32of64(Dest64) + Get_High32of64(Var64) ); \
523 #endif
525 #if defined AROS_64BIT_TYPE
526 #define ADD64QC(Dest64, Const64_Hi, Const64_Lo ) \
527 Dest64 += ConvertTo64(Const64_Hi, Const64_Lo);
528 #else
529 #define ADD64QC(Dest64, Const64_Hi, Const64_Lo ) \
530 if ((LONG) Get_Low32of64(Dest64) < 0 && \
531 (LONG) Const64_Lo < 0 ) \
533 Set_Low32of64 (Dest64, Get_Low32of64 (Dest64) + Const64_Lo ); \
534 Set_High32of64(Dest64, Get_High32of64(Dest64) + Const64_Hi + 1 ); \
536 else \
537 if ((LONG) Get_Low32of64(Dest64) >= 0 && \
538 (LONG) Const64_Lo >= 0 ) \
540 Set_Low32of64 (Dest64, Get_Low32of64 (Dest64) + Const64_Lo ); \
541 Set_High32of64(Dest64, Get_High32of64(Dest64) + Const64_Hi ); \
543 else \
545 Set_Low32of64 (Dest64, Get_Low32of64 (Dest64) + Const64_Lo ); \
546 if ((LONG)Get_Low32of64(Dest64) >= 0 ) \
547 Set_High32of64(Dest64, Get_High32of64(Dest64) + Const64_Hi + 1 ); \
548 else \
549 Set_High32of64(Dest64, Get_High32of64(Dest64) + Const64_Hi ); \
551 #endif
554 #if defined AROS_64BIT_TYPE
555 #define SUB64(Dest64, Var1_64, Var2_64) \
556 Dest64 = Var1_64 - Var2_64;
557 #else
558 #define SUB64(Dest64, Var1_64, Var2_64) \
559 if ((ULONG)Get_Low32of64(Var2_64) > (ULONG)Get_Low32of64(Var1_64)) \
561 Set_Low32of64 ( Dest64, Get_Low32of64 (Var1_64)- Get_Low32of64 (Var2_64)); \
562 Set_High32of64( Dest64, Get_High32of64(Var1_64)- Get_High32of64(Var2_64)-1); \
564 else \
566 Set_Low32of64 ( Dest64, Get_Low32of64 (Var1_64) - Get_Low32of64 (Var2_64)); \
567 Set_High32of64( Dest64, Get_High32of64(Var1_64) - Get_High32of64(Var2_64)); \
569 #endif
571 #if defined AROS_64BIT_TYPE
572 #define SUB64QC(Dest64, Const64_Hi, Const64_Lo ) \
573 Dest64 -= ConvertTo64(Const64_Hi, Const64_Lo);
574 #else
575 #define SUB64QC(Dest64, Const64_Hi, Const64_Lo ) \
576 if ((ULONG)Const64_Lo > (ULONG)Get_Low32of64(Dest64)) \
578 Set_Low32of64 ( Dest64, Get_Low32of64 (Dest64)-Const64_Lo); \
579 Set_High32of64( Dest64, Get_High32of64(Dest64)-Const64_Hi-1); \
581 else \
583 Set_Low32of64 ( Dest64, Get_Low32of64 (Dest64)-Const64_Lo); \
584 Set_High32of64( Dest64, Get_High32of64(Dest64)-Const64_Hi); \
586 #endif
590 #if defined AROS_64BIT_TYPE
591 #define NEG64(Dest64) \
592 Dest64 = -Dest64;
593 #else
594 #define NEG64(Dest64) \
595 if (0 == Get_Low32of64(Dest64)) \
596 Set_High32of64( Dest64, -Get_High32of64(Dest64) ); \
597 else \
599 Set_High32of64( Dest64, Get_High32of64(Dest64) ^ 0xFFFFFFFF ); \
600 Set_Low32of64 ( Dest64, -Get_Low32of64(Dest64)); \
602 #endif
605 #endif /* __MATHIEEE64BIT_DEFINES_H__ */