From: Florian Krohm Date: Mon, 24 Nov 2025 16:40:23 +0000 (+0000) Subject: s390: decimal-floating-point facility related cleanups (BZ 509562) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=49d3e63da64f3e57bd39d8275271535291a66be5;p=thirdparty%2Fvalgrind.git s390: decimal-floating-point facility related cleanups (BZ 509562) The decimal-floating-point facility is always present on the supported machines. - Remove VEX_HWCAPS_S390X_DFP and s390_host_has_dfp - Remove EmFail_S390X_DFP_insn - Update tests/s390x_features.c Part of fixing https://bugs.kde.org/show_bug.cgi?id=509562 --- diff --git a/VEX/priv/guest_s390_toIR.c b/VEX/priv/guest_s390_toIR.c index 42bf5ad81..463f389df 100644 --- a/VEX/priv/guest_s390_toIR.c +++ b/VEX/priv/guest_s390_toIR.c @@ -12014,49 +12014,41 @@ s390_irgen_SDB(UChar r1, IRTemp op2addr) static const HChar * s390_irgen_ADTRA(UChar r3, UChar m4, UChar r1, UChar r2) { - if (! s390_host_has_dfp) { - emulation_failure(EmFail_S390X_DFP_insn); - } else { - IRTemp op1 = newTemp(Ity_D64); - IRTemp op2 = newTemp(Ity_D64); - IRTemp result = newTemp(Ity_D64); - IRTemp rounding_mode; - - rounding_mode = encode_dfp_rounding_mode(m4); - assign(op1, get_dpr_dw0(r2)); - assign(op2, get_dpr_dw0(r3)); - assign(result, triop(Iop_AddD64, mkexpr(rounding_mode), mkexpr(op1), - mkexpr(op2))); - s390_cc_thunk_putF(S390_CC_OP_DFP_RESULT_64, result); - put_dpr_dw0(r1, mkexpr(result)); - } + IRTemp op1 = newTemp(Ity_D64); + IRTemp op2 = newTemp(Ity_D64); + IRTemp result = newTemp(Ity_D64); + IRTemp rounding_mode; + + rounding_mode = encode_dfp_rounding_mode(m4); + assign(op1, get_dpr_dw0(r2)); + assign(op2, get_dpr_dw0(r3)); + assign(result, triop(Iop_AddD64, mkexpr(rounding_mode), mkexpr(op1), + mkexpr(op2))); + s390_cc_thunk_putF(S390_CC_OP_DFP_RESULT_64, result); + put_dpr_dw0(r1, mkexpr(result)); return "adtra"; } static const HChar * s390_irgen_AXTRA(UChar r3, UChar m4, UChar r1, UChar r2) { - if (! s390_host_has_dfp) { - emulation_failure(EmFail_S390X_DFP_insn); - } else { - s390_insn_assert("axtra", is_valid_fpr_pair(r1)); - s390_insn_assert("axtra", is_valid_fpr_pair(r2)); - s390_insn_assert("axtra", is_valid_fpr_pair(r3)); + s390_insn_assert("axtra", is_valid_fpr_pair(r1)); + s390_insn_assert("axtra", is_valid_fpr_pair(r2)); + s390_insn_assert("axtra", is_valid_fpr_pair(r3)); - IRTemp op1 = newTemp(Ity_D128); - IRTemp op2 = newTemp(Ity_D128); - IRTemp result = newTemp(Ity_D128); - IRTemp rounding_mode; + IRTemp op1 = newTemp(Ity_D128); + IRTemp op2 = newTemp(Ity_D128); + IRTemp result = newTemp(Ity_D128); + IRTemp rounding_mode; - rounding_mode = encode_dfp_rounding_mode(m4); - assign(op1, get_dpr_pair(r2)); - assign(op2, get_dpr_pair(r3)); - assign(result, triop(Iop_AddD128, mkexpr(rounding_mode), mkexpr(op1), - mkexpr(op2))); - put_dpr_pair(r1, mkexpr(result)); + rounding_mode = encode_dfp_rounding_mode(m4); + assign(op1, get_dpr_pair(r2)); + assign(op2, get_dpr_pair(r3)); + assign(result, triop(Iop_AddD128, mkexpr(rounding_mode), mkexpr(op1), + mkexpr(op2))); + put_dpr_pair(r1, mkexpr(result)); - s390_cc_thunk_put1d128(S390_CC_OP_DFP_RESULT_128, result); - } + s390_cc_thunk_put1d128(S390_CC_OP_DFP_RESULT_128, result); return "axtra"; } @@ -12103,16 +12095,12 @@ static const HChar * s390_irgen_CDFTR(UChar m3 __attribute__((unused)), UChar m4, UChar r1, UChar r2) { - if (! s390_host_has_dfp) { - emulation_failure(EmFail_S390X_DFP_insn); - } else { - if ((m4 & 0x4) != 0) - emulation_warning(EmWarn_S390X_XxC_not_zero); - IRTemp op2 = newTemp(Ity_I32); + if ((m4 & 0x4) != 0) + emulation_warning(EmWarn_S390X_XxC_not_zero); + IRTemp op2 = newTemp(Ity_I32); - assign(op2, get_gpr_w1(r2)); - put_dpr_dw0(r1, unop(Iop_I32StoD64, mkexpr(op2))); - } + assign(op2, get_gpr_w1(r2)); + put_dpr_dw0(r1, unop(Iop_I32StoD64, mkexpr(op2))); return "cdftr"; } @@ -12120,36 +12108,28 @@ static const HChar * s390_irgen_CXFTR(UChar m3 __attribute__((unused)), UChar m4, UChar r1, UChar r2) { - if (! s390_host_has_dfp) { - emulation_failure(EmFail_S390X_DFP_insn); - } else { - s390_insn_assert("cxftr", is_valid_fpr_pair(r1)); - if ((m4 & 0x4) != 0) - emulation_warning(EmWarn_S390X_XxC_not_zero); + s390_insn_assert("cxftr", is_valid_fpr_pair(r1)); + if ((m4 & 0x4) != 0) + emulation_warning(EmWarn_S390X_XxC_not_zero); - IRTemp op2 = newTemp(Ity_I32); + IRTemp op2 = newTemp(Ity_I32); - assign(op2, get_gpr_w1(r2)); - put_dpr_pair(r1, unop(Iop_I32StoD128, mkexpr(op2))); - } + assign(op2, get_gpr_w1(r2)); + put_dpr_pair(r1, unop(Iop_I32StoD128, mkexpr(op2))); return "cxftr"; } static const HChar * s390_irgen_CDGTRA(UChar m3, UChar m4, UChar r1, UChar r2) { - if (! s390_host_has_dfp) { - emulation_failure(EmFail_S390X_DFP_insn); - } else { - IRTemp op2 = newTemp(Ity_I64); + IRTemp op2 = newTemp(Ity_I64); - if ((m4 & 0x4) != 0) - emulation_warning(EmWarn_S390X_XxC_not_zero); + if ((m4 & 0x4) != 0) + emulation_warning(EmWarn_S390X_XxC_not_zero); - assign(op2, get_gpr_dw0(r2)); - put_dpr_dw0(r1, binop(Iop_I64StoD64, mkexpr(encode_dfp_rounding_mode(m3)), - mkexpr(op2))); - } + assign(op2, get_gpr_dw0(r2)); + put_dpr_dw0(r1, binop(Iop_I64StoD64, mkexpr(encode_dfp_rounding_mode(m3)), + mkexpr(op2))); return "cdgtra"; } @@ -12157,21 +12137,14 @@ static const HChar * s390_irgen_CXGTRA(UChar m3 __attribute__((unused)), UChar m4, UChar r1, UChar r2) { - if (! s390_host_has_dfp) { - emulation_failure(EmFail_S390X_DFP_insn); - } else { - s390_insn_assert("cxgtra", is_valid_fpr_pair(r1)); - if ((m4 & 0x4) != 0) - emulation_warning(EmWarn_S390X_XxC_not_zero); - - IRTemp op2 = newTemp(Ity_I64); + s390_insn_assert("cxgtra", is_valid_fpr_pair(r1)); + if ((m4 & 0x4) != 0) + emulation_warning(EmWarn_S390X_XxC_not_zero); - /* No emulation warning here about an non-zero m3 on hosts without - floating point extension facility. No rounding is performed */ + IRTemp op2 = newTemp(Ity_I64); - assign(op2, get_gpr_dw0(r2)); - put_dpr_pair(r1, unop(Iop_I64StoD128, mkexpr(op2))); - } + assign(op2, get_gpr_dw0(r2)); + put_dpr_pair(r1, unop(Iop_I64StoD128, mkexpr(op2))); return "cxgtra"; } @@ -12179,16 +12152,12 @@ static const HChar * s390_irgen_CDLFTR(UChar m3 __attribute__((unused)), UChar m4, UChar r1, UChar r2) { - if (! s390_host_has_dfp) { - emulation_failure(EmFail_S390X_DFP_insn); - } else { - if ((m4 & 0x4) != 0) - emulation_warning(EmWarn_S390X_XxC_not_zero); - IRTemp op2 = newTemp(Ity_I32); + if ((m4 & 0x4) != 0) + emulation_warning(EmWarn_S390X_XxC_not_zero); + IRTemp op2 = newTemp(Ity_I32); - assign(op2, get_gpr_w1(r2)); - put_dpr_dw0(r1, unop(Iop_I32UtoD64, mkexpr(op2))); - } + assign(op2, get_gpr_w1(r2)); + put_dpr_dw0(r1, unop(Iop_I32UtoD64, mkexpr(op2))); return "cdlftr"; } @@ -12196,36 +12165,27 @@ static const HChar * s390_irgen_CXLFTR(UChar m3 __attribute__((unused)), UChar m4, UChar r1, UChar r2) { - if (! s390_host_has_dfp) { - emulation_failure(EmFail_S390X_DFP_insn); - } else { - s390_insn_assert("cxlftr", is_valid_fpr_pair(r1)); - if ((m4 & 0x4) != 0) - emulation_warning(EmWarn_S390X_XxC_not_zero); + s390_insn_assert("cxlftr", is_valid_fpr_pair(r1)); + if ((m4 & 0x4) != 0) + emulation_warning(EmWarn_S390X_XxC_not_zero); - IRTemp op2 = newTemp(Ity_I32); + IRTemp op2 = newTemp(Ity_I32); - assign(op2, get_gpr_w1(r2)); - put_dpr_pair(r1, unop(Iop_I32UtoD128, mkexpr(op2))); - } + assign(op2, get_gpr_w1(r2)); + put_dpr_pair(r1, unop(Iop_I32UtoD128, mkexpr(op2))); return "cxlftr"; } static const HChar * s390_irgen_CDLGTR(UChar m3, UChar m4, UChar r1, UChar r2) { - if (! s390_host_has_dfp) { - emulation_failure(EmFail_S390X_DFP_insn); - } else { - if ((m4 & 0x4) != 0) - emulation_warning(EmWarn_S390X_XxC_not_zero); - IRTemp op2 = newTemp(Ity_I64); + if ((m4 & 0x4) != 0) + emulation_warning(EmWarn_S390X_XxC_not_zero); + IRTemp op2 = newTemp(Ity_I64); - assign(op2, get_gpr_dw0(r2)); - put_dpr_dw0(r1, binop(Iop_I64UtoD64, - mkexpr(encode_dfp_rounding_mode(m3)), - mkexpr(op2))); - } + assign(op2, get_gpr_dw0(r2)); + put_dpr_dw0(r1, binop(Iop_I64UtoD64, + mkexpr(encode_dfp_rounding_mode(m3)), mkexpr(op2))); return "cdlgtr"; } @@ -12233,827 +12193,645 @@ static const HChar * s390_irgen_CXLGTR(UChar m3 __attribute__((unused)), UChar m4, UChar r1, UChar r2) { - if (! s390_host_has_dfp) { - emulation_failure(EmFail_S390X_DFP_insn); - } else { - s390_insn_assert("cxlgtr", is_valid_fpr_pair(r1)); - if ((m4 & 0x4) != 0) - emulation_warning(EmWarn_S390X_XxC_not_zero); + s390_insn_assert("cxlgtr", is_valid_fpr_pair(r1)); + if ((m4 & 0x4) != 0) + emulation_warning(EmWarn_S390X_XxC_not_zero); - IRTemp op2 = newTemp(Ity_I64); + IRTemp op2 = newTemp(Ity_I64); - assign(op2, get_gpr_dw0(r2)); - put_dpr_pair(r1, unop(Iop_I64UtoD128, mkexpr(op2))); - } + assign(op2, get_gpr_dw0(r2)); + put_dpr_pair(r1, unop(Iop_I64UtoD128, mkexpr(op2))); return "cxlgtr"; } static const HChar * s390_irgen_CFDTR(UChar m3, UChar m4, UChar r1, UChar r2) { - if (! s390_host_has_dfp) { - emulation_failure(EmFail_S390X_DFP_insn); - } else { - if ((m4 & 0x4) != 0) - emulation_warning(EmWarn_S390X_XxC_not_zero); - IRTemp op = newTemp(Ity_D64); - IRTemp result = newTemp(Ity_I32); - IRTemp rounding_mode = encode_dfp_rounding_mode(m3); + if ((m4 & 0x4) != 0) + emulation_warning(EmWarn_S390X_XxC_not_zero); + IRTemp op = newTemp(Ity_D64); + IRTemp result = newTemp(Ity_I32); + IRTemp rounding_mode = encode_dfp_rounding_mode(m3); - assign(op, get_dpr_dw0(r2)); - assign(result, binop(Iop_D64toI32S, mkexpr(rounding_mode), - mkexpr(op))); - put_gpr_w1(r1, mkexpr(result)); - s390_cc_thunk_putFZ(S390_CC_OP_DFP_64_TO_INT_32, op, rounding_mode); - } + assign(op, get_dpr_dw0(r2)); + assign(result, binop(Iop_D64toI32S, mkexpr(rounding_mode), mkexpr(op))); + put_gpr_w1(r1, mkexpr(result)); + s390_cc_thunk_putFZ(S390_CC_OP_DFP_64_TO_INT_32, op, rounding_mode); return "cfdtr"; } static const HChar * s390_irgen_CFXTR(UChar m3, UChar m4, UChar r1, UChar r2) { - if (! s390_host_has_dfp) { - emulation_failure(EmFail_S390X_DFP_insn); - } else { - s390_insn_assert("cfxtr", is_valid_fpr_pair(r2)); - if ((m4 & 0x4) != 0) - emulation_warning(EmWarn_S390X_XxC_not_zero); + s390_insn_assert("cfxtr", is_valid_fpr_pair(r2)); + if ((m4 & 0x4) != 0) + emulation_warning(EmWarn_S390X_XxC_not_zero); - IRTemp op = newTemp(Ity_D128); - IRTemp result = newTemp(Ity_I32); - IRTemp rounding_mode = encode_dfp_rounding_mode(m3); + IRTemp op = newTemp(Ity_D128); + IRTemp result = newTemp(Ity_I32); + IRTemp rounding_mode = encode_dfp_rounding_mode(m3); - assign(op, get_dpr_pair(r2)); - assign(result, binop(Iop_D128toI32S, mkexpr(rounding_mode), - mkexpr(op))); - put_gpr_w1(r1, mkexpr(result)); - s390_cc_thunk_put1d128Z(S390_CC_OP_DFP_128_TO_INT_32, op, - rounding_mode); - } + assign(op, get_dpr_pair(r2)); + assign(result, binop(Iop_D128toI32S, mkexpr(rounding_mode), mkexpr(op))); + put_gpr_w1(r1, mkexpr(result)); + s390_cc_thunk_put1d128Z(S390_CC_OP_DFP_128_TO_INT_32, op, rounding_mode); return "cfxtr"; } static const HChar * s390_irgen_CGDTRA(UChar m3, UChar m4, UChar r1, UChar r2) { - if (! s390_host_has_dfp) { - emulation_failure(EmFail_S390X_DFP_insn); - } else { - if ((m4 & 0x4) != 0) - emulation_warning(EmWarn_S390X_XxC_not_zero); - IRTemp op = newTemp(Ity_D64); - IRTemp rounding_mode = encode_dfp_rounding_mode(m3); + if ((m4 & 0x4) != 0) + emulation_warning(EmWarn_S390X_XxC_not_zero); + IRTemp op = newTemp(Ity_D64); + IRTemp rounding_mode = encode_dfp_rounding_mode(m3); - assign(op, get_dpr_dw0(r2)); - put_gpr_dw0(r1, binop(Iop_D64toI64S, mkexpr(rounding_mode), mkexpr(op))); - s390_cc_thunk_putFZ(S390_CC_OP_DFP_64_TO_INT_64, op, rounding_mode); - } + assign(op, get_dpr_dw0(r2)); + put_gpr_dw0(r1, binop(Iop_D64toI64S, mkexpr(rounding_mode), mkexpr(op))); + s390_cc_thunk_putFZ(S390_CC_OP_DFP_64_TO_INT_64, op, rounding_mode); return "cgdtra"; } static const HChar * s390_irgen_CGXTRA(UChar m3, UChar m4, UChar r1, UChar r2) { - if (! s390_host_has_dfp) { - emulation_failure(EmFail_S390X_DFP_insn); - } else { - s390_insn_assert("cgxtra", is_valid_fpr_pair(r2)); - if ((m4 & 0x4) != 0) - emulation_warning(EmWarn_S390X_XxC_not_zero); + s390_insn_assert("cgxtra", is_valid_fpr_pair(r2)); + if ((m4 & 0x4) != 0) + emulation_warning(EmWarn_S390X_XxC_not_zero); - IRTemp op = newTemp(Ity_D128); - IRTemp rounding_mode = encode_dfp_rounding_mode(m3); + IRTemp op = newTemp(Ity_D128); + IRTemp rounding_mode = encode_dfp_rounding_mode(m3); - assign(op, get_dpr_pair(r2)); - put_gpr_dw0(r1, binop(Iop_D128toI64S, mkexpr(rounding_mode), mkexpr(op))); - s390_cc_thunk_put1d128Z(S390_CC_OP_DFP_128_TO_INT_64, op, rounding_mode); - } + assign(op, get_dpr_pair(r2)); + put_gpr_dw0(r1, binop(Iop_D128toI64S, mkexpr(rounding_mode), mkexpr(op))); + s390_cc_thunk_put1d128Z(S390_CC_OP_DFP_128_TO_INT_64, op, rounding_mode); return "cgxtra"; } static const HChar * s390_irgen_CEDTR(UChar r1, UChar r2) { - if (! s390_host_has_dfp) { - emulation_failure(EmFail_S390X_DFP_insn); - } else { - IRTemp op1 = newTemp(Ity_D64); - IRTemp op2 = newTemp(Ity_D64); - IRTemp cc_vex = newTemp(Ity_I32); - IRTemp cc_s390 = newTemp(Ity_I32); + IRTemp op1 = newTemp(Ity_D64); + IRTemp op2 = newTemp(Ity_D64); + IRTemp cc_vex = newTemp(Ity_I32); + IRTemp cc_s390 = newTemp(Ity_I32); - assign(op1, get_dpr_dw0(r1)); - assign(op2, get_dpr_dw0(r2)); - assign(cc_vex, binop(Iop_CmpExpD64, mkexpr(op1), mkexpr(op2))); + assign(op1, get_dpr_dw0(r1)); + assign(op2, get_dpr_dw0(r2)); + assign(cc_vex, binop(Iop_CmpExpD64, mkexpr(op1), mkexpr(op2))); - assign(cc_s390, convert_vex_dfpcc_to_s390(cc_vex)); - s390_cc_thunk_put1(S390_CC_OP_SET, cc_s390, False); - } + assign(cc_s390, convert_vex_dfpcc_to_s390(cc_vex)); + s390_cc_thunk_put1(S390_CC_OP_SET, cc_s390, False); return "cedtr"; } static const HChar * s390_irgen_CEXTR(UChar r1, UChar r2) { - if (! s390_host_has_dfp) { - emulation_failure(EmFail_S390X_DFP_insn); - } else { - s390_insn_assert("cextr", is_valid_fpr_pair(r1)); - s390_insn_assert("cextr", is_valid_fpr_pair(r2)); + s390_insn_assert("cextr", is_valid_fpr_pair(r1)); + s390_insn_assert("cextr", is_valid_fpr_pair(r2)); - IRTemp op1 = newTemp(Ity_D128); - IRTemp op2 = newTemp(Ity_D128); - IRTemp cc_vex = newTemp(Ity_I32); - IRTemp cc_s390 = newTemp(Ity_I32); + IRTemp op1 = newTemp(Ity_D128); + IRTemp op2 = newTemp(Ity_D128); + IRTemp cc_vex = newTemp(Ity_I32); + IRTemp cc_s390 = newTemp(Ity_I32); - assign(op1, get_dpr_pair(r1)); - assign(op2, get_dpr_pair(r2)); - assign(cc_vex, binop(Iop_CmpExpD128, mkexpr(op1), mkexpr(op2))); + assign(op1, get_dpr_pair(r1)); + assign(op2, get_dpr_pair(r2)); + assign(cc_vex, binop(Iop_CmpExpD128, mkexpr(op1), mkexpr(op2))); - assign(cc_s390, convert_vex_dfpcc_to_s390(cc_vex)); - s390_cc_thunk_put1(S390_CC_OP_SET, cc_s390, False); - } + assign(cc_s390, convert_vex_dfpcc_to_s390(cc_vex)); + s390_cc_thunk_put1(S390_CC_OP_SET, cc_s390, False); return "cextr"; } static const HChar * s390_irgen_CLFDTR(UChar m3, UChar m4, UChar r1, UChar r2) { - if (! s390_host_has_dfp) { - emulation_failure(EmFail_S390X_DFP_insn); - } else { - if ((m4 & 0x4) != 0) - emulation_warning(EmWarn_S390X_XxC_not_zero); - IRTemp op = newTemp(Ity_D64); - IRTemp result = newTemp(Ity_I32); - IRTemp rounding_mode = encode_dfp_rounding_mode(m3); + if ((m4 & 0x4) != 0) + emulation_warning(EmWarn_S390X_XxC_not_zero); + IRTemp op = newTemp(Ity_D64); + IRTemp result = newTemp(Ity_I32); + IRTemp rounding_mode = encode_dfp_rounding_mode(m3); - assign(op, get_dpr_dw0(r2)); - assign(result, binop(Iop_D64toI32U, mkexpr(rounding_mode), - mkexpr(op))); - put_gpr_w1(r1, mkexpr(result)); - s390_cc_thunk_putFZ(S390_CC_OP_DFP_64_TO_UINT_32, op, rounding_mode); - } + assign(op, get_dpr_dw0(r2)); + assign(result, binop(Iop_D64toI32U, mkexpr(rounding_mode), mkexpr(op))); + put_gpr_w1(r1, mkexpr(result)); + s390_cc_thunk_putFZ(S390_CC_OP_DFP_64_TO_UINT_32, op, rounding_mode); return "clfdtr"; } static const HChar * s390_irgen_CLFXTR(UChar m3, UChar m4, UChar r1, UChar r2) { - if (! s390_host_has_dfp) { - emulation_failure(EmFail_S390X_DFP_insn); - } else { - s390_insn_assert("clfxtr", is_valid_fpr_pair(r2)); - if ((m4 & 0x4) != 0) - emulation_warning(EmWarn_S390X_XxC_not_zero); + s390_insn_assert("clfxtr", is_valid_fpr_pair(r2)); + if ((m4 & 0x4) != 0) + emulation_warning(EmWarn_S390X_XxC_not_zero); - IRTemp op = newTemp(Ity_D128); - IRTemp result = newTemp(Ity_I32); - IRTemp rounding_mode = encode_dfp_rounding_mode(m3); + IRTemp op = newTemp(Ity_D128); + IRTemp result = newTemp(Ity_I32); + IRTemp rounding_mode = encode_dfp_rounding_mode(m3); - assign(op, get_dpr_pair(r2)); - assign(result, binop(Iop_D128toI32U, mkexpr(rounding_mode), - mkexpr(op))); - put_gpr_w1(r1, mkexpr(result)); - s390_cc_thunk_put1d128Z(S390_CC_OP_DFP_128_TO_UINT_32, op, - rounding_mode); - } + assign(op, get_dpr_pair(r2)); + assign(result, binop(Iop_D128toI32U, mkexpr(rounding_mode), mkexpr(op))); + put_gpr_w1(r1, mkexpr(result)); + s390_cc_thunk_put1d128Z(S390_CC_OP_DFP_128_TO_UINT_32, op, rounding_mode); return "clfxtr"; } static const HChar * s390_irgen_CLGDTR(UChar m3, UChar m4, UChar r1, UChar r2) { - if (! s390_host_has_dfp) { - emulation_failure(EmFail_S390X_DFP_insn); - } else { - if ((m4 & 0x4) != 0) - emulation_warning(EmWarn_S390X_XxC_not_zero); - IRTemp op = newTemp(Ity_D64); - IRTemp result = newTemp(Ity_I64); - IRTemp rounding_mode = encode_dfp_rounding_mode(m3); - - assign(op, get_dpr_dw0(r2)); - assign(result, binop(Iop_D64toI64U, mkexpr(rounding_mode), - mkexpr(op))); - put_gpr_dw0(r1, mkexpr(result)); - s390_cc_thunk_putFZ(S390_CC_OP_DFP_64_TO_UINT_64, op, rounding_mode); - } + if ((m4 & 0x4) != 0) + emulation_warning(EmWarn_S390X_XxC_not_zero); + IRTemp op = newTemp(Ity_D64); + IRTemp result = newTemp(Ity_I64); + IRTemp rounding_mode = encode_dfp_rounding_mode(m3); + + assign(op, get_dpr_dw0(r2)); + assign(result, binop(Iop_D64toI64U, mkexpr(rounding_mode), mkexpr(op))); + put_gpr_dw0(r1, mkexpr(result)); + s390_cc_thunk_putFZ(S390_CC_OP_DFP_64_TO_UINT_64, op, rounding_mode); return "clgdtr"; } static const HChar * s390_irgen_CLGXTR(UChar m3, UChar m4, UChar r1, UChar r2) { - if (! s390_host_has_dfp) { - emulation_failure(EmFail_S390X_DFP_insn); - } else { - s390_insn_assert("clgxtr", is_valid_fpr_pair(r2)); - if ((m4 & 0x4) != 0) - emulation_warning(EmWarn_S390X_XxC_not_zero); + s390_insn_assert("clgxtr", is_valid_fpr_pair(r2)); + if ((m4 & 0x4) != 0) + emulation_warning(EmWarn_S390X_XxC_not_zero); - IRTemp op = newTemp(Ity_D128); - IRTemp result = newTemp(Ity_I64); - IRTemp rounding_mode = encode_dfp_rounding_mode(m3); + IRTemp op = newTemp(Ity_D128); + IRTemp result = newTemp(Ity_I64); + IRTemp rounding_mode = encode_dfp_rounding_mode(m3); - assign(op, get_dpr_pair(r2)); - assign(result, binop(Iop_D128toI64U, mkexpr(rounding_mode), - mkexpr(op))); - put_gpr_dw0(r1, mkexpr(result)); - s390_cc_thunk_put1d128Z(S390_CC_OP_DFP_128_TO_UINT_64, op, - rounding_mode); - } + assign(op, get_dpr_pair(r2)); + assign(result, binop(Iop_D128toI64U, mkexpr(rounding_mode), mkexpr(op))); + put_gpr_dw0(r1, mkexpr(result)); + s390_cc_thunk_put1d128Z(S390_CC_OP_DFP_128_TO_UINT_64, op, rounding_mode); return "clgxtr"; } static const HChar * s390_irgen_DDTRA(UChar r3, UChar m4, UChar r1, UChar r2) { - if (! s390_host_has_dfp) { - emulation_failure(EmFail_S390X_DFP_insn); - } else { - IRTemp op1 = newTemp(Ity_D64); - IRTemp op2 = newTemp(Ity_D64); - IRTemp result = newTemp(Ity_D64); - IRTemp rounding_mode; - - rounding_mode = encode_dfp_rounding_mode(m4); - assign(op1, get_dpr_dw0(r2)); - assign(op2, get_dpr_dw0(r3)); - assign(result, triop(Iop_DivD64, mkexpr(rounding_mode), mkexpr(op1), - mkexpr(op2))); - put_dpr_dw0(r1, mkexpr(result)); - } + IRTemp op1 = newTemp(Ity_D64); + IRTemp op2 = newTemp(Ity_D64); + IRTemp result = newTemp(Ity_D64); + IRTemp rounding_mode; + + rounding_mode = encode_dfp_rounding_mode(m4); + assign(op1, get_dpr_dw0(r2)); + assign(op2, get_dpr_dw0(r3)); + assign(result, triop(Iop_DivD64, mkexpr(rounding_mode), mkexpr(op1), + mkexpr(op2))); + put_dpr_dw0(r1, mkexpr(result)); return "ddtra"; } static const HChar * s390_irgen_DXTRA(UChar r3, UChar m4, UChar r1, UChar r2) { - if (! s390_host_has_dfp) { - emulation_failure(EmFail_S390X_DFP_insn); - } else { - s390_insn_assert("dxtra", is_valid_fpr_pair(r1)); - s390_insn_assert("dxtra", is_valid_fpr_pair(r2)); - s390_insn_assert("dxtra", is_valid_fpr_pair(r3)); - - IRTemp op1 = newTemp(Ity_D128); - IRTemp op2 = newTemp(Ity_D128); - IRTemp result = newTemp(Ity_D128); - IRTemp rounding_mode; - - rounding_mode = encode_dfp_rounding_mode(m4); - assign(op1, get_dpr_pair(r2)); - assign(op2, get_dpr_pair(r3)); - assign(result, triop(Iop_DivD128, mkexpr(rounding_mode), mkexpr(op1), - mkexpr(op2))); - put_dpr_pair(r1, mkexpr(result)); - } + s390_insn_assert("dxtra", is_valid_fpr_pair(r1)); + s390_insn_assert("dxtra", is_valid_fpr_pair(r2)); + s390_insn_assert("dxtra", is_valid_fpr_pair(r3)); + + IRTemp op1 = newTemp(Ity_D128); + IRTemp op2 = newTemp(Ity_D128); + IRTemp result = newTemp(Ity_D128); + IRTemp rounding_mode; + + rounding_mode = encode_dfp_rounding_mode(m4); + assign(op1, get_dpr_pair(r2)); + assign(op2, get_dpr_pair(r3)); + assign(result, triop(Iop_DivD128, mkexpr(rounding_mode), mkexpr(op1), + mkexpr(op2))); + put_dpr_pair(r1, mkexpr(result)); return "dxtra"; } static const HChar * s390_irgen_EEDTR(UChar r1, UChar r2) { - if (! s390_host_has_dfp) { - emulation_failure(EmFail_S390X_DFP_insn); - } else { - put_gpr_dw0(r1, unop(Iop_ExtractExpD64, get_dpr_dw0(r2))); - } + put_gpr_dw0(r1, unop(Iop_ExtractExpD64, get_dpr_dw0(r2))); return "eedtr"; } static const HChar * s390_irgen_EEXTR(UChar r1, UChar r2) { - if (! s390_host_has_dfp) { - emulation_failure(EmFail_S390X_DFP_insn); - } else { - s390_insn_assert("eextr", is_valid_fpr_pair(r2)); + s390_insn_assert("eextr", is_valid_fpr_pair(r2)); - put_gpr_dw0(r1, unop(Iop_ExtractExpD128, get_dpr_pair(r2))); - } + put_gpr_dw0(r1, unop(Iop_ExtractExpD128, get_dpr_pair(r2))); return "eextr"; } static const HChar * s390_irgen_ESDTR(UChar r1, UChar r2) { - if (! s390_host_has_dfp) { - emulation_failure(EmFail_S390X_DFP_insn); - } else { - put_gpr_dw0(r1, unop(Iop_ExtractSigD64, get_dpr_dw0(r2))); - } + put_gpr_dw0(r1, unop(Iop_ExtractSigD64, get_dpr_dw0(r2))); return "esdtr"; } static const HChar * s390_irgen_ESXTR(UChar r1, UChar r2) { - if (! s390_host_has_dfp) { - emulation_failure(EmFail_S390X_DFP_insn); - } else { - s390_insn_assert("esxtr", is_valid_fpr_pair(r2)); + s390_insn_assert("esxtr", is_valid_fpr_pair(r2)); - put_gpr_dw0(r1, unop(Iop_ExtractSigD128, get_dpr_pair(r2))); - } + put_gpr_dw0(r1, unop(Iop_ExtractSigD128, get_dpr_pair(r2))); return "esxtr"; } static const HChar * s390_irgen_IEDTR(UChar r3, UChar r1, UChar r2) { - if (! s390_host_has_dfp) { - emulation_failure(EmFail_S390X_DFP_insn); - } else { - IRTemp op1 = newTemp(Ity_I64); - IRTemp op2 = newTemp(Ity_D64); - IRTemp result = newTemp(Ity_D64); + IRTemp op1 = newTemp(Ity_I64); + IRTemp op2 = newTemp(Ity_D64); + IRTemp result = newTemp(Ity_D64); - assign(op1, get_gpr_dw0(r2)); - assign(op2, get_dpr_dw0(r3)); - assign(result, binop(Iop_InsertExpD64, mkexpr(op1), mkexpr(op2))); - put_dpr_dw0(r1, mkexpr(result)); - } + assign(op1, get_gpr_dw0(r2)); + assign(op2, get_dpr_dw0(r3)); + assign(result, binop(Iop_InsertExpD64, mkexpr(op1), mkexpr(op2))); + put_dpr_dw0(r1, mkexpr(result)); return "iedtr"; } static const HChar * s390_irgen_IEXTR(UChar r3, UChar r1, UChar r2) { - if (! s390_host_has_dfp) { - emulation_failure(EmFail_S390X_DFP_insn); - } else { - s390_insn_assert("iextr", is_valid_fpr_pair(r1)); - s390_insn_assert("iextr", is_valid_fpr_pair(r3)); + s390_insn_assert("iextr", is_valid_fpr_pair(r1)); + s390_insn_assert("iextr", is_valid_fpr_pair(r3)); - IRTemp op1 = newTemp(Ity_I64); - IRTemp op2 = newTemp(Ity_D128); - IRTemp result = newTemp(Ity_D128); + IRTemp op1 = newTemp(Ity_I64); + IRTemp op2 = newTemp(Ity_D128); + IRTemp result = newTemp(Ity_D128); - assign(op1, get_gpr_dw0(r2)); - assign(op2, get_dpr_pair(r3)); - assign(result, binop(Iop_InsertExpD128, mkexpr(op1), mkexpr(op2))); - put_dpr_pair(r1, mkexpr(result)); - } + assign(op1, get_gpr_dw0(r2)); + assign(op2, get_dpr_pair(r3)); + assign(result, binop(Iop_InsertExpD128, mkexpr(op1), mkexpr(op2))); + put_dpr_pair(r1, mkexpr(result)); return "iextr"; } static const HChar * s390_irgen_LDETR(UChar m4, UChar r1, UChar r2) { - if (! s390_host_has_dfp) { - emulation_failure(EmFail_S390X_DFP_insn); - } else { - if ((m4 & 0x8) != 0) - emulation_warning(EmWarn_S390X_XiC_not_zero); - IRTemp op = newTemp(Ity_D32); + if ((m4 & 0x8) != 0) + emulation_warning(EmWarn_S390X_XiC_not_zero); + IRTemp op = newTemp(Ity_D32); - assign(op, get_dpr_w0(r2)); - put_dpr_dw0(r1, unop(Iop_D32toD64, mkexpr(op))); - } + assign(op, get_dpr_w0(r2)); + put_dpr_dw0(r1, unop(Iop_D32toD64, mkexpr(op))); return "ldetr"; } static const HChar * s390_irgen_LXDTR(UChar m4, UChar r1, UChar r2) { - if (! s390_host_has_dfp) { - emulation_failure(EmFail_S390X_DFP_insn); - } else { - if ((m4 & 0x8) != 0) - emulation_warning(EmWarn_S390X_XiC_not_zero); - s390_insn_assert("lxdtr", is_valid_fpr_pair(r1)); + if ((m4 & 0x8) != 0) + emulation_warning(EmWarn_S390X_XiC_not_zero); + s390_insn_assert("lxdtr", is_valid_fpr_pair(r1)); - IRTemp op = newTemp(Ity_D64); + IRTemp op = newTemp(Ity_D64); - assign(op, get_dpr_dw0(r2)); - put_dpr_pair(r1, unop(Iop_D64toD128, mkexpr(op))); - } + assign(op, get_dpr_dw0(r2)); + put_dpr_pair(r1, unop(Iop_D64toD128, mkexpr(op))); return "lxdtr"; } static const HChar * s390_irgen_LDXTR(UChar m3, UChar m4, UChar r1, UChar r2) { - if (! s390_host_has_dfp) { - emulation_failure(EmFail_S390X_DFP_insn); - } else { - s390_insn_assert("ldxtr", is_valid_fpr_pair(r1)); - s390_insn_assert("ldxtr", is_valid_fpr_pair(r2)); + s390_insn_assert("ldxtr", is_valid_fpr_pair(r1)); + s390_insn_assert("ldxtr", is_valid_fpr_pair(r2)); - if ((m4 & 0x8) != 0) - emulation_warning(EmWarn_S390X_XiC_not_zero); - if ((m4 & 0x4) != 0) - emulation_warning(EmWarn_S390X_XxC_not_zero); - IRTemp result = newTemp(Ity_D64); + if ((m4 & 0x8) != 0) + emulation_warning(EmWarn_S390X_XiC_not_zero); + if ((m4 & 0x4) != 0) + emulation_warning(EmWarn_S390X_XxC_not_zero); + IRTemp result = newTemp(Ity_D64); - assign(result, binop(Iop_D128toD64, mkexpr(encode_dfp_rounding_mode(m3)), - get_dpr_pair(r2))); - put_dpr_dw0(r1, mkexpr(result)); - } + assign(result, binop(Iop_D128toD64, mkexpr(encode_dfp_rounding_mode(m3)), + get_dpr_pair(r2))); + put_dpr_dw0(r1, mkexpr(result)); return "ldxtr"; } static const HChar * s390_irgen_LEDTR(UChar m3, UChar m4, UChar r1, UChar r2) { - if (! s390_host_has_dfp) { - emulation_failure(EmFail_S390X_DFP_insn); - } else { - if ((m4 & 0x8) != 0) - emulation_warning(EmWarn_S390X_XiC_not_zero); - if ((m4 & 0x4) != 0) - emulation_warning(EmWarn_S390X_XxC_not_zero); - IRTemp op = newTemp(Ity_D64); + if ((m4 & 0x8) != 0) + emulation_warning(EmWarn_S390X_XiC_not_zero); + if ((m4 & 0x4) != 0) + emulation_warning(EmWarn_S390X_XxC_not_zero); + IRTemp op = newTemp(Ity_D64); - assign(op, get_dpr_dw0(r2)); - put_dpr_w0(r1, binop(Iop_D64toD32, mkexpr(encode_dfp_rounding_mode(m3)), - mkexpr(op))); - } + assign(op, get_dpr_dw0(r2)); + put_dpr_w0(r1, binop(Iop_D64toD32, mkexpr(encode_dfp_rounding_mode(m3)), + mkexpr(op))); return "ledtr"; } static const HChar * s390_irgen_LTDTR(UChar r1, UChar r2) { - if (! s390_host_has_dfp) { - emulation_failure(EmFail_S390X_DFP_insn); - } else { - IRTemp result = newTemp(Ity_D64); + IRTemp result = newTemp(Ity_D64); - assign(result, get_dpr_dw0(r2)); - put_dpr_dw0(r1, mkexpr(result)); - s390_cc_thunk_putF(S390_CC_OP_DFP_RESULT_64, result); - } + assign(result, get_dpr_dw0(r2)); + put_dpr_dw0(r1, mkexpr(result)); + s390_cc_thunk_putF(S390_CC_OP_DFP_RESULT_64, result); return "ltdtr"; } static const HChar * s390_irgen_LTXTR(UChar r1, UChar r2) { - if (! s390_host_has_dfp) { - emulation_failure(EmFail_S390X_DFP_insn); - } else { - s390_insn_assert("ltxtr", is_valid_fpr_pair(r1)); - s390_insn_assert("ltxtr", is_valid_fpr_pair(r2)); + s390_insn_assert("ltxtr", is_valid_fpr_pair(r1)); + s390_insn_assert("ltxtr", is_valid_fpr_pair(r2)); - IRTemp result = newTemp(Ity_D128); + IRTemp result = newTemp(Ity_D128); - assign(result, get_dpr_pair(r2)); - put_dpr_pair(r1, mkexpr(result)); - s390_cc_thunk_put1d128(S390_CC_OP_DFP_RESULT_128, result); - } + assign(result, get_dpr_pair(r2)); + put_dpr_pair(r1, mkexpr(result)); + s390_cc_thunk_put1d128(S390_CC_OP_DFP_RESULT_128, result); return "ltxtr"; } static const HChar * s390_irgen_MDTRA(UChar r3, UChar m4, UChar r1, UChar r2) { - if (! s390_host_has_dfp) { - emulation_failure(EmFail_S390X_DFP_insn); - } else { - IRTemp op1 = newTemp(Ity_D64); - IRTemp op2 = newTemp(Ity_D64); - IRTemp result = newTemp(Ity_D64); - IRTemp rounding_mode; - - rounding_mode = encode_dfp_rounding_mode(m4); - assign(op1, get_dpr_dw0(r2)); - assign(op2, get_dpr_dw0(r3)); - assign(result, triop(Iop_MulD64, mkexpr(rounding_mode), mkexpr(op1), - mkexpr(op2))); - put_dpr_dw0(r1, mkexpr(result)); - } + IRTemp op1 = newTemp(Ity_D64); + IRTemp op2 = newTemp(Ity_D64); + IRTemp result = newTemp(Ity_D64); + IRTemp rounding_mode; + + rounding_mode = encode_dfp_rounding_mode(m4); + assign(op1, get_dpr_dw0(r2)); + assign(op2, get_dpr_dw0(r3)); + assign(result, triop(Iop_MulD64, mkexpr(rounding_mode), mkexpr(op1), + mkexpr(op2))); + put_dpr_dw0(r1, mkexpr(result)); return "mdtra"; } static const HChar * s390_irgen_MXTRA(UChar r3, UChar m4, UChar r1, UChar r2) { - if (! s390_host_has_dfp) { - emulation_failure(EmFail_S390X_DFP_insn); - } else { - s390_insn_assert("mxtra", is_valid_fpr_pair(r1)); - s390_insn_assert("mxtra", is_valid_fpr_pair(r2)); - s390_insn_assert("mxtra", is_valid_fpr_pair(r3)); - - IRTemp op1 = newTemp(Ity_D128); - IRTemp op2 = newTemp(Ity_D128); - IRTemp result = newTemp(Ity_D128); - IRTemp rounding_mode; - - rounding_mode = encode_dfp_rounding_mode(m4); - assign(op1, get_dpr_pair(r2)); - assign(op2, get_dpr_pair(r3)); - assign(result, triop(Iop_MulD128, mkexpr(rounding_mode), mkexpr(op1), - mkexpr(op2))); - put_dpr_pair(r1, mkexpr(result)); - } + s390_insn_assert("mxtra", is_valid_fpr_pair(r1)); + s390_insn_assert("mxtra", is_valid_fpr_pair(r2)); + s390_insn_assert("mxtra", is_valid_fpr_pair(r3)); + + IRTemp op1 = newTemp(Ity_D128); + IRTemp op2 = newTemp(Ity_D128); + IRTemp result = newTemp(Ity_D128); + IRTemp rounding_mode; + + rounding_mode = encode_dfp_rounding_mode(m4); + assign(op1, get_dpr_pair(r2)); + assign(op2, get_dpr_pair(r3)); + assign(result, triop(Iop_MulD128, mkexpr(rounding_mode), mkexpr(op1), + mkexpr(op2))); + put_dpr_pair(r1, mkexpr(result)); return "mxtra"; } static const HChar * s390_irgen_QADTR(UChar r3, UChar m4, UChar r1, UChar r2) { - if (! s390_host_has_dfp) { - emulation_failure(EmFail_S390X_DFP_insn); - } else { - IRTemp op1 = newTemp(Ity_D64); - IRTemp op2 = newTemp(Ity_D64); - IRTemp result = newTemp(Ity_D64); - IRTemp rounding_mode; - - rounding_mode = encode_dfp_rounding_mode(m4); - assign(op1, get_dpr_dw0(r2)); - assign(op2, get_dpr_dw0(r3)); - assign(result, triop(Iop_QuantizeD64, mkexpr(rounding_mode), mkexpr(op1), - mkexpr(op2))); - put_dpr_dw0(r1, mkexpr(result)); - } + IRTemp op1 = newTemp(Ity_D64); + IRTemp op2 = newTemp(Ity_D64); + IRTemp result = newTemp(Ity_D64); + IRTemp rounding_mode; + + rounding_mode = encode_dfp_rounding_mode(m4); + assign(op1, get_dpr_dw0(r2)); + assign(op2, get_dpr_dw0(r3)); + assign(result, triop(Iop_QuantizeD64, mkexpr(rounding_mode), mkexpr(op1), + mkexpr(op2))); + put_dpr_dw0(r1, mkexpr(result)); return "qadtr"; } static const HChar * s390_irgen_QAXTR(UChar r3, UChar m4, UChar r1, UChar r2) { - if (! s390_host_has_dfp) { - emulation_failure(EmFail_S390X_DFP_insn); - } else { - s390_insn_assert("qaxtr", is_valid_fpr_pair(r1)); - s390_insn_assert("qaxtr", is_valid_fpr_pair(r2)); - s390_insn_assert("qaxtr", is_valid_fpr_pair(r3)); - - IRTemp op1 = newTemp(Ity_D128); - IRTemp op2 = newTemp(Ity_D128); - IRTemp result = newTemp(Ity_D128); - IRTemp rounding_mode; - - rounding_mode = encode_dfp_rounding_mode(m4); - assign(op1, get_dpr_pair(r2)); - assign(op2, get_dpr_pair(r3)); - assign(result, triop(Iop_QuantizeD128, mkexpr(rounding_mode), mkexpr(op1), - mkexpr(op2))); - put_dpr_pair(r1, mkexpr(result)); - } + s390_insn_assert("qaxtr", is_valid_fpr_pair(r1)); + s390_insn_assert("qaxtr", is_valid_fpr_pair(r2)); + s390_insn_assert("qaxtr", is_valid_fpr_pair(r3)); + + IRTemp op1 = newTemp(Ity_D128); + IRTemp op2 = newTemp(Ity_D128); + IRTemp result = newTemp(Ity_D128); + IRTemp rounding_mode; + + rounding_mode = encode_dfp_rounding_mode(m4); + assign(op1, get_dpr_pair(r2)); + assign(op2, get_dpr_pair(r3)); + assign(result, triop(Iop_QuantizeD128, mkexpr(rounding_mode), mkexpr(op1), + mkexpr(op2))); + put_dpr_pair(r1, mkexpr(result)); return "qaxtr"; } static const HChar * s390_irgen_RRDTR(UChar r3, UChar m4, UChar r1, UChar r2) { - if (! s390_host_has_dfp) { - emulation_failure(EmFail_S390X_DFP_insn); - } else { - IRTemp op1 = newTemp(Ity_I8); - IRTemp op2 = newTemp(Ity_D64); - IRTemp result = newTemp(Ity_D64); - IRTemp rounding_mode; - - rounding_mode = encode_dfp_rounding_mode(m4); - assign(op1, get_gpr_b7(r2)); - assign(op2, get_dpr_dw0(r3)); - assign(result, triop(Iop_SignificanceRoundD64, mkexpr(rounding_mode), - mkexpr(op1), mkexpr(op2))); - put_dpr_dw0(r1, mkexpr(result)); - } + IRTemp op1 = newTemp(Ity_I8); + IRTemp op2 = newTemp(Ity_D64); + IRTemp result = newTemp(Ity_D64); + IRTemp rounding_mode; + + rounding_mode = encode_dfp_rounding_mode(m4); + assign(op1, get_gpr_b7(r2)); + assign(op2, get_dpr_dw0(r3)); + assign(result, triop(Iop_SignificanceRoundD64, mkexpr(rounding_mode), + mkexpr(op1), mkexpr(op2))); + put_dpr_dw0(r1, mkexpr(result)); return "rrdtr"; } static const HChar * s390_irgen_RRXTR(UChar r3, UChar m4, UChar r1, UChar r2) { - if (! s390_host_has_dfp) { - emulation_failure(EmFail_S390X_DFP_insn); - } else { - s390_insn_assert("rrxtr", is_valid_fpr_pair(r1)); - s390_insn_assert("rrxtr", is_valid_fpr_pair(r3)); + s390_insn_assert("rrxtr", is_valid_fpr_pair(r1)); + s390_insn_assert("rrxtr", is_valid_fpr_pair(r3)); - IRTemp op1 = newTemp(Ity_I8); - IRTemp op2 = newTemp(Ity_D128); - IRTemp result = newTemp(Ity_D128); - IRTemp rounding_mode; - - rounding_mode = encode_dfp_rounding_mode(m4); - assign(op1, get_gpr_b7(r2)); - assign(op2, get_dpr_pair(r3)); - assign(result, triop(Iop_SignificanceRoundD128, mkexpr(rounding_mode), - mkexpr(op1), mkexpr(op2))); - put_dpr_pair(r1, mkexpr(result)); - } + IRTemp op1 = newTemp(Ity_I8); + IRTemp op2 = newTemp(Ity_D128); + IRTemp result = newTemp(Ity_D128); + IRTemp rounding_mode; + + rounding_mode = encode_dfp_rounding_mode(m4); + assign(op1, get_gpr_b7(r2)); + assign(op2, get_dpr_pair(r3)); + assign(result, triop(Iop_SignificanceRoundD128, mkexpr(rounding_mode), + mkexpr(op1), mkexpr(op2))); + put_dpr_pair(r1, mkexpr(result)); return "rrxtr"; } static const HChar * s390_irgen_SDTRA(UChar r3, UChar m4, UChar r1, UChar r2) { - if (! s390_host_has_dfp) { - emulation_failure(EmFail_S390X_DFP_insn); - } else { - IRTemp op1 = newTemp(Ity_D64); - IRTemp op2 = newTemp(Ity_D64); - IRTemp result = newTemp(Ity_D64); - IRTemp rounding_mode; - - rounding_mode = encode_dfp_rounding_mode(m4); - assign(op1, get_dpr_dw0(r2)); - assign(op2, get_dpr_dw0(r3)); - assign(result, triop(Iop_SubD64, mkexpr(rounding_mode), mkexpr(op1), - mkexpr(op2))); - s390_cc_thunk_putF(S390_CC_OP_DFP_RESULT_64, result); - put_dpr_dw0(r1, mkexpr(result)); - } + IRTemp op1 = newTemp(Ity_D64); + IRTemp op2 = newTemp(Ity_D64); + IRTemp result = newTemp(Ity_D64); + IRTemp rounding_mode; + + rounding_mode = encode_dfp_rounding_mode(m4); + assign(op1, get_dpr_dw0(r2)); + assign(op2, get_dpr_dw0(r3)); + assign(result, triop(Iop_SubD64, mkexpr(rounding_mode), mkexpr(op1), + mkexpr(op2))); + s390_cc_thunk_putF(S390_CC_OP_DFP_RESULT_64, result); + put_dpr_dw0(r1, mkexpr(result)); return "sdtra"; } static const HChar * s390_irgen_SXTRA(UChar r3, UChar m4, UChar r1, UChar r2) { - if (! s390_host_has_dfp) { - emulation_failure(EmFail_S390X_DFP_insn); - } else { - s390_insn_assert("sxtra", is_valid_fpr_pair(r1)); - s390_insn_assert("sxtra", is_valid_fpr_pair(r2)); - s390_insn_assert("sxtra", is_valid_fpr_pair(r3)); + s390_insn_assert("sxtra", is_valid_fpr_pair(r1)); + s390_insn_assert("sxtra", is_valid_fpr_pair(r2)); + s390_insn_assert("sxtra", is_valid_fpr_pair(r3)); - IRTemp op1 = newTemp(Ity_D128); - IRTemp op2 = newTemp(Ity_D128); - IRTemp result = newTemp(Ity_D128); - IRTemp rounding_mode; - - rounding_mode = encode_dfp_rounding_mode(m4); - assign(op1, get_dpr_pair(r2)); - assign(op2, get_dpr_pair(r3)); - assign(result, triop(Iop_SubD128, mkexpr(rounding_mode), mkexpr(op1), - mkexpr(op2))); - put_dpr_pair(r1, mkexpr(result)); + IRTemp op1 = newTemp(Ity_D128); + IRTemp op2 = newTemp(Ity_D128); + IRTemp result = newTemp(Ity_D128); + IRTemp rounding_mode; - s390_cc_thunk_put1d128(S390_CC_OP_DFP_RESULT_128, result); - } + rounding_mode = encode_dfp_rounding_mode(m4); + assign(op1, get_dpr_pair(r2)); + assign(op2, get_dpr_pair(r3)); + assign(result, triop(Iop_SubD128, mkexpr(rounding_mode), mkexpr(op1), + mkexpr(op2))); + put_dpr_pair(r1, mkexpr(result)); + s390_cc_thunk_put1d128(S390_CC_OP_DFP_RESULT_128, result); return "sxtra"; } static const HChar * s390_irgen_SLDT(UChar r3, IRTemp op2addr, UChar r1) { - if (! s390_host_has_dfp) { - emulation_failure(EmFail_S390X_DFP_insn); - } else { - IRTemp op = newTemp(Ity_D64); + IRTemp op = newTemp(Ity_D64); - assign(op, get_dpr_dw0(r3)); - put_dpr_dw0(r1, binop(Iop_ShlD64, mkexpr(op), - unop(Iop_64to8, binop(Iop_And64, mkexpr(op2addr), - mkU64(63))))); - } + assign(op, get_dpr_dw0(r3)); + put_dpr_dw0(r1, binop(Iop_ShlD64, mkexpr(op), + unop(Iop_64to8, binop(Iop_And64, mkexpr(op2addr), + mkU64(63))))); return "sldt"; } static const HChar * s390_irgen_SLXT(UChar r3, IRTemp op2addr, UChar r1) { - if (! s390_host_has_dfp) { - emulation_failure(EmFail_S390X_DFP_insn); - } else { - s390_insn_assert("slxt", is_valid_fpr_pair(r1)); - s390_insn_assert("slxt", is_valid_fpr_pair(r3)); + s390_insn_assert("slxt", is_valid_fpr_pair(r1)); + s390_insn_assert("slxt", is_valid_fpr_pair(r3)); - IRTemp op = newTemp(Ity_D128); + IRTemp op = newTemp(Ity_D128); - assign(op, get_dpr_pair(r3)); - put_dpr_pair(r1, binop(Iop_ShlD128, mkexpr(op), - unop(Iop_64to8, binop(Iop_And64, mkexpr(op2addr), - mkU64(63))))); - } + assign(op, get_dpr_pair(r3)); + put_dpr_pair(r1, binop(Iop_ShlD128, mkexpr(op), + unop(Iop_64to8, binop(Iop_And64, mkexpr(op2addr), + mkU64(63))))); return "slxt"; } static const HChar * s390_irgen_SRDT(UChar r3, IRTemp op2addr, UChar r1) { - if (! s390_host_has_dfp) { - emulation_failure(EmFail_S390X_DFP_insn); - } else { - IRTemp op = newTemp(Ity_D64); + IRTemp op = newTemp(Ity_D64); - assign(op, get_dpr_dw0(r3)); - put_dpr_dw0(r1, binop(Iop_ShrD64, mkexpr(op), - unop(Iop_64to8, binop(Iop_And64, mkexpr(op2addr), - mkU64(63))))); - } + assign(op, get_dpr_dw0(r3)); + put_dpr_dw0(r1, binop(Iop_ShrD64, mkexpr(op), + unop(Iop_64to8, binop(Iop_And64, mkexpr(op2addr), + mkU64(63))))); return "srdt"; } static const HChar * s390_irgen_SRXT(UChar r3, IRTemp op2addr, UChar r1) { - if (! s390_host_has_dfp) { - emulation_failure(EmFail_S390X_DFP_insn); - } else { - s390_insn_assert("srxt", is_valid_fpr_pair(r1)); - s390_insn_assert("srxt", is_valid_fpr_pair(r3)); + s390_insn_assert("srxt", is_valid_fpr_pair(r1)); + s390_insn_assert("srxt", is_valid_fpr_pair(r3)); - IRTemp op = newTemp(Ity_D128); + IRTemp op = newTemp(Ity_D128); - assign(op, get_dpr_pair(r3)); - put_dpr_pair(r1, binop(Iop_ShrD128, mkexpr(op), - unop(Iop_64to8, binop(Iop_And64, mkexpr(op2addr), - mkU64(63))))); - } + assign(op, get_dpr_pair(r3)); + put_dpr_pair(r1, binop(Iop_ShrD128, mkexpr(op), + unop(Iop_64to8, binop(Iop_And64, mkexpr(op2addr), + mkU64(63))))); return "srxt"; } static const HChar * s390_irgen_TDCET(UChar r1, IRTemp op2addr) { - if (! s390_host_has_dfp) { - emulation_failure(EmFail_S390X_DFP_insn); - } else { - IRTemp value = newTemp(Ity_D32); + IRTemp value = newTemp(Ity_D32); - assign(value, get_dpr_w0(r1)); + assign(value, get_dpr_w0(r1)); - s390_cc_thunk_putFZ(S390_CC_OP_DFP_TDC_32, value, op2addr); - } + s390_cc_thunk_putFZ(S390_CC_OP_DFP_TDC_32, value, op2addr); return "tdcet"; } static const HChar * s390_irgen_TDCDT(UChar r1, IRTemp op2addr) { - if (! s390_host_has_dfp) { - emulation_failure(EmFail_S390X_DFP_insn); - } else { - IRTemp value = newTemp(Ity_D64); + IRTemp value = newTemp(Ity_D64); - assign(value, get_dpr_dw0(r1)); + assign(value, get_dpr_dw0(r1)); - s390_cc_thunk_putFZ(S390_CC_OP_DFP_TDC_64, value, op2addr); - } + s390_cc_thunk_putFZ(S390_CC_OP_DFP_TDC_64, value, op2addr); return "tdcdt"; } static const HChar * s390_irgen_TDCXT(UChar r1, IRTemp op2addr) { - if (! s390_host_has_dfp) { - emulation_failure(EmFail_S390X_DFP_insn); - } else { - s390_insn_assert("tdcxt", is_valid_fpr_pair(r1)); + s390_insn_assert("tdcxt", is_valid_fpr_pair(r1)); - IRTemp value = newTemp(Ity_D128); + IRTemp value = newTemp(Ity_D128); - assign(value, get_dpr_pair(r1)); + assign(value, get_dpr_pair(r1)); - s390_cc_thunk_put1d128Z(S390_CC_OP_DFP_TDC_128, value, op2addr); - } + s390_cc_thunk_put1d128Z(S390_CC_OP_DFP_TDC_128, value, op2addr); return "tdcxt"; } static const HChar * s390_irgen_TDGET(UChar r1, IRTemp op2addr) { - if (! s390_host_has_dfp) { - emulation_failure(EmFail_S390X_DFP_insn); - } else { - IRTemp value = newTemp(Ity_D32); + IRTemp value = newTemp(Ity_D32); - assign(value, get_dpr_w0(r1)); + assign(value, get_dpr_w0(r1)); - s390_cc_thunk_putFZ(S390_CC_OP_DFP_TDG_32, value, op2addr); - } + s390_cc_thunk_putFZ(S390_CC_OP_DFP_TDG_32, value, op2addr); return "tdget"; } static const HChar * s390_irgen_TDGDT(UChar r1, IRTemp op2addr) { - if (! s390_host_has_dfp) { - emulation_failure(EmFail_S390X_DFP_insn); - } else { - IRTemp value = newTemp(Ity_D64); + IRTemp value = newTemp(Ity_D64); - assign(value, get_dpr_dw0(r1)); + assign(value, get_dpr_dw0(r1)); - s390_cc_thunk_putFZ(S390_CC_OP_DFP_TDG_64, value, op2addr); - } + s390_cc_thunk_putFZ(S390_CC_OP_DFP_TDG_64, value, op2addr); return "tdgdt"; } static const HChar * s390_irgen_TDGXT(UChar r1, IRTemp op2addr) { - if (! s390_host_has_dfp) { - emulation_failure(EmFail_S390X_DFP_insn); - } else { - s390_insn_assert("tdgxt", is_valid_fpr_pair(r1)); + s390_insn_assert("tdgxt", is_valid_fpr_pair(r1)); - IRTemp value = newTemp(Ity_D128); + IRTemp value = newTemp(Ity_D128); - assign(value, get_dpr_pair(r1)); + assign(value, get_dpr_pair(r1)); - s390_cc_thunk_put1d128Z(S390_CC_OP_DFP_TDG_128, value, op2addr); - } + s390_cc_thunk_put1d128Z(S390_CC_OP_DFP_TDG_128, value, op2addr); return "tdgxt"; } diff --git a/VEX/priv/host_s390_defs.c b/VEX/priv/host_s390_defs.c index 6f5191124..4831e1d67 100644 --- a/VEX/priv/host_s390_defs.c +++ b/VEX/priv/host_s390_defs.c @@ -4562,7 +4562,6 @@ s390_emit_SXBR(UChar *p, UChar r1, UChar r2) static UChar * s390_emit_ADTRA(UChar *p, UChar r3, UChar m4, UChar r1, UChar r2) { - vassert(s390_host_has_dfp); if (UNLIKELY(vex_traceflags & VEX_TRACE_ASM)) S390_DISASM(XMNM("adtra", adtra_like_disasm), FPR(r1), FPR(r2), FPR(r3), MASK(m4)); @@ -4573,7 +4572,6 @@ s390_emit_ADTRA(UChar *p, UChar r3, UChar m4, UChar r1, UChar r2) static UChar * s390_emit_AXTRA(UChar *p, UChar r3, UChar m4, UChar r1, UChar r2) { - vassert(s390_host_has_dfp); if (UNLIKELY(vex_traceflags & VEX_TRACE_ASM)) S390_DISASM(XMNM("axtra", adtra_like_disasm), FPR(r1), FPR(r2), FPR(r3), MASK(m4)); @@ -4584,7 +4582,6 @@ s390_emit_AXTRA(UChar *p, UChar r3, UChar m4, UChar r1, UChar r2) static UChar * s390_emit_CDTR(UChar *p, UChar r1, UChar r2) { - vassert(s390_host_has_dfp); if (UNLIKELY(vex_traceflags & VEX_TRACE_ASM)) S390_DISASM(MNM("cdtr"), FPR(r1), FPR(r2)); @@ -4595,7 +4592,6 @@ s390_emit_CDTR(UChar *p, UChar r1, UChar r2) static UChar * s390_emit_CXTR(UChar *p, UChar r1, UChar r2) { - vassert(s390_host_has_dfp); if (UNLIKELY(vex_traceflags & VEX_TRACE_ASM)) S390_DISASM(MNM("cxtr"), FPR(r1), FPR(r2)); @@ -4606,7 +4602,6 @@ s390_emit_CXTR(UChar *p, UChar r1, UChar r2) static UChar * s390_emit_CDGTRA(UChar *p, UChar m3, UChar m4, UChar r1, UChar r2) { - vassert(s390_host_has_dfp); vassert(m4 == 0); if (UNLIKELY(vex_traceflags & VEX_TRACE_ASM)) @@ -4619,7 +4614,6 @@ s390_emit_CDGTRA(UChar *p, UChar m3, UChar m4, UChar r1, UChar r2) static UChar * s390_emit_CXGTRA(UChar *p, UChar m3, UChar m4, UChar r1, UChar r2) { - vassert(s390_host_has_dfp); vassert(m4 == 0); /* rounding mode m3 is not considered, as the corresponding IRop (Iop_I64StoD128) does not take rounding mode. */ @@ -4636,7 +4630,6 @@ static UChar * s390_emit_CDFTR(UChar *p, UChar m3, UChar m4, UChar r1, UChar r2) { vassert(m4 == 0); - vassert(s390_host_has_dfp); if (UNLIKELY(vex_traceflags & VEX_TRACE_ASM)) S390_DISASM(XMNM("cdftr", fp_convf_disasm), FPR(r1), MASK(m3), GPR(r2), MASK(m4)); @@ -4649,7 +4642,6 @@ static UChar * s390_emit_CXFTR(UChar *p, UChar m3, UChar m4, UChar r1, UChar r2) { vassert(m4 == 0); - vassert(s390_host_has_dfp); if (UNLIKELY(vex_traceflags & VEX_TRACE_ASM)) S390_DISASM(XMNM("cxftr", fp_convf_disasm), FPR(r1), MASK(m3), GPR(r2), MASK(m4)); @@ -4662,7 +4654,6 @@ static UChar * s390_emit_CDLFTR(UChar *p, UChar m3, UChar m4, UChar r1, UChar r2) { vassert(m4 == 0); - vassert(s390_host_has_dfp); if (UNLIKELY(vex_traceflags & VEX_TRACE_ASM)) S390_DISASM(XMNM("cdlftr", fp_convf_disasm), FPR(r1), MASK(m3), GPR(r2), MASK(m4)); @@ -4675,7 +4666,6 @@ static UChar * s390_emit_CXLFTR(UChar *p, UChar m3, UChar m4, UChar r1, UChar r2) { vassert(m4 == 0); - vassert(s390_host_has_dfp); if (UNLIKELY(vex_traceflags & VEX_TRACE_ASM)) S390_DISASM(XMNM("cxlftr", fp_convf_disasm), FPR(r1), MASK(m3), GPR(r2), MASK(m4)); @@ -4688,7 +4678,6 @@ static UChar * s390_emit_CDLGTR(UChar *p, UChar m3, UChar m4, UChar r1, UChar r2) { vassert(m4 == 0); - vassert(s390_host_has_dfp); if (UNLIKELY(vex_traceflags & VEX_TRACE_ASM)) S390_DISASM(XMNM("cdlgtr", fp_convf_disasm), FPR(r1), MASK(m3), GPR(r2), MASK(m4)); @@ -4701,7 +4690,6 @@ static UChar * s390_emit_CXLGTR(UChar *p, UChar m3, UChar m4, UChar r1, UChar r2) { vassert(m4 == 0); - vassert(s390_host_has_dfp); if (UNLIKELY(vex_traceflags & VEX_TRACE_ASM)) S390_DISASM(XMNM("cxlgtr", fp_convf_disasm), FPR(r1), MASK(m3), GPR(r2), MASK(m4)); @@ -4734,7 +4722,6 @@ static UChar * s390_emit_CFDTR(UChar *p, UChar m3, UChar m4, UChar r1, UChar r2) { vassert(m4 == 0); - vassert(s390_host_has_dfp); if (UNLIKELY(vex_traceflags & VEX_TRACE_ASM)) S390_DISASM(XMNM("cfdtr", fp_convt_disasm), GPR(r1), MASK(m3), FPR(r2), MASK(m4)); @@ -4747,7 +4734,6 @@ static UChar * s390_emit_CFXTR(UChar *p, UChar m3, UChar m4, UChar r1, UChar r2) { vassert(m4 == 0); - vassert(s390_host_has_dfp); if (UNLIKELY(vex_traceflags & VEX_TRACE_ASM)) S390_DISASM(XMNM("cfxtr", fp_convt_disasm), GPR(r1), MASK(m3), FPR(r2), MASK(m4)); @@ -4759,7 +4745,6 @@ s390_emit_CFXTR(UChar *p, UChar m3, UChar m4, UChar r1, UChar r2) static UChar * s390_emit_CGDTRA(UChar *p, UChar m3, UChar m4, UChar r1, UChar r2) { - vassert(s390_host_has_dfp); vassert(m4 == 0); if (UNLIKELY(vex_traceflags & VEX_TRACE_ASM)) @@ -4772,7 +4757,6 @@ s390_emit_CGDTRA(UChar *p, UChar m3, UChar m4, UChar r1, UChar r2) static UChar * s390_emit_CGXTRA(UChar *p, UChar m3, UChar m4, UChar r1, UChar r2) { - vassert(s390_host_has_dfp); vassert(m4 == 0); if (UNLIKELY(vex_traceflags & VEX_TRACE_ASM)) @@ -4786,7 +4770,6 @@ static UChar * s390_emit_CLFDTR(UChar *p, UChar m3, UChar m4, UChar r1, UChar r2) { vassert(m4 == 0); - vassert(s390_host_has_dfp); if (UNLIKELY(vex_traceflags & VEX_TRACE_ASM)) S390_DISASM(XMNM("clfdtr", fp_convt_disasm), GPR(r1), MASK(m3), FPR(r2), MASK(m4)); @@ -4799,7 +4782,6 @@ static UChar * s390_emit_CLFXTR(UChar *p, UChar m3, UChar m4, UChar r1, UChar r2) { vassert(m4 == 0); - vassert(s390_host_has_dfp); if (UNLIKELY(vex_traceflags & VEX_TRACE_ASM)) S390_DISASM(XMNM("clfxtr", fp_convt_disasm), GPR(r1), MASK(m3), FPR(r2), MASK(m4)); @@ -4812,7 +4794,6 @@ static UChar * s390_emit_CLGDTR(UChar *p, UChar m3, UChar m4, UChar r1, UChar r2) { vassert(m4 == 0); - vassert(s390_host_has_dfp); if (UNLIKELY(vex_traceflags & VEX_TRACE_ASM)) S390_DISASM(XMNM("clgdtr", fp_convt_disasm), GPR(r1), MASK(m3), FPR(r2), MASK(m4)); @@ -4825,7 +4806,6 @@ static UChar * s390_emit_CLGXTR(UChar *p, UChar m3, UChar m4, UChar r1, UChar r2) { vassert(m4 == 0); - vassert(s390_host_has_dfp); if (UNLIKELY(vex_traceflags & VEX_TRACE_ASM)) S390_DISASM(XMNM("clgxtr", fp_convt_disasm), GPR(r1), MASK(m3), FPR(r2), MASK(m4)); @@ -4837,7 +4817,6 @@ s390_emit_CLGXTR(UChar *p, UChar m3, UChar m4, UChar r1, UChar r2) static UChar * s390_emit_DDTRA(UChar *p, UChar r3, UChar m4, UChar r1, UChar r2) { - vassert(s390_host_has_dfp); if (UNLIKELY(vex_traceflags & VEX_TRACE_ASM)) S390_DISASM(XMNM("ddtra", adtra_like_disasm), FPR(r1), FPR(r2), FPR(r3), MASK(m4)); @@ -4848,7 +4827,6 @@ s390_emit_DDTRA(UChar *p, UChar r3, UChar m4, UChar r1, UChar r2) static UChar * s390_emit_DXTRA(UChar *p, UChar r3, UChar m4, UChar r1, UChar r2) { - vassert(s390_host_has_dfp); if (UNLIKELY(vex_traceflags & VEX_TRACE_ASM)) S390_DISASM(XMNM("dxtra", adtra_like_disasm), FPR(r1), FPR(r2), FPR(r3), MASK(m4)); @@ -4919,7 +4897,6 @@ s390_emit_IEXTR(UChar *p, UChar r3, UChar r1, UChar r2) static UChar * s390_emit_LDETR(UChar *p, UChar m4, UChar r1, UChar r2) { - vassert(s390_host_has_dfp); if (UNLIKELY(vex_traceflags & VEX_TRACE_ASM)) S390_DISASM(MNM("ldetr"), FPR(r1), FPR(r2), UINT(m4)); @@ -4930,7 +4907,6 @@ s390_emit_LDETR(UChar *p, UChar m4, UChar r1, UChar r2) static UChar * s390_emit_LXDTR(UChar *p, UChar m4, UChar r1, UChar r2) { - vassert(s390_host_has_dfp); if (UNLIKELY(vex_traceflags & VEX_TRACE_ASM)) S390_DISASM(MNM("lxdtr"), FPR(r1), FPR(r2), UINT(m4)); @@ -4941,7 +4917,6 @@ s390_emit_LXDTR(UChar *p, UChar m4, UChar r1, UChar r2) static UChar * s390_emit_LEDTR(UChar *p, UChar m3, UChar m4, UChar r1, UChar r2) { - vassert(s390_host_has_dfp); vassert(m4 == 0); if (UNLIKELY(vex_traceflags & VEX_TRACE_ASM)) @@ -4954,7 +4929,6 @@ s390_emit_LEDTR(UChar *p, UChar m3, UChar m4, UChar r1, UChar r2) static UChar * s390_emit_LDXTR(UChar *p, UChar m3, UChar m4, UChar r1, UChar r2) { - vassert(s390_host_has_dfp); vassert(m4 == 0); if (UNLIKELY(vex_traceflags & VEX_TRACE_ASM)) @@ -4967,7 +4941,6 @@ s390_emit_LDXTR(UChar *p, UChar m3, UChar m4, UChar r1, UChar r2) static UChar * s390_emit_MDTRA(UChar *p, UChar r3, UChar m4, UChar r1, UChar r2) { - vassert(s390_host_has_dfp); if (UNLIKELY(vex_traceflags & VEX_TRACE_ASM)) S390_DISASM(XMNM("mdtra", adtra_like_disasm), FPR(r1), FPR(r2), FPR(r3), MASK(m4)); @@ -4978,7 +4951,6 @@ s390_emit_MDTRA(UChar *p, UChar r3, UChar m4, UChar r1, UChar r2) static UChar * s390_emit_MXTRA(UChar *p, UChar r3, UChar m4, UChar r1, UChar r2) { - vassert(s390_host_has_dfp); if (UNLIKELY(vex_traceflags & VEX_TRACE_ASM)) S390_DISASM(XMNM("mxtra", adtra_like_disasm), FPR(r1), FPR(r2), FPR(r3), MASK(m4)); @@ -5010,7 +4982,6 @@ s390_emit_PFPO(UChar *p) static UChar * s390_emit_QADTR(UChar *p, UChar r3, UChar m4, UChar r1, UChar r2) { - vassert(s390_host_has_dfp); if (UNLIKELY(vex_traceflags & VEX_TRACE_ASM)) S390_DISASM(MNM("qadtr"), FPR(r1), FPR(r3), FPR(r2), UINT(m4)); @@ -5021,7 +4992,6 @@ s390_emit_QADTR(UChar *p, UChar r3, UChar m4, UChar r1, UChar r2) static UChar * s390_emit_QAXTR(UChar *p, UChar r3, UChar m4, UChar r1, UChar r2) { - vassert(s390_host_has_dfp); if (UNLIKELY(vex_traceflags & VEX_TRACE_ASM)) S390_DISASM(MNM("qaxtr"), FPR(r1), FPR(r3), FPR(r2), UINT(m4)); @@ -5032,7 +5002,6 @@ s390_emit_QAXTR(UChar *p, UChar r3, UChar m4, UChar r1, UChar r2) static UChar * s390_emit_RRDTR(UChar *p, UChar r3, UChar m4, UChar r1, UChar r2) { - vassert(s390_host_has_dfp); if (UNLIKELY(vex_traceflags & VEX_TRACE_ASM)) S390_DISASM(MNM("rrdtr"), FPR(r1), FPR(r3), GPR(r2), UINT(m4)); @@ -5043,7 +5012,6 @@ s390_emit_RRDTR(UChar *p, UChar r3, UChar m4, UChar r1, UChar r2) static UChar * s390_emit_RRXTR(UChar *p, UChar r3, UChar m4, UChar r1, UChar r2) { - vassert(s390_host_has_dfp); if (UNLIKELY(vex_traceflags & VEX_TRACE_ASM)) S390_DISASM(MNM("rrxtr"), FPR(r1), FPR(r3), GPR(r2), UINT(m4)); @@ -5054,7 +5022,6 @@ s390_emit_RRXTR(UChar *p, UChar r3, UChar m4, UChar r1, UChar r2) static UChar * s390_emit_SDTRA(UChar *p, UChar r3, UChar m4, UChar r1, UChar r2) { - vassert(s390_host_has_dfp); if (UNLIKELY(vex_traceflags & VEX_TRACE_ASM)) S390_DISASM(XMNM("sdtra", adtra_like_disasm), FPR(r1), FPR(r2), FPR(r3), MASK(m4)); @@ -5065,7 +5032,6 @@ s390_emit_SDTRA(UChar *p, UChar r3, UChar m4, UChar r1, UChar r2) static UChar * s390_emit_SXTRA(UChar *p, UChar r3, UChar m4, UChar r1, UChar r2) { - vassert(s390_host_has_dfp); if (UNLIKELY(vex_traceflags & VEX_TRACE_ASM)) S390_DISASM(XMNM("sxtra", adtra_like_disasm), FPR(r1), FPR(r2), FPR(r3), MASK(m4)); @@ -5076,7 +5042,6 @@ s390_emit_SXTRA(UChar *p, UChar r3, UChar m4, UChar r1, UChar r2) static UChar * s390_emit_SLDT(UChar *p, UChar r3, UChar r1, UChar r2) { - vassert(s390_host_has_dfp); if (UNLIKELY(vex_traceflags & VEX_TRACE_ASM)) S390_DISASM(MNM("sldt"), FPR(r1), FPR(r3), UDXB(0, 0, r2)); @@ -5087,7 +5052,6 @@ s390_emit_SLDT(UChar *p, UChar r3, UChar r1, UChar r2) static UChar * s390_emit_SLXT(UChar *p, UChar r3, UChar r1, UChar r2) { - vassert(s390_host_has_dfp); if (UNLIKELY(vex_traceflags & VEX_TRACE_ASM)) S390_DISASM(MNM("slxt"), FPR(r1), FPR(r3), UDXB(0, 0, r2)); @@ -5098,7 +5062,6 @@ s390_emit_SLXT(UChar *p, UChar r3, UChar r1, UChar r2) static UChar * s390_emit_SRDT(UChar *p, UChar r3, UChar r1, UChar r2) { - vassert(s390_host_has_dfp); if (UNLIKELY(vex_traceflags & VEX_TRACE_ASM)) S390_DISASM(MNM("srdt"), FPR(r1), FPR(r3), UDXB(0, 0, r2)); @@ -5109,7 +5072,6 @@ s390_emit_SRDT(UChar *p, UChar r3, UChar r1, UChar r2) static UChar * s390_emit_SRXT(UChar *p, UChar r3, UChar r1, UChar r2) { - vassert(s390_host_has_dfp); if (UNLIKELY(vex_traceflags & VEX_TRACE_ASM)) S390_DISASM(MNM("srxt"), FPR(r1), FPR(r3), UDXB(0, 0, r2)); diff --git a/VEX/priv/host_s390_defs.h b/VEX/priv/host_s390_defs.h index 89ebfc747..da0e2553e 100644 --- a/VEX/priv/host_s390_defs.h +++ b/VEX/priv/host_s390_defs.h @@ -922,8 +922,6 @@ extern UInt s390_host_hwcaps; (s390_host_hwcaps & (VEX_HWCAPS_S390X_EIMM)) #define s390_host_has_gie \ (s390_host_hwcaps & (VEX_HWCAPS_S390X_GIE)) -#define s390_host_has_dfp \ - (s390_host_hwcaps & (VEX_HWCAPS_S390X_DFP)) #define s390_host_has_fgx \ (s390_host_hwcaps & (VEX_HWCAPS_S390X_FGX)) #define s390_host_has_etf2 \ diff --git a/VEX/priv/main_main.c b/VEX/priv/main_main.c index 9a12eebad..1cdbd1b4b 100644 --- a/VEX/priv/main_main.c +++ b/VEX/priv/main_main.c @@ -1546,8 +1546,6 @@ const HChar* LibVEX_EmNote_string ( VexEmNote ew ) " IEEE-invalid-operation exceptions will not be suppressed."; case EmFail_S390X_pfpo: return "Instruction pfpo is not supported on this host"; - case EmFail_S390X_DFP_insn: - return "DFP instructions are 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"; @@ -1914,7 +1912,6 @@ static const HChar* show_hwcaps_s390x ( UInt hwcaps ) } hwcaps_list[] = { { VEX_HWCAPS_S390X_EIMM, "eimm" }, { VEX_HWCAPS_S390X_GIE, "gie" }, - { VEX_HWCAPS_S390X_DFP, "dfp" }, { VEX_HWCAPS_S390X_FGX, "fgx" }, { VEX_HWCAPS_S390X_ETF2, "etf2" }, { VEX_HWCAPS_S390X_ETF3, "etf3" }, diff --git a/VEX/pub/libvex.h b/VEX/pub/libvex.h index 8ff333bc4..a1db9dbf6 100644 --- a/VEX/pub/libvex.h +++ b/VEX/pub/libvex.h @@ -164,7 +164,6 @@ typedef #define VEX_HWCAPS_S390X_EIMM (1<<7) /* Extended-immediate facility */ #define VEX_HWCAPS_S390X_GIE (1<<8) /* General-instruction-extension facility */ -#define VEX_HWCAPS_S390X_DFP (1<<9) /* Decimal floating point facility */ #define VEX_HWCAPS_S390X_FGX (1<<10) /* FPR-GR transfer facility */ #define VEX_HWCAPS_S390X_ETF2 (1<<11) /* ETF2-enhancement facility */ #define VEX_HWCAPS_S390X_ETF3 (1<<13) /* ETF3-enhancement facility */ @@ -187,7 +186,6 @@ typedef /* Special value representing all available s390x hwcaps */ #define VEX_HWCAPS_S390X_ALL (VEX_HWCAPS_S390X_EIMM | \ VEX_HWCAPS_S390X_GIE | \ - VEX_HWCAPS_S390X_DFP | \ VEX_HWCAPS_S390X_FGX | \ VEX_HWCAPS_S390X_LSC | \ VEX_HWCAPS_S390X_ETF3 | \ diff --git a/VEX/pub/libvex_emnote.h b/VEX/pub/libvex_emnote.h index fc2053125..8e0fc1349 100644 --- a/VEX/pub/libvex_emnote.h +++ b/VEX/pub/libvex_emnote.h @@ -97,9 +97,6 @@ typedef /* pfpo insn is not supported on this host */ EmFail_S390X_pfpo, - /* DFP insns are not supported on this host */ - EmFail_S390X_DFP_insn, - /* GPR 0 contains invalid rounding mode for PFPO instruction */ EmFail_S390X_invalid_PFPO_rounding_mode, diff --git a/coregrind/m_machine.c b/coregrind/m_machine.c index a1fa59351..4690163f4 100644 --- a/coregrind/m_machine.c +++ b/coregrind/m_machine.c @@ -1567,7 +1567,6 @@ Bool VG_(machine_get_hwcaps)( void ) } fac_hwcaps[] = { { False, 21, VEX_HWCAPS_S390X_EIMM, "EIMM" }, { False, 34, VEX_HWCAPS_S390X_GIE, "GIE" }, - { False, 42, VEX_HWCAPS_S390X_DFP, "DFP" }, { False, 41, VEX_HWCAPS_S390X_FGX, "FGX" }, { False, 24, VEX_HWCAPS_S390X_ETF2, "ETF2" }, { False, 30, VEX_HWCAPS_S390X_ETF3, "ETF3" }, diff --git a/none/tests/s390x/dfp-1.vgtest b/none/tests/s390x/dfp-1.vgtest index 0423b34ad..4ec0137dc 100644 --- a/none/tests/s390x/dfp-1.vgtest +++ b/none/tests/s390x/dfp-1.vgtest @@ -1,2 +1 @@ prog: dfp-1 -prereq: test -e dfp-1 && ../../../tests/s390x_features s390x-dfp diff --git a/none/tests/s390x/dfp-2.vgtest b/none/tests/s390x/dfp-2.vgtest index 164632918..0619fc347 100644 --- a/none/tests/s390x/dfp-2.vgtest +++ b/none/tests/s390x/dfp-2.vgtest @@ -1,2 +1 @@ prog: dfp-2 -prereq: test -e dfp-2 && ../../../tests/s390x_features s390x-dfp diff --git a/none/tests/s390x/dfp-3.vgtest b/none/tests/s390x/dfp-3.vgtest index e2b5673e4..4748299da 100644 --- a/none/tests/s390x/dfp-3.vgtest +++ b/none/tests/s390x/dfp-3.vgtest @@ -1,2 +1 @@ prog: dfp-3 -prereq: test -e dfp-3 && ../../../tests/s390x_features s390x-dfp diff --git a/none/tests/s390x/dfp-4.vgtest b/none/tests/s390x/dfp-4.vgtest index 0ffc1a6d6..7591e189c 100644 --- a/none/tests/s390x/dfp-4.vgtest +++ b/none/tests/s390x/dfp-4.vgtest @@ -1,2 +1 @@ prog: dfp-4 -prereq: test -e dfp-4 && ../../../tests/s390x_features s390x-dfp diff --git a/none/tests/s390x/dfp-XiC.vgtest b/none/tests/s390x/dfp-XiC.vgtest index 6f4b2d0fd..74979eb9b 100644 --- a/none/tests/s390x/dfp-XiC.vgtest +++ b/none/tests/s390x/dfp-XiC.vgtest @@ -1,3 +1,2 @@ -prereq: ../../../tests/s390x_features s390x-dfp prog: /bin/true post: ./emwarn-gen.pl --dfp-XiC diff --git a/none/tests/s390x/dfp-XxC.vgtest b/none/tests/s390x/dfp-XxC.vgtest index 76cd80726..0f29e3fd6 100644 --- a/none/tests/s390x/dfp-XxC.vgtest +++ b/none/tests/s390x/dfp-XxC.vgtest @@ -1,3 +1,2 @@ -prereq: ../../../tests/s390x_features s390x-dfp prog: /bin/true post: ./emwarn-gen.pl --dfp-XxC diff --git a/none/tests/s390x/dfpconv.vgtest b/none/tests/s390x/dfpconv.vgtest index 0b0f133b3..cf2468daa 100644 --- a/none/tests/s390x/dfpconv.vgtest +++ b/none/tests/s390x/dfpconv.vgtest @@ -1,2 +1 @@ prog: dfpconv -prereq: test -e dfpconv && ../../../tests/s390x_features s390x-dfp diff --git a/none/tests/s390x/dfpext.vgtest b/none/tests/s390x/dfpext.vgtest index 9cca69158..2347c39bc 100644 --- a/none/tests/s390x/dfpext.vgtest +++ b/none/tests/s390x/dfpext.vgtest @@ -1,2 +1 @@ prog: dfpext -prereq: test -e dfpext && ../../../tests/s390x_features s390x-dfp diff --git a/none/tests/s390x/dfptest.vgtest b/none/tests/s390x/dfptest.vgtest index a6f129139..440c611b4 100644 --- a/none/tests/s390x/dfptest.vgtest +++ b/none/tests/s390x/dfptest.vgtest @@ -1,2 +1 @@ prog: dfptest -prereq: test -e dfptest && ../../../tests/s390x_features s390x-dfp diff --git a/none/tests/s390x/srnmt.vgtest b/none/tests/s390x/srnmt.vgtest index cb7a4485f..358127665 100644 --- a/none/tests/s390x/srnmt.vgtest +++ b/none/tests/s390x/srnmt.vgtest @@ -1,2 +1 @@ prog: srnmt -prereq: test -e srnmt && ../../../tests/s390x_features s390x-dfp diff --git a/tests/s390x_features.c b/tests/s390x_features.c index 560fbb843..1a5b4f5f7 100644 --- a/tests/s390x_features.c +++ b/tests/s390x_features.c @@ -237,8 +237,6 @@ static int go(char *feature, char *cpu) match = facilities[0] & FAC_BIT(35); } else if (strcmp(feature, "s390x-etf3") == 0 ) { match = facilities[0] & FAC_BIT(30); - } else if (strcmp(feature, "s390x-dfp") == 0 ) { - match = facilities[0] & FAC_BIT(42); } else if (strcmp(feature, "s390x-pfpo") == 0 ) { match = facilities[0] & FAC_BIT(44); } else if (strcmp(feature, "s390x-highw") == 0 ) {