Add T Math/F.FusedMultiplyAdd(T, T, T). Nits.

This commit is contained in:
LDj3SNuD 2019-10-09 18:12:36 +02:00
parent aa87ae8c81
commit fc3eb113e5
2 changed files with 10 additions and 30 deletions

View file

@ -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);

View file

@ -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))
{