Skip to content

Commit d8811c1

Browse files
Added comment describing vectorization.
1 parent 7dac297 commit d8811c1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/ICSharpCode.SharpZipLib/BZip2/BZip2InputStream.cs

+5
Original file line numberDiff line numberDiff line change
@@ -718,6 +718,11 @@ cache misses.
718718
var j = nextSym - 1;
719719

720720
#if !NETSTANDARD2_0 && !NETFRAMEWORK
721+
// This is vectorized memory move. Going from the back, we're taking chunks of array
722+
// and write them at the new location shifted by one. Since chunks are VectorSize long,
723+
// at the end we have to move "tail" (or head actually) of the array using a plain loop.
724+
// If System.Numerics.Vector API is not available, the plain loop is used to do the whole copying.
725+
721726
while(j >= VectorSize)
722727
{
723728
var arrayPart = new System.Numerics.Vector<byte>(yy, j - VectorSize);

0 commit comments

Comments
 (0)