Skip to content

Commit a992e33

Browse files
committed
Further cleanup
1 parent 163e636 commit a992e33

File tree

1 file changed

+15
-16
lines changed

1 file changed

+15
-16
lines changed

src/UTF8.cs

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -483,22 +483,21 @@ private unsafe static (int utfadjust, int scalaradjust) calculateErrorPathadjust
483483
if (inputLength > 128)
484484
{
485485
// We skip any ASCII characters at the start of the buffer
486-
//TODO: uncomment fast path eventually, this part should be ok
487-
// int asciirun = 0;
488-
// for (; asciirun + 64 <= inputLength; asciirun += 64)
489-
// {
490-
// Vector128<byte> block1 = Avx.LoadVector128(pInputBuffer + asciirun);
491-
// Vector128<byte> block2 = Avx.LoadVector128(pInputBuffer + asciirun + 16);
492-
// Vector128<byte> block3 = Avx.LoadVector128(pInputBuffer + asciirun + 32);
493-
// Vector128<byte> block4 = Avx.LoadVector128(pInputBuffer + asciirun + 48);
494-
495-
// Vector128<byte> or = Sse2.Or(Sse2.Or(block1, block2), Sse2.Or(block3, block4));
496-
// if (Sse2.MoveMask(or) != 0)
497-
// {
498-
// break;
499-
// }
500-
// }
501-
// processedLength = asciirun;
486+
int asciirun = 0;
487+
for (; asciirun + 64 <= inputLength; asciirun += 64)
488+
{
489+
Vector128<byte> block1 = Avx.LoadVector128(pInputBuffer + asciirun);
490+
Vector128<byte> block2 = Avx.LoadVector128(pInputBuffer + asciirun + 16);
491+
Vector128<byte> block3 = Avx.LoadVector128(pInputBuffer + asciirun + 32);
492+
Vector128<byte> block4 = Avx.LoadVector128(pInputBuffer + asciirun + 48);
493+
494+
Vector128<byte> or = Sse2.Or(Sse2.Or(block1, block2), Sse2.Or(block3, block4));
495+
if (Sse2.MoveMask(or) != 0)
496+
{
497+
break;
498+
}
499+
}
500+
processedLength = asciirun;
502501

503502
if (processedLength + 16 < inputLength)
504503
{

0 commit comments

Comments
 (0)