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 #ifndef SCS_PRIVATE_H
00030 #define SCS_PRIVATE_H 1
00031
00032
00033 #define SCS_RADIX (1<<SCS_NB_BITS)
00034
00035 #define SCS_MASK_RADIX ((unsigned int)(SCS_RADIX-1))
00036
00037 #include "scs.h"
00038
00039 #ifdef WORDS_BIGENDIAN
00040 #define HI_ENDIAN 0
00041 #define LO_ENDIAN 1
00042 #else
00043 #define HI_ENDIAN 1
00044 #define LO_ENDIAN 0
00045 #endif
00046
00047
00048
00049
00050
00051 #define SCS_MAX_RANGE 32
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061 #ifdef WORDS_BIGENDIAN
00062 static const scs_db_number radix_one_double = {{((1023+SCS_NB_BITS)<<20) , 0x00000000 }};
00063 static const scs_db_number radix_two_double = {{((1023+2*SCS_NB_BITS)<<20) , 0x00000000 }};
00064 static const scs_db_number radix_mone_double = {{((1023-SCS_NB_BITS)<<20) , 0x00000000 }};
00065 static const scs_db_number radix_mtwo_double = {{((1023-2*SCS_NB_BITS)<<20) , 0x00000000 }};
00066 static const scs_db_number radix_rng_double = {{((1023+SCS_NB_BITS*SCS_MAX_RANGE)<<20) , 0x00000000 }};
00067 static const scs_db_number radix_mrng_double = {{((1023-SCS_NB_BITS*SCS_MAX_RANGE)<<20) , 0x00000000 }};
00068 static const scs_db_number max_double = {{0x7FEFFFFF , 0xFFFFFFFF }};
00069 static const scs_db_number min_double = {{0x00000000 , 0x00000001 }};
00070 #else
00071 static const scs_db_number radix_one_double = {{0x00000000 , ((1023+SCS_NB_BITS)<<20) }};
00072 static const scs_db_number radix_two_double = {{0x00000000 , ((1023+2*SCS_NB_BITS)<<20) }};
00073 static const scs_db_number radix_mone_double = {{0x00000000 , ((1023-SCS_NB_BITS)<<20) }};
00074 static const scs_db_number radix_mtwo_double = {{0x00000000 , ((1023-2*SCS_NB_BITS)<<20) }};
00075 static const scs_db_number radix_rng_double = {{0x00000000 , ((1023+SCS_NB_BITS*SCS_MAX_RANGE)<<20) }};
00076 static const scs_db_number radix_mrng_double = {{0x00000000 , ((1023-SCS_NB_BITS*SCS_MAX_RANGE)<<20) }};
00077 static const scs_db_number max_double = {{0xFFFFFFFF , 0x7FEFFFFF }};
00078 static const scs_db_number min_double = {{0x00000001 , 0x00000000 }};
00079 #endif
00080
00081
00082 #define SCS_RADIX_ONE_DOUBLE radix_one_double.d
00083 #define SCS_RADIX_TWO_DOUBLE radix_two_double.d
00084 #define SCS_RADIX_MONE_DOUBLE radix_mone_double.d
00085 #define SCS_RADIX_MTWO_DOUBLE radix_mtwo_double.d
00086 #define SCS_RADIX_RNG_DOUBLE radix_rng_double.d
00087 #define SCS_RADIX_MRNG_DOUBLE radix_mrng_double.d
00088 #define SCS_MAX_DOUBLE max_double.d
00089 #define SCS_MIN_DOUBLE min_double.d
00090
00091
00092
00093
00094
00095
00096 #define R_HW result->h_word
00097 #define R_SGN result->sign
00098 #define R_IND result->index
00099 #define R_EXP result->exception.d
00100
00101 #define X_HW x->h_word
00102 #define X_SGN x->sign
00103 #define X_IND x->index
00104 #define X_EXP x->exception.d
00105
00106 #define Y_HW y->h_word
00107 #define Y_SGN y->sign
00108 #define Y_IND y->index
00109 #define Y_EXP y->exception.d
00110
00111 #define Z_HW z->h_word
00112 #define Z_SGN z->sign
00113 #define Z_IND z->index
00114 #define Z_EXP z->exception.d
00115
00116 #define W_HW w->h_word
00117 #define W_SGN w->sign
00118 #define W_IND w->index
00119 #define W_EXP w->exception.d
00120
00121
00122
00123
00124
00125
00126 #ifdef SCS_USE_FLT_MULT
00127
00128
00129
00130
00131 #ifdef WORDS_BIGENDIAN
00132 static const scs_db_number scs_flt_trunc_cst = {{ ((1023+SCS_NB_BITS-1)<<20) , 0x00000000 }};
00133 static const scs_db_number scs_flt_shift_cst = {{ ((1023+SCS_NB_BITS+53)<<20),0x00000000}};
00134 #else
00135 static const scs_db_number scs_flt_trunc_cst = {{ 0x00000000, ((1023+SCS_NB_BITS-1)<<20) }};
00136 static const scs_db_number scs_flt_shift_cst = {{ 0x00000000 ,((1023+SCS_NB_BITS+53)<<20)}};
00137 #endif
00138
00139 #define SCS_FLT_TRUNC_CST scs_flt_trunc_cst.d
00140 #define SCS_FLT_SHIFT_CST scs_flt_shift_cst.d
00141 #endif
00142
00143 #endif