Re:Does a compiler use all x86 instructions? (2016)
by Findecanor on Monday July 18, 2022 @04:19AM
(#32135849)
It is not as generic. k can only be the constants 1, 2, 4 or 8, which makes the "multiplication" a shift. And the offset is also a constant (8 or 32 bits).
But you could multiply by 2+1, 4+1 or 8+1 by having base and n be the same register.
But you could multiply by 2+1, 4+1 or 8+1 by having base and n be the same register.