Currently building for a non-conventional x86 target fails with:
Compiling raw-cpuid v10.2.0
error[E0433]: failed to resolve: could not find `arch` in `self`
--> ~/.cargo/registry/src/github.com-1ecc6299db9ec823/raw-cpuid-10.2.0/src/lib.rs:80:37
|
80 | let result = unsafe { self::arch::__cpuid_count(a, c) };
| ^^^^ could not find `arch` in `self`
This is because the target has no SSE, and therefore it has no native cpuid according to this create.
This PR only enables ::native_cpuid and the functions that depend on it, when the target has support for it.
Targets that by this create are considered to not have native cpuid, can still provide there own function via CpuId::with_cpuid_fn().
If core::arch::x86::has_cpuid() stabilizes, it could be used to detect cpuid support at runtime to better cover supported target.
With these changes I was able to output the following 😁
Hello world from GenuineIntel Intel (R) Quark (TM) D1100 CPU @ 32MHz
Currently building for a non-conventional x86 target fails with:
This is because the target has no SSE, and therefore it has no native cpuid according to this create.
This PR only enables ::native_cpuid and the functions that depend on it, when the target has support for it.
Targets that by this create are considered to not have native cpuid, can still provide there own function via
CpuId::with_cpuid_fn()
.If
core::arch::x86::has_cpuid()
stabilizes, it could be used to detect cpuid support at runtime to better cover supported target.With these changes I was able to output the following 😁
Hello world from GenuineIntel Intel (R) Quark (TM) D1100 CPU @ 32MHz