|
@@ -132,7 +132,7 @@ namespace Ryujinx.Graphics.Shader.Translation
|
|
|
public TreeNode(InstOp op, byte order)
|
|
public TreeNode(InstOp op, byte order)
|
|
|
{
|
|
{
|
|
|
Op = op;
|
|
Op = op;
|
|
|
- Uses = new List<TreeNodeUse>();
|
|
|
|
|
|
|
+ Uses = [];
|
|
|
Type = TreeNodeType.Op;
|
|
Type = TreeNodeType.Op;
|
|
|
Order = order;
|
|
Order = order;
|
|
|
}
|
|
}
|
|
@@ -150,7 +150,7 @@ namespace Ryujinx.Graphics.Shader.Translation
|
|
|
|
|
|
|
|
private static TreeNode[] BuildTree(Block[] blocks)
|
|
private static TreeNode[] BuildTree(Block[] blocks)
|
|
|
{
|
|
{
|
|
|
- List<TreeNode> nodes = new();
|
|
|
|
|
|
|
+ List<TreeNode> nodes = [];
|
|
|
|
|
|
|
|
Dictionary<ulong, TreeNode> labels = new();
|
|
Dictionary<ulong, TreeNode> labels = new();
|
|
|
|
|
|
|
@@ -382,7 +382,7 @@ namespace Ryujinx.Graphics.Shader.Translation
|
|
|
Type = type;
|
|
Type = type;
|
|
|
Order = order;
|
|
Order = order;
|
|
|
IsImm = isImm;
|
|
IsImm = isImm;
|
|
|
- Uses = new List<PatternTreeNodeUse>();
|
|
|
|
|
|
|
+ Uses = [];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public PatternTreeNode<T> Use(PatternTreeNodeUse use)
|
|
public PatternTreeNode<T> Use(PatternTreeNodeUse use)
|
|
@@ -527,8 +527,8 @@ namespace Ryujinx.Graphics.Shader.Translation
|
|
|
PatternTreeNodeUse affinityValue = S2r(SReg.Affinity).Use(PT).Out;
|
|
PatternTreeNodeUse affinityValue = S2r(SReg.Affinity).Use(PT).Out;
|
|
|
PatternTreeNodeUse orderingTicketValue = S2r(SReg.OrderingTicket).Use(PT).Out;
|
|
PatternTreeNodeUse orderingTicketValue = S2r(SReg.OrderingTicket).Use(PT).Out;
|
|
|
|
|
|
|
|
- return new IPatternTreeNode[]
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ return
|
|
|
|
|
+ [
|
|
|
Iscadd(cc: true, 2, 0, 404)
|
|
Iscadd(cc: true, 2, 0, 404)
|
|
|
.Use(PT)
|
|
.Use(PT)
|
|
|
.Use(Iscadd(cc: false, 8)
|
|
.Use(Iscadd(cc: false, 8)
|
|
@@ -548,8 +548,8 @@ namespace Ryujinx.Graphics.Shader.Translation
|
|
|
.Use(PT)
|
|
.Use(PT)
|
|
|
.Use(orderingTicketValue).Out),
|
|
.Use(orderingTicketValue).Out),
|
|
|
Iadd(x: true, 0, 405).Use(PT).Use(RZ),
|
|
Iadd(x: true, 0, 405).Use(PT).Use(RZ),
|
|
|
- Ret().Use(PT),
|
|
|
|
|
- };
|
|
|
|
|
|
|
+ Ret().Use(PT)
|
|
|
|
|
+ ];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public static IPatternTreeNode[] GetFsiGetAddressV2()
|
|
public static IPatternTreeNode[] GetFsiGetAddressV2()
|
|
@@ -557,8 +557,8 @@ namespace Ryujinx.Graphics.Shader.Translation
|
|
|
PatternTreeNodeUse affinityValue = S2r(SReg.Affinity).Use(PT).Out;
|
|
PatternTreeNodeUse affinityValue = S2r(SReg.Affinity).Use(PT).Out;
|
|
|
PatternTreeNodeUse orderingTicketValue = S2r(SReg.OrderingTicket).Use(PT).Out;
|
|
PatternTreeNodeUse orderingTicketValue = S2r(SReg.OrderingTicket).Use(PT).Out;
|
|
|
|
|
|
|
|
- return new IPatternTreeNode[]
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ return
|
|
|
|
|
+ [
|
|
|
ShrU32W(16)
|
|
ShrU32W(16)
|
|
|
.Use(PT)
|
|
.Use(PT)
|
|
|
.Use(orderingTicketValue),
|
|
.Use(orderingTicketValue),
|
|
@@ -576,8 +576,8 @@ namespace Ryujinx.Graphics.Shader.Translation
|
|
|
.Use(PT)
|
|
.Use(PT)
|
|
|
.Use(orderingTicketValue).Out).Out),
|
|
.Use(orderingTicketValue).Out).Out),
|
|
|
Iadd(x: true, 0, 405).Use(PT).Use(RZ),
|
|
Iadd(x: true, 0, 405).Use(PT).Use(RZ),
|
|
|
- Ret().Use(PT),
|
|
|
|
|
- };
|
|
|
|
|
|
|
+ Ret().Use(PT)
|
|
|
|
|
+ ];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public static IPatternTreeNode[] GetFsiIsLastWarpThread()
|
|
public static IPatternTreeNode[] GetFsiIsLastWarpThread()
|
|
@@ -585,8 +585,8 @@ namespace Ryujinx.Graphics.Shader.Translation
|
|
|
PatternTreeNodeUse threadKillValue = S2r(SReg.ThreadKill).Use(PT).Out;
|
|
PatternTreeNodeUse threadKillValue = S2r(SReg.ThreadKill).Use(PT).Out;
|
|
|
PatternTreeNodeUse laneIdValue = S2r(SReg.LaneId).Use(PT).Out;
|
|
PatternTreeNodeUse laneIdValue = S2r(SReg.LaneId).Use(PT).Out;
|
|
|
|
|
|
|
|
- return new IPatternTreeNode[]
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ return
|
|
|
|
|
+ [
|
|
|
IsetpU32(IComp.Eq)
|
|
IsetpU32(IComp.Eq)
|
|
|
.Use(PT)
|
|
.Use(PT)
|
|
|
.Use(PT)
|
|
.Use(PT)
|
|
@@ -603,8 +603,8 @@ namespace Ryujinx.Graphics.Shader.Translation
|
|
|
.Use(threadKillValue).OutAt(1))
|
|
.Use(threadKillValue).OutAt(1))
|
|
|
.Use(RZ).Out).OutAt(1)).Out)
|
|
.Use(RZ).Out).OutAt(1)).Out)
|
|
|
.Use(laneIdValue),
|
|
.Use(laneIdValue),
|
|
|
- Ret().Use(PT),
|
|
|
|
|
- };
|
|
|
|
|
|
|
+ Ret().Use(PT)
|
|
|
|
|
+ ];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public static IPatternTreeNode[] GetFsiBeginPattern()
|
|
public static IPatternTreeNode[] GetFsiBeginPattern()
|
|
@@ -624,8 +624,8 @@ namespace Ryujinx.Graphics.Shader.Translation
|
|
|
|
|
|
|
|
PatternTreeNode<byte> label;
|
|
PatternTreeNode<byte> label;
|
|
|
|
|
|
|
|
- return new IPatternTreeNode[]
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ return
|
|
|
|
|
+ [
|
|
|
Cal(),
|
|
Cal(),
|
|
|
Ret().Use(CallArg(0).Inv),
|
|
Ret().Use(CallArg(0).Inv),
|
|
|
Ret()
|
|
Ret()
|
|
@@ -638,8 +638,8 @@ namespace Ryujinx.Graphics.Shader.Translation
|
|
|
.Use(PT)
|
|
.Use(PT)
|
|
|
.Use(addressLowValue).Out).Inv)
|
|
.Use(addressLowValue).Out).Inv)
|
|
|
.Use(label.Out),
|
|
.Use(label.Out),
|
|
|
- Ret().Use(PT),
|
|
|
|
|
- };
|
|
|
|
|
|
|
+ Ret().Use(PT)
|
|
|
|
|
+ ];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public static IPatternTreeNode[] GetFsiEndPattern()
|
|
public static IPatternTreeNode[] GetFsiEndPattern()
|
|
@@ -652,8 +652,8 @@ namespace Ryujinx.Graphics.Shader.Translation
|
|
|
PatternTreeNodeUse addressLowValue = CallArg(1);
|
|
PatternTreeNodeUse addressLowValue = CallArg(1);
|
|
|
PatternTreeNodeUse incrementValue = CallArg(2);
|
|
PatternTreeNodeUse incrementValue = CallArg(2);
|
|
|
|
|
|
|
|
- return new IPatternTreeNode[]
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ return
|
|
|
|
|
+ [
|
|
|
Cal(),
|
|
Cal(),
|
|
|
Ret().Use(CallArg(0).Inv),
|
|
Ret().Use(CallArg(0).Inv),
|
|
|
Membar(Decoders.Membar.Vc).Use(PT),
|
|
Membar(Decoders.Membar.Vc).Use(PT),
|
|
@@ -684,8 +684,8 @@ namespace Ryujinx.Graphics.Shader.Translation
|
|
|
.Use(incrementValue)
|
|
.Use(incrementValue)
|
|
|
.Use(popcResult)
|
|
.Use(popcResult)
|
|
|
.Use(RZ).Out).Out),
|
|
.Use(RZ).Out).Out),
|
|
|
- Ret().Use(PT),
|
|
|
|
|
- };
|
|
|
|
|
|
|
+ Ret().Use(PT)
|
|
|
|
|
+ ];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private static PatternTreeNode<InstBfiI> Bfi(int imm)
|
|
private static PatternTreeNode<InstBfiI> Bfi(int imm)
|