Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,8 @@ public static Vector128<T> Invoke(Vector128<T> x, Vector128<T> y, Vector128<T> z
{
return Vector128.MultiplyAddEstimate(x.AsDouble(), y.AsDouble(), z.AsDouble()).As<double, T>();
}
else
else if (typeof(T) == typeof(float))
{
Debug.Assert(typeof(T) == typeof(float));
return Vector128.MultiplyAddEstimate(x.AsSingle(), y.AsSingle(), z.AsSingle()).As<float, T>();
}
#else
Expand All @@ -149,9 +148,9 @@ public static Vector128<T> Invoke(Vector128<T> x, Vector128<T> y, Vector128<T> z
{
if (typeof(T) == typeof(double)) return AdvSimd.Arm64.FusedMultiplyAdd(z.AsDouble(), x.AsDouble(), y.AsDouble()).As<double, T>();
}
#endif

return (x * y) + z;
#endif
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
Expand All @@ -162,9 +161,8 @@ public static Vector256<T> Invoke(Vector256<T> x, Vector256<T> y, Vector256<T> z
{
return Vector256.MultiplyAddEstimate(x.AsDouble(), y.AsDouble(), z.AsDouble()).As<double, T>();
}
else
else if (typeof(T) == typeof(float))
{
Debug.Assert(typeof(T) == typeof(float));
return Vector256.MultiplyAddEstimate(x.AsSingle(), y.AsSingle(), z.AsSingle()).As<float, T>();
}
#else
Expand All @@ -173,9 +171,9 @@ public static Vector256<T> Invoke(Vector256<T> x, Vector256<T> y, Vector256<T> z
if (typeof(T) == typeof(float)) return Fma.MultiplyAdd(x.AsSingle(), y.AsSingle(), z.AsSingle()).As<float, T>();
if (typeof(T) == typeof(double)) return Fma.MultiplyAdd(x.AsDouble(), y.AsDouble(), z.AsDouble()).As<double, T>();
}
#endif

return (x * y) + z;
#endif
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
Expand All @@ -186,9 +184,8 @@ public static Vector512<T> Invoke(Vector512<T> x, Vector512<T> y, Vector512<T> z
{
return Vector512.MultiplyAddEstimate(x.AsDouble(), y.AsDouble(), z.AsDouble()).As<double, T>();
}
else
else if (typeof(T) == typeof(float))
{
Debug.Assert(typeof(T) == typeof(float));
return Vector512.MultiplyAddEstimate(x.AsSingle(), y.AsSingle(), z.AsSingle()).As<float, T>();
}
#else
Expand All @@ -197,9 +194,9 @@ public static Vector512<T> Invoke(Vector512<T> x, Vector512<T> y, Vector512<T> z
if (typeof(T) == typeof(float)) return Avx512F.FusedMultiplyAdd(x.AsSingle(), y.AsSingle(), z.AsSingle()).As<float, T>();
if (typeof(T) == typeof(double)) return Avx512F.FusedMultiplyAdd(x.AsDouble(), y.AsDouble(), z.AsDouble()).As<double, T>();
}
#endif

return (x * y) + z;
#endif
}
}
}
Expand Down
Loading
Loading