Detect +/- INF when loading a 80bit
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3614
This commit is contained in:
parent
b441536ff4
commit
d7404e0ba4
1 changed files with 6 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue