interp: Correct vscl/vmscl t prefix handling.

This makes more sense.  Fixes Dissidia 012 issues.
This commit is contained in:
Unknown W. Brackets 2022-10-29 22:43:30 -07:00
parent 3f997518f3
commit bbdc8a8f98
2 changed files with 8 additions and 5 deletions

View File

@ -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;

View File

@ -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++) {
@ -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);