Michael Schwendt wrote:
On Wed, 23 Oct 2002 17:36:14 -0400, Jakub Jelinek wrote:
A test using a simple C source file:
-march=i386 -mcpu=i686 was the same as -march=i386 -mcpu=athlon
Most interesting to me,
The mix is different.
example
i686 athlon
movl -24(%edp), %edx andl -24(%edp), %eax
andl %edx, %eax
movl %eax, %edx imull $100, %eax, %edx
movl %edx, %eax
sall $2, %eax
addl %edx, %eax
leal 0(,%eax,4), %edx
addl %edx, %eax
leal 0(,%eax,4), %edx
Do you have testcase and exact options for this?
$edx = 100*$eax is with -O2 -mcpu=i686:
leal (%eax,%eax,4), %edx
leal (%edx,%edx,4), %edx
sall $2, %edx
for me.
I think Thomas didn't use -O2.
Correct. I was comparing the code/scheduler differences
in -mcpu settings. adding -O2 for the previous example:
i686 athlon
movl -24(%ebp), %ebx movl -24(%ebp), %ecx
movl -28(%ebp), %edx movl %ecx, %eax
movl %ebx, %eax subl -28(%ebp), %eax
subl %edx, %eax imull $100, %eax, %edx
leal (%eax,%eax,4), %eax movl %edx, %eax
leal (%eax,%eax,4), %eax
leal 0(,%eax,4), %edx
movl %edx, %eax
Some other code is mixed in now, but still i686 is
using leal and athlon is using imull. So gcc thinks imul
is a better choice on the athlon than i686.
also this one I like:
i686 athlon
xorl %edi, %edi testb $32, 9(%edx)
xorl %esi, %esi movl $0, -9836(%ebp)
testb $32, 9(%ecx) movl $0, -9840(%ebp)
movl %edi, -9836(%ebp)
movl %esi, -9840(%ebp)
I see slightly different register usage again, but the
interesting part is i686 using xorl, and 2 registers,
while the athlon uses constants.
Still I need something to test with to see how much difference
it makes when running.
-Thomas