Implement shader CC mode for ISCADD, X mode for ISETP and fix STL/STS/STG with RZ (#1901)

* Implement shader CC mode for ISCADD, X mode for ISETP and fix STS/STG with RZ

* Fix STG too and bump shader cache version

* Fix wrong name

* Fix Carry being inverted on comparison
This commit is contained in:
gdkchan 2021-01-12 18:52:13 -03:00 committed by GitHub
parent df820a72de
commit 36c6e67df2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 128 additions and 34 deletions

View file

@ -501,7 +501,9 @@ namespace Ryujinx.Graphics.Shader.Instructions
for (int index = 0; index < count; index++)
{
Register rd = new Register(op.Rd.Index + index, RegisterType.Gpr);
bool isRz = op.Rd.IsRZ;
Register rd = new Register(isRz ? op.Rd.Index : op.Rd.Index + index, RegisterType.Gpr);
Operand value = Register(rd);
@ -525,11 +527,6 @@ namespace Ryujinx.Graphics.Shader.Instructions
case MemoryRegion.Local: context.StoreLocal (offset, value); break;
case MemoryRegion.Shared: context.StoreShared(offset, value); break;
}
if (rd.IsRZ)
{
break;
}
}
}
@ -547,7 +544,9 @@ namespace Ryujinx.Graphics.Shader.Instructions
for (int index = 0; index < count; index++)
{
Register rd = new Register(op.Rd.Index + index, RegisterType.Gpr);
bool isRz = op.Rd.IsRZ;
Register rd = new Register(isRz ? op.Rd.Index : op.Rd.Index + index, RegisterType.Gpr);
Operand value = Register(rd);
@ -559,11 +558,6 @@ namespace Ryujinx.Graphics.Shader.Instructions
}
context.StoreGlobal(context.IAdd(addrLow, Const(index * 4)), addrHigh, value);
if (rd.IsRZ)
{
break;
}
}
}