VoteAllEqual, FindLSB/MSB

This commit is contained in:
Isaac Marovitz
2024-06-22 14:38:09 +01:00
committed by Isaac Marovitz
parent b094d34575
commit a71b5f1a3a
13 changed files with 101 additions and 23 deletions

View File

@@ -7,6 +7,11 @@ namespace Ryujinx.Graphics.Shader.StructuredIr
{
MultiplyHighS32 = 1 << 2,
MultiplyHighU32 = 1 << 3,
FindLSB = 1 << 5,
FindMSBS32 = 1 << 6,
FindMSBU32 = 1 << 7,
SwizzleAdd = 1 << 10,
FSI = 1 << 11,
}

View File

@@ -321,8 +321,9 @@ namespace Ryujinx.Graphics.Shader.StructuredIr
}
// Those instructions needs to be emulated by using helper functions,
// because they are NVIDIA specific. Those flags helps the backend to
// decide which helper functions are needed on the final generated code.
// because they are NVIDIA specific or because the target language has
// no direct equivalent. Those flags helps the backend to decide which
// helper functions are needed on the final generated code.
switch (operation.Inst)
{
case Instruction.MultiplyHighS32:
@@ -331,6 +332,15 @@ namespace Ryujinx.Graphics.Shader.StructuredIr
case Instruction.MultiplyHighU32:
context.Info.HelperFunctionsMask |= HelperFunctionsMask.MultiplyHighU32;
break;
case Instruction.FindLSB:
context.Info.HelperFunctionsMask |= HelperFunctionsMask.FindLSB;
break;
case Instruction.FindMSBS32:
context.Info.HelperFunctionsMask |= HelperFunctionsMask.FindMSBS32;
break;
case Instruction.FindMSBU32:
context.Info.HelperFunctionsMask |= HelperFunctionsMask.FindMSBU32;
break;
case Instruction.SwizzleAdd:
context.Info.HelperFunctionsMask |= HelperFunctionsMask.SwizzleAdd;
break;