You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are a number of places where rust handles architecture-specific features, in particular:
the target_feature attribute to enable/disable features when compiling parts of the code base
the target_feature conditional compilation option to check for the presence of a feature at compile time
the is_arch_feature_detected! macro to check for the presence of a feature at run time
All of this seems to be missing for s390x at the moment.
The LLVM back-end does support fine-grained selection of features as defined by the architecture (Principles of Operation). There is also support for run-time detection on Linux via the HWCAP mechanism and/or the /proc/cpuinfo file, however this is somewhat less fine-grained and uses slightly different naming conventions, so there may have to be some selection / name mapping here.
This is the current list of HWCAP values and the associated string in the features line in /proc/cpuinfo. Where applicable, I've also listed the corresponding LLVM feature name and architecture level where it was introduced. Some HWCAP values have no feature name, either because they're assumed to always present (LLVM doesn't support any architecture earlier than arch8), or because they refer to HW features without ISA impact.
As an alternative to using HWCAP, it would also be possible to detect the fine-grained facilities available in the hardware. This could be done either by parsing the facilities line in /proc/cpuinfo, or else by using the STORE FACILITY LIST EXTENDED instruction. The advantage would be that the HW facilities match 1:1 to the LLVM features. The disadvantage is that certain facilities (e.g. "transactional-execution" or "vector") require OS support in addition to HW support, e.g. to swap extended register sets during context switch. This is correctly handled by checking the HWCAP feature list, but will be missed by just checking for the HW facilities.
The text was updated successfully, but these errors were encountered:
There are a number of places where rust handles architecture-specific features, in particular:
target_feature
attribute to enable/disable features when compiling parts of the code basetarget_feature
conditional compilation option to check for the presence of a feature at compile timeis_
arch_feature_detected!
macro to check for the presence of a feature at run timeAll of this seems to be missing for s390x at the moment.
The LLVM back-end does support fine-grained selection of features as defined by the architecture (Principles of Operation). There is also support for run-time detection on Linux via the HWCAP mechanism and/or the
/proc/cpuinfo
file, however this is somewhat less fine-grained and uses slightly different naming conventions, so there may have to be some selection / name mapping here.This is the current list of HWCAP values and the associated string in the
features
line in/proc/cpuinfo
. Where applicable, I've also listed the corresponding LLVM feature name and architecture level where it was introduced. Some HWCAP values have no feature name, either because they're assumed to always present (LLVM doesn't support any architecture earlier than arch8), or because they refer to HW features without ISA impact.As an alternative to using HWCAP, it would also be possible to detect the fine-grained facilities available in the hardware. This could be done either by parsing the
facilities
line in/proc/cpuinfo
, or else by using the STORE FACILITY LIST EXTENDED instruction. The advantage would be that the HW facilities match 1:1 to the LLVM features. The disadvantage is that certain facilities (e.g. "transactional-execution" or "vector") require OS support in addition to HW support, e.g. to swap extended register sets during context switch. This is correctly handled by checking the HWCAP feature list, but will be missed by just checking for the HW facilities.The text was updated successfully, but these errors were encountered: