multiplies by powers of two

Matthew Fluet mfluet@intertrust.com
Fri, 13 Jul 2001 13:48:52 -0700 (PDT)


> If you look at the spy output on nested loops you will see it.  Things like
> 	inc	%ebp
> 	jo	???
> 	mov	%esp, 0xdc(%edi)
> 	mov	%ebp, 0xd8(%edi)
> If I were writing this I wouldn't put the %esp store while I was working on
> the %ebp.
> As I said, there is nothing wrong with this, and it might even be good, but
> it definitely reads as being not something a human would do.

I agree, and this is an artefact of the register allocation; from one
point of view, I'm "done" with %ebp right after not taking the jo branch
-- there wasn't an overflow, I silently rename %ebp from the temporary
overflow variable to it's final location and that's it.  Then we're at the
end of a block and have to right all stack slots back to memory.  I've got
a list of registers that are carrying uncommited values, and I just run
through them in some arbitrary order and commit them.