This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] real.c IBM 128-bit extended format support


On Mon, Sep 23, 2002 at 02:49:33PM -0400, David Edelsohn wrote:
> +       buf[0] = r->sign << 31;
> +       buf[1] = 0;
> +       buf[2] = r->sign << 31;
> +       buf[3] = 0;

Both zeros carry the sign?

Also, please do go ahead and use FLOAT_WORDS_BIG_ENDIAN, 
even if this is just for rs6000.

> +     case rvc_normal:
> +       memcpy (&t, r, sizeof (*r));
> +       memcpy (&u, r, sizeof (*r));

Use structure assignment.

> +       clear_significand_below (&t, SIGNIFICAND_BITS - 106);

In theory round_for_format has done this for you already.

> +   if (u.class == rvc_inf || u.class == rvc_nan)
> +     memcpy (r, &u, sizeof (*r));

Structure assignment again.

> +   else
> +     do_add (r, &u, &v, 0);

This loses -0.  You probably need to force-copy the sign from
the first double.

> +     106, /* 53 + 53 */

No reason not to just write 53 + 53 in the first place.


How do denormals work?  Seems like either you can't support them.
If you allow one double to underflow, that only gets you half
the denormal range.  Which, btw, would fail LIA-1's definition
of denormals, which means that you should set has_denorm false.


r~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]