Skip to content

Commit

Permalink
Don't vectorize division for integer types (#106288)
Browse files Browse the repository at this point in the history
  • Loading branch information
tannergooding authored Aug 12, 2024
1 parent fd304de commit abdef75
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ public static void Divide<T>(T x, ReadOnlySpan<T> y, Span<T> destination)
/// <summary>x / y</summary>
internal readonly struct DivideOperator<T> : IBinaryOperator<T> where T : IDivisionOperators<T, T, T>
{
public static bool Vectorizable => true;
public static bool Vectorizable => typeof(T) == typeof(float)
|| typeof(T) == typeof(double);
public static T Invoke(T x, T y) => x / y;
public static Vector128<T> Invoke(Vector128<T> x, Vector128<T> y) => x / y;
public static Vector256<T> Invoke(Vector256<T> x, Vector256<T> y) => x / y;
Expand Down

0 comments on commit abdef75

Please sign in to comment.