cpufeatures: add compile time fallback for unsupported targets and target features#1205
cpufeatures: add compile time fallback for unsupported targets and target features#1205
Conversation
|
@heiher Additionally, For example, there are no mentions of the I think we should change the module to follow |
|
@newpavlov You're right. The LoongArch target features in cpufeatures are indeed different from those used by rustc. In cpufeatures, they come from the Linux kernel's HWCAP set, but those don't map one-to-one with LLVM's compiler features. That's the root cause of the discrepancy. I agree we should align with std, and I'll update them accordingly. EDIT: |
|
Why did you close this PR? |
|
Mistake, my bad |
The changes simplify the code a bit and add a
cfg-based fallback for all targets. This allows users to use the crate even if runtime detection was not implemented for a given target or target feature combination.It ties the list of target features supported by the crate to
std. This should not be a concern since we generally use target feature names defined bystd.TODO: Update docs and check list of supported target features in
__can_detectmacros.