Skip to content

Commit

Permalink
irjit: Correct VV2Op SIMD check.
Browse files Browse the repository at this point in the history
It's unlikely, but possible, uninitialized data could cause
IsConsecutive4() to return true when n < 4.
  • Loading branch information
unknownbrackets committed Nov 19, 2022
1 parent 2e6a19f commit 2419e56
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Core/MIPS/IR/IRCompVFPU.cpp
Expand Up @@ -788,7 +788,7 @@ namespace MIPSComp {
VectorSize sz = GetVecSize(op);
int n = GetNumVectorElements(sz);

u8 sregs[4], dregs[4];
u8 sregs[4]{}, dregs[4]{};
GetVectorRegsPrefixS(sregs, sz, vs);
GetVectorRegsPrefixD(dregs, sz, vd);

Expand All @@ -809,7 +809,8 @@ namespace MIPSComp {
case 0: // vmov
case 1: // vabs
case 2: // vneg
canSIMD = true;
// Our Vec4 ops require aligned regs and sets of 4.
canSIMD = n == 4 && (sregs[0] & 3) == 0 && (dregs[0] & 3) == 0;
break;
}

Expand Down

0 comments on commit 2419e56

Please sign in to comment.