Skip to content

Commit

Permalink
interp: Correct vscl/vmscl t prefix handling.
Browse files Browse the repository at this point in the history
This makes more sense.  Fixes Dissidia 012 issues.
  • Loading branch information
unknownbrackets committed Oct 30, 2022
1 parent 3f99751 commit bbdc8a8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Core/MIPS/IR/IRCompVFPU.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1185,8 +1185,8 @@ namespace MIPSComp {
int vt = _VT;
u8 sregs[4], dregs[4], treg;
GetVectorRegsPrefixS(sregs, sz, vs);
// TODO: Prefixes seem strange...
GetVectorRegsPrefixT(&treg, V_Single, vt);
// T prefixes handled by interp.
GetVectorRegs(&treg, V_Single, vt);
GetVectorRegsPrefixD(dregs, sz, vd);

bool overlap = false;
Expand Down
9 changes: 6 additions & 3 deletions Core/MIPS/MIPSIntVFPU.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -540,8 +540,10 @@ namespace MIPSInt
ApplySwizzleS(&s[(n - 1) * 4], V_Quad);
// T prefix applies only for the last row, and is used per element.
// This is like vscl, but instead of zzzz it uses xxxx.
int tlane = (vt >> 5) & 3;
t[tlane] = t[0];
u32 tprefixRemove = VFPU_ANY_SWIZZLE();
u32 tprefixAdd = VFPU_SWIZZLE(0, 0, 0, 0);
u32 tprefixAdd = VFPU_SWIZZLE(tlane, tlane, tlane, tlane);
ApplyPrefixST(t, VFPURewritePrefix(VFPU_CTRL_TPREFIX, tprefixRemove, tprefixAdd), V_Quad);

for (int b = 0; b < n; b++) {
Expand Down Expand Up @@ -1518,9 +1520,10 @@ namespace MIPSInt

// T prefix forces swizzle (zzzz for some reason, so we force V_Quad.)
// That means negate still works, but constants are a bit weird.
t[2] = V(vt);
int tlane = (vt >> 5) & 3;
t[tlane] = V(vt);
u32 tprefixRemove = VFPU_ANY_SWIZZLE();
u32 tprefixAdd = VFPU_SWIZZLE(2, 2, 2, 2);
u32 tprefixAdd = VFPU_SWIZZLE(tlane, tlane, tlane, tlane);
ApplyPrefixST(t, VFPURewritePrefix(VFPU_CTRL_TPREFIX, tprefixRemove, tprefixAdd), V_Quad);

int n = GetNumVectorElements(sz);
Expand Down

0 comments on commit bbdc8a8

Please sign in to comment.