Implement remaining shader double-precision instructions (#2845)
* Implement remaining shader double-precision instructions * Shader cache version bump
This commit is contained in:
parent
a0aa87366c
commit
650cc41c02
12 changed files with 282 additions and 121 deletions
|
@ -9,6 +9,39 @@ namespace Ryujinx.Graphics.Shader.Instructions
|
|||
{
|
||||
static partial class InstEmit
|
||||
{
|
||||
public static void DmnmxR(EmitterContext context)
|
||||
{
|
||||
InstDmnmxR op = context.GetOp<InstDmnmxR>();
|
||||
|
||||
var srcA = GetSrcReg(context, op.SrcA, isFP64: true);
|
||||
var srcB = GetSrcReg(context, op.SrcB, isFP64: true);
|
||||
var srcPred = GetPredicate(context, op.SrcPred, op.SrcPredInv);
|
||||
|
||||
EmitFmnmx(context, srcA, srcB, srcPred, op.Dest, op.AbsA, op.AbsB, op.NegA, op.NegB, op.WriteCC, isFP64: true);
|
||||
}
|
||||
|
||||
public static void DmnmxI(EmitterContext context)
|
||||
{
|
||||
InstDmnmxI op = context.GetOp<InstDmnmxI>();
|
||||
|
||||
var srcA = GetSrcReg(context, op.SrcA, isFP64: true);
|
||||
var srcB = GetSrcImm(context, Imm20ToFloat(op.Imm20), isFP64: true);
|
||||
var srcPred = GetPredicate(context, op.SrcPred, op.SrcPredInv);
|
||||
|
||||
EmitFmnmx(context, srcA, srcB, srcPred, op.Dest, op.AbsA, op.AbsB, op.NegA, op.NegB, op.WriteCC, isFP64: true);
|
||||
}
|
||||
|
||||
public static void DmnmxC(EmitterContext context)
|
||||
{
|
||||
InstDmnmxC op = context.GetOp<InstDmnmxC>();
|
||||
|
||||
var srcA = GetSrcReg(context, op.SrcA, isFP64: true);
|
||||
var srcB = GetSrcCbuf(context, op.CbufSlot, op.CbufOffset, isFP64: true);
|
||||
var srcPred = GetPredicate(context, op.SrcPred, op.SrcPredInv);
|
||||
|
||||
EmitFmnmx(context, srcA, srcB, srcPred, op.Dest, op.AbsA, op.AbsB, op.NegA, op.NegB, op.WriteCC, isFP64: true);
|
||||
}
|
||||
|
||||
public static void FmnmxR(EmitterContext context)
|
||||
{
|
||||
InstFmnmxR op = context.GetOp<InstFmnmxR>();
|
||||
|
@ -52,19 +85,22 @@ namespace Ryujinx.Graphics.Shader.Instructions
|
|||
bool absoluteB,
|
||||
bool negateA,
|
||||
bool negateB,
|
||||
bool writeCC)
|
||||
bool writeCC,
|
||||
bool isFP64 = false)
|
||||
{
|
||||
srcA = context.FPAbsNeg(srcA, absoluteA, negateA);
|
||||
srcB = context.FPAbsNeg(srcB, absoluteB, negateB);
|
||||
Instruction fpType = isFP64 ? Instruction.FP64 : Instruction.FP32;
|
||||
|
||||
Operand resMin = context.FPMinimum(srcA, srcB);
|
||||
Operand resMax = context.FPMaximum(srcA, srcB);
|
||||
srcA = context.FPAbsNeg(srcA, absoluteA, negateA, fpType);
|
||||
srcB = context.FPAbsNeg(srcB, absoluteB, negateB, fpType);
|
||||
|
||||
Operand dest = GetDest(rd);
|
||||
Operand resMin = context.FPMinimum(srcA, srcB, fpType);
|
||||
Operand resMax = context.FPMaximum(srcA, srcB, fpType);
|
||||
|
||||
context.Copy(dest, context.ConditionalSelect(srcPred, resMin, resMax));
|
||||
Operand res = context.ConditionalSelect(srcPred, resMin, resMax);
|
||||
|
||||
SetFPZnFlags(context, dest, writeCC);
|
||||
SetDest(context, res, rd, isFP64);
|
||||
|
||||
SetFPZnFlags(context, res, writeCC, fpType);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue