-
Notifications
You must be signed in to change notification settings - Fork 150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Decoder/formatter failures #233
Comments
I started to work on this one. I have fixed the 1st and 4th issues in my work area. Thanks. I believe the SDM may be wrong for the 5th issue (EVEX.V' appears to be guarded in 32b mode). That instruction pattern generates an illegal instruction fault on real hardware. I'm checking with someone who owns the RTL to confirm before submitting a fix request to t he SDM. |
Wouldn't be the first time the SDM is wrong, unfortunately. |
I try not to bash the SDM. The current owner is a friend of mine and was handed a document with a lot of technical debt. We are constantly working to improve things... |
Fixed the 2nd one too. That was probably 16y old bug. |
I fixed all but the last one now. Thinking about whether it is worth bothering. Those are the only 2 instr with "~4b" imm when there is a register in the upper bits. Is AMD even supporting those instructions going forwards? I assumed they were removed from Zen when XOP instr was removed but don't know for sure. |
The CPUID feature bit is XOP so they shouldn't be supported by current and future AMD CPUs. |
FWIW, I got a response back from the decoder team. As I suggested above, Table 2-39 is wrong for EVEX.V'. For EVEX.V' (P[19]), the table should say "if 0" in both rows for the non-64b #UD, indicating that bit is guarded. Table 2-39 will be fixed in the next release of the SDM (which happens roughly quarterly). Thank you for bringing that issue to my attention. |
* part of #233 (cherry picked from commit 0fb6f8655cf67c9b59e0b7cf7048e22d989f9a84)
* needed to ignore upper 8 regs when in 32b mode. * use VGPR32_B and VGPR32_R for correct 32b mode behavior of AMD XOP instr. * Add&use VGPRy_R and VGPRy_B for correct 32/64b mode behavior of AMD XOP. * #233 (cherry picked from commit 1dd63ff3cf987057016ca354f10facb206fec102)
* using eosz instead of just the 64b mode indicator * ~16 year old bug... * #233 (cherry picked from commit 932bbd537986d804ec96e5ae18f56589fe61555a)
* #233 (cherry picked from commit 562689f047f2643a9ba042d0b42d244df45778a1)
* part of #233 (cherry picked from commit 0fb6f8655cf67c9b59e0b7cf7048e22d989f9a84)
* needed to ignore upper 8 regs when in 32b mode. * use VGPR32_B and VGPR32_R for correct 32b mode behavior of AMD XOP instr. * Add&use VGPRy_R and VGPRy_B for correct 32/64b mode behavior of AMD XOP. * #233 (cherry picked from commit 1dd63ff3cf987057016ca354f10facb206fec102)
* using eosz instead of just the 64b mode indicator * ~16 year old bug... * #233 (cherry picked from commit 932bbd537986d804ec96e5ae18f56589fe61555a)
* #233 (cherry picked from commit 562689f047f2643a9ba042d0b42d244df45778a1)
{er} is ignored, see the SDM
Offset is unsigned and should not be sign-extended (32-bit code)
Can't disassemble pvalidate in 16/32-bit mode (AMD: "While this instruction is intended for use in SNP-active guest system software, it is recognized in any operating mode at CPL0.")
R8D/R9D can't be used in 32-bit mode. RX bits should probably be ignored (I haven't tested real HW)
Fails to decode this in 32-bit mode. According to the SDM, V' is ignored in 16/32-bit mode, see SDM vol 2, Table 2-39 (page 77), bottom two rows.
imm shouldn't show the reg op (upper 4 bits)
The text was updated successfully, but these errors were encountered: