Skip to content

Commit

Permalink
interp: Correct vocp prefix handling.
Browse files Browse the repository at this point in the history
Also, guess that vsocp also applies prefixes.  See hrydgard#5549.
  • Loading branch information
unknownbrackets committed Feb 22, 2019
1 parent b1146d8 commit d7f40af
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 0 additions & 2 deletions Core/MIPS/ARM/ArmCompVFPU.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2302,8 +2302,6 @@ namespace MIPSComp
int n = GetNumVectorElements(sz);

u8 sregs[4], dregs[4];
// Actually, not sure that this instruction accepts an S prefix. We don't apply it in the
// interpreter. But whatever.
GetVectorRegsPrefixS(sregs, sz, _VS);
GetVectorRegsPrefixD(dregs, sz, _VD);

Expand Down
2 changes: 0 additions & 2 deletions Core/MIPS/ARM64/Arm64CompVFPU.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1953,8 +1953,6 @@ namespace MIPSComp {
int n = GetNumVectorElements(sz);

u8 sregs[4], dregs[4];
// Actually, not sure that this instruction accepts an S prefix. We don't apply it in the
// interpreter. But whatever.
GetVectorRegsPrefixS(sregs, sz, _VS);
GetVectorRegsPrefixD(dregs, sz, _VD);

Expand Down
5 changes: 3 additions & 2 deletions Core/MIPS/IR/IRCompVFPU.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1840,12 +1840,13 @@ namespace MIPSComp {
DISABLE;
}

// Vector one's complement
// d[N] = 1.0 - s[N]

VectorSize sz = GetVecSize(op);
int n = GetNumVectorElements(sz);

u8 sregs[4], dregs[4];
// Actually, not sure that this instruction accepts an S prefix. We don't apply it in the
// interpreter. But whatever.
GetVectorRegsPrefixS(sregs, sz, _VS);
GetVectorRegsPrefixD(dregs, sz, _VD);

Expand Down
5 changes: 4 additions & 1 deletion Core/MIPS/MIPSIntVFPU.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,7 @@ namespace MIPSInt
int vs = _VS;
VectorSize sz = GetVecSize(op);
ReadVector(s, sz, vs);
ApplySwizzleS(s, sz);
for (int i = 0; i < GetNumVectorElements(sz); i++)
{
// Always positive NaN.
Expand All @@ -567,6 +568,7 @@ namespace MIPSInt
int vs = _VS;
VectorSize sz = GetVecSize(op);
ReadVector(s, sz, vs);
ApplySwizzleS(s, sz);
int n = GetNumVectorElements(sz);
float x = s[0];
d[0] = nanclamp(1.0f - x, 0.0f, 1.0f);
Expand All @@ -577,7 +579,8 @@ namespace MIPSInt
d[2] = nanclamp(1.0f - y, 0.0f, 1.0f);
d[3] = nanclamp(y, 0.0f, 1.0f);
outSize = V_Quad;
}
}
ApplyPrefixD(d, sz);
WriteVector(d, outSize, vd);
PC += 4;
EatPrefixes();
Expand Down

0 comments on commit d7f40af

Please sign in to comment.