@jj2007 What do you want to prove ? that an alone guy in 2 years does less well than a very skilled team during many years ;-)
Gas64 uses one only pass I guess that with a second pass more optimizations could be made and therefore executions be speed up.
I have to study the asm code generated by gcc with -O2 maybe I can optimize something in gas64 but that's unlikely.
Btw -Wc -O2 and -g are useless with gas64. In 1.08 the stack size is increased to 2048 for 64bit.
A timer is added when filling the array.
Gas32 : 5145 / 525 / 525
Gas64 : 3008 / 536 / 605 -------------------------------------> total = 4149, not so bad.
Gcc64 no optim : 10891 / 529 / 524
Gcc -02: 10010 / 128 / 153 ---------------------------------- --> total = 10291
A surprise without the first timer Gcc -02 : 159 / 100 ?????
Code: Select all
#Define elements 150000000 ' thread Integer data types in 32-bit and 64-bit
if (sizeof(any ptr))=8 Then
Print "sizes in 64-bit code:"
else
Print "sizes in 32-bit code:"
endif
Print sizeof(integer), "integer"
Print sizeof(long), "long"
Dim shared As long longvar(elements)
Dim shared As integer intvar(elements)
Dim As long tmp, ms
Dim As integer sumi
Dim As long suml
Dim As double ti, tl, tp
tp=Timer()
for n as integer=0 to elements-1 ' create an array of random integers and longs
tmp=Rnd()*16
longvar(n)=tmp
intvar(n)=tmp
next
tp=Timer()-tp
ms=1000*tp
print "Fill array=";ms
ti=Timer()
for n as integer=0 to elements-1 ' sum of integers
sumi+=intvar(n)
next
ti=Timer()-ti
tl=Timer()
for n as integer=0 to elements-1 ' sum of longs
suml+=longvar(n)
next
tl=Timer()-tl
ms=1000*ti
Print "Sum integer=";sumi;" added in ";ms;" ms"
ms=1000*tl
Print "Sum long =";suml;" added in ";ms;" ms"
sleep