Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed mismatched framework directives for vectorized memory move #635

Merged
merged 4 commits into from
Aug 12, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/ICSharpCode.SharpZipLib/BZip2/BZip2InputStream.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#if !NETSTANDARD2_0 && !NETFRAMEWORK
modio-jackson marked this conversation as resolved.
Show resolved Hide resolved
#define VECTORIZE_MEMORY_MOVE
#endif // !NETSTANDARD2_0 && !NETFRAMEWORK

using ICSharpCode.SharpZipLib.Checksum;
using System;
using System.IO;
Expand All @@ -19,7 +23,7 @@ public class BZip2InputStream : Stream
private const int NO_RAND_PART_B_STATE = 6;
private const int NO_RAND_PART_C_STATE = 7;

#if NETSTANDARD2_1
#if VECTORIZE_MEMORY_MOVE
private static readonly int VectorSize = System.Numerics.Vector<byte>.Count;
#endif

Expand Down Expand Up @@ -717,7 +721,7 @@ cache misses.

var j = nextSym - 1;

#if !NETSTANDARD2_0 && !NETFRAMEWORK
#if VECTORIZE_MEMORY_MOVE
// This is vectorized memory move. Going from the back, we're taking chunks of array
// and write them at the new location shifted by one. Since chunks are VectorSize long,
// at the end we have to move "tail" (or head actually) of the array using a plain loop.
Expand Down