mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-15 02:29:51 +01:00
interp: Correct Vsgn out of swizzle bounds.
This commit is contained in:
1 parent
d708e2ebd9
commit
ad7e322c7e
2 files changed
+9
-3
No files matched your search
@@ -1841,7 +1841,7 @@ namespace MIPSComp {
|
||||
|
||||
void IRFrontend::Comp_Vsgn(MIPSOpcode op) {
|
||||
CONDITIONAL_DISABLE(VFPU_VEC);
|
||||
if (js.HasUnknownPrefix()) {
|
||||
if (js.HasUnknownPrefix() || !IsPrefixWithinSize(js.prefixS, op) || !IsPrefixWithinSize(js.prefixT, op)) {
|
||||
DISABLE;
|
||||
}
|
||||
|
||||
|
||||
@@ -659,14 +659,20 @@ namespace MIPSInt
|
||||
int vs = _VS;
|
||||
VectorSize sz = GetVecSize(op);
|
||||
ReadVector(s, sz, vs);
|
||||
ApplySwizzleS(s, sz);
|
||||
|
||||
// Not sure who would do this, but using abs/neg allows a compare against 3 or -3.
|
||||
u32 tprefixRemove = VFPU_ANY_SWIZZLE();
|
||||
u32 tprefixAdd = VFPU_CONST(1, 1, 1, 1) | VFPU_SWIZZLE(0, 0, 0, 0);
|
||||
ApplyPrefixST(t, VFPURewritePrefix(VFPU_CTRL_TPREFIX, tprefixRemove, tprefixAdd), sz);
|
||||
|
||||
for (int i = 0; i < GetNumVectorElements(sz); i++) {
|
||||
int n = GetNumVectorElements(sz);
|
||||
if (n < 4) {
|
||||
// Compare with a swizzled value out of bounds always produces 0.
|
||||
memcpy(&s[n], &t[n], sizeof(float) * (4 - n));
|
||||
}
|
||||
ApplySwizzleS(s, V_Quad);
|
||||
|
||||
for (int i = 0; i < n; i++) {
|
||||
float diff = s[i] - t[i];
|
||||
// To handle NaNs correctly, we do this with integer hackery
|
||||
u32 val;
|
||||
|
||||
Reference in new issue
Block a user