mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-23 13:30:02 +00:00
Prevent some warnings in vfpu, add reporting.
Uninitialized value and out of bounds error.
This commit is contained in:
parent
f16858ac4b
commit
e3e5b24bf8
@ -623,18 +623,17 @@ namespace MIPSInt
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
double sv = s[i] * mult; // (float)0x7fffffff == (float)0x80000000
|
double sv = s[i] * mult; // (float)0x7fffffff == (float)0x80000000
|
||||||
int dsv;
|
|
||||||
// Cap/floor it to 0x7fffffff / 0x80000000
|
// Cap/floor it to 0x7fffffff / 0x80000000
|
||||||
if (sv > 0x7fffffff) sv = 0x7fffffff;
|
if (sv > 0x7fffffff) sv = 0x7fffffff;
|
||||||
if (sv < (int)0x80000000) sv = (int)0x80000000;
|
if (sv < (int)0x80000000) sv = (int)0x80000000;
|
||||||
switch ((op >> 21) & 0x1f)
|
switch ((op >> 21) & 0x1f)
|
||||||
{
|
{
|
||||||
case 16: dsv = (int)rint(sv); break; //n
|
case 16: d[i] = (int)rint(sv); break; //n
|
||||||
case 17: dsv = s[i]>=0 ? (int)floor(sv) : (int)ceil(sv); break; //z
|
case 17: d[i] = s[i]>=0 ? (int)floor(sv) : (int)ceil(sv); break; //z
|
||||||
case 18: dsv = (int)ceil(sv); break; //u
|
case 18: d[i] = (int)ceil(sv); break; //u
|
||||||
case 19: dsv = (int)floor(sv); break; //d
|
case 19: d[i] = (int)floor(sv); break; //d
|
||||||
|
default: d[i] = 0x7FFFFFFF; break;
|
||||||
}
|
}
|
||||||
d[i] = (int) dsv;
|
|
||||||
}
|
}
|
||||||
ApplyPrefixD((float*)d, sz, true);
|
ApplyPrefixD((float*)d, sz, true);
|
||||||
WriteVector((float*)d, sz, vd);
|
WriteVector((float*)d, sz, vd);
|
||||||
@ -837,24 +836,47 @@ namespace MIPSInt
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 2: // vus2i
|
case 2: // vus2i
|
||||||
for (int i = 0; i < GetNumVectorElements(sz); i++) {
|
|
||||||
u32 value = s[i];
|
|
||||||
d[i * 2] = (value & 0xFFFF) << 15;
|
|
||||||
d[i * 2 + 1] = (value & 0xFFFF0000) >> 1;
|
|
||||||
}
|
|
||||||
oz = V_Pair;
|
oz = V_Pair;
|
||||||
if (sz == V_Pair) oz = V_Quad;
|
switch (sz)
|
||||||
|
{
|
||||||
|
case V_Pair:
|
||||||
|
oz = V_Quad;
|
||||||
|
// Intentional fallthrough.
|
||||||
|
case V_Single:
|
||||||
|
for (int i = 0; i < GetNumVectorElements(sz); i++) {
|
||||||
|
u32 value = s[i];
|
||||||
|
d[i * 2] = (value & 0xFFFF) << 15;
|
||||||
|
d[i * 2 + 1] = (value & 0xFFFF0000) >> 1;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
ERROR_LOG_REPORT(CPU, "vus2i with more than 2 elements.");
|
||||||
|
break;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 3: // vs2i
|
case 3: // vs2i
|
||||||
for (int i = 0; i < GetNumVectorElements(sz); i++) {
|
|
||||||
u32 value = s[i];
|
|
||||||
d[i * 2] = (value & 0xFFFF) << 16;
|
|
||||||
d[i * 2 + 1] = value & 0xFFFF0000;
|
|
||||||
}
|
|
||||||
oz = V_Pair;
|
oz = V_Pair;
|
||||||
if (sz == V_Pair) oz = V_Quad;
|
switch (sz)
|
||||||
|
{
|
||||||
|
case V_Pair:
|
||||||
|
oz = V_Quad;
|
||||||
|
// Intentional fallthrough.
|
||||||
|
case V_Single:
|
||||||
|
for (int i = 0; i < GetNumVectorElements(sz); i++) {
|
||||||
|
u32 value = s[i];
|
||||||
|
d[i * 2] = (value & 0xFFFF) << 16;
|
||||||
|
d[i * 2 + 1] = value & 0xFFFF0000;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
ERROR_LOG_REPORT(CPU, "vs2i with more than 2 elements.");
|
||||||
|
break;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
_dbg_assert_msg_(CPU,0,"Trying to interpret instruction that can't be interpreted");
|
_dbg_assert_msg_(CPU,0,"Trying to interpret instruction that can't be interpreted");
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user