From: Florian Krohm Date: Tue, 25 Nov 2025 13:50:37 +0000 (+0000) Subject: s390: PFPO facility related cleanups (BZ 509562) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5e0aa0cefa62fe3a9f712befb21e50650b9b3dea;p=thirdparty%2Fvalgrind.git s390: PFPO facility related cleanups (BZ 509562) The PFPO facility is always present on the supported machines. - Remove VEX_HWCAPS_S390X_PFPO, s390_host_has_pfpo and EmFail_S390X_pfpo - Update tests/s390x_features.c and none/tests/s390x/pfpo - Update memcheck/tests/vbit-test Part of fixing https://bugs.kde.org/show_bug.cgi?id=509562 --- diff --git a/VEX/priv/guest_s390_toIR.c b/VEX/priv/guest_s390_toIR.c index b01849cb6..8f42c844d 100644 --- a/VEX/priv/guest_s390_toIR.c +++ b/VEX/priv/guest_s390_toIR.c @@ -9530,11 +9530,6 @@ s390_call_pfpo_helper(IRExpr *gr0) static const HChar * s390_irgen_PFPO(void) { - if (! s390_host_has_pfpo) { - emulation_failure(EmFail_S390X_pfpo); - return "pfpo"; - } - IRTemp gr0 = newTemp(Ity_I32); /* word 1 [32:63] of GR 0 */ IRTemp test_bit = newTemp(Ity_I32); /* bit 32 of GR 0 - test validity */ IRTemp fn = newTemp(Ity_I32); /* [33:55] of GR 0 - function code */ diff --git a/VEX/priv/host_s390_defs.c b/VEX/priv/host_s390_defs.c index 948219342..96c566823 100644 --- a/VEX/priv/host_s390_defs.c +++ b/VEX/priv/host_s390_defs.c @@ -4838,7 +4838,6 @@ emit_E(UChar *p, UInt op) static UChar * s390_emit_PFPO(UChar *p) { - vassert(s390_host_has_pfpo); if (UNLIKELY(vex_traceflags & VEX_TRACE_ASM)) { S390_DISASM(MNM("pfpo")); } diff --git a/VEX/priv/host_s390_defs.h b/VEX/priv/host_s390_defs.h index b660b7077..f089eac9a 100644 --- a/VEX/priv/host_s390_defs.h +++ b/VEX/priv/host_s390_defs.h @@ -918,8 +918,6 @@ VexInvalRange patchProfInc_S390(VexEndness endness_host, extern UInt s390_host_hwcaps; /* Convenience macros to test installed facilities */ -#define s390_host_has_pfpo \ - (s390_host_hwcaps & (VEX_HWCAPS_S390X_PFPO)) #define s390_host_has_vx \ (s390_host_hwcaps & (VEX_HWCAPS_S390X_VX)) #define s390_host_has_msa5 \ diff --git a/VEX/priv/main_main.c b/VEX/priv/main_main.c index 9783d0e31..32a78190a 100644 --- a/VEX/priv/main_main.c +++ b/VEX/priv/main_main.c @@ -1544,8 +1544,6 @@ const HChar* LibVEX_EmNote_string ( VexEmNote ew ) return "Encountered an insn with the IEEE-invalid-operation-exception\n" " control (XiC) bit set to 1. This is not supported. Continuing anyway.\n" " IEEE-invalid-operation exceptions will not be suppressed."; - case EmFail_S390X_pfpo: - return "Instruction pfpo is not supported on this host"; case EmFail_S390X_invalid_PFPO_rounding_mode: return "The rounding mode in GPR 0 for the PFPO instruction" " is invalid"; @@ -1902,7 +1900,6 @@ static const HChar* show_hwcaps_s390x ( UInt hwcaps ) UInt hwcaps_bit; HChar name[6]; } hwcaps_list[] = { - { VEX_HWCAPS_S390X_PFPO, "pfpo" }, { VEX_HWCAPS_S390X_VX, "vx" }, { VEX_HWCAPS_S390X_MSA5, "msa5" }, { VEX_HWCAPS_S390X_MI2, "mi2" }, diff --git a/VEX/pub/libvex.h b/VEX/pub/libvex.h index 3fcecd00f..07c39eb4e 100644 --- a/VEX/pub/libvex.h +++ b/VEX/pub/libvex.h @@ -162,7 +162,6 @@ typedef #define VEX_S390X_MODEL_UNKNOWN 19 /* always last in list */ #define VEX_S390X_MODEL_MASK 0x3F -#define VEX_HWCAPS_S390X_PFPO (1<<17) /* Perform floating point ops facility */ #define VEX_HWCAPS_S390X_VX (1<<18) /* Vector facility */ #define VEX_HWCAPS_S390X_MSA5 (1<<19) /* Message-security-assistance facility 5 */ #define VEX_HWCAPS_S390X_MI2 (1<<20) /* Miscellaneous-instruction-extensions facility 2 */ @@ -176,8 +175,7 @@ typedef #define VEX_HWCAPS_S390X_MSA9 (1<<30) /* Message-security-assist extension 9 */ /* Special value representing all available s390x hwcaps */ -#define VEX_HWCAPS_S390X_ALL (VEX_HWCAPS_S390X_PFPO | \ - VEX_HWCAPS_S390X_VX | \ +#define VEX_HWCAPS_S390X_ALL (VEX_HWCAPS_S390X_VX | \ VEX_HWCAPS_S390X_MSA5 | \ VEX_HWCAPS_S390X_MI2 | \ VEX_HWCAPS_S390X_LSC2 | \ diff --git a/VEX/pub/libvex_emnote.h b/VEX/pub/libvex_emnote.h index 04a9e0a6e..a3fa19652 100644 --- a/VEX/pub/libvex_emnote.h +++ b/VEX/pub/libvex_emnote.h @@ -94,9 +94,6 @@ typedef in VEX and is expected to be zero. */ EmWarn_S390X_XiC_not_zero, - /* pfpo insn is not supported on this host */ - EmFail_S390X_pfpo, - /* GPR 0 contains invalid rounding mode for PFPO instruction */ EmFail_S390X_invalid_PFPO_rounding_mode, diff --git a/coregrind/m_machine.c b/coregrind/m_machine.c index e285ec3d3..01a50c9b2 100644 --- a/coregrind/m_machine.c +++ b/coregrind/m_machine.c @@ -1565,7 +1565,6 @@ Bool VG_(machine_get_hwcaps)( void ) UInt hwcaps_bit; const HChar name[6]; // may need adjustment for new facility names } fac_hwcaps[] = { - { False, 44, VEX_HWCAPS_S390X_PFPO, "PFPO" }, { False, 129, VEX_HWCAPS_S390X_VX, "VX" }, { False, 57, VEX_HWCAPS_S390X_MSA5, "MSA5" }, { False, 58, VEX_HWCAPS_S390X_MI2, "MI2" }, diff --git a/memcheck/tests/vbit-test/irops.c b/memcheck/tests/vbit-test/irops.c index e3e06d7c7..8cd400e62 100644 --- a/memcheck/tests/vbit-test/irops.c +++ b/memcheck/tests/vbit-test/irops.c @@ -1208,7 +1208,6 @@ get_irop(IROp op) if (p->op == op) { #ifdef __s390x__ #define S390X_FEATURES "../../../tests/s390x_features" - int rc; switch (op) { case Iop_I32StoD64: // CDFTR @@ -1253,14 +1252,7 @@ get_irop(IROp op) case Iop_D64toF128: case Iop_D128toF32: case Iop_D128toF64: - case Iop_D128toF128: { - /* These IROps require the Perform Floating Point Operation - facility */ - rc = system(S390X_FEATURES " s390x-pfpo"); - // s390x_features returns 1 if feature does not exist - rc /= 256; - if (rc != 0) return NULL; - } + case Iop_D128toF128: break; /* Other */ default: diff --git a/none/tests/s390x/pfpo.vgtest b/none/tests/s390x/pfpo.vgtest index 0f1f5b9c4..31d43c285 100644 --- a/none/tests/s390x/pfpo.vgtest +++ b/none/tests/s390x/pfpo.vgtest @@ -1,2 +1 @@ prog: pfpo -prereq: test -e pfpo && ../../../tests/s390x_features s390x-pfpo diff --git a/tests/s390x_features.c b/tests/s390x_features.c index dc91ab549..f9aa96640 100644 --- a/tests/s390x_features.c +++ b/tests/s390x_features.c @@ -231,8 +231,6 @@ static int go(char *feature, char *cpu) match = facilities[0] & FAC_BIT(0); } else if (strcmp(feature, "s390x-exrl") == 0 ) { match = facilities[0] & FAC_BIT(35); - } else if (strcmp(feature, "s390x-pfpo") == 0 ) { - match = facilities[0] & FAC_BIT(44); } else if (strcmp(feature, "s390x-vx") == 0 ) { /* VX needs kernel support; thus check the appropriate HWCAP bit. */ match = GET_HWCAP() & 0x800;