From: Florian Krohm Date: Fri, 5 Dec 2014 18:55:39 +0000 (+0000) Subject: Encountering a PFPO insn in a client program while running on a host X-Git-Tag: svn/VALGRIND_3_11_0^2~144 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0eaf04ab0bd161b5b37194cae711f364fce8c238;p=thirdparty%2Fvalgrind.git 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 --- diff --git a/VEX/priv/guest_s390_toIR.c b/VEX/priv/guest_s390_toIR.c index ec7e370ad2..f0add1ba1f 100644 --- a/VEX/priv/guest_s390_toIR.c +++ b/VEX/priv/guest_s390_toIR.c @@ -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"; } diff --git a/VEX/priv/main_main.c b/VEX/priv/main_main.c index 871fc1318f..a50f3f7c75 100644 --- a/VEX/priv/main_main.c +++ b/VEX/priv/main_main.c @@ -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" diff --git a/VEX/pub/libvex_emnote.h b/VEX/pub/libvex_emnote.h index e4eaab06b0..82b0e76a40 100644 --- a/VEX/pub/libvex_emnote.h +++ b/VEX/pub/libvex_emnote.h @@ -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,