diff --git a/ARMeilleure/Instructions/InstEmitSimdArithmetic.cs b/ARMeilleure/Instructions/InstEmitSimdArithmetic.cs index 44659e8057..c411a6d3fc 100644 --- a/ARMeilleure/Instructions/InstEmitSimdArithmetic.cs +++ b/ARMeilleure/Instructions/InstEmitSimdArithmetic.cs @@ -1033,14 +1033,13 @@ namespace ARMeilleure.Instructions } } - public static void Fnmadd_S(ArmEmitterContext context) + public static void Fnmadd_S(ArmEmitterContext context) // Fused. { OpCodeSimdReg op = (OpCodeSimdReg)context.CurrOp; int sizeF = op.Size & 1; - OperandType type = sizeF != 0 ? OperandType.FP64 - : OperandType.FP32; + OperandType type = sizeF != 0 ? OperandType.FP64 : OperandType.FP32; Operand ne = context.VectorExtract(type, GetVec(op.Rn), 0); Operand me = context.VectorExtract(type, GetVec(op.Rm), 0); @@ -1051,14 +1050,13 @@ namespace ARMeilleure.Instructions context.Copy(GetVec(op.Rd), context.VectorInsert(context.VectorZero(), res, 0)); } - public static void Fnmsub_S(ArmEmitterContext context) + public static void Fnmsub_S(ArmEmitterContext context) // Fused. { OpCodeSimdReg op = (OpCodeSimdReg)context.CurrOp; int sizeF = op.Size & 1; - OperandType type = sizeF != 0 ? OperandType.FP64 - : OperandType.FP32; + OperandType type = sizeF != 0 ? OperandType.FP64 : OperandType.FP32; Operand ne = context.VectorExtract(type, GetVec(op.Rn), 0); Operand me = context.VectorExtract(type, GetVec(op.Rm), 0); diff --git a/ARMeilleure/Instructions/SoftFloat.cs b/ARMeilleure/Instructions/SoftFloat.cs index 7358e6b2cb..af22c85d21 100644 --- a/ARMeilleure/Instructions/SoftFloat.cs +++ b/ARMeilleure/Instructions/SoftFloat.cs @@ -1073,10 +1073,7 @@ namespace ARMeilleure.Instructions } else { - // TODO: When available, use: T MathF.FusedMultiplyAdd(T, T, T); - // https://github.com/dotnet/corefx/issues/31903 - - result = valueA + (value1 * value2); + result = MathF.FusedMultiplyAdd(value1, value2, valueA); if ((context.Fpcr & FPCR.Fz) != 0 && float.IsSubnormal(result)) { @@ -1256,10 +1253,7 @@ namespace ARMeilleure.Instructions } else { - // TODO: When available, use: T MathF.FusedMultiplyAdd(T, T, T); - // https://github.com/dotnet/corefx/issues/31903 - - result = 2f + (value1 * value2); + result = MathF.FusedMultiplyAdd(value1, value2, 2f); if ((context.Fpcr & FPCR.Fz) != 0 && float.IsSubnormal(result)) { @@ -1388,10 +1382,7 @@ namespace ARMeilleure.Instructions } else { - // TODO: When available, use: T MathF.FusedMultiplyAdd(T, T, T); - // https://github.com/dotnet/corefx/issues/31903 - - result = (3f + (value1 * value2)) / 2f; + result = MathF.FusedMultiplyAdd(value1, value2, 3f) / 2f; if ((context.Fpcr & FPCR.Fz) != 0 && float.IsSubnormal(result)) { @@ -2142,10 +2133,7 @@ namespace ARMeilleure.Instructions } else { - // TODO: When available, use: T Math.FusedMultiplyAdd(T, T, T); - // https://github.com/dotnet/corefx/issues/31903 - - result = valueA + (value1 * value2); + result = Math.FusedMultiplyAdd(value1, value2, valueA); if ((context.Fpcr & FPCR.Fz) != 0 && double.IsSubnormal(result)) { @@ -2323,10 +2311,7 @@ namespace ARMeilleure.Instructions } else { - // TODO: When available, use: T Math.FusedMultiplyAdd(T, T, T); - // https://github.com/dotnet/corefx/issues/31903 - - result = 2d + (value1 * value2); + result = Math.FusedMultiplyAdd(value1, value2, 2d); if ((context.Fpcr & FPCR.Fz) != 0 && double.IsSubnormal(result)) { @@ -2455,10 +2440,7 @@ namespace ARMeilleure.Instructions } else { - // TODO: When available, use: T Math.FusedMultiplyAdd(T, T, T); - // https://github.com/dotnet/corefx/issues/31903 - - result = (3d + (value1 * value2)) / 2d; + result = Math.FusedMultiplyAdd(value1, value2, 3d) / 2d; if ((context.Fpcr & FPCR.Fz) != 0 && double.IsSubnormal(result)) {