MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / decode

Method decode

source/emulation/cpu/decoder.cpp:4609–4642  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4607class DecodeFPU2 : public DecodeFunc {
4608public:
4609 void decode(DecodeData* data, DecodedOp* op) const override {
4610 U8 rm = data->fetch8();
4611
4612 if (rm >= 0xc0) {
4613 op->reg = E(rm);
4614 switch ((rm >> 3) & 7) {
4615 case 0: op->inst = FCMOV_ST0_STj_CF; break;
4616 case 1: op->inst = FCMOV_ST0_STj_ZF; break;
4617 case 2: op->inst = FCMOV_ST0_STj_CF_OR_ZF; break;
4618 case 3: op->inst = FCMOV_ST0_STj_PF; break;
4619 case 5:
4620 if ((rm & 7)==1) {
4621 op->inst = FUCOMPP;
4622 break;
4623 }
4624 // intentional fall through
4625 [[fallthrough]];
4626 default:
4627 op->inst = Invalid; op->reg = rm; op->imm = data->inst; break;
4628 }
4629 } else {
4630 decodeEa(data, op, rm);
4631 switch ((rm >> 3) & 7) {
4632 case 0: op->inst = FIADD_DWORD_INTEGER; break;
4633 case 1: op->inst = FIMUL_DWORD_INTEGER; break;
4634 case 2: op->inst = FICOM_DWORD_INTEGER; break;
4635 case 3: op->inst = FICOM_DWORD_INTEGER_Pop; break;
4636 case 4: op->inst = FISUB_DWORD_INTEGER; break;
4637 case 5: op->inst = FISUBR_DWORD_INTEGER; break;
4638 case 6: op->inst = FIDIV_DWORD_INTEGER; break;
4639 case 7: op->inst = FIDIVR_DWORD_INTEGER; break;
4640 }
4641 }
4642 }
4643};
4644
4645class DecodeFPU3 : public DecodeFunc {

Callers

nothing calls this directly

Calls 2

decodeEaFunction · 0.85
fetch8Method · 0.80

Tested by

no test coverage detected