Boost logo

Boost :

From: Howard Hinnant (hinnant_at_[hidden])
Date: 1999-11-30 09:30:59


John Maddock wrote on 11/30/99 7:57 AM
>Within the body of the function, pass by value is marginally better (the
>code stores the value in a register, rather than a pointer to the value in
>a register):
>
>;by reference:
>?live16441_at_16: ; EAX = out, EDX = n, ECX = t
>@361:
> mov ebx,dword ptr [ecx]
> mov dword ptr [eax],ebx
> add eax,4
>
>;by value:
>?live16442_at_16: ; EAX = out, EDX = n, ECX = t
>@365:
> mov dword ptr [eax],ecx
> add eax,4

My x86 assembly is a little rusty. I don't see the loop (where is EDX
getting decremented?). If this is the loop body and you've edited out
the loop, then the by-value looks like a very big win to me for this
platform. Is this with optimizations turned on?

-Howard


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk