[FAST486]

Combine FPREM and FPREM1 into one case.


svn path=/trunk/; revision=68400
This commit is contained in:
Aleksandar Andrejevic 2015-07-14 23:29:23 +00:00
parent 33cbfd3217
commit dc52a69141

View file

@ -2418,6 +2418,8 @@ FAST486_OPCODE_HANDLER(Fast486FpuOpcodeD9)
/* FPREM1 */
case 0x35:
/* FPREM */
case 0x38:
{
LONGLONG Quotient;
@ -2430,7 +2432,12 @@ FAST486_OPCODE_HANDLER(Fast486FpuOpcodeD9)
break;
}
if (Fast486FpuRemainder(State, &FPU_ST(0), &FPU_ST(1), TRUE, &FPU_ST(0), &Quotient))
if (Fast486FpuRemainder(State,
&FPU_ST(0),
&FPU_ST(1),
ModRegRm.Register == 6, /* TRUE if it's FPREM1 */
&FPU_ST(0),
&Quotient))
{
FPU_UPDATE_TAG(0);
@ -2457,33 +2464,6 @@ FAST486_OPCODE_HANDLER(Fast486FpuOpcodeD9)
break;
}
/* FPREM */
case 0x38:
{
LONGLONG Quotient;
Fast486FpuExceptionCheck(State);
FPU_SAVE_LAST_INST();
if (FPU_GET_TAG(0) == FPU_TAG_EMPTY || FPU_GET_TAG(1) == FPU_TAG_EMPTY)
{
State->FpuStatus.Ie = TRUE;
break;
}
if (Fast486FpuRemainder(State, &FPU_ST(0), &FPU_ST(1), FALSE, &FPU_ST(0), &Quotient))
{
FPU_UPDATE_TAG(0);
/* Return the lowest 3 bits of the quotient in C1, C3, C0 */
State->FpuStatus.Code1 = Quotient & 1;
State->FpuStatus.Code3 = (Quotient >> 1) & 1;
State->FpuStatus.Code0 = (Quotient >> 2) & 1;
}
break;
}
/* FYL2XP1 */
case 0x39:
{