diff --git a/src/libraries/System.Private.CoreLib/src/System/Numerics/BitOperations.cs b/src/libraries/System.Private.CoreLib/src/System/Numerics/BitOperations.cs index fe457200e960d3..0847f377e0c98e 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Numerics/BitOperations.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Numerics/BitOperations.cs @@ -254,7 +254,7 @@ public static int PopCount(uint value) // Hence use Vector64.Create(ulong) to create Vector64 and operate on that. Vector64 input = Vector64.Create((ulong)value); Vector64 aggregated = AdvSimd.Arm64.AddAcross(AdvSimd.PopCount(input.AsByte())); - return AdvSimd.Extract(aggregated, 0); + return aggregated.ToScalar(); } return SoftwareFallback(value); @@ -293,7 +293,7 @@ public static int PopCount(ulong value) // PopCount works on vector so convert input value to vector first. Vector64 input = Vector64.Create(value); Vector64 aggregated = AdvSimd.Arm64.AddAcross(AdvSimd.PopCount(input.AsByte())); - return AdvSimd.Extract(aggregated, 0); + return aggregated.ToScalar(); } #if TARGET_32BIT diff --git a/src/libraries/System.Utf8String.Experimental/src/System/Runtime/Intrinsics/Intrinsics.Shims.cs b/src/libraries/System.Utf8String.Experimental/src/System/Runtime/Intrinsics/Intrinsics.Shims.cs index e1654081c77662..38e129a08022ca 100644 --- a/src/libraries/System.Utf8String.Experimental/src/System/Runtime/Intrinsics/Intrinsics.Shims.cs +++ b/src/libraries/System.Utf8String.Experimental/src/System/Runtime/Intrinsics/Intrinsics.Shims.cs @@ -25,6 +25,7 @@ internal static class Vector128 public static Vector128 AsUInt32(this Vector128 vector) where T : struct => throw new PlatformNotSupportedException(); public static Vector128 AsUInt64(this Vector128 vector) where T : struct => throw new PlatformNotSupportedException(); public static T GetElement(this Vector128 vector, int index) where T : struct => throw new PlatformNotSupportedException(); + public static T ToScalar(this Vector64 vector) where T : struct => throw new PlatformNotSupportedException(); } internal readonly struct Vector128 where T : struct @@ -147,7 +148,6 @@ internal abstract class AdvSimd : ArmBase { public static Vector64 AddAcross(Vector64 value) => throw new PlatformNotSupportedException(); } - public static byte Extract(Vector64 vector, byte index) => throw new PlatformNotSupportedException(); public static Vector64 PopCount(Vector64 value) => throw new PlatformNotSupportedException(); } }