mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-24 18:00:44 +02:00
Previously if the instruction was encoded to use rsp, rbp, rsi, or rdi then due to how these were encoded in modrm this would hit the frontend path for writing to the high 8 bits of a 16bit register. This is because it's instruction specific if an 8-bit modrm instruction chooses to use the high 8-bit region or the upper 4 registers. See the ModRM.reg section of `ModRM.reg and .r/m Field Encodings` specifically to see what each encoding stands for. Has four different meanings per encoding depending on instruction. This instruction doesn't actually write to registers at 8-bit size, it extracts an element at 8-bit size and then zero extends it to the full GPR. When storing to memory it always stores to memory at the size of the element extracted. I grepped around the instruction tables to see if there were any other instances of this mistake. This was the only one. Fixes #1472 and also gets Psychonauts 2 running.