Tech News
← Back to articles

How many registers does an x86-64 CPU have? (2020)

read original related products more articles

ENOSUCHBLOG

Programming, philosophy, pedaling.

Nov 30, 2020 Tags: programming, x86

This post is at least a year old.

x86 is back in the general programmer discourse, in part thanks to Apple’s M1 and Rosetta 2. As such, I figured I’d do yet another x86-64 post.

Just like the last one, I’m going to cover a facet of the x86-64 ISA that sets it apart as unusually complex among modern ISAs: the number and diversity of registers available.

Like instruction counting, register counting on x86-64 is subject to debates over methodology. In particular, for this blog post, I’m going to lay the following ground rules:

I will count sub-registers (e.g., EAX for RAX ) as distinct registers. My justification: they have different instruction encodings, and both Intel and AMD optimize/pessimize particular sub-register use patterns in their microcode.

I will count registers that are present on x86-64 CPUs, but that can’t be used in long mode.

I won’t count registers that are only present on older x86 CPUs, like the 80386 and 80486 test registers.

... continue reading