diff options
author | makigumo <makigumo@users.noreply.github.com> | 2023-05-22 22:32:15 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-22 17:32:15 -0300 |
commit | 6cb6b15612a20717c0e98045914b535f582cdc33 (patch) | |
tree | fd6e03f2db0e09d8297b69ffb25cdae1857ae3cd /src/Ryujinx.Graphics.Shader/Instructions/InstEmitMove.cs | |
parent | 2725e40838070f34e2d10938f3a4223ee0629186 (diff) |
Implement p2rc, p2ri, p2rr and r2p.cc shaders (#5031)1.1.818
* implement P2rC, P2rI, P2rR shaders
* implement R2p.CC shader
* bump CodeGenVersion
* address feedback
Diffstat (limited to 'src/Ryujinx.Graphics.Shader/Instructions/InstEmitMove.cs')
-rw-r--r-- | src/Ryujinx.Graphics.Shader/Instructions/InstEmitMove.cs | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/src/Ryujinx.Graphics.Shader/Instructions/InstEmitMove.cs b/src/Ryujinx.Graphics.Shader/Instructions/InstEmitMove.cs index 9992ac37..e12177f7 100644 --- a/src/Ryujinx.Graphics.Shader/Instructions/InstEmitMove.cs +++ b/src/Ryujinx.Graphics.Shader/Instructions/InstEmitMove.cs @@ -209,21 +209,15 @@ namespace Ryujinx.Graphics.Shader.Instructions return context.ICompareNotEqual(context.BitwiseAnd(value, Const(1 << bit)), Const(0)); } - if (ccpr) + int count = ccpr ? RegisterConsts.FlagsCount : RegisterConsts.PredsCount; + RegisterType type = ccpr ? RegisterType.Flag : RegisterType.Predicate; + int shift = (int)byteSel * 8; + + for (int bit = 0; bit < count; bit++) { - // TODO: Support Register to condition code flags copy. - context.Config.GpuAccessor.Log("R2P.CC not implemented."); - } - else - { - int shift = (int)byteSel * 8; - - for (int bit = 0; bit < RegisterConsts.PredsCount; bit++) - { - Operand pred = Register(bit, RegisterType.Predicate); - Operand res = context.ConditionalSelect(Test(mask, bit), Test(value, bit + shift), pred); - context.Copy(pred, res); - } + Operand flag = Register(bit, type); + Operand res = context.ConditionalSelect(Test(mask, bit), Test(value, bit + shift), flag); + context.Copy(flag, res); } } |