This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/6585] Redundant store/load instruction pairs on ix86
- From: "steven at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 26 Jun 2005 13:35:46 -0000
- Subject: [Bug rtl-optimization/6585] Redundant store/load instruction pairs on ix86
- References: <20020506130600.6585.bruno@clisp.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From steven at gcc dot gnu dot org 2005-06-26 13:35 -------
Today's results ("-O2 -m32 -march=i686 -mtune=i686 -fomit-frame-pointer"):
.file "t.c"
.text
.p2align 4,,15
.globl mul
.type mul, @function
mul:
subl $12, %esp # get space to save three registers
movl %ebx, (%esp) # save %ebx
movl 20(%esp), %edx # %edx <- a1 COULD GO INTO %esi
movl 28(%esp), %ebx # %ebx <- b1 COULD GO INTO %edi
movl 16(%esp), %eax # %eax <- a0
movl 24(%esp), %ecx # %ecx <- b0
movl %esi, 4(%esp) # save %esi
movl %edx, %esi # %esi <- a1
movl %edi, 8(%esp) # save %edi
movl %ebx, %edi # %edi <- b1
movl (%esp), %ebx # restore %ebx
imull %eax, %edi # %edi <- a0*b1
imull %ecx, %esi # %esi <- b0*a1
mull %ecx # %edx:%eax := a0*b0
addl %edi, %esi # %esi <- a0*b1 + b0*a1
movl 8(%esp), %edi # restore %edi
leal (%esi,%edx), %edx # %edx <- a0*b1 + b0*a1 + hi(a0*b0)
movl 4(%esp), %esi # %restore %esi
addl $12, %esp # free stack space
ret # return result in %edx:%eax
.size mul, .-mul
.ident "GCC: (GNU) 4.1.0 20050626 (experimental)"
.section .note.GNU-stack,"",@progbits
There are still the questionable moves through %ebx and %edx, but it is
still better than before.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=6585