Skip to content

Commit 3417111

Browse files
author
Ubuntu
committed
Optimizing for neoverse
1 parent ff40b25 commit 3417111

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/UTF8.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1362,8 +1362,9 @@ private unsafe static (int utfadjust, int scalaradjust) calculateErrorPathadjust
13621362
{
13631363

13641364
Vector128<byte> currentBlock = AdvSimd.LoadVector128(pInputBuffer + processedLength);
1365-
1366-
if (AdvSimd.Arm64.MaxAcross(currentBlock).ToScalar() <= 127)
1365+
if (AdvSimd.Arm64.MaxAcross(Vector128.AsUInt32(AdvSimd.And(currentBlock, v80))).ToScalar() == 0)
1366+
// We could it with (AdvSimd.Arm64.MaxAcross(currentBlock).ToScalar() <= 127) but it is slower on some
1367+
// hardware.
13671368
{
13681369
// We have an ASCII block, no need to process it, but
13691370
// we need to check if the previous block was incomplete.

0 commit comments

Comments
 (0)