From 2e8f7ddee2eb9dde59fdcf32263cb9399a87e878 Mon Sep 17 00:00:00 2001 From: Daniel Lemire Date: Thu, 15 Aug 2024 01:11:39 -0400 Subject: [PATCH] some minor fixes --- src/UTF8.cs | 2 +- test/UTF8ValidationTests.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/UTF8.cs b/src/UTF8.cs index 4412f17..72abebd 100644 --- a/src/UTF8.cs +++ b/src/UTF8.cs @@ -1405,7 +1405,7 @@ private unsafe static (int utfadjust, int scalaradjust) calculateErrorPathadjust if (processedLength + localasciirun + 16 <= inputLength) { Vector128 block = AdvSimd.LoadVector128(pInputBuffer + processedLength + localasciirun); - if (AdvSimd.Arm64.MaxAcross(Vector128.AsUInt32(AdvSimd.And(block, v80))).ToScalar() == 0) + if ((block & v80) == Vector128.Zero) { localasciirun += 16; for (; processedLength + localasciirun + 64 <= inputLength; localasciirun += 64) diff --git a/test/UTF8ValidationTests.cs b/test/UTF8ValidationTests.cs index 9b21e5f..6951c85 100644 --- a/test/UTF8ValidationTests.cs +++ b/test/UTF8ValidationTests.cs @@ -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. }