Skip to content

Commit

Permalink
binary and unary ops
Browse files Browse the repository at this point in the history
261 failures
  • Loading branch information
pmatos committed Apr 22, 2024
1 parent 4775cf4 commit 7ebba82
Show file tree
Hide file tree
Showing 6 changed files with 455 additions and 274 deletions.
272 changes: 95 additions & 177 deletions FEXCore/Source/Interface/Core/OpcodeDispatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6392,81 +6392,47 @@ void InstallOpcodeHandlers(Context::OperatingMode Mode) {
{OPD(0xDF, 0xF0), 8, &OpDispatchBuilder::FCOMIF64<80, false, OpDispatchBuilder::FCOMIFlags::FLAGS_RFLAGS, false>},
};

constexpr std::tuple<uint16_t, uint8_t, FEXCore::X86Tables::OpDispatchPtr>
X87OpTable[] = {
{OPDReg(0xD8, 0) | 0x00, 8,
&OpDispatchBuilder::FADD<32, false,
OpDispatchBuilder::OpResult::RES_ST0>},

{OPDReg(0xD8, 1) | 0x00, 8,
&OpDispatchBuilder::FMUL<32, false,
OpDispatchBuilder::OpResult::RES_ST0>},

{OPDReg(0xD8, 2) | 0x00, 8,
&OpDispatchBuilder::FCOMI<
32, false, OpDispatchBuilder::FCOMIFlags::FLAGS_X87, false>},

{OPDReg(0xD8, 3) | 0x00, 8,
&OpDispatchBuilder::FCOMI<
32, false, OpDispatchBuilder::FCOMIFlags::FLAGS_X87, false>},

{OPDReg(0xD8, 4) | 0x00, 8,
&OpDispatchBuilder::FSUB<32, false, false,
OpDispatchBuilder::OpResult::RES_ST0>},

{OPDReg(0xD8, 5) | 0x00, 8,
&OpDispatchBuilder::FSUB<32, false, true,
OpDispatchBuilder::OpResult::RES_ST0>},

{OPDReg(0xD8, 6) | 0x00, 8,
&OpDispatchBuilder::FDIV<32, false, false,
OpDispatchBuilder::OpResult::RES_ST0>},

{OPDReg(0xD8, 7) | 0x00, 8,
&OpDispatchBuilder::FDIV<32, false, true,
OpDispatchBuilder::OpResult::RES_ST0>},

{OPD(0xD8, 0xC0), 8,
&OpDispatchBuilder::FADD<80, false,
OpDispatchBuilder::OpResult::RES_ST0>},
{OPD(0xD8, 0xC8), 8,
&OpDispatchBuilder::FMUL<80, false,
OpDispatchBuilder::OpResult::RES_ST0>},
{OPD(0xD8, 0xD0), 8,
&OpDispatchBuilder::FCOMI<
80, false, OpDispatchBuilder::FCOMIFlags::FLAGS_X87, false>},
{OPD(0xD8, 0xD8), 8,
&OpDispatchBuilder::FCOMI<
80, false, OpDispatchBuilder::FCOMIFlags::FLAGS_X87, false>},
{OPD(0xD8, 0xE0), 8,
&OpDispatchBuilder::FSUB<80, false, false,
OpDispatchBuilder::OpResult::RES_ST0>},
{OPD(0xD8, 0xE8), 8,
&OpDispatchBuilder::FSUB<80, false, true,
OpDispatchBuilder::OpResult::RES_ST0>},
{OPD(0xD8, 0xF0), 8,
&OpDispatchBuilder::FDIV<80, false, false,
OpDispatchBuilder::OpResult::RES_ST0>},
{OPD(0xD8, 0xF8), 8,
&OpDispatchBuilder::FDIV<80, false, true,
OpDispatchBuilder::OpResult::RES_ST0>},

{OPDReg(0xD9, 0) | 0x00, 8, &OpDispatchBuilder::FLD<32>},

// 1 = Invalid

{OPDReg(0xD9, 2) | 0x00, 8, &OpDispatchBuilder::FST<32>},

{OPDReg(0xD9, 3) | 0x00, 8, &OpDispatchBuilder::FST<32>},

{OPDReg(0xD9, 4) | 0x00, 8, &OpDispatchBuilder::X87LDENV},

{OPDReg(0xD9, 5) | 0x00, 8,
&OpDispatchBuilder::X87FLDCW}, // XXX: stubbed FLDCW

{OPDReg(0xD9, 6) | 0x00, 8, &OpDispatchBuilder::X87FNSTENV},

{OPDReg(0xD9, 7) | 0x00, 8, &OpDispatchBuilder::X87FSTCW},
constexpr std::tuple<uint16_t, uint8_t, FEXCore::X86Tables::OpDispatchPtr> X87OpTable[] = {
{OPDReg(0xD8, 0) | 0x00, 8, &OpDispatchBuilder::FADD<32, false, OpDispatchBuilder::OpResult::RES_ST0>},

{OPDReg(0xD8, 1) | 0x00, 8, &OpDispatchBuilder::FMUL<32, false, OpDispatchBuilder::OpResult::RES_ST0>},

{OPDReg(0xD8, 2) | 0x00, 8, &OpDispatchBuilder::FCOMI< 32, false, OpDispatchBuilder::FCOMIFlags::FLAGS_X87, false>},

{OPDReg(0xD8, 3) | 0x00, 8, &OpDispatchBuilder::FCOMI< 32, false, OpDispatchBuilder::FCOMIFlags::FLAGS_X87, false>},

{OPDReg(0xD8, 4) | 0x00, 8, &OpDispatchBuilder::FSUB<32, false, false, OpDispatchBuilder::OpResult::RES_ST0>},

{OPDReg(0xD8, 5) | 0x00, 8, &OpDispatchBuilder::FSUB<32, false, true, OpDispatchBuilder::OpResult::RES_ST0>},

{OPDReg(0xD8, 6) | 0x00, 8, &OpDispatchBuilder::FDIV<32, false, false, OpDispatchBuilder::OpResult::RES_ST0>},

{OPDReg(0xD8, 7) | 0x00, 8, &OpDispatchBuilder::FDIV<32, false, true, OpDispatchBuilder::OpResult::RES_ST0>},

{OPD(0xD8, 0xC0), 8, &OpDispatchBuilder::FADD<80, false, OpDispatchBuilder::OpResult::RES_ST0>},
{OPD(0xD8, 0xC8), 8, &OpDispatchBuilder::FMUL<80, false, OpDispatchBuilder::OpResult::RES_ST0>},
{OPD(0xD8, 0xD0), 8, &OpDispatchBuilder::FCOMI< 80, false, OpDispatchBuilder::FCOMIFlags::FLAGS_X87, false>},
{OPD(0xD8, 0xD8), 8, &OpDispatchBuilder::FCOMI< 80, false, OpDispatchBuilder::FCOMIFlags::FLAGS_X87, false>},
{OPD(0xD8, 0xE0), 8, &OpDispatchBuilder::FSUB<80, false, false, OpDispatchBuilder::OpResult::RES_ST0>},
{OPD(0xD8, 0xE8), 8, &OpDispatchBuilder::FSUB<80, false, true, OpDispatchBuilder::OpResult::RES_ST0>},
{OPD(0xD8, 0xF0), 8, &OpDispatchBuilder::FDIV<80, false, false, OpDispatchBuilder::OpResult::RES_ST0>},
{OPD(0xD8, 0xF8), 8, &OpDispatchBuilder::FDIV<80, false, true, OpDispatchBuilder::OpResult::RES_ST0>},

{OPDReg(0xD9, 0) | 0x00, 8, &OpDispatchBuilder::FLD<32>},

// 1 = Invalid

{OPDReg(0xD9, 2) | 0x00, 8, &OpDispatchBuilder::FST<32>},

{OPDReg(0xD9, 3) | 0x00, 8, &OpDispatchBuilder::FST<32>},

{OPDReg(0xD9, 4) | 0x00, 8, &OpDispatchBuilder::X87LDENV},

{OPDReg(0xD9, 5) | 0x00, 8, &OpDispatchBuilder::X87FLDCW}, // XXX: stubbed FLDCW

{OPDReg(0xD9, 6) | 0x00, 8, &OpDispatchBuilder::X87FNSTENV},

{OPDReg(0xD9, 7) | 0x00, 8, &OpDispatchBuilder::X87FSTCW},

{OPD(0xD9, 0xC0), 8, &OpDispatchBuilder::FLD<80>},
{OPD(0xD9, 0xC8), 8, &OpDispatchBuilder::FXCH},
Expand All @@ -6488,54 +6454,38 @@ void InstallOpcodeHandlers(Context::OperatingMode Mode) {
{OPD(0xD9, 0xEE), 1, &OpDispatchBuilder::FLD_Const<NamedVectorConstant::NAMED_VECTOR_ZERO>}, // 0.0

// EF = Invalid
{OPD(0xD9, 0xF0), 1, &OpDispatchBuilder::X87UnaryOp<IR::OP_F80F2XM1>},
{OPD(0xD9, 0xF0), 1, &OpDispatchBuilder::F80F2XM1},
{OPD(0xD9, 0xF1), 1, &OpDispatchBuilder::X87FYL2X},
{OPD(0xD9, 0xF2), 1, &OpDispatchBuilder::X87TAN},
{OPD(0xD9, 0xF3), 1, &OpDispatchBuilder::X87ATAN},
{OPD(0xD9, 0xF4), 1, &OpDispatchBuilder::FXTRACT},
{OPD(0xD9, 0xF5), 1, &OpDispatchBuilder::X87BinaryOp<IR::OP_F80FPREM1>},
{OPD(0xD9, 0xF5), 1, &OpDispatchBuilder::F80FPREM1},
{OPD(0xD9, 0xF6), 1, &OpDispatchBuilder::X87ModifySTP<false>},
{OPD(0xD9, 0xF7), 1, &OpDispatchBuilder::X87ModifySTP<true>},
{OPD(0xD9, 0xF8), 1, &OpDispatchBuilder::X87BinaryOp<IR::OP_F80FPREM>},
{OPD(0xD9, 0xF8), 1, &OpDispatchBuilder::F80FPREM},
{OPD(0xD9, 0xF9), 1, &OpDispatchBuilder::X87FYL2X},
{OPD(0xD9, 0xFA), 1, &OpDispatchBuilder::X87UnaryOp<IR::OP_F80SQRT>},
{OPD(0xD9, 0xFA), 1, &OpDispatchBuilder::F80SQRT},
{OPD(0xD9, 0xFB), 1, &OpDispatchBuilder::X87SinCos},
{OPD(0xD9, 0xFC), 1, &OpDispatchBuilder::FRNDINT},
{OPD(0xD9, 0xFD), 1, &OpDispatchBuilder::X87BinaryOp<IR::OP_F80SCALE>},
{OPD(0xD9, 0xFE), 1, &OpDispatchBuilder::X87UnaryOp<IR::OP_F80SIN>},
{OPD(0xD9, 0xFF), 1, &OpDispatchBuilder::X87UnaryOp<IR::OP_F80COS>},
{OPD(0xD9, 0xFD), 1, &OpDispatchBuilder::F80SCALE},
{OPD(0xD9, 0xFE), 1, &OpDispatchBuilder::F80SIN},
{OPD(0xD9, 0xFF), 1, &OpDispatchBuilder::F80COS},

{OPDReg(0xDA, 0) | 0x00, 8,
&OpDispatchBuilder::FADD<32, true,
OpDispatchBuilder::OpResult::RES_ST0>},
{OPDReg(0xDA, 0) | 0x00, 8, &OpDispatchBuilder::FADD<32, true, OpDispatchBuilder::OpResult::RES_ST0>},

{OPDReg(0xDA, 1) | 0x00, 8,
&OpDispatchBuilder::FMUL<32, true,
OpDispatchBuilder::OpResult::RES_ST0>},
{OPDReg(0xDA, 1) | 0x00, 8, &OpDispatchBuilder::FMUL<32, true, OpDispatchBuilder::OpResult::RES_ST0>},

{OPDReg(0xDA, 2) | 0x00, 8,
&OpDispatchBuilder::FCOMI<
32, true, OpDispatchBuilder::FCOMIFlags::FLAGS_X87, false>},
{OPDReg(0xDA, 2) | 0x00, 8, &OpDispatchBuilder::FCOMI< 32, true, OpDispatchBuilder::FCOMIFlags::FLAGS_X87, false>},

{OPDReg(0xDA, 3) | 0x00, 8,
&OpDispatchBuilder::FCOMI<
32, true, OpDispatchBuilder::FCOMIFlags::FLAGS_X87, false>},
{OPDReg(0xDA, 3) | 0x00, 8, &OpDispatchBuilder::FCOMI< 32, true, OpDispatchBuilder::FCOMIFlags::FLAGS_X87, false>},

{OPDReg(0xDA, 4) | 0x00, 8,
&OpDispatchBuilder::FSUB<32, true, false,
OpDispatchBuilder::OpResult::RES_ST0>},
{OPDReg(0xDA, 4) | 0x00, 8, &OpDispatchBuilder::FSUB<32, true, false, OpDispatchBuilder::OpResult::RES_ST0>},

{OPDReg(0xDA, 5) | 0x00, 8,
&OpDispatchBuilder::FSUB<32, true, true,
OpDispatchBuilder::OpResult::RES_ST0>},
{OPDReg(0xDA, 5) | 0x00, 8, &OpDispatchBuilder::FSUB<32, true, true, OpDispatchBuilder::OpResult::RES_ST0>},

{OPDReg(0xDA, 6) | 0x00, 8,
&OpDispatchBuilder::FDIV<32, true, false,
OpDispatchBuilder::OpResult::RES_ST0>},
{OPDReg(0xDA, 6) | 0x00, 8, &OpDispatchBuilder::FDIV<32, true, false, OpDispatchBuilder::OpResult::RES_ST0>},

{OPDReg(0xDA, 7) | 0x00, 8,
&OpDispatchBuilder::FDIV<32, true, true,
OpDispatchBuilder::OpResult::RES_ST0>},
{OPDReg(0xDA, 7) | 0x00, 8, &OpDispatchBuilder::FDIV<32, true, true, OpDispatchBuilder::OpResult::RES_ST0>},

{OPD(0xDA, 0xC0), 8, &OpDispatchBuilder::X87FCMOV},
{OPD(0xDA, 0xC8), 8, &OpDispatchBuilder::X87FCMOV},
Expand All @@ -6548,19 +6498,19 @@ void InstallOpcodeHandlers(Context::OperatingMode Mode) {
// F0 = Invalid
// F8 = Invalid

{OPDReg(0xDB, 0) | 0x00, 8, &OpDispatchBuilder::FILD},
{OPDReg(0xDB, 0) | 0x00, 8, &OpDispatchBuilder::FILD},

{OPDReg(0xDB, 1) | 0x00, 8, &OpDispatchBuilder::FIST<true>},
{OPDReg(0xDB, 1) | 0x00, 8, &OpDispatchBuilder::FIST<true>},

{OPDReg(0xDB, 2) | 0x00, 8, &OpDispatchBuilder::FIST<false>},
{OPDReg(0xDB, 2) | 0x00, 8, &OpDispatchBuilder::FIST<false>},

{OPDReg(0xDB, 3) | 0x00, 8, &OpDispatchBuilder::FIST<false>},
{OPDReg(0xDB, 3) | 0x00, 8, &OpDispatchBuilder::FIST<false>},

// 4 = Invalid
// 4 = Invalid

{OPDReg(0xDB, 5) | 0x00, 8, &OpDispatchBuilder::FLD<80>},
{OPDReg(0xDB, 5) | 0x00, 8, &OpDispatchBuilder::FLD<80>},

// 6 = Invalid
// 6 = Invalid

{OPDReg(0xDB, 7) | 0x00, 8, &OpDispatchBuilder::FST<80>},

Expand All @@ -6578,37 +6528,21 @@ void InstallOpcodeHandlers(Context::OperatingMode Mode) {

// F8 = Invalid

{OPDReg(0xDC, 0) | 0x00, 8,
&OpDispatchBuilder::FADD<64, false,
OpDispatchBuilder::OpResult::RES_ST0>},
{OPDReg(0xDC, 0) | 0x00, 8, &OpDispatchBuilder::FADD<64, false, OpDispatchBuilder::OpResult::RES_ST0>},

{OPDReg(0xDC, 1) | 0x00, 8,
&OpDispatchBuilder::FMUL<64, false,
OpDispatchBuilder::OpResult::RES_ST0>},
{OPDReg(0xDC, 1) | 0x00, 8, &OpDispatchBuilder::FMUL<64, false, OpDispatchBuilder::OpResult::RES_ST0>},

{OPDReg(0xDC, 2) | 0x00, 8,
&OpDispatchBuilder::FCOMI<
64, false, OpDispatchBuilder::FCOMIFlags::FLAGS_X87, false>},
{OPDReg(0xDC, 2) | 0x00, 8, &OpDispatchBuilder::FCOMI< 64, false, OpDispatchBuilder::FCOMIFlags::FLAGS_X87, false>},

{OPDReg(0xDC, 3) | 0x00, 8,
&OpDispatchBuilder::FCOMI<
64, false, OpDispatchBuilder::FCOMIFlags::FLAGS_X87, false>},
{OPDReg(0xDC, 3) | 0x00, 8, &OpDispatchBuilder::FCOMI< 64, false, OpDispatchBuilder::FCOMIFlags::FLAGS_X87, false>},

{OPDReg(0xDC, 4) | 0x00, 8,
&OpDispatchBuilder::FSUB<64, false, false,
OpDispatchBuilder::OpResult::RES_ST0>},
{OPDReg(0xDC, 4) | 0x00, 8, &OpDispatchBuilder::FSUB<64, false, false, OpDispatchBuilder::OpResult::RES_ST0>},

{OPDReg(0xDC, 5) | 0x00, 8,
&OpDispatchBuilder::FSUB<64, false, true,
OpDispatchBuilder::OpResult::RES_ST0>},
{OPDReg(0xDC, 5) | 0x00, 8, &OpDispatchBuilder::FSUB<64, false, true, OpDispatchBuilder::OpResult::RES_ST0>},

{OPDReg(0xDC, 6) | 0x00, 8,
&OpDispatchBuilder::FDIV<64, false, false,
OpDispatchBuilder::OpResult::RES_ST0>},
{OPDReg(0xDC, 6) | 0x00, 8, &OpDispatchBuilder::FDIV<64, false, false, OpDispatchBuilder::OpResult::RES_ST0>},

{OPDReg(0xDC, 7) | 0x00, 8,
&OpDispatchBuilder::FDIV<64, false, true,
OpDispatchBuilder::OpResult::RES_ST0>},
{OPDReg(0xDC, 7) | 0x00, 8, &OpDispatchBuilder::FDIV<64, false, true, OpDispatchBuilder::OpResult::RES_ST0>},

{OPD(0xDC, 0xC0), 8, &OpDispatchBuilder::FADD<80, false, OpDispatchBuilder::OpResult::RES_STI>},
{OPD(0xDC, 0xC8), 8, &OpDispatchBuilder::FMUL<80, false, OpDispatchBuilder::OpResult::RES_STI>},
Expand All @@ -6617,20 +6551,20 @@ void InstallOpcodeHandlers(Context::OperatingMode Mode) {
{OPD(0xDC, 0xF0), 8, &OpDispatchBuilder::FDIV<80, false, false, OpDispatchBuilder::OpResult::RES_STI>},
{OPD(0xDC, 0xF8), 8, &OpDispatchBuilder::FDIV<80, false, true, OpDispatchBuilder::OpResult::RES_STI>},

{OPDReg(0xDD, 0) | 0x00, 8, &OpDispatchBuilder::FLD<64>},
{OPDReg(0xDD, 0) | 0x00, 8, &OpDispatchBuilder::FLD<64>},

{OPDReg(0xDD, 1) | 0x00, 8, &OpDispatchBuilder::FIST<true>},
{OPDReg(0xDD, 1) | 0x00, 8, &OpDispatchBuilder::FIST<true>},

{OPDReg(0xDD, 2) | 0x00, 8, &OpDispatchBuilder::FST<64>},
{OPDReg(0xDD, 2) | 0x00, 8, &OpDispatchBuilder::FST<64>},

{OPDReg(0xDD, 3) | 0x00, 8, &OpDispatchBuilder::FST<64>},
{OPDReg(0xDD, 3) | 0x00, 8, &OpDispatchBuilder::FST<64>},

{OPDReg(0xDD, 4) | 0x00, 8, &OpDispatchBuilder::X87FRSTOR},
{OPDReg(0xDD, 4) | 0x00, 8, &OpDispatchBuilder::X87FRSTOR},

// 5 = Invalid
{OPDReg(0xDD, 6) | 0x00, 8, &OpDispatchBuilder::X87FNSAVE},
// 5 = Invalid
{OPDReg(0xDD, 6) | 0x00, 8, &OpDispatchBuilder::X87FNSAVE},

{OPDReg(0xDD, 7) | 0x00, 8, &OpDispatchBuilder::X87FNSTSW},
{OPDReg(0xDD, 7) | 0x00, 8, &OpDispatchBuilder::X87FNSTSW},

{OPD(0xDD, 0xC0), 8, &OpDispatchBuilder::X87FFREE},
{OPD(0xDD, 0xD0), 8, &OpDispatchBuilder::FST},
Expand All @@ -6639,37 +6573,21 @@ void InstallOpcodeHandlers(Context::OperatingMode Mode) {
{OPD(0xDD, 0xE0), 8, &OpDispatchBuilder::FCOMI<80, false, OpDispatchBuilder::FCOMIFlags::FLAGS_X87, false>},
{OPD(0xDD, 0xE8), 8, &OpDispatchBuilder::FCOMI<80, false, OpDispatchBuilder::FCOMIFlags::FLAGS_X87, false>},

{OPDReg(0xDE, 0) | 0x00, 8,
&OpDispatchBuilder::FADD<16, true,
OpDispatchBuilder::OpResult::RES_ST0>},
{OPDReg(0xDE, 0) | 0x00, 8, &OpDispatchBuilder::FADD<16, true, OpDispatchBuilder::OpResult::RES_ST0>},

{OPDReg(0xDE, 1) | 0x00, 8,
&OpDispatchBuilder::FMUL<16, true,
OpDispatchBuilder::OpResult::RES_ST0>},
{OPDReg(0xDE, 1) | 0x00, 8, &OpDispatchBuilder::FMUL<16, true, OpDispatchBuilder::OpResult::RES_ST0>},

{OPDReg(0xDE, 2) | 0x00, 8,
&OpDispatchBuilder::FCOMI<
16, true, OpDispatchBuilder::FCOMIFlags::FLAGS_X87, false>},
{OPDReg(0xDE, 2) | 0x00, 8, &OpDispatchBuilder::FCOMI< 16, true, OpDispatchBuilder::FCOMIFlags::FLAGS_X87, false>},

{OPDReg(0xDE, 3) | 0x00, 8,
&OpDispatchBuilder::FCOMI<
16, true, OpDispatchBuilder::FCOMIFlags::FLAGS_X87, false>},
{OPDReg(0xDE, 3) | 0x00, 8, &OpDispatchBuilder::FCOMI< 16, true, OpDispatchBuilder::FCOMIFlags::FLAGS_X87, false>},

{OPDReg(0xDE, 4) | 0x00, 8,
&OpDispatchBuilder::FSUB<16, true, false,
OpDispatchBuilder::OpResult::RES_ST0>},
{OPDReg(0xDE, 4) | 0x00, 8, &OpDispatchBuilder::FSUB<16, true, false, OpDispatchBuilder::OpResult::RES_ST0>},

{OPDReg(0xDE, 5) | 0x00, 8,
&OpDispatchBuilder::FSUB<16, true, true,
OpDispatchBuilder::OpResult::RES_ST0>},
{OPDReg(0xDE, 5) | 0x00, 8, &OpDispatchBuilder::FSUB<16, true, true, OpDispatchBuilder::OpResult::RES_ST0>},

{OPDReg(0xDE, 6) | 0x00, 8,
&OpDispatchBuilder::FDIV<16, true, false,
OpDispatchBuilder::OpResult::RES_ST0>},
{OPDReg(0xDE, 6) | 0x00, 8, &OpDispatchBuilder::FDIV<16, true, false, OpDispatchBuilder::OpResult::RES_ST0>},

{OPDReg(0xDE, 7) | 0x00, 8,
&OpDispatchBuilder::FDIV<16, true, true,
OpDispatchBuilder::OpResult::RES_ST0>},
{OPDReg(0xDE, 7) | 0x00, 8, &OpDispatchBuilder::FDIV<16, true, true, OpDispatchBuilder::OpResult::RES_ST0>},

{OPD(0xDE, 0xC0), 8, &OpDispatchBuilder::FADD<80, false, OpDispatchBuilder::OpResult::RES_STI>},
{OPD(0xDE, 0xC8), 8, &OpDispatchBuilder::FMUL<80, false, OpDispatchBuilder::OpResult::RES_STI>},
Expand All @@ -6679,21 +6597,21 @@ void InstallOpcodeHandlers(Context::OperatingMode Mode) {
{OPD(0xDE, 0xF0), 8, &OpDispatchBuilder::FDIV<80, false, false, OpDispatchBuilder::OpResult::RES_STI>},
{OPD(0xDE, 0xF8), 8, &OpDispatchBuilder::FDIV<80, false, true, OpDispatchBuilder::OpResult::RES_STI>},

{OPDReg(0xDF, 0) | 0x00, 8, &OpDispatchBuilder::FILD},
{OPDReg(0xDF, 0) | 0x00, 8, &OpDispatchBuilder::FILD},

{OPDReg(0xDF, 1) | 0x00, 8, &OpDispatchBuilder::FIST<true>},
{OPDReg(0xDF, 1) | 0x00, 8, &OpDispatchBuilder::FIST<true>},

{OPDReg(0xDF, 2) | 0x00, 8, &OpDispatchBuilder::FIST<false>},
{OPDReg(0xDF, 2) | 0x00, 8, &OpDispatchBuilder::FIST<false>},

{OPDReg(0xDF, 3) | 0x00, 8, &OpDispatchBuilder::FIST<false>},
{OPDReg(0xDF, 3) | 0x00, 8, &OpDispatchBuilder::FIST<false>},

{OPDReg(0xDF, 4) | 0x00, 8, &OpDispatchBuilder::FBLD},
{OPDReg(0xDF, 4) | 0x00, 8, &OpDispatchBuilder::FBLD},

{OPDReg(0xDF, 5) | 0x00, 8, &OpDispatchBuilder::FILD},
{OPDReg(0xDF, 5) | 0x00, 8, &OpDispatchBuilder::FILD},

{OPDReg(0xDF, 6) | 0x00, 8, &OpDispatchBuilder::FBSTP},
{OPDReg(0xDF, 6) | 0x00, 8, &OpDispatchBuilder::FBSTP},

{OPDReg(0xDF, 7) | 0x00, 8, &OpDispatchBuilder::FIST<false>},
{OPDReg(0xDF, 7) | 0x00, 8, &OpDispatchBuilder::FIST<false>},

// XXX: This should also set the x87 tag bits to empty
// We don't support this currently, so just pop the stack
Expand Down
11 changes: 7 additions & 4 deletions FEXCore/Source/Interface/Core/OpcodeDispatcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -759,11 +759,14 @@ class OpDispatchBuilder final : public IREmitter {
void FRNDINT(OpcodeArgs);
void FXTRACT(OpcodeArgs);
void FNINIT(OpcodeArgs);
void F80FPREM(OpcodeArgs);
void F80FPREM1(OpcodeArgs);
void F80SCALE(OpcodeArgs);
void F80SIN(OpcodeArgs);
void F80COS(OpcodeArgs);
void F80SQRT(OpcodeArgs);
void F80F2XM1(OpcodeArgs);

template<FEXCore::IR::IROps IROp>
void X87UnaryOp(OpcodeArgs);
template<FEXCore::IR::IROps IROp>
void X87BinaryOp(OpcodeArgs);
template<bool Inc>
void X87ModifySTP(OpcodeArgs);
void X87SinCos(OpcodeArgs);
Expand Down
Loading

0 comments on commit 7ebba82

Please sign in to comment.