00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040 #ifndef AR_INTERNAL_H
00041 #define AR_INTERNAL_H
00042
00043 #include "arith.h"
00044
00045 #include <limits.h>
00046
00047 #if !defined __STDC__ || __STDC__ == 0
00048 #error Must be compiled with a Standard C compiler.
00049 #endif
00050
00051 #if UINT_MAX < 0177777
00052 #error The size of an int must be at least 16 bits.
00053 #endif
00054
00055 #if ULONG_MAX < 017777777777
00056 #error The size of a long must be at least 32 bits.
00057 #endif
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087 #define AR_CLASS(type) (type & 0x1c0)
00088
00089
00090
00091
00092 typedef struct {
00093 unsigned int part1: 16;
00094 unsigned int part2: 16;
00095 unsigned int part3: 16;
00096 unsigned int part4: 8;
00097 unsigned int part5: 8;
00098 } AR_INT_8_64;
00099
00100 typedef struct {
00101 unsigned int part1: 16;
00102 unsigned int part2: 16;
00103 unsigned int part3: 16;
00104 unsigned int part4: 16;
00105 } AR_INT_64;
00106
00107 typedef struct {
00108 unsigned int part1: 16;
00109 unsigned int part2: 16;
00110 unsigned int part3: 16;
00111 unsigned int part4: 16;
00112 unsigned int part5: 16;
00113 unsigned int part6: 16;
00114 unsigned int part7: 16;
00115 unsigned int part8: 16;
00116 } AR_INT_128;
00117
00118 #define AR_INT_SIZE(type) (type & 0x3c)
00119
00120 #define AR_POINTER_FORMAT(type) (type & 0x3c)
00121
00122 #define AR_POINTER_SIZE(type) (type & 0x3)
00123
00124 #define AR_SIGNEDNESS(type) (type & 0x1)
00125
00126
00127
00128
00129 #define AR_FLOAT_FORMAT(type) (type & 0x20)
00130
00131 #define AR_FLOAT_ROUND(type) (type & 0x18)
00132
00133 #define AR_FLOAT_SIZE(type) (type & 0x6)
00134
00135 #define AR_FLOAT_IS_COMPLEX(type) (type & 0x1)
00136
00137
00138
00139
00140 #define AR_IEEE32_ZERO_BITS 32
00141 #define AR_IEEE32_EXPO_BITS 8
00142 #define AR_IEEE32_C0_BITS 7
00143 #define AR_IEEE32_C1_BITS 16
00144
00145 #define AR_IEEE64_EXPO_BITS 11
00146 #define AR_IEEE64_C0_BITS 4
00147 #define AR_IEEE64_C1_BITS 16
00148 #define AR_IEEE64_C2_BITS 16
00149 #define AR_IEEE64_C3_BITS 16
00150
00151 #define AR_IEEE128_EXPO_BITS 15
00152 #define AR_IEEE128_C0_BITS 16
00153 #define AR_IEEE128_C1_BITS 16
00154 #define AR_IEEE128_C2_BITS 16
00155 #define AR_IEEE128_C3_BITS 16
00156 #define AR_IEEE128_C4_BITS 16
00157 #define AR_IEEE128_C5_BITS 16
00158 #define AR_IEEE128_C6_BITS 16
00159
00160 #define AR_IEEE32_MIN_EXPO 0000
00161 #define AR_IEEE32_EXPO_BIAS 0177
00162 #define AR_IEEE32_MAX_EXPO 0376
00163 #define AR_IEEE32_COEFF_BITS 23
00164
00165 #define AR_IEEE64_MIN_EXPO 00000
00166 #define AR_IEEE64_EXPO_BIAS 01777
00167 #define AR_IEEE64_MAX_EXPO 03776
00168 #define AR_IEEE64_COEFF_BITS 52
00169
00170 #define AR_IEEE128_MIN_EXPO 000000
00171 #define AR_IEEE128_EXPO_BIAS 037777
00172 #define AR_IEEE128_MAX_EXPO 077776
00173 #define AR_IEEE128_COEFF_BITS 112
00174
00175 #define AR_IEEE32_ROUND_BITS 3
00176 #define AR_IEEE64_ROUND_BITS 3
00177 #define AR_IEEE128_ROUND_BITS 3
00178
00179 #define AR_MIPS128_MIN_EXPO AR_IEEE64_MIN_EXPO
00180 #define AR_MIPS128_MAX_EXPO AR_IEEE64_MAX_EXPO
00181 #define AR_MIPS128_EXPO_BIAS AR_IEEE64_EXPO_BIAS
00182
00183 typedef struct {
00184 unsigned int zero : AR_IEEE32_ZERO_BITS;
00185 unsigned int sign : 1;
00186 unsigned int expo : AR_IEEE32_EXPO_BITS;
00187 unsigned int coeff0 : AR_IEEE32_C0_BITS;
00188 unsigned int coeff1 : AR_IEEE32_C1_BITS;
00189 } AR_IEEE_32;
00190
00191 typedef struct {
00192 unsigned int sign : 1;
00193 unsigned int expo : AR_IEEE64_EXPO_BITS;
00194 unsigned int coeff0 : AR_IEEE64_C0_BITS;
00195 unsigned int coeff1 : AR_IEEE64_C1_BITS;
00196 unsigned int coeff2 : AR_IEEE64_C2_BITS;
00197 unsigned int coeff3 : AR_IEEE64_C3_BITS;
00198 } AR_IEEE_64;
00199
00200 typedef struct {
00201 unsigned int sign : 1;
00202 unsigned int expo : AR_IEEE128_EXPO_BITS;
00203 unsigned int coeff0 : AR_IEEE128_C0_BITS;
00204 unsigned int coeff1 : AR_IEEE128_C1_BITS;
00205 unsigned int coeff2 : AR_IEEE128_C2_BITS;
00206 unsigned int coeff3 : AR_IEEE128_C3_BITS;
00207 unsigned int coeff4 : AR_IEEE128_C4_BITS;
00208 unsigned int coeff5 : AR_IEEE128_C5_BITS;
00209 unsigned int coeff6 : AR_IEEE128_C6_BITS;
00210 } AR_IEEE_128;
00211
00212 typedef struct {
00213 unsigned int sign : 1;
00214 unsigned int expo : AR_IEEE64_EXPO_BITS;
00215 unsigned int coeff0 : AR_IEEE64_C0_BITS;
00216 unsigned int coeff1 : AR_IEEE64_C1_BITS;
00217 unsigned int coeff2 : AR_IEEE64_C2_BITS;
00218 unsigned int coeff3 : AR_IEEE64_C3_BITS;
00219 unsigned int signl : 1;
00220 unsigned int expol : AR_IEEE64_EXPO_BITS;
00221 unsigned int coeff0l : AR_IEEE64_C0_BITS;
00222 unsigned int coeff1l : AR_IEEE64_C1_BITS;
00223 unsigned int coeff2l : AR_IEEE64_C2_BITS;
00224 unsigned int coeff3l : AR_IEEE64_C3_BITS;
00225 } AR_MIPS_128;
00226
00227 typedef struct {
00228 unsigned int rsign : 1;
00229 unsigned int rexpo : AR_IEEE32_EXPO_BITS;
00230 unsigned int rcoeff0 : AR_IEEE32_C0_BITS;
00231 unsigned int rcoeff1 : AR_IEEE32_C1_BITS;
00232 unsigned int isign : 1;
00233 unsigned int iexpo : AR_IEEE32_EXPO_BITS;
00234 unsigned int icoeff0 : AR_IEEE32_C0_BITS;
00235 unsigned int icoeff1 : AR_IEEE32_C1_BITS;
00236 } AR_CPLX_IEEE_32;
00237
00238 typedef struct {
00239 AR_IEEE_64 real;
00240 AR_IEEE_64 imag;
00241 } AR_CPLX_IEEE_64;
00242
00243 typedef struct {
00244 AR_IEEE_128 real;
00245 AR_IEEE_128 imag;
00246 } AR_CPLX_IEEE_128;
00247
00248 typedef struct {
00249 AR_MIPS_128 real;
00250 AR_MIPS_128 imag;
00251 } AR_CPLX_MIPS_128;
00252
00253
00254
00255
00256 #define AR_CRAY_EXPO_BITS 15
00257 #define AR_CRAY_C0_BITS 16
00258 #define AR_CRAY_C1_BITS 16
00259 #define AR_CRAY_C2_BITS 16
00260 #define AR_CRAY_ZERO_BITS 16
00261 #define AR_CRAY_C3_BITS 16
00262 #define AR_CRAY_C4_BITS 16
00263 #define AR_CRAY_C5_BITS 16
00264
00265 #define AR_CRAY_MIN_EXPO 020000
00266 #define AR_CRAY_EXPO_BIAS 040001
00267 #define AR_CRAY_MAX_EXPO 057777
00268 #define AR_CRAY64_COEFF_BITS 48
00269 #define AR_CRAY128_COEFF_BITS 96
00270
00271 typedef struct {
00272 unsigned int sign : 1;
00273 unsigned int expo : AR_CRAY_EXPO_BITS;
00274 unsigned int coeff0 : AR_CRAY_C0_BITS;
00275 unsigned int coeff1 : AR_CRAY_C1_BITS;
00276 unsigned int coeff2 : AR_CRAY_C2_BITS;
00277 } AR_CRAY_64;
00278
00279 typedef struct {
00280 unsigned int sign : 1;
00281 unsigned int expo : AR_CRAY_EXPO_BITS;
00282 unsigned int coeff0 : AR_CRAY_C0_BITS;
00283 unsigned int coeff1 : AR_CRAY_C1_BITS;
00284 unsigned int coeff2 : AR_CRAY_C2_BITS;
00285 unsigned int zero : AR_CRAY_ZERO_BITS;
00286 unsigned int coeff3 : AR_CRAY_C3_BITS;
00287 unsigned int coeff4 : AR_CRAY_C4_BITS;
00288 unsigned int coeff5 : AR_CRAY_C5_BITS;
00289 } AR_CRAY_128;
00290
00291 typedef struct {
00292 AR_CRAY_64 real;
00293 AR_CRAY_64 imag;
00294 } AR_CPLX_CRAY_64;
00295
00296 typedef struct {
00297 AR_CRAY_128 real;
00298 AR_CRAY_128 imag;
00299 } AR_CPLX_CRAY_128;
00300
00301
00302
00303
00304 typedef union {
00305 AR_INT_64 ar_i64;
00306 AR_INT_8_64 ar_i8;
00307 AR_INT_128 ar_i128;
00308 AR_CRAY_64 ar_f64;
00309 AR_CRAY_128 ar_f128;
00310 AR_IEEE_32 ar_ieee32;
00311 AR_IEEE_64 ar_ieee64;
00312 AR_IEEE_128 ar_ieee128;
00313 AR_MIPS_128 ar_mips128;
00314 AR_CPLX_CRAY_64 ar_cplx_f64;
00315 AR_CPLX_CRAY_128 ar_cplx_f128;
00316 AR_CPLX_IEEE_32 ar_cplx_ieee32;
00317 AR_CPLX_IEEE_64 ar_cplx_ieee64;
00318 AR_CPLX_IEEE_128 ar_cplx_ieee128;
00319 AR_CPLX_MIPS_128 ar_cplx_mips128;
00320 } ar_data;
00321
00322
00323
00324
00325 typedef struct {
00326 unsigned int ar_high_mode_bits1 : 16;
00327 unsigned int ar_high_mode_bits2 : 16;
00328 unsigned int ar_unused_mode_bits: 19;
00329 unsigned int ar_truncate_bits : 6;
00330 unsigned int ar_128bit_format : 1;
00331 unsigned int ar_denorms_trap : 1;
00332 unsigned int ar_underflow_mode : 2;
00333 unsigned int ar_rounding_mode : 2;
00334 unsigned int ar_float_format : 1;
00335 } ar_state_info;
00336
00337 extern ar_state_info ar_state_register;
00338
00339 extern int ar_simulate;
00340 extern int ar_rounding_modes;
00341 extern int ar_underflow_modes;
00342
00343
00344
00345
00346 #define MASKL(bits) ((unsigned long) \
00347 (~((~(unsigned long) 0) >> (bits))))
00348 #define MASKR(bits) ((unsigned long) \
00349 (~((~(unsigned long) 0) << (bits))))
00350 #define MASKM(bits,where) ((unsigned long) (MASKR(bits) << (where)))
00351
00352
00353
00354
00355
00356 enum message_types {
00357 Comment, Note, Caution, Warning,
00358 Error, Internal, Vector_Info, Scalar_Info,
00359 Table, Ansi, Logfile_Warning, Inline_Info,
00360 Info, Tasking_Info, Limit, Logfile_Error,
00361 Logfile_Summary, F77_ANSI, Unknown};
00362
00363
00364
00365
00366
00367
00368 int ar_add_integer(ar_data *,
00369 const AR_TYPE *,
00370 const ar_data *,
00371 const AR_TYPE *,
00372 const ar_data *,
00373 const AR_TYPE *);
00374
00375 void ar_dblshift(ar_data *,
00376 const AR_TYPE *resulttype,
00377 const ar_data *,
00378 const ar_data *,
00379 int);
00380
00381 int ar_divide_integer(ar_data *,
00382 const AR_TYPE *,
00383 ar_data *,
00384 const AR_TYPE *,
00385 const ar_data *,
00386 const AR_TYPE *,
00387 const ar_data *,
00388 const AR_TYPE *);
00389
00390 int ar_negate_integer(ar_data *,
00391 const AR_TYPE *,
00392 const ar_data *,
00393 const AR_TYPE *);
00394
00395 int ar_multiply_integer(ar_data *,
00396 const AR_TYPE *,
00397 const ar_data *,
00398 const AR_TYPE *,
00399 const ar_data *,
00400 const AR_TYPE *);
00401
00402 int ar_subtract_integer(ar_data *,
00403 const AR_TYPE *,
00404 int *,
00405 const ar_data *,
00406 const AR_TYPE *,
00407 const ar_data *,
00408 const AR_TYPE *);
00409
00410
00411
00412 int ar_i32norm (signed int,
00413 unsigned long,
00414 unsigned long,
00415 AR_IEEE_32 *,
00416 int);
00417
00418 int ar_i64norm (signed int,
00419 unsigned long,
00420 unsigned long,
00421 AR_IEEE_64 *,
00422 int);
00423
00424 int ar_i128norm(signed int,
00425 unsigned long,
00426 unsigned long,
00427 AR_IEEE_128 *,
00428 int);
00429
00430 int ar_i32to64 (AR_IEEE_64 *,
00431 const AR_IEEE_32 *);
00432
00433 int ar_i64to32 (AR_IEEE_32 *,
00434 const AR_IEEE_64 *,
00435 const int);
00436
00437 int ar_i64to128(AR_IEEE_128 *,
00438 const AR_IEEE_64 *);
00439
00440 int ar_i128to64(AR_IEEE_64 *,
00441 const AR_IEEE_128 *,
00442 const int);
00443
00444 int ar_ifadd32 (AR_IEEE_32 *,
00445 const AR_IEEE_32 *,
00446 const AR_IEEE_32 *,
00447 int);
00448
00449 int ar_ifadd64 (AR_IEEE_64 *,
00450 const AR_IEEE_64 *,
00451 const AR_IEEE_64 *,
00452 int);
00453
00454 int ar_ifadd128(AR_IEEE_128 *,
00455 const AR_IEEE_128 *,
00456 const AR_IEEE_128 *,
00457 int);
00458
00459 int ar_ifdiv32 (AR_IEEE_32 *,
00460 const AR_IEEE_32 *,
00461 const AR_IEEE_32 *,
00462 int);
00463
00464 int ar_ifdiv64 (AR_IEEE_64 *,
00465 const AR_IEEE_64 *,
00466 const AR_IEEE_64 *,
00467 int);
00468
00469 int ar_ifdiv128(AR_IEEE_128 *,
00470 const AR_IEEE_128 *,
00471 const AR_IEEE_128 *,
00472 int);
00473
00474 int ar_ifix32 (AR_INT_64 *,
00475 const AR_IEEE_32 *,
00476 int,
00477 int);
00478
00479 int ar_ifix64 (AR_INT_64 *,
00480 const AR_IEEE_64 *,
00481 int,
00482 int);
00483
00484 int ar_ifix128 (AR_INT_64 *,
00485 const AR_IEEE_128 *,
00486 int,
00487 int);
00488
00489 int ar_iflt32 (AR_IEEE_32 *,
00490 const AR_INT_64 *,
00491 int,
00492 int);
00493
00494 int ar_iflt64 (AR_IEEE_64 *,
00495 const AR_INT_64 *,
00496 int,
00497 int);
00498
00499 int ar_iflt128 (AR_IEEE_128 *,
00500 const AR_INT_64 *,
00501 int,
00502 int);
00503
00504 int ar_ifmul32 (AR_IEEE_32 *,
00505 const AR_IEEE_32 *,
00506 const AR_IEEE_32 *,
00507 int);
00508
00509 int ar_ifmul64 (AR_IEEE_64 *,
00510 const AR_IEEE_64 *,
00511 const AR_IEEE_64 *,
00512 int);
00513
00514 int ar_ifmul128(AR_IEEE_128 *,
00515 const AR_IEEE_128 *,
00516 const AR_IEEE_128 *,
00517 int);
00518
00519 int ar_ifsub32 (AR_IEEE_32 *,
00520 const AR_IEEE_32 *,
00521 const AR_IEEE_32 *,
00522 int);
00523
00524 int ar_ifsub64 (AR_IEEE_64 *,
00525 const AR_IEEE_64 *,
00526 const AR_IEEE_64 *,
00527 int);
00528
00529 int ar_ifsub128(AR_IEEE_128 *,
00530 const AR_IEEE_128 *,
00531 const AR_IEEE_128 *,
00532 int);
00533
00534 int ar_isqrt64 (AR_IEEE_64 *,
00535 const AR_IEEE_64 *,
00536 int);
00537
00538
00539
00540 int ar_c64to128(AR_CRAY_128 *,
00541 const AR_CRAY_64 *);
00542
00543 int ar_c128to64(AR_CRAY_64 *,
00544 const AR_CRAY_128 *);
00545
00546 int ar_c1frecip(AR_CRAY_64 *,
00547 const AR_CRAY_64 *);
00548
00549 int ar_cfadd64 (AR_CRAY_64 *,
00550 const AR_CRAY_64 *,
00551 const AR_CRAY_64 *);
00552
00553 int ar_cfadd128(AR_CRAY_128 *,
00554 const AR_CRAY_128 *,
00555 const AR_CRAY_128 *);
00556
00557 int ar_cfdiv64 (AR_CRAY_64 *,
00558 const AR_CRAY_64 *,
00559 const AR_CRAY_64 *,
00560 int);
00561
00562 int ar_cfdiv128(AR_CRAY_128 *,
00563 const AR_CRAY_128 *,
00564 const AR_CRAY_128 *,
00565 int);
00566
00567 int ar_cfix64 (AR_INT_64 *,
00568 const AR_CRAY_64 *,
00569 int);
00570
00571 int ar_cfix128 (AR_INT_64 *,
00572 const AR_CRAY_128 *,
00573 int);
00574
00575 int ar_cflt64 (AR_CRAY_64 *,
00576 const AR_INT_64 *,
00577 int);
00578
00579 int ar_cflt128 (AR_CRAY_128 *,
00580 const AR_INT_64 *,
00581 int);
00582
00583 int ar_cfmul64 (AR_CRAY_64 *,
00584 const AR_CRAY_64 *,
00585 const AR_CRAY_64 *,
00586 int);
00587
00588 int ar_cfmul128(AR_CRAY_128 *,
00589 const AR_CRAY_128 *,
00590 const AR_CRAY_128 *,
00591 int);
00592
00593 int ar_crnd64 (AR_CRAY_64 *,
00594 const AR_CRAY_64 *);
00595
00596 int ar_crnd128 (AR_CRAY_128 *,
00597 const AR_CRAY_128 *);
00598
00599 int ar_cfsub64 (AR_CRAY_64 *,
00600 const AR_CRAY_64 *,
00601 const AR_CRAY_64 *);
00602
00603 int ar_cfsub128(AR_CRAY_128 *,
00604 const AR_CRAY_128 *,
00605 const AR_CRAY_128 *);
00606
00607 void ar_CRAY_64_trunc(AR_CRAY_64 *opnd);
00608
00609
00610
00611 int ar_convert_to_integral(ar_data *,
00612 const AR_TYPE *,
00613 const ar_data *,
00614 const AR_TYPE *);
00615
00616 int ar_compose_complex(ar_data *,
00617 AR_TYPE *,
00618 const ar_data *,
00619 const ar_data *,
00620 const AR_TYPE *);
00621
00622 int ar_decompose_complex(ar_data *,
00623 ar_data *,
00624 AR_TYPE *,
00625 const ar_data *,
00626 const AR_TYPE *);
00627
00628 int ar_negate_float(ar_data *,
00629 const AR_TYPE *,
00630 const ar_data *,
00631 const AR_TYPE *);
00632
00633
00634
00635 int ar_c128toi64(AR_IEEE_64 *,
00636 const AR_CRAY_128 *);
00637
00638 int ar_i64toc128(AR_CRAY_128 *,
00639 const AR_IEEE_64 *);
00640
00641 int ar_ctoi64 (AR_IEEE_64 *,
00642 const AR_CRAY_64 *);
00643
00644 int ar_ctoi128 (AR_IEEE_128 *,
00645 const AR_CRAY_128 *);
00646
00647 int ar_itoc64 (AR_CRAY_64 *,
00648 const AR_IEEE_64 *,
00649 int);
00650
00651 int ar_itoc128 (AR_CRAY_128 *,
00652 const AR_IEEE_128 *,
00653 int);
00654
00655 #ifdef __mips
00656
00657
00658 int ar_m128toi128(AR_IEEE_128 *out, long double *in);
00659
00660 int ar_i128tom128(long double *out, AR_IEEE_128 *in);
00661
00662 #endif
00663
00664
00665
00666 extern int ar_ifcmp64 (const AR_IEEE_64 *a, const AR_IEEE_64 *b);
00667
00668 extern void ar_clear_unused_bits (ar_data *opnd, const AR_TYPE *opndtype);
00669
00670
00671
00672 extern int ar_index (ar_data *result, const AR_TYPE *resulttype,
00673 const char *str1, long len1, const char *str2,
00674 long len2, long backward);
00675
00676 extern int ar_scan (ar_data *result, const AR_TYPE *resulttype,
00677 const char *str1, long len1, const char *str2,
00678 long len2, long backward);
00679
00680 extern int ar_verify (ar_data *result, const AR_TYPE *resulttype,
00681 const char *str1, long len1, const char *str2,
00682 long len2, long backward);
00683
00684 extern int ar_reshape (void *result, const void *source, const void *shape,
00685 const void *pad, const void *order);
00686
00687 extern int ar_transfer (void *result, const void *source, const void *mold,
00688 long *length);
00689
00690 extern int ar_modulo (ar_data *result, const AR_TYPE *resulttype,
00691 const ar_data *opnd1, const AR_TYPE *opnd1type,
00692 const ar_data *opnd2, const AR_TYPE *opnd2type);
00693
00694 extern int ar_selected_real_kind (ar_data *result, const AR_TYPE *resulttype,
00695 const ar_data *opnd1,
00696 const AR_TYPE *opnd1type,
00697 const ar_data *opnd2,
00698 const AR_TYPE *opnd2type);
00699
00700 extern int ar_sqrt (ar_data *result, const AR_TYPE *resulttype,
00701 const ar_data *opnd, const AR_TYPE *opndtype);
00702
00703 extern int ar_log (ar_data *result, const AR_TYPE *resulttype,
00704 const ar_data *opnd, const AR_TYPE *opndtype);
00705
00706 extern int ar_exp (ar_data *result, const AR_TYPE *resulttype,
00707 const ar_data *opnd, const AR_TYPE *opndtype);
00708
00709 extern int ar_cabs (ar_data *result, const AR_TYPE *resulttype,
00710 const ar_data *opnd, const AR_TYPE *opndtype);
00711
00712 extern int ar_power(ar_data *result, const AR_TYPE *resulttype,
00713 const ar_data *base, const AR_TYPE *basetype,
00714 const ar_data *power, const AR_TYPE *powertype);
00715
00716 extern int ar_convert_str_to_float (ar_data *result, const AR_TYPE *resulttype,
00717 const char *str);
00718
00719 extern int ar_divide_complex (ar_data *result, const AR_TYPE *resulttype,
00720 const ar_data *opnd1, const AR_TYPE *opnd1type,
00721 const ar_data *opnd2, const AR_TYPE *opnd2type);
00722
00723 extern int ar_cvt_str_to_float (ar_data *result, const AR_TYPE *resulttype,
00724 const char *str);
00725
00726
00727
00728 void ar_internal_error(int msgnum,
00729 char *file,
00730 int line);
00731
00732 void ar_set_invalid_result(ar_data *result,
00733 const AR_TYPE *resulttype);
00734
00735 extern void PRINTMSG(int pseudo_line_num,
00736 int msg_number,
00737 enum message_types msg_severity,
00738 int column_num,
00739 ...);
00740
00741
00742
00743
00744 typedef enum {
00745 AR_Arch_Unknown,
00746 AR_Arch_PVP,
00747 AR_Arch_PVP_IEEE,
00748 AR_Arch_T3D,
00749 AR_Arch_T3E,
00750 AR_Arch_SPARC,
00751 AR_Arch_MIPS
00752 } AR_ARCHITECTURE;
00753
00754 extern AR_ARCHITECTURE ar_host(void);
00755
00756 #define HOST_IS_UNKNOWN (ar_host() == AR_Arch_Unknown )
00757 #define HOST_IS_PVP (ar_host() == AR_Arch_PVP )
00758 #define HOST_IS_PVP_IEEE (ar_host() == AR_Arch_PVP_IEEE)
00759 #define HOST_IS_T3D (ar_host() == AR_Arch_T3D )
00760 #define HOST_IS_T3E (ar_host() == AR_Arch_T3E )
00761 #define HOST_IS_SPARC (ar_host() == AR_Arch_SPARC )
00762 #define HOST_IS_MIPS (ar_host() == AR_Arch_MIPS )
00763
00764 #define HOST_IS_MPP (HOST_IS_T3D || HOST_IS_T3E)
00765
00766 #define HOST_IS_CRAY_FLOAT (HOST_IS_PVP)
00767 #define HOST_IS_IEEE_FLOAT (HOST_IS_PVP_IEEE || \
00768 HOST_IS_MPP || \
00769 HOST_IS_SPARC || \
00770 HOST_IS_MIPS)
00771
00772
00773
00774
00775 #define _Solaris (__sparc__ && __svr4__)
00776
00777 #define ROUND_MODE(t) ((t >> 3) & 3)
00778 #define UNROUNDED_TYPE(t) (t &~ 0x18)
00779
00780 #define IS_ERROR_STATUS(s) (((s) & AR_ERROR_STATUS) != 0)
00781
00782
00783 #define INT_OVERFLOWS_46_BITS(OPND) \
00784 ((((OPND).ar_i64.part1 & 0xffff) != 0xffff || \
00785 ((OPND).ar_i64.part2 & 0xe000) != 0xe000) && \
00786 (((OPND).ar_i64.part1 & 0xffff) != 0 || \
00787 ((OPND).ar_i64.part2 & 0xe000) != 0))
00788
00789
00790
00791
00792 #define IS_INT8_ZERO(i) \
00793 ((i)->ar_i8.part5 == 0)
00794 #define IS_INT16_ZERO(i) \
00795 ((i)->ar_i64.part4 == 0)
00796 #define IS_INT24_ZERO(i) \
00797 (((i)->ar_i64.part3 & 0xFF) == 0 && \
00798 (i)->ar_i64.part4 == 0)
00799 #define IS_INT32_ZERO(i) \
00800 ((i)->ar_i64.part3 == 0 && \
00801 (i)->ar_i64.part4 == 0)
00802 #define IS_INT46_ZERO(i) \
00803 (((i)->ar_i64.part2 & 0x3FFF) == 0 && \
00804 (i)->ar_i64.part3 == 0 && \
00805 (i)->ar_i64.part4 == 0)
00806 #define IS_INT64_ZERO(i) \
00807 ((i)->ar_i64.part1 == 0 && \
00808 (i)->ar_i64.part2 == 0 && \
00809 (i)->ar_i64.part3 == 0 && \
00810 (i)->ar_i64.part4 == 0)
00811 #define IS_INT128_ZERO(i) \
00812 ((i)->ar_i128.part1 == 0 && \
00813 (i)->ar_i128.part2 == 0 && \
00814 (i)->ar_i128.part3 == 0 && \
00815 (i)->ar_i128.part4 == 0 && \
00816 (i)->ar_i128.part5 == 0 && \
00817 (i)->ar_i128.part6 == 0 && \
00818 (i)->ar_i128.part7 == 0 && \
00819 (i)->ar_i128.part8 == 0)
00820
00821 #define IS_INT8_UPPER_ZERO(i) \
00822 ((i)->ar_i8.part1 == 0 && \
00823 (i)->ar_i8.part2 == 0 && \
00824 (i)->ar_i8.part3 == 0 && \
00825 (i)->ar_i8.part4 == 0)
00826 #define IS_INT16_UPPER_ZERO(i) \
00827 ((i)->ar_i64.part1 == 0 && \
00828 (i)->ar_i64.part2 == 0 && \
00829 (i)->ar_i64.part3 == 0)
00830 #define IS_INT24_UPPER_ZERO(i) \
00831 ((i)->ar_i64.part1 == 0 && \
00832 (i)->ar_i64.part2 == 0 && \
00833 ((i)->ar_i64.part3 & 0xFF00) == 0)
00834 #define IS_INT32_UPPER_ZERO(i) \
00835 ((i)->ar_i64.part1 == 0 && \
00836 (i)->ar_i64.part2 == 0)
00837 #define IS_INT46_UPPER_ZERO(i) \
00838 ((i)->ar_i64.part1 == 0 && \
00839 ((i)->ar_i64.part2 & 0xC000) == 0)
00840
00841 #define ZERO_INT8(i) \
00842 (i)->ar_i8.part5 = 0
00843 #define ZERO_INT16(i) \
00844 (i)->ar_i64.part4 = 0
00845 #define ZERO_INT24(i) \
00846 do { \
00847 (i)->ar_i64.part3 &= 0xFF00; \
00848 (i)->ar_i64.part4 = 0; \
00849 } while(0)
00850 #define ZERO_INT32(i) \
00851 (i)->ar_i64.part3 = \
00852 (i)->ar_i64.part4 = 0
00853 #define ZERO_INT64(i) \
00854 (i)->ar_i64.part1 = \
00855 (i)->ar_i64.part2 = \
00856 (i)->ar_i64.part3 = \
00857 (i)->ar_i64.part4 = 0
00858 #define ZERO_INT128(i) \
00859 (i)->ar_i128.part1 = \
00860 (i)->ar_i128.part2 = \
00861 (i)->ar_i128.part3 = \
00862 (i)->ar_i128.part4 = \
00863 (i)->ar_i128.part5 = \
00864 (i)->ar_i128.part6 = \
00865 (i)->ar_i128.part7 = \
00866 (i)->ar_i128.part8 = 0
00867
00868 #define ZERO_INT8_UPPER(i) \
00869 (i)->ar_i8.part1 = \
00870 (i)->ar_i8.part2 = \
00871 (i)->ar_i8.part3 = \
00872 (i)->ar_i8.part4 = 0
00873 #define ZERO_INT16_UPPER(i) \
00874 (i)->ar_i64.part1 = \
00875 (i)->ar_i64.part2 = \
00876 (i)->ar_i64.part3 = 0
00877 #define ZERO_INT24_UPPER(i) \
00878 do { \
00879 (i)->ar_i64.part1 = \
00880 (i)->ar_i64.part2 = 0; \
00881 (i)->ar_i64.part3 &= 0xFF; \
00882 } while(0)
00883 #define ZERO_INT32_UPPER(i) \
00884 (i)->ar_i64.part1 = \
00885 (i)->ar_i64.part2 = 0
00886
00887 #define ZERO_INT8_ALL(i) \
00888 (i)->ar_i8.part1 = \
00889 (i)->ar_i8.part2 = \
00890 (i)->ar_i8.part3 = \
00891 (i)->ar_i8.part4 = \
00892 (i)->ar_i8.part5 = 0
00893 #define ZERO_INT16_ALL(i) \
00894 (i)->ar_i64.part1 = \
00895 (i)->ar_i64.part2 = \
00896 (i)->ar_i64.part3 = \
00897 (i)->ar_i64.part4 = 0
00898 #define ZERO_INT24_ALL(i) \
00899 ZERO_INT16_ALL(i)
00900 #define ZERO_INT32_ALL(i) \
00901 ZERO_INT16_ALL(i)
00902 #define ZERO_INT64_ALL(i) \
00903 ZERO_INT16_ALL(i)
00904 #define ZERO_INT128_ALL(i) \
00905 (i)->ar_i128.part1 = \
00906 (i)->ar_i128.part2 = \
00907 (i)->ar_i128.part3 = \
00908 (i)->ar_i128.part4 = \
00909 (i)->ar_i128.part5 = \
00910 (i)->ar_i128.part6 = \
00911 (i)->ar_i128.part7 = \
00912 (i)->ar_i128.part8 = 0
00913
00914 #define IS_INT8_UPPER_ONES(i) \
00915 ((i)->ar_i8.part1 == 0xFFFF && \
00916 (i)->ar_i8.part2 == 0xFFFF && \
00917 (i)->ar_i8.part3 == 0xFFFF && \
00918 (i)->ar_i8.part4 == 0xFF)
00919 #define IS_INT16_UPPER_ONES(i) \
00920 ((i)->ar_i64.part1 == 0xFFFF && \
00921 (i)->ar_i64.part2 == 0xFFFF && \
00922 (i)->ar_i64.part3 == 0xFFFF)
00923 #define IS_INT24_UPPER_ONES(i) \
00924 ((i)->ar_i64.part1 == 0xFFFF && \
00925 (i)->ar_i64.part2 == xxFFFF && \
00926 ((i)->ar_i64.part3 & 0xFF00) == 0xFF00)
00927 #define IS_INT32_UPPER_ONES(i) \
00928 ((i)->ar_i64.part1 == 0xFFFF && \
00929 (i)->ar_i64.part2 == 0xFFFF)
00930 #define IS_INT46_UPPER_ONES(i) \
00931 ((i)->ar_i64.part1 == 0xFFFF && \
00932 ((i)->ar_i64.part2 & 0xC000) == 0xC000)
00933
00934 #define INT8_SIGN(i) \
00935 ((i)->ar_i8.part5 & 0x80 )
00936 #define INT16_SIGN(i) \
00937 ((i)->ar_i64.part4 & 0x8000)
00938 #define INT24_SIGN(i) \
00939 ((i)->ar_i64.part3 & 0x80 )
00940 #define INT32_SIGN(i) \
00941 ((i)->ar_i64.part3 & 0x8000)
00942 #define INT64_SIGN(i) \
00943 ((i)->ar_i64.part1 & 0x8000)
00944 #define INT128_SIGN(i) \
00945 ((i)->ar_i128.part1 & 0x8000)
00946
00947 #define INT_SIGN(t, i) \
00948 ((AR_INT_SIZE(t) == AR_INT_SIZE_8 && \
00949 INT8_SIGN(i)) || \
00950 (AR_INT_SIZE(t) == AR_INT_SIZE_16 && \
00951 INT16_SIGN(i)) || \
00952 (AR_INT_SIZE(t) == AR_INT_SIZE_24 && \
00953 INT24_SIGN(i)) || \
00954 (AR_INT_SIZE(t) == AR_INT_SIZE_32 && \
00955 INT32_SIGN(i)) || \
00956 (AR_INT_SIZE(t) == AR_INT_SIZE_46 && \
00957 INT64_SIGN(i)) || \
00958 (AR_INT_SIZE(t) == AR_INT_SIZE_64 && \
00959 INT64_SIGN(i)) || \
00960 (AR_INT_SIZE(t) == AR_INT_SIZE_128 && \
00961 INT128_SIGN(i)))
00962
00963 #define COPY_INT8(i, j) \
00964 (i)->ar_i8.part5 = (j)->ar_i8.part5
00965 #define COPY_INT16(i, j) \
00966 (i)->ar_i64.part4 = (j)->ar_i64.part4
00967 #define COPY_INT24(i, j) \
00968 do { \
00969 (i)->ar_i64.part3 = (j)->ar_i64.part3 & 0xFF00; \
00970 (i)->ar_i64.part4 = (j)->ar_i64.part4; \
00971 } while(0)
00972 #define COPY_INT32(i, j) \
00973 do { \
00974 (i)->ar_i64.part3 = (j)->ar_i64.part3; \
00975 (i)->ar_i64.part4 = (j)->ar_i64.part4; \
00976 } while(0)
00977 #define COPY_INT46(i, j) \
00978 do { \
00979 (i)->ar_i64.part2 = (j)->ar_i64.part2 & 0x3FFF; \
00980 (i)->ar_i64.part3 = (j)->ar_i64.part3; \
00981 (i)->ar_i64.part4 = (j)->ar_i64.part4; \
00982 } while(0)
00983 #define COPY_INT64(i, j) \
00984 do { \
00985 (i)->ar_i64.part1 = (j)->ar_i64.part1; \
00986 (i)->ar_i64.part2 = (j)->ar_i64.part2; \
00987 (i)->ar_i64.part3 = (j)->ar_i64.part3; \
00988 (i)->ar_i64.part4 = (j)->ar_i64.part4; \
00989 } while(0)
00990 #define COPY_INT128(i, j) \
00991 do { \
00992 (i)->ar_i128.part1 = (j)->ar_i128.part1; \
00993 (i)->ar_i128.part2 = (j)->ar_i128.part2; \
00994 (i)->ar_i128.part3 = (j)->ar_i128.part3; \
00995 (i)->ar_i128.part4 = (j)->ar_i128.part4; \
00996 (i)->ar_i128.part5 = (j)->ar_i128.part5; \
00997 (i)->ar_i128.part6 = (j)->ar_i128.part6; \
00998 (i)->ar_i128.part7 = (j)->ar_i128.part7; \
00999 (i)->ar_i128.part8 = (j)->ar_i128.part8; \
01000 } while(0)
01001
01002 #define INT8_TO_HOST_SINT64(i,a) \
01003 do { \
01004 if (INT8_SIGN(a)) \
01005 i = -(((~((AR_HOST_SINT64) ((a)->ar_i8.part5))) + \
01006 1 \
01007 ) & \
01008 ~(-((AR_HOST_SINT64) 1) << 8) \
01009 ); \
01010 else \
01011 i = (AR_HOST_SINT64) (a)->ar_i8.part5; \
01012 } while (0)
01013 #define INT16_TO_HOST_SINT64(i,a) \
01014 do { \
01015 if (INT16_SIGN(a)) \
01016 i = -(((~((AR_HOST_SINT64) ((a)->ar_i64.part4))) + \
01017 1 \
01018 ) & \
01019 ~(-((AR_HOST_SINT64) 1) << 16) \
01020 ); \
01021 else \
01022 i = (AR_HOST_SINT64) (a)->ar_i64.part4; \
01023 } while (0)
01024 #define INT32_TO_HOST_SINT64(i,a) \
01025 do { \
01026 if (INT32_SIGN(a)) \
01027 i = -(((~((((AR_HOST_SINT64) (a)->ar_i64.part3) << 16) \
01028 | \
01029 (((AR_HOST_SINT64) (a)->ar_i64.part4) ) \
01030 ) \
01031 ) + \
01032 1 \
01033 ) & \
01034 ~(-((AR_HOST_SINT64) 1) << 32) \
01035 ); \
01036 else \
01037 i = (((AR_HOST_SINT64) (a)->ar_i64.part3) << 16) | \
01038 (((AR_HOST_SINT64) (a)->ar_i64.part4) ); \
01039 } while (0)
01040 #define INT64_TO_HOST_SINT64(i,a) \
01041 do { \
01042 i = (((AR_HOST_SINT64) (a)->ar_i64.part1) << 48) | \
01043 (((AR_HOST_SINT64) (a)->ar_i64.part2) << 32) | \
01044 (((AR_HOST_SINT64) (a)->ar_i64.part3) << 16) | \
01045 (((AR_HOST_SINT64) (a)->ar_i64.part4) ); \
01046 } while (0)
01047
01048
01049
01050 #define IS_IEEE32_NZ_COEFF(x) \
01051 ((x)->coeff0 != 0 || \
01052 (x)->coeff1 != 0)
01053
01054 #define IS_IEEE64_NZ_COEFF(x) \
01055 ((x)->coeff0 != 0 || \
01056 (x)->coeff1 != 0 || \
01057 (x)->coeff2 != 0 || \
01058 (x)->coeff3 != 0)
01059
01060 #define IS_IEEE128_NZ_COEFF(x) \
01061 ((x)->coeff0 != 0 || \
01062 (x)->coeff1 != 0 || \
01063 (x)->coeff2 != 0 || \
01064 (x)->coeff3 != 0 || \
01065 (x)->coeff4 != 0 || \
01066 (x)->coeff5 != 0 || \
01067 (x)->coeff6 != 0)
01068
01069 #define IS_MIPS128_NZ_COEFF(x) \
01070 ((x)->coeff0 != 0 || \
01071 (x)->coeff1 != 0 || \
01072 (x)->coeff2 != 0 || \
01073 (x)->coeff3 != 0 || \
01074 (x)->coeff0l != 0 || \
01075 (x)->coeff1l != 0 || \
01076 (x)->coeff2l != 0 || \
01077 (x)->coeff3l != 0 )
01078
01079
01080 #define IS_IEEE32_NaN(x) \
01081 ((x)->expo > AR_IEEE32_MAX_EXPO && IS_IEEE32_NZ_COEFF(x))
01082
01083 #define IS_IEEE64_NaN(x) \
01084 ((x)->expo > AR_IEEE64_MAX_EXPO && IS_IEEE64_NZ_COEFF(x))
01085
01086 #define IS_IEEE128_NaN(x) \
01087 ((x)->expo > AR_IEEE128_MAX_EXPO && IS_IEEE128_NZ_COEFF(x))
01088
01089 #define IS_MIPS128_NaN(x) \
01090 (((x)->expo > AR_MIPS128_MAX_EXPO || \
01091 (x)->expol > AR_MIPS128_MAX_EXPO) && IS_MIPS128_NZ_COEFF(x))
01092
01093
01094 #define ADDIEEE32(sum,carry,a,b) do { \
01095 (sum).coeff1 = (carry) += (a).coeff1 + (b).coeff1; \
01096 (carry) >>= AR_IEEE32_C1_BITS; \
01097 (sum).coeff0 = (carry) += (a).coeff0 + (b).coeff0; \
01098 (carry) >>= AR_IEEE32_C0_BITS; \
01099 } while (0)
01100
01101 #define ADDIEEE64(sum,carry,a,b) do { \
01102 (sum).coeff3 = (carry) += (a).coeff3 + (b).coeff3; \
01103 (carry) >>= AR_IEEE64_C3_BITS; \
01104 (sum).coeff2 = (carry) += (a).coeff2 + (b).coeff2; \
01105 (carry) >>= AR_IEEE64_C2_BITS; \
01106 (sum).coeff1 = (carry) += (a).coeff1 + (b).coeff1; \
01107 (carry) >>= AR_IEEE64_C1_BITS; \
01108 (sum).coeff0 = (carry) += (a).coeff0 + (b).coeff0; \
01109 (carry) >>= AR_IEEE64_C0_BITS; \
01110 } while (0)
01111
01112 #define ADDIEEE128(sum,carry,a,b) do { \
01113 (sum).coeff6 = (carry) += (a).coeff6 + (b).coeff6; \
01114 (carry) >>= AR_IEEE128_C6_BITS; \
01115 (sum).coeff5 = (carry) += (a).coeff5 + (b).coeff5; \
01116 (carry) >>= AR_IEEE128_C5_BITS; \
01117 (sum).coeff4 = (carry) += (a).coeff4 + (b).coeff4; \
01118 (carry) >>= AR_IEEE128_C4_BITS; \
01119 (sum).coeff3 = (carry) += (a).coeff3 + (b).coeff3; \
01120 (carry) >>= AR_IEEE128_C3_BITS; \
01121 (sum).coeff2 = (carry) += (a).coeff2 + (b).coeff2; \
01122 (carry) >>= AR_IEEE128_C2_BITS; \
01123 (sum).coeff1 = (carry) += (a).coeff1 + (b).coeff1; \
01124 (carry) >>= AR_IEEE128_C1_BITS; \
01125 (sum).coeff0 = (carry) += (a).coeff0 + (b).coeff0; \
01126 (carry) >>= AR_IEEE128_C0_BITS; \
01127 } while (0)
01128
01129
01130 #define CPLX32_IMAG_TO_IEEE32(s, c) ( \
01131 (s).sign = (c).isign, \
01132 (s).expo = (c).iexpo, \
01133 (s).coeff0 = (c).icoeff0, \
01134 (s).coeff1 = (c).icoeff1, \
01135 (s).zero = 0 )
01136
01137 #define CPLX32_REAL_TO_IEEE32(s, c) ( \
01138 (s).sign = (c).rsign, \
01139 (s).expo = (c).rexpo, \
01140 (s).coeff0 = (c).rcoeff0, \
01141 (s).coeff1 = (c).rcoeff1, \
01142 (s).zero = 0 )
01143
01144 #define IEEE32_TO_CPLX32_REAL(c, s) ( \
01145 (c).rsign = (s).sign, \
01146 (c).rexpo = (s).expo, \
01147 (c).rcoeff0 = (s).coeff0, \
01148 (c).rcoeff1 = (s).coeff1 )
01149
01150 #define IEEE32_TO_CPLX32_IMAG(c, s) ( \
01151 (c).isign = (s).sign, \
01152 (c).iexpo = (s).expo, \
01153 (c).icoeff0 = (s).coeff0, \
01154 (c).icoeff1 = (s).coeff1 )
01155
01156 #define IEEE32TOINT64(i,f) ( \
01157 (i).part1 = (i).part2 = 0, \
01158 (i).part3 = (f).sign << 15 | (f).expo << 7 | (f).coeff0, \
01159 (i).part4 = (f).coeff1 )
01160
01161 #define IEEE64TOINT64(i,f) ( \
01162 (i).part1 = (f).sign << 15 | (f).expo << 4 | (f).coeff0, \
01163 (i).part2 = (f).coeff1, \
01164 (i).part3 = (f).coeff2, \
01165 (i).part4 = (f).coeff3 )
01166
01167
01168 #define INCIEEE32(sum,carry) do { \
01169 (sum).coeff1 = (carry) += (sum).coeff1; \
01170 (carry) >>= AR_IEEE32_C1_BITS; \
01171 (sum).coeff0 = (carry) += (sum).coeff0; \
01172 (carry) >>= AR_IEEE32_C0_BITS; \
01173 } while (0)
01174
01175 #define INCIEEE64(sum,carry) do { \
01176 (sum).coeff3 = (carry) += (sum).coeff3; \
01177 (carry) >>= AR_IEEE64_C3_BITS; \
01178 (sum).coeff2 = (carry) += (sum).coeff2; \
01179 (carry) >>= AR_IEEE64_C2_BITS; \
01180 (sum).coeff1 = (carry) += (sum).coeff1; \
01181 (carry) >>= AR_IEEE64_C1_BITS; \
01182 (sum).coeff0 = (carry) += (sum).coeff0; \
01183 (carry) >>= AR_IEEE64_C0_BITS; \
01184 } while (0)
01185
01186 #define INCIEEE128(sum,carry) do { \
01187 (sum).coeff6 = (carry) += (sum).coeff6; \
01188 (carry) >>= AR_IEEE128_C6_BITS; \
01189 (sum).coeff5 = (carry) += (sum).coeff5; \
01190 (carry) >>= AR_IEEE128_C5_BITS; \
01191 (sum).coeff4 = (carry) += (sum).coeff4; \
01192 (carry) >>= AR_IEEE128_C4_BITS; \
01193 (sum).coeff3 = (carry) += (sum).coeff3; \
01194 (carry) >>= AR_IEEE128_C3_BITS; \
01195 (sum).coeff2 = (carry) += (sum).coeff2; \
01196 (carry) >>= AR_IEEE128_C2_BITS; \
01197 (sum).coeff1 = (carry) += (sum).coeff1; \
01198 (carry) >>= AR_IEEE128_C1_BITS; \
01199 (sum).coeff0 = (carry) += (sum).coeff0; \
01200 (carry) >>= AR_IEEE128_C0_BITS; \
01201 } while (0)
01202
01203
01204 #define INT64TOIEEE32(f,i) ( \
01205 (f).zero = 0, \
01206 (f).sign = (i).part3 >> 15, \
01207 (f).expo = (i).part3 >> 7, \
01208 (f).coeff0 = (i).part3, \
01209 (f).coeff1 = (i).part4 )
01210
01211 #define INT64TOIEEE64(f,i) ( \
01212 (f).sign = (i).part1 >> 15, \
01213 (f).expo = (i).part1 >> 4, \
01214 (f).coeff0 = (i).part1, \
01215 (f).coeff1 = (i).part2, \
01216 (f).coeff2 = (i).part3, \
01217 (f).coeff3 = (i).part4 )
01218
01219 #define INT64TOIEEE128(f,i) ( \
01220 (f).sign = (i).part1 >> 15, \
01221 (f).expo = (i).part1, \
01222 (f).coeff0 = (i).part2, \
01223 (f).coeff1 = (i).part3, \
01224 (f).coeff2 = (i).part4 )
01225
01226
01227 #define NOTIEEE32(x) ( (x).coeff0 ^= MASKR (AR_IEEE32_C0_BITS), \
01228 (x).coeff1 ^= MASKR (AR_IEEE32_C1_BITS) )
01229
01230 #define NOTIEEE64(x) ( (x).coeff0 ^= MASKR (AR_IEEE64_C0_BITS), \
01231 (x).coeff1 ^= MASKR (AR_IEEE64_C1_BITS), \
01232 (x).coeff2 ^= MASKR (AR_IEEE64_C2_BITS), \
01233 (x).coeff3 ^= MASKR (AR_IEEE64_C3_BITS) )
01234
01235 #define NOTIEEE128(x) ( (x).coeff0 ^= MASKR (AR_IEEE128_C0_BITS), \
01236 (x).coeff1 ^= MASKR (AR_IEEE128_C1_BITS), \
01237 (x).coeff2 ^= MASKR (AR_IEEE128_C2_BITS), \
01238 (x).coeff3 ^= MASKR (AR_IEEE128_C3_BITS), \
01239 (x).coeff4 ^= MASKR (AR_IEEE128_C4_BITS), \
01240 (x).coeff5 ^= MASKR (AR_IEEE128_C5_BITS), \
01241 (x).coeff6 ^= MASKR (AR_IEEE128_C6_BITS) )
01242
01243
01244 #define SHLEFTIEEE32(x) do { \
01245 (x).coeff0 = ((x).coeff0 << 1) | \
01246 ((x).coeff1 >> (AR_IEEE32_C1_BITS - 1)); \
01247 (x).coeff1 <<= 1; \
01248 } while (0)
01249
01250 #define SHLEFTIEEE64(x) do { \
01251 (x).coeff0 = ((x).coeff0 << 1) | \
01252 ((x).coeff1 >> (AR_IEEE64_C1_BITS - 1)); \
01253 (x).coeff1 = ((x).coeff1 << 1) | \
01254 ((x).coeff2 >> (AR_IEEE64_C2_BITS - 1)); \
01255 (x).coeff2 = ((x).coeff2 << 1) | \
01256 ((x).coeff3 >> (AR_IEEE64_C3_BITS - 1)); \
01257 (x).coeff3 <<= 1; \
01258 } while (0)
01259
01260 #define SHLEFTIEEE128(x) do { \
01261 (x).coeff0 = ((x).coeff0 << 1) | \
01262 ((x).coeff1 >> (AR_IEEE128_C1_BITS - 1)); \
01263 (x).coeff1 = ((x).coeff1 << 1) | \
01264 ((x).coeff2 >> (AR_IEEE128_C2_BITS - 1)); \
01265 (x).coeff2 = ((x).coeff2 << 1) | \
01266 ((x).coeff3 >> (AR_IEEE128_C3_BITS - 1)); \
01267 (x).coeff3 = ((x).coeff3 << 1) | \
01268 ((x).coeff4 >> (AR_IEEE128_C4_BITS - 1)); \
01269 (x).coeff4 = ((x).coeff4 << 1) | \
01270 ((x).coeff5 >> (AR_IEEE128_C5_BITS - 1)); \
01271 (x).coeff5 = ((x).coeff5 << 1) | \
01272 ((x).coeff6 >> (AR_IEEE128_C6_BITS - 1)); \
01273 (x).coeff6 <<= 1; \
01274 } while (0)
01275
01276
01277 #define SHLEFTIEEE32_2(x,y) do { \
01278 (x).coeff0 = ((x).coeff0 << 1) | \
01279 ((x).coeff1 >> (AR_IEEE32_C1_BITS - 1)); \
01280 (x).coeff1 = ((x).coeff1 << 1) | \
01281 ((y).coeff0 >> (AR_IEEE32_C0_BITS - 1)); \
01282 (y).coeff0 = ((y).coeff0 << 1) | \
01283 ((y).coeff1 >> (AR_IEEE32_C1_BITS - 1)); \
01284 (y).coeff1 <<= 1; \
01285 } while (0)
01286
01287 #define SHLEFTIEEE64_2(x,y) do { \
01288 (x).coeff0 = ((x).coeff0 << 1) | \
01289 ((x).coeff1 >> (AR_IEEE64_C1_BITS - 1)); \
01290 (x).coeff1 = ((x).coeff1 << 1) | \
01291 ((x).coeff2 >> (AR_IEEE64_C2_BITS - 1)); \
01292 (x).coeff2 = ((x).coeff2 << 1) | \
01293 ((x).coeff3 >> (AR_IEEE64_C3_BITS - 1)); \
01294 (x).coeff3 = ((x).coeff3 << 1) | \
01295 ((y).coeff0 >> (AR_IEEE64_C0_BITS - 1)); \
01296 (y).coeff0 = ((y).coeff0 << 1) | \
01297 ((y).coeff1 >> (AR_IEEE64_C1_BITS - 1)); \
01298 (y).coeff1 = ((y).coeff1 << 1) | \
01299 ((y).coeff2 >> (AR_IEEE64_C2_BITS - 1)); \
01300 (y).coeff2 = ((y).coeff2 << 1) | \
01301 ((y).coeff3 >> (AR_IEEE64_C3_BITS - 1)); \
01302 (y).coeff3 <<= 1; \
01303 } while (0)
01304
01305 #define SHLEFTIEEE128_2(x,y) do { \
01306 (x).coeff0 = ((x).coeff0 << 1) | \
01307 ((x).coeff1 >> (AR_IEEE128_C1_BITS - 1)); \
01308 (x).coeff1 = ((x).coeff1 << 1) | \
01309 ((x).coeff2 >> (AR_IEEE128_C2_BITS - 1)); \
01310 (x).coeff2 = ((x).coeff2 << 1) | \
01311 ((x).coeff3 >> (AR_IEEE128_C3_BITS - 1)); \
01312 (x).coeff3 = ((x).coeff3 << 1) | \
01313 ((x).coeff4 >> (AR_IEEE128_C4_BITS - 1)); \
01314 (x).coeff4 = ((x).coeff4 << 1) | \
01315 ((x).coeff5 >> (AR_IEEE128_C5_BITS - 1)); \
01316 (x).coeff5 = ((x).coeff5 << 1) | \
01317 ((x).coeff6 >> (AR_IEEE128_C6_BITS - 1)); \
01318 (x).coeff6 = ((x).coeff6 << 1) | \
01319 ((y).coeff0 >> (AR_IEEE128_C0_BITS - 1)); \
01320 (y).coeff0 = ((y).coeff0 << 1) | \
01321 ((y).coeff1 >> (AR_IEEE128_C1_BITS - 1)); \
01322 (y).coeff1 = ((y).coeff1 << 1) | \
01323 ((y).coeff2 >> (AR_IEEE128_C2_BITS - 1)); \
01324 (y).coeff2 = ((y).coeff2 << 1) | \
01325 ((y).coeff3 >> (AR_IEEE128_C3_BITS - 1)); \
01326 (y).coeff3 = ((y).coeff3 << 1) | \
01327 ((y).coeff4 >> (AR_IEEE128_C4_BITS - 1)); \
01328 (y).coeff4 = ((y).coeff4 << 1) | \
01329 ((y).coeff5 >> (AR_IEEE128_C5_BITS - 1)); \
01330 (y).coeff5 = ((y).coeff5 << 1) | \
01331 ((y).coeff6 >> (AR_IEEE128_C6_BITS - 1)); \
01332 (y).coeff6 <<= 1; \
01333 } while (0)
01334
01335
01336 #define SHRIGHTIEEE32(x) do { \
01337 (x).coeff1 = ((x).coeff1 >> 1) | \
01338 ((x).coeff0 << (AR_IEEE32_C1_BITS - 1)); \
01339 (x).coeff0 >>= 1; \
01340 } while (0)
01341
01342 #define SHRIGHTIEEE64(x) do { \
01343 (x).coeff3 = ((x).coeff3 >> 1) | \
01344 ((x).coeff2 << (AR_IEEE64_C3_BITS - 1)); \
01345 (x).coeff2 = ((x).coeff2 >> 1) | \
01346 ((x).coeff1 << (AR_IEEE64_C2_BITS - 1)); \
01347 (x).coeff1 = ((x).coeff1 >> 1) | \
01348 ((x).coeff0 << (AR_IEEE64_C1_BITS - 1)); \
01349 (x).coeff0 >>= 1; \
01350 } while (0)
01351
01352 #define SHRIGHTIEEE128(x) do { \
01353 (x).coeff6 = ((x).coeff6 >> 1) | \
01354 ((x).coeff5 << (AR_IEEE128_C6_BITS - 1)); \
01355 (x).coeff5 = ((x).coeff5 >> 1) | \
01356 ((x).coeff4 << (AR_IEEE128_C5_BITS - 1)); \
01357 (x).coeff4 = ((x).coeff4 >> 1) | \
01358 ((x).coeff3 << (AR_IEEE128_C4_BITS - 1)); \
01359 (x).coeff3 = ((x).coeff3 >> 1) | \
01360 ((x).coeff2 << (AR_IEEE128_C3_BITS - 1)); \
01361 (x).coeff2 = ((x).coeff2 >> 1) | \
01362 ((x).coeff1 << (AR_IEEE128_C2_BITS - 1)); \
01363 (x).coeff1 = ((x).coeff1 >> 1) | \
01364 ((x).coeff0 << (AR_IEEE128_C1_BITS - 1)); \
01365 (x).coeff0 >>= 1; \
01366 } while (0)
01367
01368
01369 #define SHRIGHTIEEE32_2(x,y) do { \
01370 (y).coeff1 = ((y).coeff1 >> 1) | \
01371 ((y).coeff0 << (AR_IEEE32_C1_BITS - 1)); \
01372 (y).coeff0 = ((y).coeff0 >> 1) | \
01373 ((x).coeff1 << (AR_IEEE32_C0_BITS - 1)); \
01374 (x).coeff1 = ((x).coeff1 >> 1) | \
01375 ((x).coeff0 << (AR_IEEE32_C1_BITS - 1)); \
01376 (x).coeff0 >>= 1; \
01377 } while (0)
01378
01379 #define SHRIGHTIEEE64_2(x,y) do { \
01380 (y).coeff3 = ((y).coeff3 >> 1) | \
01381 ((y).coeff2 << (AR_IEEE64_C3_BITS - 1)); \
01382 (y).coeff2 = ((y).coeff2 >> 1) | \
01383 ((y).coeff1 << (AR_IEEE64_C2_BITS - 1)); \
01384 (y).coeff1 = ((y).coeff1 >> 1) | \
01385 ((y).coeff0 << (AR_IEEE64_C1_BITS - 1)); \
01386 (y).coeff0 = ((y).coeff0 >> 1) | \
01387 ((x).coeff3 << (AR_IEEE64_C0_BITS - 1)); \
01388 (x).coeff3 = ((x).coeff3 >> 1) | \
01389 ((x).coeff2 << (AR_IEEE64_C3_BITS - 1)); \
01390 (x).coeff2 = ((x).coeff2 >> 1) | \
01391 ((x).coeff1 << (AR_IEEE64_C2_BITS - 1)); \
01392 (x).coeff1 = ((x).coeff1 >> 1) | \
01393 ((x).coeff0 << (AR_IEEE64_C1_BITS - 1)); \
01394 (x).coeff0 >>= 1; \
01395 } while (0)
01396
01397 #define SHRIGHTIEEE128_2(x,y) do { \
01398 (y).coeff6 = ((y).coeff6 >> 1) | \
01399 ((y).coeff5 << (AR_IEEE128_C6_BITS - 1)); \
01400 (y).coeff5 = ((y).coeff5 >> 1) | \
01401 ((y).coeff4 << (AR_IEEE128_C5_BITS - 1)); \
01402 (y).coeff4 = ((y).coeff4 >> 1) | \
01403 ((y).coeff3 << (AR_IEEE128_C4_BITS - 1)); \
01404 (y).coeff3 = ((y).coeff3 >> 1) | \
01405 ((y).coeff2 << (AR_IEEE128_C3_BITS - 1)); \
01406 (y).coeff2 = ((y).coeff2 >> 1) | \
01407 ((y).coeff1 << (AR_IEEE128_C2_BITS - 1)); \
01408 (y).coeff1 = ((y).coeff1 >> 1) | \
01409 ((y).coeff0 << (AR_IEEE128_C1_BITS - 1)); \
01410 (y).coeff0 = ((y).coeff0 >> 1) | \
01411 ((x).coeff6 << (AR_IEEE128_C0_BITS - 1)); \
01412 (x).coeff6 = ((x).coeff6 >> 1) | \
01413 ((x).coeff5 << (AR_IEEE128_C6_BITS - 1)); \
01414 (x).coeff5 = ((x).coeff5 >> 1) | \
01415 ((x).coeff4 << (AR_IEEE128_C5_BITS - 1)); \
01416 (x).coeff4 = ((x).coeff4 >> 1) | \
01417 ((x).coeff3 << (AR_IEEE128_C4_BITS - 1)); \
01418 (x).coeff3 = ((x).coeff3 >> 1) | \
01419 ((x).coeff2 << (AR_IEEE128_C3_BITS - 1)); \
01420 (x).coeff2 = ((x).coeff2 >> 1) | \
01421 ((x).coeff1 << (AR_IEEE128_C2_BITS - 1)); \
01422 (x).coeff1 = ((x).coeff1 >> 1) | \
01423 ((x).coeff0 << (AR_IEEE128_C1_BITS - 1)); \
01424 (x).coeff0 >>= 1; \
01425 } while (0)
01426
01427
01428 #define ZEROIEEE32(x) ((x).zero = (x).sign = (x).expo = (x).coeff0 =\
01429 (x).coeff1 = 0)
01430
01431 #define ZEROIEEE64(x) ((x).sign = (x).expo = (x).coeff0 = \
01432 (x).coeff1 = (x).coeff2 = (x).coeff3 = 0)
01433
01434 #define ZEROIEEE128(x) ((x).sign = (x).expo = (x).coeff0 = \
01435 (x).coeff1 = (x).coeff2 = (x).coeff3 = \
01436 (x).coeff4 = (x).coeff5 = (x).coeff6 = 0)
01437
01438 #define ZEROIEEE128M(x) ((x).sign = (x).expo = (x).coeff0 = \
01439 (x).coeff1 = (x).coeff2 = (x).coeff3 = \
01440 (x).signl = (x).expol = (x).coeff0l = \
01441 (x).coeff1l = (x).coeff2l = (x).coeff3l = 0)
01442
01443
01444 #define QNaNIEEE32(x) do { \
01445 ZEROIEEE32(*x); \
01446 NOTIEEE32(*x); \
01447 if (HOST_IS_MIPS) { \
01448 (x)->coeff0 ^= (1 << (AR_IEEE32_C0_BITS - 1)); \
01449 } \
01450 (x)->expo = AR_IEEE32_MAX_EXPO + 1; \
01451 } while (0)
01452
01453 #define QNaNIEEE64(x) do { \
01454 ZEROIEEE64(*x); \
01455 NOTIEEE64(*x); \
01456 if (HOST_IS_MIPS) { \
01457 (x)->coeff0 ^= (1 << (AR_IEEE64_C0_BITS - 1)); \
01458 } \
01459 (x)->expo = AR_IEEE64_MAX_EXPO + 1; \
01460 } while (0)
01461
01462 #define QNaNIEEE128(x) do { \
01463 if (HOST_IS_MIPS) { \
01464 ZEROIEEE128M(*((AR_MIPS_128 *) x)); \
01465 ((AR_MIPS_128 *) x)->coeff0 = MASKR (AR_IEEE64_C0_BITS - 1); \
01466 ((AR_MIPS_128 *) x)->coeff1 = MASKR (AR_IEEE64_C1_BITS ); \
01467 ((AR_MIPS_128 *) x)->coeff2 = MASKR (AR_IEEE64_C2_BITS ); \
01468 ((AR_MIPS_128 *) x)->coeff3 = MASKR (AR_IEEE64_C3_BITS ); \
01469 ((AR_MIPS_128 *) x)->expo = AR_IEEE64_MAX_EXPO + 1; \
01470 } \
01471 else { \
01472 ZEROIEEE128(*x); \
01473 NOTIEEE128(*x); \
01474 (x)->expo = AR_IEEE128_MAX_EXPO + 1; \
01475 } \
01476 } while (0)
01477
01478
01479
01480
01481 #define ADDCRAY64(sum,carry,a,b) do { \
01482 (sum).coeff2 = (carry) += (a).coeff2 + (b).coeff2; \
01483 (carry) >>= AR_CRAY_C2_BITS; \
01484 (sum).coeff1 = (carry) += (a).coeff1 + (b).coeff1; \
01485 (carry) >>= AR_CRAY_C1_BITS; \
01486 (sum).coeff0 = (carry) += (a).coeff0 + (b).coeff0; \
01487 (carry) >>= AR_CRAY_C0_BITS; \
01488 } while (0)
01489
01490 #define ADDCRAY128(sum,carry,a,b) do { \
01491 (sum).coeff5 = (carry) += (a).coeff5 + (b).coeff5; \
01492 (carry) >>= AR_CRAY_C5_BITS; \
01493 (sum).coeff4 = (carry) += (a).coeff4 + (b).coeff4; \
01494 (carry) >>= AR_CRAY_C4_BITS; \
01495 (sum).coeff3 = (carry) += (a).coeff3 + (b).coeff3; \
01496 (carry) >>= AR_CRAY_C3_BITS; \
01497 (sum).coeff2 = (carry) += (a).coeff2 + (b).coeff2; \
01498 (carry) >>= AR_CRAY_C2_BITS; \
01499 (sum).coeff1 = (carry) += (a).coeff1 + (b).coeff1; \
01500 (carry) >>= AR_CRAY_C1_BITS; \
01501 (sum).coeff0 = (carry) += (a).coeff0 + (b).coeff0; \
01502 (carry) >>= AR_CRAY_C0_BITS; \
01503 } while (0)
01504
01505 #define CRAY64TO128(d,s) ( \
01506 (d).sign = (s).sign, \
01507 (d).expo = (s).expo, \
01508 (d).coeff0 = (s).coeff0, \
01509 (d).coeff1 = (s).coeff1, \
01510 (d).coeff2 = (s).coeff2, \
01511 (d).zero = (d).coeff3 = (d).coeff4 = (d).coeff5 = 0 )
01512
01513 #define CRAY128TO64(s,d) ( \
01514 (s).sign = (d).sign, \
01515 (s).expo = (d).expo, \
01516 (s).coeff0 = (d).coeff0, \
01517 (s).coeff1 = (d).coeff1, \
01518 (s).coeff2 = (d).coeff2 )
01519
01520 #define CRAY64TOINT64(i,c) ( \
01521 (i).part1 = (c).sign << 15 | (c).expo, \
01522 (i).part2 = (c).coeff0, \
01523 (i).part3 = (c).coeff1, \
01524 (i).part4 = (c).coeff2 )
01525
01526 #define INCCRAY64(sum,carry) do { \
01527 (sum).coeff2 = (carry) += (sum).coeff2; \
01528 (carry) >>= AR_CRAY_C2_BITS; \
01529 (sum).coeff1 = (carry) += (sum).coeff1; \
01530 (carry) >>= AR_CRAY_C1_BITS; \
01531 (sum).coeff0 = (carry) += (sum).coeff0; \
01532 (carry) >>= AR_CRAY_C0_BITS; \
01533 } while (0)
01534
01535 #define INCCRAY128(sum,carry) do { \
01536 (sum).coeff5 = (carry) += (sum).coeff5; \
01537 (carry) >>= AR_CRAY_C5_BITS; \
01538 (sum).coeff4 = (carry) += (sum).coeff4; \
01539 (carry) >>= AR_CRAY_C4_BITS; \
01540 (sum).coeff3 = (carry) += (sum).coeff3; \
01541 (carry) >>= AR_CRAY_C3_BITS; \
01542 (sum).coeff2 = (carry) += (sum).coeff2; \
01543 (carry) >>= AR_CRAY_C2_BITS; \
01544 (sum).coeff1 = (carry) += (sum).coeff1; \
01545 (carry) >>= AR_CRAY_C1_BITS; \
01546 (sum).coeff0 = (carry) += (sum).coeff0; \
01547 (carry) >>= AR_CRAY_C0_BITS; \
01548 } while (0)
01549
01550 #define INT64TOCRAY64(c,i) ( \
01551 (c).sign = (i).part1 >> 15, \
01552 (c).expo = (i).part1, \
01553 (c).coeff0 = (i).part2, \
01554 (c).coeff1 = (i).part3, \
01555 (c).coeff2 = (i).part4 )
01556
01557 #define NOTCRAY64(x) ( (x).coeff0 ^= MASKR (AR_CRAY_C0_BITS), \
01558 (x).coeff1 ^= MASKR (AR_CRAY_C1_BITS), \
01559 (x).coeff2 ^= MASKR (AR_CRAY_C2_BITS) )
01560
01561 #define NOTCRAY128(x) ( (x).coeff0 ^= MASKR (AR_CRAY_C0_BITS), \
01562 (x).coeff1 ^= MASKR (AR_CRAY_C1_BITS), \
01563 (x).coeff2 ^= MASKR (AR_CRAY_C2_BITS), \
01564 (x).coeff3 ^= MASKR (AR_CRAY_C3_BITS), \
01565 (x).coeff4 ^= MASKR (AR_CRAY_C4_BITS), \
01566 (x).coeff5 ^= MASKR (AR_CRAY_C5_BITS) )
01567
01568 #if _CRAY
01569 #define SHLEFTCRAY64(x) \
01570 (*((long*)&(x)) = \
01571 (*((long*)&(x))&~MASKR(AR_CRAY64_COEFF_BITS)) | \
01572 ((*((long*)&(x))<<1)&MASKR(AR_CRAY64_COEFF_BITS)))
01573 #else
01574 #define SHLEFTCRAY64(x) do { \
01575 (x).coeff0 = ((x).coeff0 << 1) | \
01576 ((x).coeff1 >> (AR_CRAY_C1_BITS - 1)); \
01577 (x).coeff1 = ((x).coeff1 << 1) | \
01578 ((x).coeff2 >> (AR_CRAY_C2_BITS - 1)); \
01579 (x).coeff2 <<= 1; \
01580 } while (0)
01581 #endif
01582
01583 #define SHLEFTCRAY128(x) do { \
01584 (x).coeff0 = ((x).coeff0 << 1) | \
01585 ((x).coeff1 >> (AR_CRAY_C1_BITS - 1)); \
01586 (x).coeff1 = ((x).coeff1 << 1) | \
01587 ((x).coeff2 >> (AR_CRAY_C2_BITS - 1)); \
01588 (x).coeff2 = ((x).coeff2 << 1) | \
01589 ((x).coeff3 >> (AR_CRAY_C3_BITS - 1)); \
01590 (x).coeff3 = ((x).coeff3 << 1) | \
01591 ((x).coeff4 >> (AR_CRAY_C4_BITS - 1)); \
01592 (x).coeff4 = ((x).coeff4 << 1) | \
01593 ((x).coeff5 >> (AR_CRAY_C5_BITS - 1)); \
01594 (x).coeff5 <<= 1; \
01595 } while (0)
01596
01597 #if _CRAY
01598 #define SHRIGHTCRAY64(x) \
01599 (*((long*)&(x)) = \
01600 (*((long*)&(x))&~MASKR(AR_CRAY64_COEFF_BITS)) | \
01601 ((*((long*)&(x))&MASKR(AR_CRAY64_COEFF_BITS))>>1))
01602 #else
01603 #define SHRIGHTCRAY64(x) do { \
01604 (x).coeff2 = ((x).coeff2 >> 1) | \
01605 ((x).coeff1 << (AR_CRAY_C2_BITS - 1)); \
01606 (x).coeff1 = ((x).coeff1 >> 1) | \
01607 ((x).coeff0 << (AR_CRAY_C1_BITS - 1)); \
01608 (x).coeff0 >>= 1; \
01609 } while (0)
01610 #endif
01611
01612 #define SHRIGHTCRAY128(x) do { \
01613 (x).coeff5 = ((x).coeff5 >> 1) | \
01614 ((x).coeff4 << (AR_CRAY_C5_BITS - 1)); \
01615 (x).coeff4 = ((x).coeff4 >> 1) | \
01616 ((x).coeff3 << (AR_CRAY_C4_BITS - 1)); \
01617 (x).coeff3 = ((x).coeff3 >> 1) | \
01618 ((x).coeff2 << (AR_CRAY_C3_BITS - 1)); \
01619 (x).coeff2 = ((x).coeff2 >> 1) | \
01620 ((x).coeff1 << (AR_CRAY_C2_BITS - 1)); \
01621 (x).coeff1 = ((x).coeff1 >> 1) | \
01622 ((x).coeff0 << (AR_CRAY_C1_BITS - 1)); \
01623 (x).coeff0 >>= 1; \
01624 } while (0)
01625
01626 #define ZEROCRAY64(x) \
01627 ((x).sign = (x).expo = (x).coeff0 = (x).coeff1 = (x).coeff2 = 0)
01628
01629 #define ZEROCRAY128(x) \
01630 ((x).sign = (x).expo = (x).coeff0 = (x).coeff1 = (x).coeff2 = \
01631 (x).zero = (x).coeff3 = (x).coeff4 = (x).coeff5 = 0)
01632
01633
01634 #endif