diff --git a/src/ImageSharp/Common/Helpers/SimdUtils.HwIntrinsics.cs b/src/ImageSharp/Common/Helpers/SimdUtils.HwIntrinsics.cs index 6f0b4b4e3c..6e45f1619c 100644 --- a/src/ImageSharp/Common/Helpers/SimdUtils.HwIntrinsics.cs +++ b/src/ImageSharp/Common/Helpers/SimdUtils.HwIntrinsics.cs @@ -761,10 +761,13 @@ internal static partial class SimdUtils { DebugGuard.IsTrue(source.Length == destination.Length, nameof(source), "Input spans must be of same length!"); - if (Avx2.IsSupported || Sse2.IsSupported) + if ((Vector512.IsHardwareAccelerated && Avx512F.IsSupported) || + Avx2.IsSupported || + Sse2.IsSupported || + AdvSimd.IsSupported) { int remainder; - if (Vector512.IsHardwareAccelerated && Avx512F.IsSupported) + if (Avx512F.IsSupported) { remainder = Numerics.ModuloP2(source.Length, Vector512.Count); } @@ -877,7 +880,6 @@ internal static partial class SimdUtils ref Vector128 destinationBase = ref Unsafe.As>(ref MemoryMarshal.GetReference(destination)); Vector128 scale = Vector128.Create(1 / (float)byte.MaxValue); - Vector128 zero = Vector128.Zero; for (nuint i = 0; i < n; i++) {