This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Omitted conversion float -> double in x86 back-end
Hi,
On Tue, 21 Nov 2006, Richard Guenther wrote:
> but then regstack comes along and
>
> (insn:TI 10 32 33 2 (set (reg:SF 8 st)
> (float:SF (mem/c/i:DI (plus:SI (reg/f:SI 6 bp)
> (const_int 8 [0x8])) [3 l+0 S8 A32]))) 172
> {*floatdisf2_i387} (nil)
> (nil))
>
> where the *floatdisf2_i387 pattern misses the truncation to SFmode.
>
> (you should file a bugzilla about this)
No you don't need to. This is the usual x87-does-everything-in-extended
problem, i.e. PR 323. There is no way to truncate that extended precision
to float (or double for that matter) without explicitely storing to
memory. If you want to take that performance hit use -ffloat-store, in
which case the correct code will be produced:
foo:
pushl %ebp
movl %esp, %ebp
subl $16, %esp
fildll 8(%ebp)
fstps -4(%ebp)
flds -4(%ebp)
fstpl -16(%ebp)
fldl -16(%ebp)
leave
ret
Better of course if to use SSE math.
Ciao,
Michael.