2 ms·
Good article, nice and meaty. mov 0xc(%r12,%r11,8),%eax Interesting choice, won't this be a so-called "slow lea" on recent Intel hardware?
by gsg 12y ago
Good article, nice and meaty.
mov 0xc(%r12,%r11,8),%eax
Interesting choice, won't this be a so-called "slow lea" on recent Intel hardware?
- vardump 12y agoI think the relevant execution unit for address calculation is always available at that point. Not sure without testing, of course. I'm pretty sure the following replacement sequence for just that one instruction would be more expensive regardless: shl 0x3, %r11 ; Multiply by 8 add %r12, %r11 ; Add (heap?) base address to r11 mov 0xc(%r11),%eax ; Indexed + displacement addressing mode xor %r11, %r11 ; Make sure upper 32 bits are cleared for future r11 use Last line (xor) is most likely not necessary, but might depend on how r11 is used in the future. If JVM assumes the upper bits to be always zero, it is needed.