Don't go out of bounds applying vfpu swizzle.

This commit is contained in:
Unknown W. Brackets committed 2013-02-15 23:43:40 -08:00
1 parent b1f31f052e
commit be8ddf12aa
2 files changed
+11

No files matched your search

+5
View File
@@ -110,6 +110,11 @@ void ApplyPrefixST(float *v, u32 data, VectorSize size)
if (!constants)
{
// Prefix may say "z, z, z, z" but if this is a pair, we force to x.
// TODO: But some ops seem to use const 0 instead?
if (regnum >= n)
regnum = 0;
v[i] = origV[regnum];
if (abs)
v[i] = fabs(v[i]);
+6
View File
@@ -87,6 +87,7 @@ void Jit::ApplyPrefixST(u8 *vregs, u32 prefix, VectorSize sz) {
for (int i = 0; i < n; i++)
{
// TODO: This needs to be the original values, not the original regs. (e.g. [-x, |x|, x])
origV[i] = vregs[i];
}
@@ -98,6 +99,11 @@ void Jit::ApplyPrefixST(u8 *vregs, u32 prefix, VectorSize sz) {
int constants = (prefix >> (12+i)) & 1;
if (!constants) {
// Prefix may say "z, z, z, z" but if this is a pair, we force to x.
// TODO: But some ops seem to use const 0 instead?
if (regnum > n) {
regnum = 0;
}
vregs[i] = origV[regnum];
if (abs) {
ANDPS(fpr.VX(vregs[i]), M((void *)&noSignMask));