From 87af6c708fe18eb0679059d9dc2fe9c2400ba6e8 Mon Sep 17 00:00:00 2001 From: Sewer 56 Date: Sat, 22 Oct 2022 00:21:28 +0100 Subject: [PATCH] Changed: Removed Unnecessary Annotations --- .../Reloaded.Memory.Sigscan.csproj | 2 +- Reloaded.Memory.Sigscan/Scanner_AVX2.cs | 7 ------- Reloaded.Memory.Sigscan/Scanner_Compiled.cs | 10 ---------- Reloaded.Memory.Sigscan/Scanner_SSE2.cs | 11 ----------- Reloaded.Memory.Sigscan/Scanner_Simple.cs | 6 ------ 5 files changed, 1 insertion(+), 35 deletions(-) diff --git a/Reloaded.Memory.Sigscan/Reloaded.Memory.Sigscan.csproj b/Reloaded.Memory.Sigscan/Reloaded.Memory.Sigscan.csproj index ebac97d..a586e0a 100644 --- a/Reloaded.Memory.Sigscan/Reloaded.Memory.Sigscan.csproj +++ b/Reloaded.Memory.Sigscan/Reloaded.Memory.Sigscan.csproj @@ -21,7 +21,7 @@ preview true - 3.1.4 + 3.1.5 true diff --git a/Reloaded.Memory.Sigscan/Scanner_AVX2.cs b/Reloaded.Memory.Sigscan/Scanner_AVX2.cs index d8a058b..219e5eb 100644 --- a/Reloaded.Memory.Sigscan/Scanner_AVX2.cs +++ b/Reloaded.Memory.Sigscan/Scanner_AVX2.cs @@ -5,11 +5,9 @@ #if SIMD_INTRINSICS using System.Runtime.Intrinsics; using System.Runtime.Intrinsics.X86; -#endif namespace Reloaded.Memory.Sigscan; -#if SIMD_INTRINSICS /// /// Modified version of: Pattern scan implementation 'LazySIMD' - by uberhalit /// https://github.com/uberhalit @@ -46,7 +44,6 @@ public unsafe partial class Scanner #if NET5_0_OR_GREATER [SkipLocalsInit] #endif - [MethodImpl(MethodImplOptions.AggressiveOptimization)] public static PatternScanResult FindPatternAvx2(byte* data, int dataLength, string pattern) { var patternData = new SimdPatternScanData(pattern); @@ -125,10 +122,6 @@ public static PatternScanResult FindPatternAvx2(byte* data, int dataLength, stri /// Generates byte-Vectors that are right-padded with 0 from a pattern. The first byte is skipped. /// /// The pattern in question. -#if NET5_0_OR_GREATER - [SkipLocalsInit] -#endif - [MethodImpl(MethodImplOptions.AggressiveOptimization)] private static Vector256[] PadPatternToVector256Avx(in SimdPatternScanData cbPattern) { int patternLen = cbPattern.Mask.Length; diff --git a/Reloaded.Memory.Sigscan/Scanner_Compiled.cs b/Reloaded.Memory.Sigscan/Scanner_Compiled.cs index 38e9651..56a8344 100644 --- a/Reloaded.Memory.Sigscan/Scanner_Compiled.cs +++ b/Reloaded.Memory.Sigscan/Scanner_Compiled.cs @@ -16,12 +16,6 @@ public unsafe partial class Scanner /// The compiled pattern to look for inside the given region. /// /// A result indicating an offset (if found) of the pattern. -#if NET5_0_OR_GREATER - [SkipLocalsInit] -#endif -#if NETCOREAPP3_0_OR_GREATER - [MethodImpl(MethodImplOptions.AggressiveOptimization)] -#endif public static PatternScanResult FindPatternCompiled(byte* data, int dataLength, CompiledScanPattern pattern) { const int numberOfUnrolls = 8; @@ -123,10 +117,6 @@ as opposing to having to dereference a pointer and then take an offset from the } } -#if NET5_0_OR_GREATER - [SkipLocalsInit] - [MethodImpl(MethodImplOptions.AggressiveOptimization)] -#endif private static bool TestRemainingMasks(int numberOfInstructions, byte* currentDataPointer, GenericInstruction* instructions) { /* When NumberOfInstructions > 1 */ diff --git a/Reloaded.Memory.Sigscan/Scanner_SSE2.cs b/Reloaded.Memory.Sigscan/Scanner_SSE2.cs index 8330afe..d915484 100644 --- a/Reloaded.Memory.Sigscan/Scanner_SSE2.cs +++ b/Reloaded.Memory.Sigscan/Scanner_SSE2.cs @@ -6,11 +6,9 @@ #if SIMD_INTRINSICS using System.Runtime.Intrinsics; using System.Runtime.Intrinsics.X86; -#endif namespace Reloaded.Memory.Sigscan; -#if SIMD_INTRINSICS /// /// Modified version of: Pattern scan implementation 'LazySIMD' - by uberhalit /// https://github.com/uberhalit @@ -44,9 +42,6 @@ public unsafe partial class Scanner /// Key: ?? represents a byte that should be ignored, anything else if a hex byte. i.e. 11 represents 0x11, 1F represents 0x1F /// /// -1 if pattern is not found. -#if NET5_0_OR_GREATER - [SkipLocalsInit] -#endif [MethodImpl(MethodImplOptions.AggressiveOptimization)] public static PatternScanResult FindPatternSse2(byte* data, int dataLength, string pattern) { @@ -126,9 +121,6 @@ public static PatternScanResult FindPatternSse2(byte* data, int dataLength, stri /// the first match is skipped and all indexes are shifted to the left by 1. /// /// Data of the pattern to be scanned. -#if NET5_0_OR_GREATER - [SkipLocalsInit] -#endif [MethodImpl(MethodImplOptions.AggressiveOptimization)] private static Span BuildMatchIndexes(in SimdPatternScanData scanPattern) { @@ -153,9 +145,6 @@ private static Span BuildMatchIndexes(in SimdPatternScanData scanPattern /// Generates byte-Vectors that are right-padded with 0 from a pattern. The first byte is skipped. /// /// The pattern in question. -#if NET5_0_OR_GREATER - [SkipLocalsInit] -#endif [MethodImpl(MethodImplOptions.AggressiveOptimization)] private static Vector128[] PadPatternToVector128Sse(in SimdPatternScanData cbPattern) { diff --git a/Reloaded.Memory.Sigscan/Scanner_Simple.cs b/Reloaded.Memory.Sigscan/Scanner_Simple.cs index 5524a60..0545b03 100644 --- a/Reloaded.Memory.Sigscan/Scanner_Simple.cs +++ b/Reloaded.Memory.Sigscan/Scanner_Simple.cs @@ -19,12 +19,6 @@ public unsafe partial class Scanner /// Key: ?? represents a byte that should be ignored, anything else if a hex byte. i.e. 11 represents 0x11, 1F represents 0x1F /// /// A result indicating an offset (if found) of the pattern. -#if NET5_0_OR_GREATER - [SkipLocalsInit] -#endif -#if NETCOREAPP3_0_OR_GREATER - [MethodImpl(MethodImplOptions.AggressiveOptimization)] -#endif public static PatternScanResult FindPatternSimple(byte* data, int dataLength, SimplePatternScanData pattern) { var patternData = pattern.Bytes;