What is register %eiz?

后端 未结 3 551
时光取名叫无心
时光取名叫无心 2020-12-08 03:39

In the following assembly code that I dumped out using objdump:

lea    0x0(%esi,%eiz,1),%esi

What is register %eiz

3条回答
  •  情深已故
    2020-12-08 04:16

    See Why Does GCC LEA EIZ?:

    Apparently %eiz is a pseudo-register that just evaluates to zero at all times (like r0 on MIPS).

    ...

    I eventually found a mailing list post by binutils guru Ian Lance Taylor that reveals the answer. Sometimes GCC inserts NOP instructions into the code stream to ensure proper alignment and stuff like that. The NOP instruction takes one byte, so you would think that you could just add as many as needed. But according to Ian Lance Taylor, it’s faster for the chip to execute one long instruction than many short instructions. So rather than inserting seven NOP instructions, they instead use one bizarro LEA, which uses up seven bytes and is semantically equivalent to a NOP.

提交回复
热议问题