Source
/* this is just to shut the compiler up about shifts > word length -- PMM 02/1998 */
/* Software floating-point emulation. Common operations.
Copyright (C) 1997,1998,1999 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com),
Jakub Jelinek (jj@ultra.linux.cz),
David S. Miller (davem@redhat.com) and
Peter Maydell (pmaydell@chiark.greenend.org.uk).
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If
not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/*
* Finish truly unpacking a native fp value by classifying the kind
* of fp value and normalizing both the exponent and the fraction.
*/
/* a denormalized number */ \
_FP_I_TYPE _shift; \
_FP_FRAC_CLZ_##wc(_shift, X); \
_shift -= _FP_FRACXBITS_##fs; \
_FP_FRAC_SLL_##wc(X, (_shift+_FP_WORKBITS)); \
X##_e -= _FP_EXPBIAS_##fs - 1 + _shift; \
X##_c = FP_CLS_NORMAL; \
FP_SET_EXCEPTION(FP_EX_DENORM); \
if (FP_DENORM_ZERO) \
{ \
FP_SET_EXCEPTION(FP_EX_INEXACT); \
X##_c = FP_CLS_ZERO; \
} \
} \
break; \
\
case _FP_EXPMAX_##fs: \
if (_FP_FRAC_ZEROP_##wc(X)) \
X##_c = FP_CLS_INF; \
else \
{ \
X##_c = FP_CLS_NAN; \
/* Check for signaling NaN */ \
if (!(_FP_FRAC_HIGH_RAW_##fs(X) & _FP_QNANBIT_##fs)) \
FP_SET_EXCEPTION(FP_EX_INVALID | FP_EX_INVALID_SNAN); \
} \
break; \
} \
} while (0)
/*
* Before packing the bits back into the native fp result, take care
* of such mundane things as rounding and overflow. Also, for some
* kinds of fp values, the original parts may not have been fully
* extracted -- but that is ok, we can regenerate them now.
*/