aboutsummaryrefslogtreecommitdiff
path: root/ARMeilleure/Instructions/InstEmitSimdArithmetic.cs
diff options
context:
space:
mode:
authorLDj3SNuD <35856442+LDj3SNuD@users.noreply.github.com>2022-09-20 23:55:13 +0200
committerGitHub <noreply@github.com>2022-09-20 18:55:13 -0300
commit814f75142e8e4e81741a859db8189ca60535f3e6 (patch)
tree0a93fdd74d5dba52beed07892b3f8b7c10c4d597 /ARMeilleure/Instructions/InstEmitSimdArithmetic.cs
parent4c0eb91d7e6bdbe42ffa6e950e3288f8066de089 (diff)
Fpsr and Fpcr freed. (#3701)1.1.279
* Implemented in IR the managed methods of the Saturating region ... ... of the SoftFallback class (the SatQ ones). The need to natively manage the Fpcr and Fpsr system registers is still a fact. Contributes to https://github.com/Ryujinx/Ryujinx/issues/2917 ; I will open another PR to implement in Intrinsics-branchless the methods of the Saturation region as well (the SatXXXToXXX ones). All instructions involved have been tested locally in both release and debug modes, in both lowcq and highcq. * Ptc.InternalVersion = 3665 * Addressed PR feedback. * Implemented in IR the managed methods of the ShlReg region of the SoftFallback class. It also includes the last two SatQ ones (following up on https://github.com/Ryujinx/Ryujinx/pull/3665). All instructions involved have been tested locally in both release and debug modes, in both lowcq and highcq. * Fpsr and Fpcr freed. Handling/isolation of Fpsr and Fpcr via register for IR and via memory for Tests and Threads, with synchronization to context exchanges (explicit for SoftFloat); without having to call managed methods. Thanks to the inlining work of the previous two PRs and others in this. Tests performed locally in both release and debug modes, in both lowcq and highcq, with FastFP to true and false (explicit FP tests included). Tested with the title Tony Hawk's PS. Depends on shlreg. * Update InstEmitSimdHelper.cs * De-magic Masks. Remove the Stride and Len flags; Fpsr.NZCV are A32 only, then moved to Fpscr: this leads to emitting less IR in reference to Get/Set Fpsr/Fpcr/Fpscr methods in reference to Mrs/Msr (A64) and Vmrs/Vmsr (A32) instructions. * Addressed PR feedback.
Diffstat (limited to 'ARMeilleure/Instructions/InstEmitSimdArithmetic.cs')
-rw-r--r--ARMeilleure/Instructions/InstEmitSimdArithmetic.cs56
1 files changed, 8 insertions, 48 deletions
diff --git a/ARMeilleure/Instructions/InstEmitSimdArithmetic.cs b/ARMeilleure/Instructions/InstEmitSimdArithmetic.cs
index 9a632fd6..a35e28a1 100644
--- a/ARMeilleure/Instructions/InstEmitSimdArithmetic.cs
+++ b/ARMeilleure/Instructions/InstEmitSimdArithmetic.cs
@@ -726,7 +726,7 @@ namespace ARMeilleure.Instructions
{
EmitVectorAcrossVectorOpF(context, (op1, op2) =>
{
- return context.Call(typeof(SoftFloat32).GetMethod(nameof(SoftFloat32.FPMaxNum)), op1, op2);
+ return EmitSoftFloatCall(context, nameof(SoftFloat32.FPMaxNum), op1, op2);
});
}
}
@@ -774,7 +774,7 @@ namespace ARMeilleure.Instructions
{
EmitVectorAcrossVectorOpF(context, (op1, op2) =>
{
- return context.Call(typeof(SoftFloat32).GetMethod(nameof(SoftFloat32.FPMax)), op1, op2);
+ return EmitSoftFloatCall(context, nameof(SoftFloat32.FPMax), op1, op2);
});
}
}
@@ -900,7 +900,7 @@ namespace ARMeilleure.Instructions
{
EmitVectorAcrossVectorOpF(context, (op1, op2) =>
{
- return context.Call(typeof(SoftFloat32).GetMethod(nameof(SoftFloat32.FPMinNum)), op1, op2);
+ return EmitSoftFloatCall(context, nameof(SoftFloat32.FPMinNum), op1, op2);
});
}
}
@@ -948,7 +948,7 @@ namespace ARMeilleure.Instructions
{
EmitVectorAcrossVectorOpF(context, (op1, op2) =>
{
- return context.Call(typeof(SoftFloat32).GetMethod(nameof(SoftFloat32.FPMin)), op1, op2);
+ return EmitSoftFloatCall(context, nameof(SoftFloat32.FPMin), op1, op2);
});
}
}
@@ -1633,37 +1633,17 @@ namespace ARMeilleure.Instructions
public static void Frinti_S(ArmEmitterContext context)
{
- OpCodeSimd op = (OpCodeSimd)context.CurrOp;
-
EmitScalarUnaryOpF(context, (op1) =>
{
- if (op.Size == 0)
- {
- return context.Call(typeof(SoftFallback).GetMethod(nameof(SoftFallback.RoundF)), op1);
- }
- else /* if (op.Size == 1) */
- {
- return context.Call(typeof(SoftFallback).GetMethod(nameof(SoftFallback.Round)), op1);
- }
+ return EmitRoundByRMode(context, op1);
});
}
public static void Frinti_V(ArmEmitterContext context)
{
- OpCodeSimd op = (OpCodeSimd)context.CurrOp;
-
- int sizeF = op.Size & 1;
-
EmitVectorUnaryOpF(context, (op1) =>
{
- if (sizeF == 0)
- {
- return context.Call(typeof(SoftFallback).GetMethod(nameof(SoftFallback.RoundF)), op1);
- }
- else /* if (sizeF == 1) */
- {
- return context.Call(typeof(SoftFallback).GetMethod(nameof(SoftFallback.Round)), op1);
- }
+ return EmitRoundByRMode(context, op1);
});
}
@@ -1759,37 +1739,17 @@ namespace ARMeilleure.Instructions
public static void Frintx_S(ArmEmitterContext context)
{
- OpCodeSimd op = (OpCodeSimd)context.CurrOp;
-
EmitScalarUnaryOpF(context, (op1) =>
{
- if (op.Size == 0)
- {
- return context.Call(typeof(SoftFallback).GetMethod(nameof(SoftFallback.RoundF)), op1);
- }
- else /* if (op.Size == 1) */
- {
- return context.Call(typeof(SoftFallback).GetMethod(nameof(SoftFallback.Round)), op1);
- }
+ return EmitRoundByRMode(context, op1);
});
}
public static void Frintx_V(ArmEmitterContext context)
{
- OpCodeSimd op = (OpCodeSimd)context.CurrOp;
-
- int sizeF = op.Size & 1;
-
EmitVectorUnaryOpF(context, (op1) =>
{
- if (sizeF == 0)
- {
- return context.Call(typeof(SoftFallback).GetMethod(nameof(SoftFallback.RoundF)), op1);
- }
- else /* if (sizeF == 1) */
- {
- return context.Call(typeof(SoftFallback).GetMethod(nameof(SoftFallback.Round)), op1);
- }
+ return EmitRoundByRMode(context, op1);
});
}