From dc52a69141ff92603f29c7e0782eb3ac1a73bb46 Mon Sep 17 00:00:00 2001 From: Aleksandar Andrejevic Date: Tue, 14 Jul 2015 23:29:23 +0000 Subject: [PATCH] [FAST486] Combine FPREM and FPREM1 into one case. svn path=/trunk/; revision=68400 --- reactos/lib/fast486/fpu.c | 36 ++++++++---------------------------- 1 file changed, 8 insertions(+), 28 deletions(-) diff --git a/reactos/lib/fast486/fpu.c b/reactos/lib/fast486/fpu.c index fd81b3a276a..8e78e7a6a1b 100644 --- a/reactos/lib/fast486/fpu.c +++ b/reactos/lib/fast486/fpu.c @@ -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: {