mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-12-02 18:53:58 +01:00
Don't go out of bounds applying vfpu swizzle.
This commit is contained in:
1 parent
b1f31f052e
commit
be8ddf12aa
2 files changed
+11
No files matched your search
@@ -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]);
|
||||
|
||||
@@ -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));
|
||||
|
||||
Reference in new issue
Block a user