3 msgproblem with my account
6 msgregarding privilege levels of pentium 4

how to generate code-loops
\ David Livshin (30 Sep 2006)
. \ Brian Budge (30 Sep 2006)
. . \ David Livshin (30 Sep 2006)
. . . \ ArtÅ«ras Moskvinas (30 Sep 2006)
. . . . \ David Livshin (30 Sep 2006)
. . . \ Tim Prince (1 Oct 2006)

1 msgHow to get address and size of a section
2 msgStill can't build C++ for xscale-elf
1 msgMac OS X: sudo gcc_select 4.0: Error trying to ...
1 msgENQUIRY
1 msgRe: Trampoline implementation for MIPS
2 msgAdding -R to specs, need assistance
2 msgproblems building ARM compiler
1 msgautovect and autoparallel
1 msgCompiling from alternate root prefix.
3 msgRe: How do I build C++ for xscale-elf?
2 msgbinary compatibility between gcc 3.4.3 and 4.x
2 msgHiding constructior is required while no direct...
2 msgCan conditional compilation test strings?
5 msgHelp with gcc installation on AIX 5.3
2 msgcollect2: ld returned 1 exit status
7 msgAssembly constraints - offset?
2 msgrtl.def
Subject:how to generate code-loops
Group:Gcc-help
From:David Livshin
Date:30 Sep 2006



Hi,

Is there a way ( command line option ) to instruct the compiler to
generate code-loops ( when possible ):

Label:
<code>
conditional jump to 'Label'


Compiling

for ( k=0 ; k<n ; k++ )
{
x[k] = y[k+1] - y[k];
}


with the command line options

" -O3 -fomit-frame-pointer -funroll-all-loops -ffast-math
-march=pentium4 -mfpmath=sse -msse2 -mmmx"

produces

.L1064:
movsd as1+32032(,%edx,8), %xmm1
subsd as1+32024(,%edx,8), %xmm1
movsd %xmm1, as1+24016(,%edx,8)
cmpl %ecx, %edx
je .L1010
.L1012:
leal 1(%edx), %esi
movsd as1+32032(,%esi,8), %xmm0
subsd as1+32024(,%esi,8), %xmm0
movsd %xmm0, as1+24016(,%esi,8)
leal 2(%edx), %ebx
movsd as1+32032(,%ebx,8), %xmm7
subsd as1+32024(,%ebx,8), %xmm7
movsd %xmm7, as1+24016(,%ebx,8)
leal 3(%edx), %eax
movsd as1+32032(,%eax,8), %xmm6
subsd as1+32024(,%eax,8), %xmm6
movsd %xmm6, as1+24016(,%eax,8)
leal 4(%edx), %esi
movsd as1+32032(,%esi,8), %xmm5
subsd as1+32024(,%esi,8), %xmm5
movsd %xmm5, as1+24016(,%esi,8)
leal 5(%edx), %ebx
movsd as1+32032(,%ebx,8), %xmm4
subsd as1+32024(,%ebx,8), %xmm4
movsd %xmm4, as1+24016(,%ebx,8)
leal 6(%edx), %eax
movsd as1+32032(,%eax,8), %xmm3
subsd as1+32024(,%eax,8), %xmm3
movsd %xmm3, as1+24016(,%eax,8)
leal 7(%edx), %esi
movsd as1+32032(,%esi,8), %xmm2
subsd as1+32024(,%esi,8), %xmm2
movsd %xmm2, as1+24016(,%esi,8)
addl $8, %edx
jmp .L1064
.L1010:

which is not a loop; it is difficult to process ( and also runs slower
then when the code is a loop ).

Thank you in advance,

David

--
David Livshin
david.livshin

http://www.dalsoft.com



© 2004-2008 readlist.com