Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arm64: Add SVE feature detection for Windows #100937

Merged
merged 2 commits into from
Apr 12, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/native/minipal/cpufeatures.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ static uint32_t xmmYmmStateSupport()
#define XSTATE_MASK_AVX512 (0xE0) /* 0b1110_0000 */
#endif // XSTATE_MASK_AVX512

#ifndef PF_ARM_SVE_INSTRUCTIONS_AVAILABLE
#define PF_ARM_SVE_INSTRUCTIONS_AVAILABLE (46)
#endif

static uint32_t avx512StateSupport()
{
#if defined(HOST_APPLE)
Expand Down Expand Up @@ -458,6 +462,11 @@ int minipal_getcpufeatures(void)

// TODO: IsProcessorFeaturePresent doesn't support LRCPC2 yet.

if (IsProcessorFeaturePresent(PF_ARM_SVE_INSTRUCTIONS_AVAILABLE))
{
result |= ARM64IntrinsicConstants_Sve;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this give us parity between Linux/Windows at this point or are there others that are still missing on Windows that Linux currently handles?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ARM64IntrinsicConstants_Rcpc2 and ARM64IntrinsicConstants_Rdm are still missing and I didn't see their equivalent yet on windows side.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LRCPC2 is supported since Windows 11 22H2.

I don't see an entry of LRCPC2 in that. It just has LRCPC that is mapped to 45.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's not LRCPC2. Not a big deal though, it's just a minor optimization on top of RCPC1

}

#endif // HOST_WINDOWS

#endif // HOST_ARM64
Expand Down
Loading