mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-23 21:39:52 +00:00
Merge pull request #705 from unknownbrackets/jit-vfpu
Small VFPU prefix fixes
This commit is contained in:
commit
61e13e4475
@ -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]);
|
||||
@ -150,7 +155,8 @@ void ApplyPrefixD(float *v, VectorSize size, bool onlyWriteMask = false)
|
||||
if (sat == 1)
|
||||
{
|
||||
if (v[i] > 1.0f) v[i] = 1.0f;
|
||||
if (v[i] < 0.0f) v[i] = 0.0f;
|
||||
// This includes -0.0f -> +0.0f.
|
||||
if (v[i] <= 0.0f) v[i] = 0.0f;
|
||||
}
|
||||
else if (sat == 3)
|
||||
{
|
||||
@ -1182,6 +1188,7 @@ namespace MIPSInt
|
||||
ReadVector(s, sz, vs);
|
||||
ApplySwizzleS(s, sz);
|
||||
float scale = V(vt);
|
||||
ApplySwizzleT(&scale, V_Single);
|
||||
int n = GetNumVectorElements(sz);
|
||||
for (int i = 0; i < n; 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));
|
||||
|
Loading…
Reference in New Issue
Block a user