-
Notifications
You must be signed in to change notification settings - Fork 275
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
Optimize has_cpuid for x86 targets with know support #497
Comments
I'm not sure mmx is the correct feature to check for. One can compile for, for example, {
"llvm-target": "i686-unknown-none",
"features": "-mmx"
...
} But its presence is certainly sufficient. If I'm reading this correctly (and I'm just poking around for the first time now), there are a whole bunch of features that are available. I'm not sure which features are exposed, but perhaps one could check for the presence of at least one of a set of them that imply |
I'd prefer to keep this simple, this is all best effort anyways. IIRC Rust's i586 targets have sse enabled, and i686 targets have sse2 enabled. So if we just detect sse at compile-time for the x86 arch that gets us 99% there for most supported targets. For all others... unless the user is calling If We should strongly encourage |
So i've just sent a PR that just tests for SSE and returns true if that's enabled at compile-time. Should just work for all i586 rust targets and upwards, but for non Rust targets we can probably do better. I am leaving this open and changing difficulty to hard because PRs that improve on this are welcomed, but getting it "really right" isn't trivial. |
I'm closing this, improving this further is not worth tracking IMO, but if somebody sends PR I'll accept them. |
For example, we could check if the
x86
target hasmmx
support and returntrue
unconditionally if that's the case.The text was updated successfully, but these errors were encountered: