News for hackers. Stuff that matters.
Re:Reverse engineering the Intel 386 processor's register cell by ajross on Thursday November 09, 2023 @05:45PM (#38212460)
I doubt any traces would exist at the mask level if that were the case. The decoding is just a 3-bit field in the ModR/M, there have "always" been CR{1,5,6,7} in the encoding, but those don't take transistors to recognize; you only decode what you want to connect.

But the theory sounds totally plausible: they'd have written up the ISA spec long before they started designing the circuits. So if CR1 got dropped early all the existing designs would still be targetting 0/2/3 explicitly.

But FWIW: the "why wasn't it ever used" question is easier to answer: the window was extremely short. The MOVCR instructions only supported 8 32 bit registers, and when the Pentium shipped that was already too small and all future CPU state extensions were done using the new CPUID and MSR mechanisms.

Re:Reverse engineering the Intel 386 processor's register cell by anyfoo on Thursday November 09, 2023 @11:57PM (#38215219)
They could have started using CR1 instead of introducing CR4, that to me is the mystery. A likely answer is that some software may have been relying on CR1 faulting, though that’s kind of weird.
Re:Reverse engineering the Intel 386 processor's register cell by ajross on Friday November 10, 2023 @07:44AM (#38218151)
AMD could have used CR5 instead of CR8 too. Both could (and probably should have) used an MSR for those bits. Numbers are just numbers. I really don't think there's need for much speculation here.
Re:Reverse engineering the Intel 386 processor's register cell by colejohnson66 on Friday November 10, 2023 @03:57PM (#38224416)
I always assumed CR8 was used because (a) it prevents access outside 64-bit mode, and (b) being the creators of 64-bit mode, there's a guarantee Intel has no plans of using such a register for something else.
Re:Reverse engineering the Intel 386 processor's register cell by ajross on Monday November 13, 2023 @11:52AM (#38252275)
To be clear, sure, that's surely the case. The REX encoding added an extra bit to the register field used by the movcr instructions, giving you 16. So... might as well.

Nonetheless the "official" means for adding state to an x86 is an MSR. And in particular there's no good reason for putting this in legacy spaces like CRs: CR8 is an interrupt control register, unrelated to the MMU control in CR0/2/3.

(In fact the proof of this is that within the decade, x86 interrupt handling needed to evolve in the direction of MSI's and x2apic, something that even the newly-expanded CR registers were completely inadequate to do. So we do that stuff in MSRs too.)

Re:Reverse engineering the Intel 386 processor's register cell by anyfoo on Friday November 10, 2023 @04:22PM (#38224707)
I’m not sure why I have to defend my curiosity, but the engineering decision to add CR4, instead of using the existing CR1 which was literally all bits “reserved for future use”, is just interesting to me. Especially because MSRs were also an option. There must have been a reason, however minutious, leading to that, and I’d like to know.

Though it’s mostly just a corollary to the existence of the completely reserved CR1 itself, which was added in the 386 at the same time as CR2 and CR3 (so I don’t think compatibility concerns apply). Looking at it from only surface level, those massively crucial control bits in CR3 (CR2 contains an address, not control bits) should logically have been in CR1. Instead CR1 is entirely a forbidden zone.

That Intel decided to skip CR1 entirely speaks of a story. Before I knew of the plans of having an on chip cache, this story was a giant mystery. Now that I know of the possibility that it might have been related to the late-scrapped plans of having an on-chip cache on the 386, I think that’s a pretty interesting potential reason already, but I’m not yet satisfied unless confirmed.

But if CR1 actually exists in the 386 in some form other than the encoding, then that's massive news.