Skip to content

Commit

Permalink
Added comment describing vectorization.
Browse files Browse the repository at this point in the history
  • Loading branch information
konrad-kruczynski committed Apr 30, 2021
1 parent 7dac297 commit d8811c1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/ICSharpCode.SharpZipLib/BZip2/BZip2InputStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,11 @@ cache misses.
var j = nextSym - 1;

#if !NETSTANDARD2_0 && !NETFRAMEWORK
// 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.
// If System.Numerics.Vector API is not available, the plain loop is used to do the whole copying.

while(j >= VectorSize)
{
var arrayPart = new System.Numerics.Vector<byte>(yy, j - VectorSize);
Expand Down

0 comments on commit d8811c1

Please # to comment.