Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

x86 has no architectural zero register, but a x86 CPU could have a microarchitectural zero register.

And when the instruction decoder in such a CPU with register renaming sees `xor eax, eax`, it just makes `eax` point to the zero register for instructions after it. It does not have to put any instruction into the pipeline, and it takes effectively 0 cycles. That is what makes the "zeroing idiom" so powerful.





Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: