]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
s390x: PRNO tidy
authorFlorian Krohm <flo2030@eich-krohm.de>
Thu, 27 Mar 2025 16:30:03 +0000 (16:30 +0000)
committerFlorian Krohm <flo2030@eich-krohm.de>
Thu, 27 Mar 2025 16:30:03 +0000 (16:30 +0000)
The mnemonics PRNO and PPNO denote the same opcode. Both names were used
in the code. Not anymore. From now on: consistent naming PRNO / prno

While I was at it:
- Remove left-overs from the early days when PRNO was implemented by means
  of dirty helpers.
- Fix disassembly to use "prno".
- Fix a bug in s390_irgen_DFLTCC which was using "ppno" as mnemonic.

VEX/priv/guest_s390_defs.h
VEX/priv/guest_s390_helpers.c
VEX/priv/guest_s390_toIR.c
VEX/priv/main_main.c
VEX/priv/s390_defs.h
VEX/pub/libvex_emnote.h

index 607773ad14aac14be592a7006fe1f6ae3bdcfbf8..0039f5e78483ef6ff112a4a99fd8a33866fdeedf 100644 (file)
@@ -90,9 +90,7 @@ UInt  s390_do_cvb(ULong decimal);
 ULong s390_do_cvd(ULong binary);
 ULong s390_do_ecag(ULong op2addr);
 UInt  s390_do_pfpo(UInt gpr0);
-void  s390x_dirtyhelper_PPNO_query(VexGuestS390XState *guest_state, ULong r1, ULong r2);
-ULong  s390x_dirtyhelper_PPNO_sha512(VexGuestS390XState *guest_state, ULong r1, ULong r2);
-void  s390x_dirtyhelper_PPNO_sha512_load_param_block( void );
+
 /* The various ways to compute the condition code. */
 enum {
    S390_CC_OP_BITWISE = 0,
index 94d0a242db7e01738ac40782e4eab5f9d3b86c1b..bbba22b4784037d5781918cc6b9c4907c40368ae 100644 (file)
@@ -2659,75 +2659,6 @@ s390x_dirtyhelper_vec_op(VexGuestS390XState *guest_state,
 
 #endif
 
-/*-----------------------------------------------------------------*/
-/*--- Dirty helper for Perform Pseudorandom number instruction  ---*/
-/*-----------------------------------------------------------------*/
-
-/* Dummy helper that is needed to indicate load of parameter block.
-   We have to use it because dirty helper cannot have two memory side
-   effects.
- */
-void s390x_dirtyhelper_PPNO_sha512_load_param_block( void )
-{
-}
-
-#if defined(VGA_s390x)
-
-/* IMPORTANT!
-   We return here bit mask where only supported functions are set to one.
-   If you implement new functions don't forget the supported array.
- */
-void
-s390x_dirtyhelper_PPNO_query(VexGuestS390XState *guest_state, ULong r1, ULong r2)
-{
-   ULong supported[2] = {0x9000000000000000ULL, 0x0000000000000000ULL};
-   ULong *result = (ULong*) guest_state->guest_r1;
-
-   result[0] = supported[0];
-   result[1] = supported[1];
-}
-
-ULong
-s390x_dirtyhelper_PPNO_sha512(VexGuestS390XState *guest_state, ULong r1, ULong r2)
-{
-   ULong* op1 = (ULong*) (((ULong)(&guest_state->guest_r0)) + r1 * sizeof(ULong));
-   ULong* op2 = (ULong*) (((ULong)(&guest_state->guest_r0)) + r2 * sizeof(ULong));
-
-   register ULong reg0 asm("0") = guest_state->guest_r0;
-   register ULong reg1 asm("1") = guest_state->guest_r1;
-   register ULong reg2 asm("2") = op1[0];
-   register ULong reg3 asm("3") = op1[1];
-   register ULong reg4 asm("4") = op2[0];
-   register ULong reg5 asm("5") = op2[1];
-
-   ULong cc = 0;
-   asm volatile(".insn rre, 0xb93c0000, %%r2, %%r4\n"
-                "ipm %[cc]\n"
-                "srl %[cc], 28\n"
-                : "+d"(reg0), "+d"(reg1),
-                  "+d"(reg2), "+d"(reg3),
-                  "+d"(reg4), "+d"(reg5),
-                  [cc] "=d"(cc)
-                :
-                : "cc", "memory");
-
-   return cc;
-}
-
-#else
-
-void
-s390x_dirtyhelper_PPNO_query(VexGuestS390XState *guest_state, ULong r1, ULong r2)
-{
-}
-
-ULong
-s390x_dirtyhelper_PPNO_sha512(VexGuestS390XState *guest_state, ULong r1, ULong r2)
-{
-   return 0;
-}
-
-#endif /* VGA_s390x */
 /*---------------------------------------------------------------*/
 /*--- end                                guest_s390_helpers.c ---*/
 /*---------------------------------------------------------------*/
index f8caf53164eb337b863a3a252d6215395bd72a4a..1ed10acbbb82182b75715e20cf686a31cfe1b7b1 100644 (file)
@@ -17357,20 +17357,19 @@ s390_irgen_LCBB(UChar r1, IRTemp op2addr, UChar m3)
    return "lcbb";
 }
 
-/* Also known as "PRNO" */
 static const HChar *
-s390_irgen_PPNO(UChar r1, UChar r2)
+s390_irgen_PRNO(UChar r1, UChar r2)
 {
    if (!s390_host_has_msa5) {
-      emulation_failure(EmFail_S390X_ppno);
-      return "ppno";
+      emulation_failure(EmFail_S390X_prno);
+      return "prno";
    }
 
    /* Check for obvious specification exceptions */
-   s390_insn_assert("ppno", r1 % 2 == 0 && r2 % 2 == 0 && r1 != 0 && r2 != 0);
+   s390_insn_assert("prno", r1 % 2 == 0 && r2 % 2 == 0 && r1 != 0 && r2 != 0);
 
    extension(S390_EXT_PRNO, r1 | (r2 << 4));
-   return "ppno";
+   return "prno";
 }
 
 static const HChar *
@@ -17378,7 +17377,7 @@ s390_irgen_DFLTCC(UChar r3, UChar r1, UChar r2)
 {
    if (!s390_host_has_dflt) {
       emulation_failure(EmFail_S390X_dflt);
-      return "ppno";
+      return "dfltcc";
    }
 
    /* Check for obvious specification exceptions */
@@ -21083,7 +21082,7 @@ s390_decode_4byte_and_irgen(const UChar *bytes)
    case 0xb93a: s390_format_RRE_RR(s390_irgen_KDSA, RRE_r1(ovl),
                                    RRE_r2(ovl));  goto ok;
    case 0xb93b: s390_format_E(s390_irgen_NNPA);  goto ok;
-   case 0xb93c: s390_format_RRE_RR(s390_irgen_PPNO, RRE_r1(ovl),
+   case 0xb93c: s390_format_RRE_RR(s390_irgen_PRNO, RRE_r1(ovl),
                                    RRE_r2(ovl));  goto ok;
    case 0xb93e: s390_format_RRE_RR(s390_irgen_KIMD, RRE_r1(ovl),
                                    RRE_r2(ovl));  goto ok;
index 80f6d6a6d6916fd7cb73f6e0b0f348202d8f9c74..fe3cf9e573c5d75df187eb4b8ee4e6a2b90216bb 100644 (file)
@@ -1561,8 +1561,8 @@ const HChar* LibVEX_EmNote_string ( VexEmNote ew )
      case EmFail_S390X_vx:
         return "Encountered an instruction that requires the vector facility.\n"
                "  That facility is not available on this host";
-     case EmFail_S390X_ppno:
-        return "Instruction ppno is not supported on this host.";
+     case EmFail_S390X_prno:
+        return "Instruction prno is not supported on this host.";
      case EmFail_S390X_vxe:
         return "Encountered an instruction that requires the vector-extensions"
                " facility 1.\n"
index da5113f7deb18e8a9fa801eec2a697553bb40ab8..482dc4f0e93148123d21e555bb191099ceace0e5 100644 (file)
@@ -144,27 +144,6 @@ typedef enum {
    S390_PFPO_D128_TO_F128 = 0x01070A
 } s390_pfpo_function_t;
 
-/* PPNO function code as it is encoded in bits [57:63] of GR0
-   when PPNO insn is executed. */
-typedef enum
-{
-   S390_PPNO_QUERY       = 0x00,
-   S390_PPNO_SHA512_GEN  = 0x03,
-   S390_PPNO_SHA512_SEED = 0x83
-} s390_ppno_function_t;
-
-/* Size of parameter block for PPNO functions.
-   All values are in bytes.
- */
-#define S390_PPNO_PARAM_BLOCK_SIZE_QUERY  16
-#define S390_PPNO_PARAM_BLOCK_SIZE_SHA512 240
-
-/* Maximum length of modified memory for PPNO functions.
-   All values are in bytes.
-*/
-#define S390_PPNO_MAX_SIZE_SHA512_SEED 512
-#define S390_PPNO_MAX_SIZE_SHA512_GEN  64
-
 
 /* The length of the longest mnemonic: locfhrnhe */
 #define S390_MAX_MNEMONIC_LEN  9
index c3ebcf420349fc53d9c8ed359d4e990dc58de908..27b95880cb833f7e649f92aa1a10b5caeeab5d69 100644 (file)
@@ -121,8 +121,8 @@ typedef
       /* some insn needs vector facility which is not available on this host */
       EmFail_S390X_vx,
 
-      /* ppno insn is not supported on this host */
-      EmFail_S390X_ppno,
+      /* prno insn is not supported on this host */
+      EmFail_S390X_prno,
 
       /* insn needs vector-enhancements facility 1 which is not available on
          this host */