mirror of https://github.com/PCSX2/pcsx2.git
FPU: sqrt(-0) == 0
It is marked as a special case in the doc (sqrt(-0) == -0) but test on the PS2 show the contrary. Quite a mistery
This commit is contained in:
parent
6391b00c00
commit
3ec458ef4f
|
@ -345,12 +345,13 @@ void RSQRT_S() {
|
|||
}
|
||||
|
||||
void SQRT_S() {
|
||||
if ( ( _FtValUl_ & 0xFF800000 ) == 0x80000000 ) { _FdValUl_ = 0x80000000; } // If Ft = -0
|
||||
if ( ( _FtValUl_ & 0x7F800000 ) == 0 ) // If Ft = +/-0
|
||||
_FdValUl_ = 0;// result is 0
|
||||
else if ( _FtValUl_ & 0x80000000 ) { // If Ft is Negative
|
||||
_ContVal_ |= FPUflagI | FPUflagSI;
|
||||
_FdValf_ = sqrt( fabs( fpuDouble( _FtValUl_ ) ) );
|
||||
}
|
||||
else { _FdValf_ = sqrt( fpuDouble( _FtValUl_ ) ); } // If Ft is Positive
|
||||
} else
|
||||
_FdValf_ = sqrt( fpuDouble( _FtValUl_ ) ); // If Ft is Positive
|
||||
clearFPUFlags( FPUflagD );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue