"
One more question:
Which parameters do you pass to the function? How does
the code get the address of the memory block it should
process?
"
No parameters are passed.
The routine is part of an "object".
So it gets the address of fields which are inside the object.
If this is a problem for you then you can change the routine so it accepts
parameters.
For example:
procedure MyRoutine( Memory : pointer );
This would pass the memory pointer in eax if I remember correctly
"
First improvement:
This sequence
movsxd rax,r14d
shl rax,2
mov dword ptr [rdx+rax],r9d
is equal to the single instruction
mov dword ptr [rdx+r14*4),r9d
This is repeated three times, adding six -superfluous-
clock cycles per iteration. 6 * 80,000 = 480,000 saved
cycles.
"
Hmm I'll have to check this out some more... for which of my code version
was this ?
"
Do you need positive and negative indices? If not, six
more clocks per iteration can be saved. And this is no
optimization - it's just a correction of flaws...
"
Only positive in the current example, probably real world problem too.
I could try changing the type from integer (signed) to
longword(unsigned/positive only) to see if that helps the compiler.
Bye,
Skybuck.