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

Method decode

source/emulation/cpu/decoder.cpp:4528–4604  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4526class DecodeFPU1 : public DecodeFunc {
4527public:
4528 void decode(DecodeData* data, DecodedOp* op) const override {
4529 U8 rm = data->fetch8();
4530
4531 if (rm >= 0xc0) {
4532 switch ((rm >> 3) & 7) {
4533 case 0: op->reg = E(rm); op->inst = FLD_STi; break;
4534 case 1: op->reg = E(rm); op->inst = FXCH_STi; break;
4535 case 2: op->inst = FNOP; break;
4536 case 3: op->reg = E(rm); op->inst = FST_STi_Pop; break;
4537 case 4:
4538 {
4539 switch (rm & 7) {
4540 case 0: op->inst = FCHS; break;
4541 case 1: op->inst = FABS; break;
4542 case 4: op->inst = FTST; break;
4543 case 5: op->inst = FXAM; break;
4544 default: op->inst = Invalid; op->reg = rm; op->imm = data->inst; break;
4545 }
4546 break;
4547 }
4548 case 5:
4549 {
4550 switch (rm & 7) {
4551 case 0: op->inst = FLD1; break;
4552 case 1: op->inst = FLDL2T; break;
4553 case 2: op->inst = FLDL2E; break;
4554 case 3: op->inst = FLDPI; break;
4555 case 4: op->inst = FLDLG2; break;
4556 case 5: op->inst = FLDLN2; break;
4557 case 6: op->inst = FLDZ; break;
4558 case 7: op->inst = Invalid; op->reg = rm; op->imm = data->inst; break;
4559 }
4560 break;
4561 }
4562 case 6:
4563 {
4564 switch (rm & 7) {
4565 case 0: op->inst = F2XM1; break;
4566 case 1: op->inst = FYL2X; break;
4567 case 2: op->inst = FPTAN; break;
4568 case 3: op->inst = FPATAN; break;
4569 case 4: op->inst = FXTRACT; break;
4570 case 5: op->inst = FPREM_nearest; break;
4571 case 6: op->inst = FDECSTP; break;
4572 case 7: op->inst = FINCSTP; break;
4573 }
4574 break;
4575 }
4576 case 7:
4577 {
4578 switch (rm & 7) {
4579 case 0: op->inst = FPREM; break;
4580 case 1: op->inst = FYL2XP1; break;
4581 case 2: op->inst = FSQRT; break;
4582 case 3: op->inst = FSINCOS; break;
4583 case 4: op->inst = FRNDINT; break;
4584 case 5: op->inst = FSCALE; break;
4585 case 6: op->inst = FSIN; break;

Callers

nothing calls this directly

Calls 2

decodeEaFunction · 0.85
fetch8Method · 0.80

Tested by

no test coverage detected