Skip to content

Commit

Permalink
Changed: Removed Unnecessary Annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
Sewer56 committed Oct 21, 2022
1 parent 0a605da commit 87af6c7
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 35 deletions.
2 changes: 1 addition & 1 deletion Reloaded.Memory.Sigscan/Reloaded.Memory.Sigscan.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<LangVersion>preview</LangVersion>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Version>3.1.4</Version>
<Version>3.1.5</Version>
<IsTrimmable>true</IsTrimmable>
</PropertyGroup>

Expand Down
7 changes: 0 additions & 7 deletions Reloaded.Memory.Sigscan/Scanner_AVX2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@
#if SIMD_INTRINSICS
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.X86;
#endif

namespace Reloaded.Memory.Sigscan;

#if SIMD_INTRINSICS
/// <summary>
/// Modified version of: Pattern scan implementation 'LazySIMD' - by uberhalit
/// https://github.com/uberhalit
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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.
/// </summary>
/// <param name="cbPattern">The pattern in question.</param>
#if NET5_0_OR_GREATER
[SkipLocalsInit]
#endif
[MethodImpl(MethodImplOptions.AggressiveOptimization)]
private static Vector256<byte>[] PadPatternToVector256Avx(in SimdPatternScanData cbPattern)
{
int patternLen = cbPattern.Mask.Length;
Expand Down
10 changes: 0 additions & 10 deletions Reloaded.Memory.Sigscan/Scanner_Compiled.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@ public unsafe partial class Scanner
/// The compiled pattern to look for inside the given region.
/// </param>
/// <returns>A result indicating an offset (if found) of the pattern.</returns>
#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;
Expand Down Expand Up @@ -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 */
Expand Down
11 changes: 0 additions & 11 deletions Reloaded.Memory.Sigscan/Scanner_SSE2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@
#if SIMD_INTRINSICS
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.X86;
#endif

namespace Reloaded.Memory.Sigscan;

#if SIMD_INTRINSICS
/// <summary>
/// Modified version of: Pattern scan implementation 'LazySIMD' - by uberhalit
/// https://github.com/uberhalit
Expand Down Expand Up @@ -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
/// </param>
/// <returns>-1 if pattern is not found.</returns>
#if NET5_0_OR_GREATER
[SkipLocalsInit]
#endif
[MethodImpl(MethodImplOptions.AggressiveOptimization)]
public static PatternScanResult FindPatternSse2(byte* data, int dataLength, string pattern)
{
Expand Down Expand Up @@ -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.
/// </summary>
/// <param name="scanPattern">Data of the pattern to be scanned.</param>
#if NET5_0_OR_GREATER
[SkipLocalsInit]
#endif
[MethodImpl(MethodImplOptions.AggressiveOptimization)]
private static Span<ushort> BuildMatchIndexes(in SimdPatternScanData scanPattern)
{
Expand All @@ -153,9 +145,6 @@ private static Span<ushort> BuildMatchIndexes(in SimdPatternScanData scanPattern
/// Generates byte-Vectors that are right-padded with 0 from a pattern. The first byte is skipped.
/// </summary>
/// <param name="cbPattern">The pattern in question.</param>
#if NET5_0_OR_GREATER
[SkipLocalsInit]
#endif
[MethodImpl(MethodImplOptions.AggressiveOptimization)]
private static Vector128<byte>[] PadPatternToVector128Sse(in SimdPatternScanData cbPattern)
{
Expand Down
6 changes: 0 additions & 6 deletions Reloaded.Memory.Sigscan/Scanner_Simple.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
/// </param>
/// <returns>A result indicating an offset (if found) of the pattern.</returns>
#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;
Expand Down

0 comments on commit 87af6c7

Please sign in to comment.