-
Notifications
You must be signed in to change notification settings - Fork 21
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
Use cpuid #8
Comments
Yeah, this is probably a good idea. I might rather roll our own detection, as cpuid appears to be a binding to another library, which seems like a large requirement for the simple requirement we have:
Since we are already doing inline assembly, adding another chunk shouldn't be that hard, right? (Famous last words). I'd also like to be cautious about performance, perhaps caching the result of the check (global mutable state... yuck). |
Absolutely, it should be done only once, using the |
Basic beginning in cpuid-rs. |
Cool |
An interesting question - at what level should this check be done? There are two I can think of:
Compile time has the nice benefit of producing just the code appropriate for the machine. Run time means that a single compiled program could run on multiple machines, but has at least some kind of overhead on a per-call basis. I don't actually know what the base line of support that Rust itself offers with regards to compiling and running on different architectures. |
Of course, there's always "add more feature flags" to support both options... |
Right now rustc generates a generic executable, people expect to be able to copy it to a compatibe machine and run there. When |
I think we should use cpuid to check for presence of sse4_2
The text was updated successfully, but these errors were encountered: