This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Further floating-point-emulator cleanups
- From: Richard Henderson <rth at redhat dot com>
- To: Zack Weinberg <zack at codesourcery dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 22 Mar 2002 12:05:15 -0800
- Subject: Re: Further floating-point-emulator cleanups
- References: <20020322060858.GP896@codesourcery.com>
On Thu, Mar 21, 2002 at 10:08:58PM -0800, Zack Weinberg wrote:
> - HOST_WIDE_INT r[(19 + sizeof (HOST_WIDE_INT))/(sizeof (HOST_WIDE_INT))];
These numbers are off by one because some wise guy folded
20 + sizeof(HOST_WIDE_INT) - 1
by hand. I'd appreciate it if you undid this.
> + long l;
> + REAL_VALUE_TYPE r;
> + REAL_VALUE_FROM_CONST_DOUBLE (r, op);
> + REAL_VALUE_TO_TARGET_SINGLE (r, l);
> + fprintf (file, "0x%x", l);
Most of your uses of long are in error on 64-bit hosts. Here
you need to either treat it as signed, or mask it down to 32 bits.
> +++ config/m88k/m88k.c 2002/03/22 05:17:48
> @@ -1123,9 +1123,9 @@ real_power_of_2_operand (op, mode)
> rtx op;
> enum machine_mode mode ATTRIBUTE_UNUSED;
> {
> + REAL_VALUE_TYPE d;
> union {
> - REAL_VALUE_TYPE d;
> - int i[sizeof (REAL_VALUE_TYPE) / sizeof (int)];
> + long l[2];
Here long isn't necessarily the right size to use in the union.
Neither is int, really...
> @@ -1169,8 +1169,9 @@ legitimize_operand (op, mode)
> enum machine_mode mode;
> {
> rtx temp;
> + REAL_VALUE_TYPE r;
> union {
> - union real_extract r;
> + long l[2];
Likewise.
r~