mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Fix capping in vf2i
A quick and rough skim lead me to this quick and lazy fix. In short , IEEE 754 single-precision float is not precise enough for storing every int32 value, and you need double for that ;) BTW, should there be a default case for the switch ((op >> 21) & 0x1f) right following below or dsv could be uninitialized?
This commit is contained in:
parent
641a0046a6
commit
cfa029573c
1 changed files with 1 additions and 1 deletions
|
@ -622,7 +622,7 @@ namespace MIPSInt
|
|||
d[i] = 0x7FFFFFFF;
|
||||
continue;
|
||||
}
|
||||
float sv = s[i] * mult;
|
||||
double sv = s[i] * mult; // (float)0x7fffffff == (float)0x80000000
|
||||
int dsv;
|
||||
// Cap/floor it to 0x7fffffff / 0x80000000
|
||||
if (sv > 0x7fffffff) sv = 0x7fffffff;
|
||||
|
|
Loading…
Add table
Reference in a new issue