You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// By default , if there is an unterminated SIMD vector, it assumes that the next vector is SIMD,
436
+
// dont count the backed up bytes(in this case the "11101100 10001001 10011000")
437
+
// however in case there isnt enough bytes to fill in, a gap is created as (??????)
438
+
// A call to the adjustment vector has to be made and this is the value that holds whether this call is made or not.
439
+
// It is somewhat questionable to create one extra variable just for that but I felt that I needed to separate what worked and what was tacked on later as clearly as possible
440
+
435
441
436
442
if(pInputBuffer==null||inputLength<=0)
437
443
{
@@ -566,6 +572,7 @@ public unsafe static (int utfadjust, int scalaradjust) calculateErrorPathadjust(
566
572
intcontbytes=0;// number of continuation bytes in the block
567
573
intn4=0;// number of 4-byte sequences that start in this block
568
574
// int totalbyte = 0, n3 = 0, n2 = 0;
575
+
569
576
570
577
571
578
@@ -654,10 +661,16 @@ public unsafe static (int utfadjust, int scalaradjust) calculateErrorPathadjust(
654
661
// We have an unterminated sequence.
655
662
Console.WriteLine("---Unterminated seq--- at "+processedLength+"bytes");
Console.WriteLine("No error has been detected! Adding contbytes: "+(int)Popcnt.PopCount((uint)Avx2.MoveMask(sc))+"Adding n4: "+(int)Popcnt.PopCount((uint)Avx2.MoveMask(Avx2.SubtractSaturate(currentBlock,fourthByte))));
689
+
Console.WriteLine(" this is the accumulated contbytes"+contbytes+" and n4:"+n4);// debug
674
690
}
675
691
asciibytes+=(int)(32-Popcnt.PopCount((uint)mask));// TODO(Nick Nuon): simplify this expression
676
692
693
+
677
694
}
678
695
679
696
// important: we just update asciibytes if there was no error.
@@ -690,6 +707,7 @@ public unsafe static (int utfadjust, int scalaradjust) calculateErrorPathadjust(
0 commit comments