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

cpufeatures: PCLMULQDQ does not require OSXSAVE #1129

Closed
ericlagergren opened this issue Nov 9, 2024 · 1 comment · Fixed by #1130
Closed

cpufeatures: PCLMULQDQ does not require OSXSAVE #1129

ericlagergren opened this issue Nov 9, 2024 · 1 comment · Fixed by #1130

Comments

@ericlagergren
Copy link

For example, this is fails on an M1 running under Rosetta (macOS Sequoia 15.0):

fn main() {
    cpufeatures::new!(has_pclmulqdq, "pclmulqdq");
    assert!(has_pclmulqdq::get());
}

macOS (under Rosetta) does not support OSXSAVE or AVX, so has_pclmulqdq returns false. But PCLMULQDQ does not require AVX, only SSE2 + CLMUL.

Indeed, Go does not require OSXSAVE for PCLMULQDQ

See also: golang/go#41022

@newpavlov
Copy link
Member

newpavlov commented Nov 11, 2024

PCLMULQDQ works with XMM registers and I thought that XSAVE support (with 0b10 bits) is needed for properly saving and restoring XMM registers, e.g. during context switches.

Looking at is_x86_feature_detected's source code, it looks like it does not have a similar XSAVE check for XMM registers, so I guess we can drop it as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants