00001 #ifndef __SOFTFLOAT_H__
00002 #define __SOFTFLOAT_H__
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
00041
00042 #include "fp-config.h"
00043
00044
00045
00046
00047
00048
00049 typedef struct {
00050 flag sign;
00051 bits64 high, low;
00052 } commonNaNT;
00053
00054
00055
00056
00057
00058
00059 void softfloat_env_init(run_options *op);
00060
00061
00062
00063
00064
00065
00066
00067 void float_raise( int8, run_options *ro );
00068
00069
00070
00071
00072
00073
00074 float32 int32_to_float32( int, run_options *ro );
00075 float64 int32_to_float64( int, run_options *ro );
00076 float32 int64_to_float32( int64, run_options *ro );
00077 float64 int64_to_float64( int64, run_options *ro );
00078 #ifdef FLOATX80
00079 floatx80 int32_to_floatx80( int, run_options *ro );
00080 #endif
00081 #ifdef FLOAT128
00082 float128 int32_to_float128( int, run_options *ro );
00083 #endif
00084
00085
00086
00087
00088
00089
00090 int32 float32_to_int32( float32, run_options *ro );
00091 int64 float32_to_int64( float32, run_options *ro );
00092 int32 float32_to_int32_round_to_zero( float32, run_options *ro );
00093 float64 float32_to_float64( float32, run_options *ro );
00094 #ifdef FLOATX80
00095 floatx80 float32_to_floatx80( float32, run_options *ro );
00096 #endif
00097 #ifdef FLOAT128
00098 float128 float32_to_float128( float32, run_options *ro );
00099 #endif
00100
00101
00102
00103
00104
00105
00106 float32 float32_round_to_int( float32, run_options *ro );
00107 float32 float32_add( float32, float32, run_options *ro );
00108 float32 float32_sub( float32, float32, run_options *ro );
00109 float32 float32_mul( float32, float32, run_options *ro );
00110 float32 float32_div( float32, float32, run_options *ro );
00111 float32 float32_rem( float32, float32, run_options *ro );
00112 float32 float32_sqrt( float32, run_options *ro );
00113 flag float32_eq( float32, float32, run_options *ro );
00114 flag float32_le( float32, float32, run_options *ro );
00115 flag float32_lt( float32, float32, run_options *ro );
00116 flag float32_eq_signaling( float32, float32, run_options *ro );
00117 flag float32_le_quiet( float32, float32, run_options *ro );
00118 flag float32_lt_quiet( float32, float32, run_options *ro );
00119 flag float32_is_signaling_nan( float32 );
00120
00121
00122
00123
00124
00125
00126 int32 float64_to_int32( float64, run_options *ro );
00127 int64 float64_to_int64( float64, run_options *ro );
00128 int32 float64_to_int32_round_to_zero( float64, run_options *ro );
00129 float32 float64_to_float32( float64, run_options *ro );
00130 #ifdef FLOATX80
00131 floatx80 float64_to_floatx80( float64, run_options *ro );
00132 #endif
00133 #ifdef FLOAT128
00134 float128 float64_to_float128( float64, run_options *ro );
00135 #endif
00136
00137
00138 int float64ZeroType(float64 a) __attribute__((const));
00139 int float64InfType(float64 a) __attribute__((const));
00140 int float64SubnormType(float64 a) __attribute__((const));
00141 flag float64_is_nan(float64 a) __attribute__((const));
00142 flag float32_is_nan(float32 a) __attribute__((const));
00143
00144
00145
00146
00147
00148
00149 float64 float64_round_to_int( float64, run_options *ro );
00150 float64 float64_add( float64, float64, run_options *ro );
00151 float64 float64_sub( float64, float64, run_options *ro );
00152 float64 float64_mul( float64, float64, run_options *ro );
00153 float64 float64_div( float64, float64, run_options *ro );
00154 float64 float64_rem( float64, float64, run_options *ro );
00155 float64 float64_sqrt( float64, run_options *ro );
00156 flag float64_eq( float64, float64, run_options *ro );
00157 flag float64_le( float64, float64, run_options *ro );
00158 flag float64_lt( float64, float64, run_options *ro );
00159 flag float64_eq_signaling( float64, float64, run_options *ro );
00160 flag float64_le_quiet( float64, float64, run_options *ro );
00161 flag float64_lt_quiet( float64, float64, run_options *ro );
00162 flag float64_is_signaling_nan( float64 );
00163
00164 #ifdef FLOATX80
00165
00166
00167
00168
00169
00170
00171 int32 floatx80_to_int32( floatx80, run_options *ro );
00172 int32 floatx80_to_int32_round_to_zero( floatx80, run_options *ro );
00173 float32 floatx80_to_float32( floatx80, run_options *ro );
00174 float64 floatx80_to_float64( floatx80, run_options *ro );
00175 #ifdef FLOAT128
00176 float128 floatx80_to_float128( floatx80, run_options *ro );
00177 #endif
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192 floatx80 floatx80_round_to_int( floatx80, run_options *ro );
00193 floatx80 floatx80_add( floatx80, floatx80, run_options *ro );
00194 floatx80 floatx80_sub( floatx80, floatx80, run_options *ro );
00195 floatx80 floatx80_mul( floatx80, floatx80, run_options *ro );
00196 floatx80 floatx80_div( floatx80, floatx80, run_options *ro );
00197 floatx80 floatx80_rem( floatx80, floatx80, run_options *ro );
00198 floatx80 floatx80_sqrt( floatx80, run_options *ro );
00199 flag floatx80_eq( floatx80, floatx80, run_options *ro );
00200 flag floatx80_le( floatx80, floatx80, run_options *ro );
00201 flag floatx80_lt( floatx80, floatx80, run_options *ro );
00202 flag floatx80_eq_signaling( floatx80, floatx80, run_options *ro );
00203 flag floatx80_le_quiet( floatx80, floatx80, run_options *ro );
00204 flag floatx80_lt_quiet( floatx80, floatx80, run_options *ro );
00205 flag floatx80_is_signaling_nan( floatx80 );
00206
00207 #endif
00208
00209 #ifdef FLOAT128
00210
00211
00212
00213
00214
00215
00216 int32 float128_to_int32( float128, run_options *ro );
00217 int32 float128_to_int32_round_to_zero( float128, run_options *ro );
00218 float32 float128_to_float32( float128, run_options *ro );
00219 float64 float128_to_float64( float128, run_options *ro );
00220 #ifdef FLOATX80
00221 floatx80 float128_to_floatx80( float128, run_options *ro );
00222 #endif
00223
00224
00225
00226
00227
00228
00229 float128 float128_round_to_int( float128, run_options *ro );
00230 float128 float128_add( float128, float128, run_options *ro );
00231 float128 float128_sub( float128, float128, run_options *ro );
00232 float128 float128_mul( float128, float128, run_options *ro );
00233 float128 float128_div( float128, float128, run_options *ro );
00234 float128 float128_rem( float128, float128, run_options *ro );
00235 float128 float128_sqrt( float128, run_options *ro );
00236 flag float128_eq( float128, float128, run_options *ro );
00237 flag float128_le( float128, float128, run_options *ro );
00238 flag float128_lt( float128, float128, run_options *ro );
00239 flag float128_eq_signaling( float128, float128, run_options *ro );
00240 flag float128_le_quiet( float128, float128, run_options *ro );
00241 flag float128_lt_quiet( float128, float128, run_options *ro );
00242 flag float128_is_signaling_nan( float128 );
00243
00244 #endif
00245 #endif
00246
00247 __SRCVERSION( "$URL: http://svn.ott.qnx.com/product/trunk/lib/ieee754/softfloat/softfloat.h $ $Rev: 224061 $" )