static void times_pten (REAL_VALUE_TYPE *, int);
static void round_for_format (const struct real_format *, REAL_VALUE_TYPE *);
+
+/* Determine whether a floating-point value X is a denormal. R is
+ expected to be in denormal form, so this function is only
+ meaningful after a call to round_for_format. */
+
+static inline bool
+real_isdenormal (const REAL_VALUE_TYPE *r)
+{
+ return r->cl == rvc_normal && (r->sig[SIGSZ-1] & SIG_MSB) == 0;
+}
\f
/* Initialize R with a positive zero. */
{
unsigned long image, sig, exp;
unsigned long sign = r->sign;
- bool denormal = real_isdenormal (r);
image = sign << 31;
sig = (r->sig[SIGSZ-1] >> (HOST_BITS_PER_LONG - 24)) & 0x7fffff;
/* Recall that IEEE numbers are interpreted as 1.F x 2**exp,
whereas the intermediate representation is 0.F x 2**exp.
Which means we're off by one. */
- if (denormal)
+ if (real_isdenormal (r))
exp = 0;
else
exp = REAL_EXP (r) + 127 - 1;
{
unsigned long image_lo, image_hi, sig_lo, sig_hi, exp;
unsigned long sign = r->sign;
- bool denormal = real_isdenormal (r);
image_hi = sign << 31;
image_lo = 0;
/* Recall that IEEE numbers are interpreted as 1.F x 2**exp,
whereas the intermediate representation is 0.F x 2**exp.
Which means we're off by one. */
- if (denormal)
+ if (real_isdenormal (r))
exp = 0;
else
exp = REAL_EXP (r) + 1023 - 1;
const REAL_VALUE_TYPE *r)
{
unsigned long image_hi, sig_hi, sig_lo;
- bool denormal = real_isdenormal (r);
image_hi = r->sign << 15;
sig_hi = sig_lo = 0;
this discrepancy has been taken care of by the difference
in fmt->emin in round_for_format. */
- if (denormal)
+ if (real_isdenormal (r))
exp = 0;
else
{
{
unsigned long image3, image2, image1, image0, exp;
unsigned long sign = r->sign;
- bool denormal = real_isdenormal (r);
REAL_VALUE_TYPE u;
image3 = sign << 31;
/* Recall that IEEE numbers are interpreted as 1.F x 2**exp,
whereas the intermediate representation is 0.F x 2**exp.
Which means we're off by one. */
- if (denormal)
+ if (real_isdenormal (r))
exp = 0;
else
exp = REAL_EXP (r) + 16383 - 1;
{
unsigned long image, sig, exp;
unsigned long sign = r->sign;
- bool denormal = real_isdenormal (r);
image = sign << 15;
sig = (r->sig[SIGSZ-1] >> (HOST_BITS_PER_LONG - 11)) & 0x3ff;
/* Recall that IEEE numbers are interpreted as 1.F x 2**exp,
whereas the intermediate representation is 0.F x 2**exp.
Which means we're off by one. */
- if (denormal)
+ if (real_isdenormal (r))
exp = 0;
else
exp = REAL_EXP (r) + 15 - 1;
{
unsigned long image, sig, exp;
unsigned long sign = r->sign;
- bool denormal = real_isdenormal (r);
image = sign << 15;
sig = (r->sig[SIGSZ-1] >> (HOST_BITS_PER_LONG - 8)) & 0x7f;
break;
case rvc_normal:
- if (denormal)
+ if (real_isdenormal (r))
exp = 0;
else
exp = REAL_EXP (r) + 127 - 1;