mirror of
https://github.com/Ryujinx/Ryujinx.git
synced 2025-06-28 23:50:46 -07:00
Add FMaxNmV & FMinNmV Inst.s with Test. (#1279)
Successful unit testing on Windows (debug and release mode).
This commit is contained in:
@ -534,6 +534,14 @@ namespace ARMeilleure.Instructions
|
||||
}
|
||||
}
|
||||
|
||||
public static void Fmaxnmv_V(ArmEmitterContext context)
|
||||
{
|
||||
EmitVectorAcrossVectorOpF(context, (op1, op2) =>
|
||||
{
|
||||
return context.Call(new _F32_F32_F32(SoftFloat32.FPMaxNum), op1, op2);
|
||||
});
|
||||
}
|
||||
|
||||
public static void Fmaxp_V(ArmEmitterContext context)
|
||||
{
|
||||
if (Optimizations.FastFP && Optimizations.UseSse2)
|
||||
@ -609,6 +617,14 @@ namespace ARMeilleure.Instructions
|
||||
}
|
||||
}
|
||||
|
||||
public static void Fminnmv_V(ArmEmitterContext context)
|
||||
{
|
||||
EmitVectorAcrossVectorOpF(context, (op1, op2) =>
|
||||
{
|
||||
return context.Call(new _F32_F32_F32(SoftFloat32.FPMinNum), op1, op2);
|
||||
});
|
||||
}
|
||||
|
||||
public static void Fminp_V(ArmEmitterContext context)
|
||||
{
|
||||
if (Optimizations.FastFP && Optimizations.UseSse2)
|
||||
|
@ -1103,6 +1103,26 @@ namespace ARMeilleure.Instructions
|
||||
context.Copy(GetVec(op.Rd), d);
|
||||
}
|
||||
|
||||
public static void EmitVectorAcrossVectorOpF(ArmEmitterContext context, Func2I emit)
|
||||
{
|
||||
OpCodeSimd op = (OpCodeSimd)context.CurrOp;
|
||||
|
||||
Debug.Assert((op.Size & 1) == 0 && op.RegisterSize == RegisterSize.Simd128);
|
||||
|
||||
Operand res = context.VectorExtract(OperandType.FP32, GetVec(op.Rn), 0);
|
||||
|
||||
for (int index = 1; index < 4; index++)
|
||||
{
|
||||
Operand n = context.VectorExtract(OperandType.FP32, GetVec(op.Rn), index);
|
||||
|
||||
res = emit(res, n);
|
||||
}
|
||||
|
||||
Operand d = context.VectorInsert(context.VectorZero(), res, 0);
|
||||
|
||||
context.Copy(GetVec(op.Rd), d);
|
||||
}
|
||||
|
||||
public static void EmitVectorPairwiseOpF(ArmEmitterContext context, Func2I emit)
|
||||
{
|
||||
OpCodeSimdReg op = (OpCodeSimdReg)context.CurrOp;
|
||||
|
@ -212,11 +212,13 @@ namespace ARMeilleure.Instructions
|
||||
Fmax_V,
|
||||
Fmaxnm_S,
|
||||
Fmaxnm_V,
|
||||
Fmaxnmv_V,
|
||||
Fmaxp_V,
|
||||
Fmin_S,
|
||||
Fmin_V,
|
||||
Fminnm_S,
|
||||
Fminnm_V,
|
||||
Fminnmv_V,
|
||||
Fminp_V,
|
||||
Fmla_Se,
|
||||
Fmla_V,
|
||||
|
Reference in New Issue
Block a user