Encountering a PFPO insn in a client program while running on a host
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 8f6e269a-dfd6-0310-a8e1-e2731360e62c
diff --git a/priv/guest_s390_toIR.c b/priv/guest_s390_toIR.c
index ec7e370..f0add1b 100644
--- a/priv/guest_s390_toIR.c
+++ b/priv/guest_s390_toIR.c
@@ -7160,7 +7160,6 @@
    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 @@
    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_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";
 }
 
diff --git a/priv/main_main.c b/priv/main_main.c
index 871fc13..a50f3f7 100644
--- a/priv/main_main.c
+++ b/priv/main_main.c
@@ -1196,6 +1196,8 @@
         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"
diff --git a/pub/libvex_emnote.h b/pub/libvex_emnote.h
index e4eaab0..82b0e76 100644
--- a/pub/libvex_emnote.h
+++ b/pub/libvex_emnote.h
@@ -103,6 +103,9 @@
       /* 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,