Skip to content

GetIndexOfFirstNonAsciiByte_Vector path in Ascii.Utility.cs is never exercised for AdvSimd/SSE4.1 #89924

@neon-sunset

Description

@neon-sunset

Description

It appears that GetIndexOfFirstNonAsciiByte in https://github.com/dotnet/runtime/blob/main/src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs#L104 does not exercise the GetIndexOfFirstNonAsciiByte_Vector path despite it having explicit support for AdvSimd and SSE4.1.

Is this intended? Should SSE4.1 and AdvSimd targets be allowed to take _Vector instead?

Regression?

No

Data

Preliminary benchmark shows that on osx-arm64 apple-m1 the time to traverse 1_000_000 bytes is 28.71us with current _Intrinsified path and is improved by ~40% to 20.12us if we relax the check and allow calling GetIndexOfFirstNonAsciiByte_Vector for Vector128.IsHardwareAccelerated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions