This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/17619] Non-optimal code for -mfpmath=387,sse
- From: "uros at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 1 Dec 2004 14:07:29 -0000
- Subject: [Bug target/17619] Non-optimal code for -mfpmath=387,sse
- References: <20040922191917.17619.bangerth@dealii.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From uros at gcc dot gnu dot org 2004-12-01 14:07 -------
With "GCC: (GNU) 4.0.0 20041201 (experimental)", following code is produced
(without -ffast-math):
_Z6foobarv:
.LFB2:
pushl %ebp
.LCFI0:
movl %esp, %ebp
.LCFI1:
subl $4, %esp
.LCFI2:
flds b+12
fmuls a+12
movss b, %xmm1
mulss a, %xmm1
addss .LC0, %xmm1
movss b+4, %xmm0
mulss a+4, %xmm0
addss %xmm0, %xmm1
movss b+8, %xmm0
mulss a+8, %xmm0
addss %xmm0, %xmm1
movss %xmm1, -4(%ebp)
flds -4(%ebp)
faddp %st, %st(1)
leave
ret
Please note, that we should return the result in fp reg, so final flds is needed
in any case. I think, this code is optimal.
Should we close this bug?
Uros.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17619