Browse Source

Fix CA1857

pull/2583/head
Stefan Nikolei 3 years ago
parent
commit
8b2e164c83
  1. 1
      src/ImageSharp.ruleset
  2. 5
      src/ImageSharp/Common/Helpers/SimdUtils.HwIntrinsics.cs
  3. 3
      src/ImageSharp/Common/Helpers/SimdUtils.Shuffle.cs

1
src/ImageSharp.ruleset

@ -2,7 +2,6 @@
<RuleSet Name="ImageSharp" ToolsVersion="17.0"> <RuleSet Name="ImageSharp" ToolsVersion="17.0">
<Include Path="..\shared-infrastructure\sixlabors.ruleset" Action="Default" /> <Include Path="..\shared-infrastructure\sixlabors.ruleset" Action="Default" />
<Rules AnalyzerId="Microsoft.CodeAnalysis.CSharp.NetAnalyzers" RuleNamespace="Microsoft.CodeAnalysis.CSharp.NetAnalyzers"> <Rules AnalyzerId="Microsoft.CodeAnalysis.CSharp.NetAnalyzers" RuleNamespace="Microsoft.CodeAnalysis.CSharp.NetAnalyzers">
<Rule Id="CA1857" Action="None" />
<Rule Id="CA1859" Action="None" /> <Rule Id="CA1859" Action="None" />
</Rules> </Rules>
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers"> <Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers">

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

@ -1,6 +1,7 @@
// Copyright (c) Six Labors. // Copyright (c) Six Labors.
// Licensed under the Six Labors Split License. // Licensed under the Six Labors Split License.
using System.Diagnostics.CodeAnalysis;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Runtime.Intrinsics; using System.Runtime.Intrinsics;
@ -58,7 +59,7 @@ internal static partial class SimdUtils
public static void Shuffle4Reduce( public static void Shuffle4Reduce(
ref ReadOnlySpan<float> source, ref ReadOnlySpan<float> source,
ref Span<float> dest, ref Span<float> dest,
byte control) [ConstantExpected] byte control)
{ {
if (Avx.IsSupported || Sse.IsSupported) if (Avx.IsSupported || Sse.IsSupported)
{ {
@ -217,7 +218,7 @@ internal static partial class SimdUtils
private static void Shuffle4( private static void Shuffle4(
ReadOnlySpan<float> source, ReadOnlySpan<float> source,
Span<float> dest, Span<float> dest,
byte control) [ConstantExpected] byte control)
{ {
if (Avx.IsSupported) if (Avx.IsSupported)
{ {

3
src/ImageSharp/Common/Helpers/SimdUtils.Shuffle.cs

@ -2,6 +2,7 @@
// Licensed under the Six Labors Split License. // Licensed under the Six Labors Split License.
using System.Diagnostics; using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
@ -20,7 +21,7 @@ internal static partial class SimdUtils
public static void Shuffle4( public static void Shuffle4(
ReadOnlySpan<float> source, ReadOnlySpan<float> source,
Span<float> dest, Span<float> dest,
byte control) [ConstantExpected] byte control)
{ {
VerifyShuffle4SpanInput(source, dest); VerifyShuffle4SpanInput(source, dest);

Loading…
Cancel
Save