Pregunta

It's a very low level question about modern CPU architecture. I learned that I can use more additional registers in 64bit mode. such as ARM architecture has r15-r31 general purpose registers , for Intel/AMD r8-r15 general purpose registers. also SIMD registers are going to double like xmm8-xmm15 (or ymm8-ymm15)

Does anybody know how does it possible in only the 64bit mode?

I don't expect simple answer like "They just built more registers" becuase in 32bit mode , I can't use that additional register. Even those additional registers are not quite used by modern compilers.

¿Fue útil?

Solución

(I'm not familar with arm64, so I use X86-64 as example.) Register selecting is encoded in binary instructions. 32-bit instructions can only use registers in 80386, and cannot use registers beyond these. Moreover, IA-32(x86-32)use 3 bits to represent registers, but x86-64 need 4bits to represent all registers, you need another bit to access additional registers, and this bit is in the REX byte in 64-bit instructions. That means, for using additional registers, REX byte is needed, and REX is a part of 64-bit instructions; there's not a REX byte in 32-bit instructions, so you can't use additional regs in 32-bit.

In SIMD instructions you also need extention bit(s) to access more registers.


For ARM64, I know a little: its register file and instruction set are brand-new, not a extension of 32-bit ARM(X86-64 is a extension of X86-32). ARM64 processor can run 32-bit ARM legacy instructions for compatibility, but this is processor's work, not the architecture(ISA)'s work. Early ARM64 processor can run two instruction set architectures for supporting old software, but in future, 32-bit architecture support may be dropped, leaving only 64-bit(ARM64).

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top