4 ms·
Only registers that are orthogonal to each other should be counted. RAX,EAX,AX,AL,AH can not be independently varied, and thus should only count as 1.
by mikewarot 6y ago
Only registers that are orthogonal to each other should be counted. RAX,EAX,AX,AL,AH can not be independently varied, and thus should only count as 1.
- __s 6y agoAL/AH are distinct at least Maybe count how many bits of registers there are. Then count RAX as 64 bits of registers
- mikewarot 6y agoGood point, but they are both part of AX and up, so I don't think they should count.
- ithkuil 6y agoThey share the underlying storage (i.e. they are aliased) but they are independently addressed, and thus they consume instruction encoding space. Not saying that it's not interesting to know how much actual storage the register file offers; just highlighting that TFA focuses on the instruction encoding angle of the question, which is also important. CPU architectures are masterpieces of tradeoffs. Put too many registers and your instructions steam is not dense enough and you cannot keep your cpu busy due to stalls in the fetch phase. Also context switches become expensive (there are solutions to that though). Put to few registers and you have to spill registers to memory too often, and thus also consume precious instruction stream space.