diff --git a/src/fpu/fpu_instructions.h b/src/fpu/fpu_instructions.h index 9a505a2b..06b97478 100644 --- a/src/fpu/fpu_instructions.h +++ b/src/fpu/fpu_instructions.h @@ -97,7 +97,7 @@ static Real64 FPU_FLD80(PhysPt addr) { test.eind.l.lower = mem_readd(addr); test.eind.l.upper = mem_readd(addr+4); test.begin = mem_readw(addr+8); - + Bit64s exp64 = (((test.begin&0x7fff) - BIAS80)); Bit64s blah = ((exp64 >0)?exp64:-exp64)&0x3ff; Bit64s exp64final = ((exp64 >0)?blah:-blah) +BIAS64; @@ -106,6 +106,11 @@ static Real64 FPU_FLD80(PhysPt addr) { Bit64s sign = (test.begin&0x8000)?1:0; FPU_Reg result; result.ll = (sign <<63)|(exp64final << 52)| mant64; + + if(test.eind.l.lower == 0 && test.eind.l.upper == 0x80000000 && (test.begin&0x7fff) == 0x7fff) { + //Detect INF and -INF (score 3.11 when drawing a slur.) + result.d = sign?-HUGE_VAL:HUGE_VAL; + } return result.d; //mant64= test.mant80/2***64 * 2 **53