This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: rfc: constant pool and floats
- From: Geoffrey Keating <geoffk at geoffk dot org>
- To: Aldy Hernandez <aldyh at redhat dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: 15 Oct 2004 15:23:36 -0700
- Subject: Re: rfc: constant pool and floats
- References: <20041015213039.GA7011@redhat.com>
Aldy Hernandez <aldyh@redhat.com> writes:
> store_bit_field() changes the floating constant to a const_int
> because of the unalignment:
>
> /* If VALUE is a floating-point mode, access it as an integer of the
> corresponding size. This can occur on a machine with 64 bit registers
> that uses SFmode for float. This can also occur for unaligned float
> structure fields. */
>
> All this eventually creates a REG_EQUAL note with a const_int, instead
> of a const_double:
That's the problem. Clearly, (reg:SF 120) is not equal to the
CONST_INT; it's equal to a SFmode CONST_DOUBLE.
> (insn 11 10 0 (set (reg:SF 120)
> (mem/u/i:SF (lo_sum:SI (reg:SI 121)
> (symbol_ref/u:SI ("*.LC0") [flags 0x2])) [0 S4 A32])) -1 (nil)
> (expr_list:REG_EQUAL (const_int 1202908642 [0x47b2ede2])
> (nil)))
All SFmode constants are CONST_DOUBLEs. If you have a CONST_INT, you
can use simplify_subreg to turn it into a CONST_DOUBLE.