From 7e11075f0891b5a87d4b461f57c1f09e9ecc3cec Mon Sep 17 00:00:00 2001 From: Peter Veenstra Date: Sat, 26 Jul 2003 12:02:26 +0000 Subject: [PATCH] added F2XM1,FYL2X,FSCALE changed flags in FCOM Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@1163 --- src/fpu/fpu_instructions.h | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/fpu/fpu_instructions.h b/src/fpu/fpu_instructions.h index 438d2f0d..06b3ded4 100644 --- a/src/fpu/fpu_instructions.h +++ b/src/fpu/fpu_instructions.h @@ -156,16 +156,16 @@ static void FPU_FST(Bitu st, Bitu other){ static void FPU_FCOM(Bitu st, Bitu other){ if((fpu.tags[st] != TAG_Valid) || (fpu.tags[other] != TAG_Valid)){ - FPU_SET_C3(1);FPU_SET_C1(1);FPU_SET_C0(1);return; + FPU_SET_C3(1);FPU_SET_C2(1);FPU_SET_C1(1);FPU_SET_C0(1);return; } if(fpu.regs[st].d == fpu.regs[other].d){ - FPU_SET_C3(1);FPU_SET_C1(0);FPU_SET_C0(0);return; + FPU_SET_C3(1);FPU_SET_C2(0);FPU_SET_C1(0);FPU_SET_C0(0);return; } if(fpu.regs[st].d < fpu.regs[other].d){ - FPU_SET_C3(0);FPU_SET_C1(0);FPU_SET_C0(1);return; + FPU_SET_C3(0);FPU_SET_C2(0);FPU_SET_C1(0);FPU_SET_C0(1);return; } // st > other - FPU_SET_C3(0);FPU_SET_C1(0);FPU_SET_C0(0);return; + FPU_SET_C3(0);FPU_SET_C2(0);FPU_SET_C1(0);FPU_SET_C0(0);return; } static void FPU_FUCOM(Bitu st, Bitu other){ @@ -297,4 +297,18 @@ static void FPU_ST80(PhysPt addr) mem_writew(addr+8,test.begin); } +static void FPU_F2XM1(void){ + fpu.regs[TOP].d=pow(2.0,fpu.regs[TOP].d) -1; + return; +} + +static void FPU_FYL2X(void){ + fpu.regs[ST(1)].d*=log(fpu.regs[TOP].d)/log(2); + FPU_FPOP(); + return; +} +static void FPU_FSCALE(void){ + fpu.regs[TOP].d *=pow(2.0,static_cast(static_cast(FROUND(fpu.regs[ST(1)].d)))); + return; //2^x where x is chopped. +}