Skip to content

Commit 0ec839f

Browse files
Update SimdUtils.HwIntrinsics.cs
1 parent c6758df commit 0ec839f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/ImageSharp/Common/Helpers/SimdUtils.HwIntrinsics.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -761,10 +761,13 @@ internal static void ByteToNormalizedFloatReduce(
761761
{
762762
DebugGuard.IsTrue(source.Length == destination.Length, nameof(source), "Input spans must be of same length!");
763763

764-
if (Avx2.IsSupported || Sse2.IsSupported)
764+
if ((Vector512.IsHardwareAccelerated && Avx512F.IsSupported) ||
765+
Avx2.IsSupported ||
766+
Sse2.IsSupported ||
767+
AdvSimd.IsSupported)
765768
{
766769
int remainder;
767-
if (Vector512.IsHardwareAccelerated && Avx512F.IsSupported)
770+
if (Avx512F.IsSupported)
768771
{
769772
remainder = Numerics.ModuloP2(source.Length, Vector512<byte>.Count);
770773
}
@@ -877,7 +880,6 @@ internal static unsafe void ByteToNormalizedFloat(
877880
ref Vector128<float> destinationBase = ref Unsafe.As<float, Vector128<float>>(ref MemoryMarshal.GetReference(destination));
878881

879882
Vector128<float> scale = Vector128.Create(1 / (float)byte.MaxValue);
880-
Vector128<byte> zero = Vector128<byte>.Zero;
881883

882884
for (nuint i = 0; i < n; i++)
883885
{

0 commit comments

Comments
 (0)