File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
src/ICSharpCode.SharpZipLib/BZip2 Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change
1
+ #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
2
+ #define VECTORIZE_MEMORY_MOVE
3
+ #endif
4
+
1
5
using ICSharpCode . SharpZipLib . Checksum ;
2
6
using System ;
3
7
using System . IO ;
@@ -19,9 +23,9 @@ public class BZip2InputStream : Stream
19
23
private const int NO_RAND_PART_B_STATE = 6 ;
20
24
private const int NO_RAND_PART_C_STATE = 7 ;
21
25
22
- #if NETSTANDARD2_1
26
+ #if VECTORIZE_MEMORY_MOVE
23
27
private static readonly int VectorSize = System . Numerics . Vector < byte > . Count ;
24
- #endif
28
+ #endif // VECTORIZE_MEMORY_MOVE
25
29
26
30
#endregion Constants
27
31
@@ -717,7 +721,7 @@ cache misses.
717
721
718
722
var j = nextSym - 1 ;
719
723
720
- #if ! NETSTANDARD2_0 && ! NETFRAMEWORK
724
+ #if VECTORIZE_MEMORY_MOVE
721
725
// This is vectorized memory move. Going from the back, we're taking chunks of array
722
726
// and write them at the new location shifted by one. Since chunks are VectorSize long,
723
727
// at the end we have to move "tail" (or head actually) of the array using a plain loop.
@@ -729,7 +733,7 @@ cache misses.
729
733
arrayPart . CopyTo ( yy , j - VectorSize + 1 ) ;
730
734
j -= VectorSize ;
731
735
}
732
- #endif
736
+ #endif // VECTORIZE_MEMORY_MOVE
733
737
734
738
while ( j > 0 )
735
739
{
You can’t perform that action at this time.
0 commit comments