From: Keith K. <sp...@dy...> - 2007-04-18 01:41:12
|
>> ("mov eax,cr9" would compile in 32-bit mode, but >> would actually generate "mov eax,cr1" for example.) > > The correct solution is to implement CR8D. > > See SF #1117594. > > That way, CR8...CR15 remain restricted to PM64 > while CR8D [*] remains restricted to non-PM64. > > [*] And up to CR15D of course, once someone is > shipping a CPU with those CRx, and decides > that LOCK makes them visible outside PM64. > Until then CR9D...CR15D shouldn't work. > > Why does this matter? Because of REX32 mode. > > <0> mode use32 > <0> > 0000 0F20C0 <0> mov eax,cr0 > <0> ; mov eax,cr8 ; requires REX for CR8 > 0003 F00F20C0 <0> mov eax,cr8d > <0> > <0> ; mov rax,cr0 ; requires REX for RAX > <0> ; mov rax,cr8 ; requires REX for RAX and > CR8 > <0> ; mov rax,cr8d ; requires REX for RAX > <0> > <0> mode rex32 > <0> > 0007 0F20C0 <0> mov eax,cr0 > 000A 440F20C0 <0> mov eax,cr8 > 000E F00F20C0 <0> mov eax,cr8d > <0> > 0012 480F20C0 <0> mov rax,cr0 > 0016 4C0F20C0 <0> mov rax,cr8 > <0> ; mov rax,cr8d ; can't override default > O64 to O32 > <0> > <0> mode rex64 > <0> > <0> ; mov eax,cr0 ; can't override default > O64 to O32 > <0> ; mov eax,cr8 ; can't override default > O64 to O32 > <0> ; mov eax,cr8d ; can't override default > O64 to O32 > <0> > 001A 0F20C0 <0> mov rax,cr0 > 001D 440F20C0 <0> mov rax,cr8 > <0> ; mov rax,cr8d ; can't override default > O64 to O32 > I'm sorry, but I have to totally reject that. There is no reason to make such an explicit distinction when an implicit one will do. I have this *funny* feeling that HPA will whole-heartedly agree. |