Comment by xg15
It also says the multiplier must be one of 2, 4 or 8.
So I guess this trick then only works for multiplication by 2, 3, 4, 5, 8 or 9?
It also says the multiplier must be one of 2, 4 or 8.
So I guess this trick then only works for multiplication by 2, 3, 4, 5, 8 or 9?
Hey now; let's not get ahead too far :) I'm trying to keep each one bite-sized...I don't think you'll be (too) disappointed at the next few episodes :)
The tricks to avoid multiplication (and division) are probably worth a whole post.
But with -Os you get imul eax, edi, 6And on modern CPUs multiplication might not be actually all that slow (but there may be fewer multiply units).