diff --git a/src/ImageSharp.ruleset b/src/ImageSharp.ruleset index 11f504158..8327dd756 100644 --- a/src/ImageSharp.ruleset +++ b/src/ImageSharp.ruleset @@ -2,7 +2,6 @@ - diff --git a/src/ImageSharp/Common/Helpers/SimdUtils.HwIntrinsics.cs b/src/ImageSharp/Common/Helpers/SimdUtils.HwIntrinsics.cs index 7caaa5868..373069e9b 100644 --- a/src/ImageSharp/Common/Helpers/SimdUtils.HwIntrinsics.cs +++ b/src/ImageSharp/Common/Helpers/SimdUtils.HwIntrinsics.cs @@ -1,6 +1,7 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. +using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Intrinsics; @@ -58,7 +59,7 @@ internal static partial class SimdUtils public static void Shuffle4Reduce( ref ReadOnlySpan source, ref Span dest, - byte control) + [ConstantExpected] byte control) { if (Avx.IsSupported || Sse.IsSupported) { @@ -217,7 +218,7 @@ internal static partial class SimdUtils private static void Shuffle4( ReadOnlySpan source, Span dest, - byte control) + [ConstantExpected] byte control) { if (Avx.IsSupported) { diff --git a/src/ImageSharp/Common/Helpers/SimdUtils.Shuffle.cs b/src/ImageSharp/Common/Helpers/SimdUtils.Shuffle.cs index c1437c05e..83cd3d246 100644 --- a/src/ImageSharp/Common/Helpers/SimdUtils.Shuffle.cs +++ b/src/ImageSharp/Common/Helpers/SimdUtils.Shuffle.cs @@ -2,6 +2,7 @@ // Licensed under the Six Labors Split License. using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -20,7 +21,7 @@ internal static partial class SimdUtils public static void Shuffle4( ReadOnlySpan source, Span dest, - byte control) + [ConstantExpected] byte control) { VerifyShuffle4SpanInput(source, dest);