]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Encountering a PFPO insn in a client program while running on a host
authorFlorian Krohm <florian@eich-krohm.de>
Fri, 5 Dec 2014 18:55:39 +0000 (18:55 +0000)
committerFlorian Krohm <florian@eich-krohm.de>
Fri, 5 Dec 2014 18:55:39 +0000 (18:55 +0000)
that does not have that insn now causes an emulation error.
Previously, it caused a failing assertion which was incorrect.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3030

VEX/priv/guest_s390_toIR.c
VEX/priv/main_main.c
VEX/pub/libvex_emnote.h

index ec7e370ad21841e06f761e7e22061924ca1cb9e2..f0add1ba1fe120a65c52e18658a3ee982d2f5216 100644 (file)
@@ -7160,7 +7160,6 @@ get_rounding_mode_from_gr0(void)
    IRExpr *s390rm;
    IRExpr *irrm;
 
-   vassert(s390_host_has_pfpo);
    /* The dfp/bfp rounding mode is stored in bits [60:63] of GR 0
       when PFPO insn is called. So, extract the bits at [60:63] */
    assign(rm_bits, binop(Iop_And32, get_gpr_w1(0), mkU32(0xf)));
@@ -7254,7 +7253,10 @@ s390_irgen_PFPO(void)
    IRTemp dst18 = newTemp(Ity_F128);
    IRExpr *irrm;
 
-   vassert(s390_host_has_pfpo);
+   if (! s390_host_has_pfpo) {
+      emulation_failure(EmFail_S390X_pfpo);
+      goto done;
+   }
 
    assign(gr0, get_gpr_w1(0));
    /* get function code */
@@ -7433,6 +7435,7 @@ s390_irgen_PFPO(void)
    s390_cc_thunk_put1d128Z(S390_CC_OP_PFPO_128, src18, gr0);
    next_insn_if(binop(Iop_CmpEQ32, mkexpr(fn), mkU32(S390_PFPO_D128_TO_F128)));
 
+ done:
    return "pfpo";
 }
 
index 871fc1318f636e44185585fadf1b87297e877d20..a50f3f7c75c82609308149b98b331a9bdd3faa5b 100644 (file)
@@ -1196,6 +1196,8 @@ const HChar* LibVEX_EmNote_string ( VexEmNote ew )
         return "Instruction stckf is not supported on this host";
      case EmFail_S390X_ecag:
         return "Instruction ecag is not supported on this host";
+     case EmFail_S390X_pfpo:
+        return "Instruction pfpo is not supported on this host";
      case EmFail_S390X_fpext:
         return "Encountered an instruction that requires the floating "
                "point extension facility.\n"
index e4eaab06b06122b4b5039058bb25d126b178394b..82b0e76a40b67c137bccdd979ff060c9be6e5e68 100644 (file)
@@ -103,6 +103,9 @@ typedef
       /* ecag insn is not supported on this host */
       EmFail_S390X_ecag,
 
+      /* pfpo insn is not supported on this host */
+      EmFail_S390X_pfpo,
+
       /* insn needs floating point extension facility which is not
          available on this host */
       EmFail_S390X_fpext,