|
|
| 1 |
/* Software floating-point emulation. |
1 |
/* Software floating-point emulation. |
| 2 |
Definitions for IEEE Double Precision |
2 |
Definitions for IEEE Double Precision |
| 3 |
Copyright (C) 1997,1998,1999,2006 Free Software Foundation, Inc. |
3 |
Copyright (C) 1997,1998,1999,2006,2007 Free Software Foundation, Inc. |
| 4 |
This file is part of the GNU C Library. |
4 |
This file is part of the GNU C Library. |
| 5 |
Contributed by Richard Henderson (rth@cygnus.com), |
5 |
Contributed by Richard Henderson (rth@cygnus.com), |
| 6 |
Jakub Jelinek (jj@ultra.linux.cz), |
6 |
Jakub Jelinek (jj@ultra.linux.cz), |
|
|
| 142 |
_FP_PACK_RAW_2_P(D,val,X); \ |
142 |
_FP_PACK_RAW_2_P(D,val,X); \ |
| 143 |
} while (0) |
143 |
} while (0) |
| 144 |
|
144 |
|
|
|
145 |
/* Copy the internal layout between RAW, SEMIRAW, and CANONICAL forms. |
| 146 |
These macros are used in the fma implementations. */ |
| 147 |
|
| 148 |
#define FP_COPY_RAW_D(Y, X) \ |
| 149 |
do { \ |
| 150 |
Y##_f0 = X##_f0; \ |
| 151 |
Y##_f1 = X##_f1 & \ |
| 152 |
((1 << (_FP_FRACBITS_D \ |
| 153 |
- (_FP_IMPLBIT_D != 0) \ |
| 154 |
- _FP_W_TYPE_SIZE)) -1);\ |
| 155 |
Y##_e = X##_e & \ |
| 156 |
((1 << _FP_EXPBITS_D) \ |
| 157 |
-1); \ |
| 158 |
Y##_s = X##_s; \ |
| 159 |
} while (0) |
| 160 |
|
| 161 |
#define FP_COPY_RAW_TO_CANONICAL_D(Y,X) \ |
| 162 |
do { \ |
| 163 |
FP_COPY_RAW_D(Y,X); \ |
| 164 |
_FP_UNPACK_CANONICAL(D,2,Y); \ |
| 165 |
} while (0) |
| 166 |
|
| 167 |
#define FP_COPY_RAW_TO_SEMIRAW_D(Y,X) \ |
| 168 |
do { \ |
| 169 |
FP_COPY_RAW_D(Y,X); \ |
| 170 |
_FP_UNPACK_SEMIRAW(D,2,Y); \ |
| 171 |
} while (0) |
| 172 |
|
| 173 |
#define FP_COPY_SEMIRAW_D(Y, X) \ |
| 174 |
do { \ |
| 175 |
Y##_f0 = X##_f0; \ |
| 176 |
Y##_f1 = X##_f1 & \ |
| 177 |
((1 << (_FP_FRACBITS_D \ |
| 178 |
- (_FP_IMPLBIT_D != 0) \ |
| 179 |
- _FP_W_TYPE_SIZE \ |
| 180 |
+ 3)) -1); \ |
| 181 |
Y##_e = X##_e; \ |
| 182 |
Y##_s = X##_s; \ |
| 183 |
} while (0) |
| 184 |
|
| 185 |
#define FP_COPY_CANONICAL_TO_SEMIRAW_D(Y,X) \ |
| 186 |
do { \ |
| 187 |
_FP_PACK_CANONICAL(D,2,X); \ |
| 188 |
FP_COPY_RAW_D(Y,X); \ |
| 189 |
_FP_UNPACK_SEMIRAW(D,2,Y); \ |
| 190 |
} while (0) |
| 191 |
|
| 145 |
#define FP_ISSIGNAN_D(X) _FP_ISSIGNAN(D,2,X) |
192 |
#define FP_ISSIGNAN_D(X) _FP_ISSIGNAN(D,2,X) |
| 146 |
#define FP_NEG_D(R,X) _FP_NEG(D,2,R,X) |
193 |
#define FP_NEG_D(R,X) _FP_NEG(D,2,R,X) |
| 147 |
#define FP_ADD_D(R,X,Y) _FP_ADD(D,2,R,X,Y) |
194 |
#define FP_ADD_D(R,X,Y) _FP_ADD(D,2,R,X,Y) |
|
|
| 239 |
_FP_PACK_RAW_1_P(D,val,X); \ |
286 |
_FP_PACK_RAW_1_P(D,val,X); \ |
| 240 |
} while (0) |
287 |
} while (0) |
| 241 |
|
288 |
|
|
|
289 |
/* Copy the internal layout between RAW, SEMIRAW, and CANONICAL forms. |
| 290 |
These macros are used in the fma implementations. */ |
| 291 |
|
| 292 |
#define FP_COPY_RAW_D(Y, X) \ |
| 293 |
do { \ |
| 294 |
Y##_f = X##_f & \ |
| 295 |
((1 << ( _FP_FRACBITS_D \ |
| 296 |
- (_FP_IMPLBIT_D != 0)))\ |
| 297 |
-1); \ |
| 298 |
Y##_e = X##_e & \ |
| 299 |
((1 << _FP_EXPBITS_D) \ |
| 300 |
-1); \ |
| 301 |
Y##_s = X##_s; \ |
| 302 |
} while (0) |
| 303 |
|
| 304 |
#define FP_COPY_RAW_TO_CANONICAL_D(Y,X) \ |
| 305 |
do { \ |
| 306 |
FP_COPY_RAW_D(Y,X); \ |
| 307 |
_FP_UNPACK_CANONICAL(D,1,Y); \ |
| 308 |
} while (0) |
| 309 |
|
| 310 |
#define FP_COPY_RAW_TO_SEMIRAW_D(Y,X) \ |
| 311 |
do { \ |
| 312 |
FP_COPY_RAW_D(Y,X); \ |
| 313 |
_FP_UNPACK_SEMIRAW(D,1,Y); \ |
| 314 |
} while (0) |
| 315 |
|
| 316 |
#define FP_COPY_SEMIRAW_D(Y, X) \ |
| 317 |
do { \ |
| 318 |
Y##_f = X##_f & \ |
| 319 |
((1 << ( _FP_FRACBITS_D \ |
| 320 |
- (_FP_IMPLBIT_D != 0) \ |
| 321 |
+ 3)) -1); \ |
| 322 |
Y##_e = X##_e; \ |
| 323 |
Y##_s = X##_s; \ |
| 324 |
} while (0) |
| 325 |
|
| 326 |
#define FP_COPY_CANONICAL_TO_SEMIRAW_D(Y,X) \ |
| 327 |
do { \ |
| 328 |
_FP_PACK_CANONICAL(D,1,X); \ |
| 329 |
FP_COPY_RAW_D(Y,X); \ |
| 330 |
_FP_UNPACK_SEMIRAW(D,1,Y); \ |
| 331 |
} while (0) |
| 332 |
|
| 242 |
#define FP_ISSIGNAN_D(X) _FP_ISSIGNAN(D,1,X) |
333 |
#define FP_ISSIGNAN_D(X) _FP_ISSIGNAN(D,1,X) |
| 243 |
#define FP_NEG_D(R,X) _FP_NEG(D,1,R,X) |
334 |
#define FP_NEG_D(R,X) _FP_NEG(D,1,R,X) |
| 244 |
#define FP_ADD_D(R,X,Y) _FP_ADD(D,1,R,X,Y) |
335 |
#define FP_ADD_D(R,X,Y) _FP_ADD(D,1,R,X,Y) |