Skip to content

Commit 12a954f

Browse files
authored
Use UnzipEven for SearchValues<string> Teddy on Arm64 (#118110)
1 parent 2907a39 commit 12a954f

File tree

1 file changed

+3
-3
lines changed
  • src/libraries/System.Private.CoreLib/src/System/SearchValues/Strings/Helpers

1 file changed

+3
-3
lines changed

src/libraries/System.Private.CoreLib/src/System/SearchValues/Strings/Helpers/TeddyHelper.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ public static (Vector512<byte> Result, Vector512<byte> Prev0, Vector512<byte> Pr
211211
// 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.
212212
[MethodImpl(MethodImplOptions.AggressiveInlining)]
213213
[CompExactlyDependsOn(typeof(Sse2))]
214-
[CompExactlyDependsOn(typeof(AdvSimd))]
214+
[CompExactlyDependsOn(typeof(AdvSimd.Arm64))]
215215
public static Vector128<byte> LoadAndPack16AsciiChars(ref char source)
216216
{
217217
Vector128<ushort> source0 = Vector128.LoadUnsafe(ref source);
@@ -221,9 +221,9 @@ public static Vector128<byte> LoadAndPack16AsciiChars(ref char source)
221221
{
222222
return Sse2.PackUnsignedSaturate(source0.AsInt16(), source1.AsInt16());
223223
}
224-
else if (AdvSimd.IsSupported)
224+
else if (AdvSimd.Arm64.IsSupported)
225225
{
226-
return AdvSimd.ExtractNarrowingSaturateUpper(AdvSimd.ExtractNarrowingSaturateLower(source0), source1);
226+
return AdvSimd.Arm64.UnzipEven(source0.AsByte(), source1.AsByte());
227227
}
228228
else
229229
{

0 commit comments

Comments
 (0)