]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
s390: PFPO facility related cleanups (BZ 509562)
authorFlorian Krohm <flo2030@eich-krohm.de>
Tue, 25 Nov 2025 13:50:37 +0000 (13:50 +0000)
committerFlorian Krohm <flo2030@eich-krohm.de>
Tue, 25 Nov 2025 13:50:37 +0000 (13:50 +0000)
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

VEX/priv/guest_s390_toIR.c
VEX/priv/host_s390_defs.c
VEX/priv/host_s390_defs.h
VEX/priv/main_main.c
VEX/pub/libvex.h
VEX/pub/libvex_emnote.h
coregrind/m_machine.c
memcheck/tests/vbit-test/irops.c
none/tests/s390x/pfpo.vgtest
tests/s390x_features.c

index b01849cb67395f18d1841ba4c88d8a441d43ddfd..8f42c844d3c90beba55e30b4340ed3f844ad7ae0 100644 (file)
@@ -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 */
index 94821934250d1b4d85ec816ae31030e08e3c3b51..96c566823b7edd8859c778ca0b6b0e9f6f5d77db 100644 (file)
@@ -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"));
    }
index b660b70776289738f4ba1b409bc13ba13f041301..f089eac9a1ce52147d5f242c23432bd9709ed74e 100644 (file)
@@ -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 \
index 9783d0e3137b490a07fca50a4c56653bd3d183dc..32a78190ad73bce04122673696653b39ba077bf2 100644 (file)
@@ -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" },
index 3fcecd00fdca602d4f3e50432c12dab07bd66bad..07c39eb4ea6e4e4534607d2e474077ccba9bcf94 100644 (file)
@@ -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  | \
index 04a9e0a6e6f9c09b455abafc8c3749ce636b0164..a3fa196520552b23b521db5e3e899b3a39178d6b 100644 (file)
@@ -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,
 
index e285ec3d39055257f0786cd194cdaf973ef0a399..01a50c9b2c0c89c26eba7d6de591628f65316b8d 100644 (file)
@@ -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"   },
index e3e06d7c780ac6d479b3a61a4f315bc3a7b94d2a..8cd400e62ab58cf2aa47f52c1c030f152766f4b5 100644 (file)
@@ -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:
index 0f1f5b9c4165e554534607d67a78381b42713f17..31d43c2856641af296bc871362ad3f5f26c8d11d 100644 (file)
@@ -1,2 +1 @@
 prog: pfpo
-prereq: test -e pfpo && ../../../tests/s390x_features s390x-pfpo
index dc91ab549efc97d464ed66c5ca882e2c9bce3ba2..f9aa9664048dec35f8a4a81650bafc6c839513fb 100644 (file)
@@ -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;