Skip to content

Commit

Permalink
some minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
lemire committed Aug 15, 2024
1 parent 1975928 commit 2e8f7dd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/UTF8.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1405,7 +1405,7 @@ private unsafe static (int utfadjust, int scalaradjust) calculateErrorPathadjust
if (processedLength + localasciirun + 16 <= inputLength)
{
Vector128<byte> block = AdvSimd.LoadVector128(pInputBuffer + processedLength + localasciirun);
if (AdvSimd.Arm64.MaxAcross(Vector128.AsUInt32(AdvSimd.And(block, v80))).ToScalar() == 0)
if ((block & v80) == Vector128<byte>.Zero)
{
localasciirun += 16;
for (; processedLength + localasciirun + 64 <= inputLength; localasciirun += 64)
Expand Down
4 changes: 2 additions & 2 deletions test/UTF8ValidationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ private static bool IsSystemSupported(TestSystemRequirements requiredSystems)
case Architecture.Arm64:
return requiredSystems.HasFlag(TestSystemRequirements.Arm64);
case Architecture.X64:
return (requiredSystems.HasFlag(TestSystemRequirements.X64Avx512) && Vector512.IsHardwareAccelerated && System.Runtime.Intrinsics.X86.Avx512F.IsSupported) ||
return (requiredSystems.HasFlag(TestSystemRequirements.X64Avx512) && Vector512.IsHardwareAccelerated && System.Runtime.Intrinsics.X86.Avx512Vbmi.IsSupported) ||
(requiredSystems.HasFlag(TestSystemRequirements.X64Avx2) && System.Runtime.Intrinsics.X86.Avx2.IsSupported) ||
(requiredSystems.HasFlag(TestSystemRequirements.X64Sse) && System.Runtime.Intrinsics.X86.Sse.IsSupported);
(requiredSystems.HasFlag(TestSystemRequirements.X64Sse) && System.Runtime.Intrinsics.X86.Ssse3.IsSupported);
default:
return false; // If architecture is not covered above, the test is not supported.
}
Expand Down

0 comments on commit 2e8f7dd

Please sign in to comment.