The representation of hardware capabilities is less than ideal because adding a new one requires changes in several places: - in libvex_s390x_common.h - add a new S390_FAC_xyzzy - in libvex.h - add VEX_HWCAPS_S390X_xyzzy - update VEX_HWCAPS_S390X_ALL - in host_s390_defs.h - add macro s390_host_has_xyzzy - in libvex_emnote.h - add EmFail_S390X_xyzzy - in main_main.c - update LibVEX_EmNote_string - update function show_hwcaps_s390x - in m_machine.c - update fac_hwcaps table in function VG_(machine_get_hwcaps) - in extension-s390x.c - maybe update accepted_facility[] in function do_extension_STFLE Not surprisingly, occasionally something gets forgotten. This patch brings everything in synch and adds 2 new capabilities for the vector enhancements-facility 2 and vector packed-decimal facility. Those are not used yet but will be shortly. Regarding S390_FAC_xxxx I've trimmed that list to those entries that are actually used in m_machine.c But I am wondering whether that list is needed at all... Those constants are only used in m_machine.c and could be used in extension-s390x.c where they are currently hardcoded. However, given that the facility bit numbers are not going to change in the future we could as well hardcode them in m_machine.c as well.
Created attachment 176295 [details] patch for hwcaps / EmFail synch
(In reply to Florian Krohm from comment #0) > The representation of hardware capabilities is less than ideal > because adding a new one requires changes in several places: [...] > Not surprisingly, occasionally something gets forgotten. Yes. tests/s390x-features.c would be another place to touch up.
Created attachment 177161 [details] Remove facility bit macros As discussed: remove the facility-bit macros S390_FAC_... They are guaranteed to never change and are used only in m_machine.c
Created attachment 177162 [details] new hardware caps for vector insn and some fixes This patch adds: - forgotten s390_host_has_mi2 macro - handling EmFail_S390X_ppno - handling EmFail_S390X_vxe - "nnpa" to show_hwcaps_s390x - EmFail machinery for "dflt" and "nnpa" hardware capabilities - new hardware capabilities: "vxe2", "vxd", "msa", "msa4", "msa8", "msa9" need for vector insns
Fixed in 744e47c8ff5bd9a7908b63b9d053b32bac18d686