From 15bde26e12931df53c6a615135cfac75c8764b9d Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Tue, 29 Jul 2025 17:54:05 +0100 Subject: [PATCH 1/2] Fix documentation for `LoadAndPack*` methods in `TeddyHelper` * Fix mistaken references to `Vector512` (copy-paste error) * Update to use XML doc comments --- .../Strings/Helpers/TeddyHelper.cs | 24 ++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/src/libraries/System.Private.CoreLib/src/System/SearchValues/Strings/Helpers/TeddyHelper.cs b/src/libraries/System.Private.CoreLib/src/System/SearchValues/Strings/Helpers/TeddyHelper.cs index b73302a287eece..91c9073bfa4147 100644 --- a/src/libraries/System.Private.CoreLib/src/System/SearchValues/Strings/Helpers/TeddyHelper.cs +++ b/src/libraries/System.Private.CoreLib/src/System/SearchValues/Strings/Helpers/TeddyHelper.cs @@ -207,8 +207,12 @@ public static (Vector512 Result, Vector512 Prev0, Vector512 Pr return (result, match0, match1); } - // Read two Vector512 and concatenate their lower bytes together into a single Vector512. - // On X86, characters above 32767 are turned into 0, but we account for that by not using Teddy if any of the string values contain a 0. + /// + /// Read two and concatenate their lower bytes together into a single . + /// + /// + /// On X86, characters above 32767 are turned into 0, but we account for that by not using Teddy if any of the string values contain a 0. + /// [MethodImpl(MethodImplOptions.AggressiveInlining)] [CompExactlyDependsOn(typeof(Sse2))] [CompExactlyDependsOn(typeof(AdvSimd))] @@ -233,8 +237,12 @@ public static Vector128 LoadAndPack16AsciiChars(ref char source) } } - // Read two Vector512 and concatenate their lower bytes together into a single Vector512. - // Characters above 32767 are turned into 0, but we account for that by not using Teddy if any of the string values contain a 0. + /// + /// Read two and concatenate their lower bytes together into a single . + /// + /// + /// On X86, characters above 32767 are turned into 0, but we account for that by not using Teddy if any of the string values contain a 0. + /// [MethodImpl(MethodImplOptions.AggressiveInlining)] [CompExactlyDependsOn(typeof(Avx2))] public static Vector256 LoadAndPack32AsciiChars(ref char source) @@ -247,8 +255,12 @@ public static Vector256 LoadAndPack32AsciiChars(ref char source) return PackedSpanHelpers.FixUpPackedVector256Result(packed); } - // Read two Vector512 and concatenate their lower bytes together into a single Vector512. - // Characters above 32767 are turned into 0, but we account for that by not using Teddy if any of the string values contain a 0. + /// + /// Read two and concatenate their lower bytes together into a single . + /// + /// + /// On X86, characters above 32767 are turned into 0, but we account for that by not using Teddy if any of the string values contain a 0. + /// [MethodImpl(MethodImplOptions.AggressiveInlining)] [CompExactlyDependsOn(typeof(Avx512BW))] public static Vector512 LoadAndPack64AsciiChars(ref char source) From 1b5cf3b84de8f0d1b4627fbea3c37d31b445e554 Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Tue, 29 Jul 2025 19:37:45 +0100 Subject: [PATCH 2/2] Fix error CS1584 --- .../src/System/SearchValues/Strings/Helpers/TeddyHelper.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libraries/System.Private.CoreLib/src/System/SearchValues/Strings/Helpers/TeddyHelper.cs b/src/libraries/System.Private.CoreLib/src/System/SearchValues/Strings/Helpers/TeddyHelper.cs index 91c9073bfa4147..294da0a047f372 100644 --- a/src/libraries/System.Private.CoreLib/src/System/SearchValues/Strings/Helpers/TeddyHelper.cs +++ b/src/libraries/System.Private.CoreLib/src/System/SearchValues/Strings/Helpers/TeddyHelper.cs @@ -208,7 +208,7 @@ public static (Vector512 Result, Vector512 Prev0, Vector512 Pr } /// - /// Read two and concatenate their lower bytes together into a single . + /// Read two and concatenate their lower bytes together into a single . /// /// /// On X86, characters above 32767 are turned into 0, but we account for that by not using Teddy if any of the string values contain a 0. @@ -238,7 +238,7 @@ public static Vector128 LoadAndPack16AsciiChars(ref char source) } /// - /// Read two and concatenate their lower bytes together into a single . + /// Read two and concatenate their lower bytes together into a single . /// /// /// On X86, characters above 32767 are turned into 0, but we account for that by not using Teddy if any of the string values contain a 0. @@ -256,7 +256,7 @@ public static Vector256 LoadAndPack32AsciiChars(ref char source) } /// - /// Read two and concatenate their lower bytes together into a single . + /// Read two and concatenate their lower bytes together into a single . /// /// /// On X86, characters above 32767 are turned into 0, but we account for that by not using Teddy if any of the string values contain a 0.