mirror of
https://github.com/FEX-Emu/FEX.git
synced 2025-02-14 11:40:02 +00:00
OpcodeDispatcher: Handle PDEP
Now all of BMI2 is handled.
This commit is contained in:
parent
38eea80b8d
commit
6ff80670b3
@ -2449,6 +2449,14 @@ void OpDispatchBuilder::MULX(OpcodeArgs) {
|
||||
StoreResult(GPRClass, Op, Op->Dest, ResultHi, -1);
|
||||
}
|
||||
|
||||
void OpDispatchBuilder::PDEP(OpcodeArgs) {
|
||||
auto* Input = LoadSource(GPRClass, Op, Op->Src[0], Op->Flags, -1);
|
||||
auto* Mask = LoadSource(GPRClass, Op, Op->Src[1], Op->Flags, -1);
|
||||
auto Result = _PDep(Input, Mask);
|
||||
|
||||
StoreResult(GPRClass, Op, Op->Dest, Result, -1);
|
||||
}
|
||||
|
||||
void OpDispatchBuilder::PEXT(OpcodeArgs) {
|
||||
auto* Input = LoadSource(GPRClass, Op, Op->Src[0], Op->Flags, -1);
|
||||
auto* Mask = LoadSource(GPRClass, Op, Op->Src[1], Op->Flags, -1);
|
||||
@ -6196,6 +6204,7 @@ constexpr uint16_t PF_F2 = 3;
|
||||
{OPD(2, 0b00, 0xF2), 1, &OpDispatchBuilder::ANDNBMIOp},
|
||||
{OPD(2, 0b00, 0xF5), 1, &OpDispatchBuilder::BZHI},
|
||||
{OPD(2, 0b10, 0xF5), 1, &OpDispatchBuilder::PEXT},
|
||||
{OPD(2, 0b11, 0xF5), 1, &OpDispatchBuilder::PDEP},
|
||||
{OPD(2, 0b11, 0xF6), 1, &OpDispatchBuilder::MULX},
|
||||
{OPD(2, 0b00, 0xF7), 1, &OpDispatchBuilder::BEXTRBMIOp},
|
||||
{OPD(2, 0b01, 0xF7), 1, &OpDispatchBuilder::BMI2Shift},
|
||||
|
@ -338,6 +338,7 @@ public:
|
||||
void BMI2Shift(OpcodeArgs);
|
||||
void BZHI(OpcodeArgs);
|
||||
void MULX(OpcodeArgs);
|
||||
void PDEP(OpcodeArgs);
|
||||
void PEXT(OpcodeArgs);
|
||||
void RORX(OpcodeArgs);
|
||||
|
||||
|
@ -396,7 +396,7 @@ void InitializeVEXTables() {
|
||||
{OPD(2, 0b00, 0xF5), 1, X86InstInfo{"BZHI", TYPE_INST, FLAGS_MODRM | FLAGS_VEX_2ND_SRC, 0, nullptr}},
|
||||
// AMD reference manual is incorrect. PEXT actually maps to 0b10, not 0b01.
|
||||
{OPD(2, 0b10, 0xF5), 1, X86InstInfo{"PEXT", TYPE_INST, FLAGS_MODRM | FLAGS_VEX_1ST_SRC, 0, nullptr}},
|
||||
{OPD(2, 0b11, 0xF5), 1, X86InstInfo{"PDEP", TYPE_UNDEC, FLAGS_NONE, 0, nullptr}},
|
||||
{OPD(2, 0b11, 0xF5), 1, X86InstInfo{"PDEP", TYPE_INST, FLAGS_MODRM | FLAGS_VEX_1ST_SRC, 0, nullptr}},
|
||||
|
||||
{OPD(2, 0b11, 0xF6), 1, X86InstInfo{"MULX", TYPE_INST, FLAGS_MODRM | FLAGS_VEX_1ST_SRC, 0, nullptr}},
|
||||
|
||||
|
24
unittests/ASM/VEX/pdep.asm
Normal file
24
unittests/ASM/VEX/pdep.asm
Normal file
@ -0,0 +1,24 @@
|
||||
%ifdef CONFIG
|
||||
{
|
||||
"RegData": {
|
||||
"RAX": "0x00012567",
|
||||
"RBX": "0xFF00FFF0",
|
||||
"RCX": "0x12005670",
|
||||
"RDX": "0x0801256708012567",
|
||||
"RSI": "0xFF00FF00FF00FF00",
|
||||
"RDI": "0x0800010025006700"
|
||||
}
|
||||
}
|
||||
%endif
|
||||
|
||||
; 32-bit
|
||||
mov eax, 0x00012567
|
||||
mov ebx, 0xFF00FFF0
|
||||
pdep ecx, eax, ebx
|
||||
|
||||
; 64-bit
|
||||
mov rdx, 0x0801256708012567
|
||||
mov rsi, 0xFF00FF00FF00FF00
|
||||
pdep rdi, rdx, rsi
|
||||
|
||||
hlt
|
Loading…
x
Reference in New Issue
Block a user