/*--- Helpers for constructing IR. ---*/
/*------------------------------------------------------------*/
+/* Whether or not REGNO designates a valid FPR pair. */
+#define is_valid_fpr_pair(regno) (((regno) & 0x2) == 0)
+
+/* Whether or not REGNO designates an even-odd GPR pair. */
+#define is_valid_gpr_pair(regno) (((regno) & 0x1) == 0)
+
+#define is_valid_rounding_mode(rm) ((rm) < 8 && (rm) != 2)
+
+
/* Add a statement to the current irsb. */
static __inline__ void
stmt(IRStmt *st)
static const HChar *
s390_irgen_LPQ(UChar r1, IRTemp op2addr)
{
+ s390_insn_assert("lpq", is_valid_gpr_pair(r1));
+
put_gpr_dw0(r1, load(Ity_I64, mkexpr(op2addr)));
put_gpr_dw0(r1 + 1, load(Ity_I64, binop(Iop_Add64, mkexpr(op2addr), mkU64(8))
));
static const HChar *
s390_irgen_MR(UChar r1, UChar r2)
{
+ s390_insn_assert("mr", is_valid_gpr_pair(r1));
+
IRTemp op1 = newTemp(Ity_I32);
IRTemp op2 = newTemp(Ity_I32);
IRTemp result = newTemp(Ity_I64);
static const HChar *
s390_irgen_M(UChar r1, IRTemp op2addr)
{
+ s390_insn_assert("m", is_valid_gpr_pair(r1));
+
IRTemp op1 = newTemp(Ity_I32);
IRTemp op2 = newTemp(Ity_I32);
IRTemp result = newTemp(Ity_I64);
static const HChar *
s390_irgen_MFY(UChar r1, IRTemp op2addr)
{
+ s390_insn_assert("mfy", is_valid_gpr_pair(r1));
+
IRTemp op1 = newTemp(Ity_I32);
IRTemp op2 = newTemp(Ity_I32);
IRTemp result = newTemp(Ity_I64);
static const HChar *
s390_irgen_MG(UChar r1, IRTemp op2addr)
{
+ s390_insn_assert("mg", is_valid_gpr_pair(r1));
+
IRTemp op1 = newTemp(Ity_I64);
IRTemp op2 = newTemp(Ity_I64);
IRTemp result = newTemp(Ity_I128);
static const HChar *
s390_irgen_MGRK(UChar r3, UChar r1, UChar r2)
{
+ s390_insn_assert("mgrk", is_valid_gpr_pair(r1));
+
IRTemp op2 = newTemp(Ity_I64);
IRTemp op3 = newTemp(Ity_I64);
IRTemp result = newTemp(Ity_I128);
static const HChar *
s390_irgen_MLR(UChar r1, UChar r2)
{
+ s390_insn_assert("mlr", is_valid_gpr_pair(r1));
+
IRTemp op1 = newTemp(Ity_I32);
IRTemp op2 = newTemp(Ity_I32);
IRTemp result = newTemp(Ity_I64);
static const HChar *
s390_irgen_MLGR(UChar r1, UChar r2)
{
+ s390_insn_assert("mlgr", is_valid_gpr_pair(r1));
+
IRTemp op1 = newTemp(Ity_I64);
IRTemp op2 = newTemp(Ity_I64);
IRTemp result = newTemp(Ity_I128);
static const HChar *
s390_irgen_ML(UChar r1, IRTemp op2addr)
{
+ s390_insn_assert("ml", is_valid_gpr_pair(r1));
+
IRTemp op1 = newTemp(Ity_I32);
IRTemp op2 = newTemp(Ity_I32);
IRTemp result = newTemp(Ity_I64);
static const HChar *
s390_irgen_MLG(UChar r1, IRTemp op2addr)
{
+ s390_insn_assert("mlg", is_valid_gpr_pair(r1));
+
IRTemp op1 = newTemp(Ity_I64);
IRTemp op2 = newTemp(Ity_I64);
IRTemp result = newTemp(Ity_I128);
static const HChar *
s390_irgen_SLDA(UChar r1, IRTemp op2addr)
{
+ s390_insn_assert("slda", is_valid_gpr_pair(r1));
+
IRTemp p1 = newTemp(Ity_I64);
IRTemp p2 = newTemp(Ity_I64);
IRTemp op = newTemp(Ity_I64);
static const HChar *
s390_irgen_SLDL(UChar r1, IRTemp op2addr)
{
+ s390_insn_assert("sldl", is_valid_gpr_pair(r1));
+
IRTemp p1 = newTemp(Ity_I64);
IRTemp p2 = newTemp(Ity_I64);
IRTemp result = newTemp(Ity_I64);
static const HChar *
s390_irgen_SRDA(UChar r1, IRTemp op2addr)
{
+ s390_insn_assert("srda", is_valid_gpr_pair(r1));
+
IRTemp p1 = newTemp(Ity_I64);
IRTemp p2 = newTemp(Ity_I64);
IRTemp result = newTemp(Ity_I64);
static const HChar *
s390_irgen_SRDL(UChar r1, IRTemp op2addr)
{
+ s390_insn_assert("srdl", is_valid_gpr_pair(r1));
+
IRTemp p1 = newTemp(Ity_I64);
IRTemp p2 = newTemp(Ity_I64);
IRTemp result = newTemp(Ity_I64);
static const HChar *
s390_irgen_STPQ(UChar r1, IRTemp op2addr)
{
+ s390_insn_assert("stpq", is_valid_gpr_pair(r1));
+
store(mkexpr(op2addr), get_gpr_dw0(r1));
store(binop(Iop_Add64, mkexpr(op2addr), mkU64(8)), get_gpr_dw0(r1 + 1));
static const HChar *
s390_irgen_LXR(UChar r1, UChar r2)
{
+ s390_insn_assert("lxr", is_valid_fpr_pair(r1));
+ s390_insn_assert("lxr", is_valid_fpr_pair(r2));
+
put_fpr_dw0(r1, get_fpr_dw0(r2));
put_fpr_dw0(r1 + 2, get_fpr_dw0(r2 + 2));
static const HChar *
s390_irgen_LZXR(UChar r1)
{
+ s390_insn_assert("lzxr", is_valid_fpr_pair(r1));
+
put_fpr_dw0(r1, mkF64i(0x0));
put_fpr_dw0(r1 + 2, mkF64i(0x0));
emulation_warning(EmWarn_S390X_fpext_rounding);
m3 = S390_BFP_ROUND_PER_FPC;
}
+ s390_insn_assert("cefbra", is_valid_rounding_mode(m3));
+
IRTemp op2 = newTemp(Ity_I32);
assign(op2, get_gpr_w1(r2));
}
static const HChar *
-s390_irgen_CDFBRA(UChar m3 __attribute__((unused)),
+s390_irgen_CDFBRA(UChar m3,
UChar m4 __attribute__((unused)), UChar r1, UChar r2)
{
+ s390_insn_assert("cdfbra", is_valid_rounding_mode(m3));
+
IRTemp op2 = newTemp(Ity_I32);
assign(op2, get_gpr_w1(r2));
emulation_warning(EmWarn_S390X_fpext_rounding);
m3 = S390_BFP_ROUND_PER_FPC;
}
+ s390_insn_assert("cegbra", is_valid_rounding_mode(m3));
+
IRTemp op2 = newTemp(Ity_I64);
assign(op2, get_gpr_dw0(r2));
emulation_warning(EmWarn_S390X_fpext_rounding);
m3 = S390_BFP_ROUND_PER_FPC;
}
+ s390_insn_assert("cdgbra", is_valid_rounding_mode(m3));
+
IRTemp op2 = newTemp(Ity_I64);
assign(op2, get_gpr_dw0(r2));
if (! s390_host_has_fpext) {
emulation_failure(EmFail_S390X_fpext);
} else {
+ s390_insn_assert("celfbr", is_valid_rounding_mode(m3));
+
IRTemp op2 = newTemp(Ity_I32);
assign(op2, get_gpr_w1(r2));
}
static const HChar *
-s390_irgen_CDLFBR(UChar m3 __attribute__((unused)),
+s390_irgen_CDLFBR(UChar m3,
UChar m4 __attribute__((unused)), UChar r1, UChar r2)
{
if (! s390_host_has_fpext) {
emulation_failure(EmFail_S390X_fpext);
} else {
+ s390_insn_assert("cdlfbr", is_valid_rounding_mode(m3));
+
IRTemp op2 = newTemp(Ity_I32);
assign(op2, get_gpr_w1(r2));
if (! s390_host_has_fpext) {
emulation_failure(EmFail_S390X_fpext);
} else {
+ s390_insn_assert("celgbr", is_valid_rounding_mode(m3));
+
IRTemp op2 = newTemp(Ity_I64);
assign(op2, get_gpr_dw0(r2));
if (! s390_host_has_fpext) {
emulation_failure(EmFail_S390X_fpext);
} else {
+ s390_insn_assert("cdlgbr", is_valid_rounding_mode(m3));
+
IRTemp op2 = newTemp(Ity_I64);
assign(op2, get_gpr_dw0(r2));
if (! s390_host_has_fpext) {
emulation_failure(EmFail_S390X_fpext);
} else {
+ s390_insn_assert("clfebr", is_valid_rounding_mode(m3));
+
IRTemp op = newTemp(Ity_F32);
IRTemp result = newTemp(Ity_I32);
IRTemp rounding_mode = encode_bfp_rounding_mode(m3);
if (! s390_host_has_fpext) {
emulation_failure(EmFail_S390X_fpext);
} else {
+ s390_insn_assert("clfdbr", is_valid_rounding_mode(m3));
+
IRTemp op = newTemp(Ity_F64);
IRTemp result = newTemp(Ity_I32);
IRTemp rounding_mode = encode_bfp_rounding_mode(m3);
if (! s390_host_has_fpext) {
emulation_failure(EmFail_S390X_fpext);
} else {
+ s390_insn_assert("clgebr", is_valid_rounding_mode(m3));
+
IRTemp op = newTemp(Ity_F32);
IRTemp result = newTemp(Ity_I64);
IRTemp rounding_mode = encode_bfp_rounding_mode(m3);
if (! s390_host_has_fpext) {
emulation_failure(EmFail_S390X_fpext);
} else {
+ s390_insn_assert("clgdbr", is_valid_rounding_mode(m3));
+
IRTemp op = newTemp(Ity_F64);
IRTemp result = newTemp(Ity_I64);
IRTemp rounding_mode = encode_bfp_rounding_mode(m3);
s390_irgen_CFEBRA(UChar m3, UChar m4 __attribute__((unused)),
UChar r1, UChar r2)
{
+ s390_insn_assert("cfebra", is_valid_rounding_mode(m3));
+
IRTemp op = newTemp(Ity_F32);
IRTemp result = newTemp(Ity_I32);
IRTemp rounding_mode = encode_bfp_rounding_mode(m3);
s390_irgen_CFDBRA(UChar m3, UChar m4 __attribute__((unused)),
UChar r1, UChar r2)
{
+ s390_insn_assert("cfdbra", is_valid_rounding_mode(m3));
+
IRTemp op = newTemp(Ity_F64);
IRTemp result = newTemp(Ity_I32);
IRTemp rounding_mode = encode_bfp_rounding_mode(m3);
s390_irgen_CGEBRA(UChar m3, UChar m4 __attribute__((unused)),
UChar r1, UChar r2)
{
+ s390_insn_assert("cgebra", is_valid_rounding_mode(m3));
+
IRTemp op = newTemp(Ity_F32);
IRTemp result = newTemp(Ity_I64);
IRTemp rounding_mode = encode_bfp_rounding_mode(m3);
s390_irgen_CGDBRA(UChar m3, UChar m4 __attribute__((unused)),
UChar r1, UChar r2)
{
+ s390_insn_assert("cgdbra", is_valid_rounding_mode(m3));
+
IRTemp op = newTemp(Ity_F64);
IRTemp result = newTemp(Ity_I64);
IRTemp rounding_mode = encode_bfp_rounding_mode(m3);
emulation_warning(EmWarn_S390X_fpext_rounding);
m3 = S390_BFP_ROUND_PER_FPC;
}
+ s390_insn_assert("ledbra", is_valid_rounding_mode(m3));
+
IRTemp op = newTemp(Ity_F64);
assign(op, get_fpr_dw0(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));
+
IRTemp op1 = newTemp(Ity_D128);
IRTemp op2 = newTemp(Ity_D128);
IRTemp result = newTemp(Ity_D128);
s390_cc_thunk_put1d128(S390_CC_OP_DFP_RESULT_128, result);
}
- return (m4 == 0) ? "axtr" : "axtra";
+ return "axtra";
}
static const HChar *
static const HChar *
s390_irgen_CXTR(UChar r1, UChar r2)
{
+ s390_insn_assert("cxtr", is_valid_fpr_pair(r1));
+ s390_insn_assert("cxtr", is_valid_fpr_pair(r2));
+
IRTemp op1 = newTemp(Ity_D128);
IRTemp op2 = newTemp(Ity_D128);
IRTemp cc_vex = newTemp(Ity_I32);
if (! s390_host_has_dfp) {
emulation_failure(EmFail_S390X_DFP_insn);
} else {
- if (! s390_host_has_fpext) {
- emulation_failure(EmFail_S390X_fpext);
- } else {
- IRTemp op2 = newTemp(Ity_I32);
+ 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";
}
if (! s390_host_has_dfp) {
emulation_failure(EmFail_S390X_DFP_insn);
} else {
- if (! s390_host_has_fpext) {
- emulation_failure(EmFail_S390X_fpext);
- } else {
- IRTemp op2 = newTemp(Ity_I32);
+ s390_insn_assert("cxftr", is_valid_fpr_pair(r1));
- assign(op2, get_gpr_w1(r2));
- put_dpr_pair(r1, unop(Iop_I32StoD128, mkexpr(op2)));
- }
+ IRTemp op2 = newTemp(Ity_I32);
+
+ assign(op2, get_gpr_w1(r2));
+ put_dpr_pair(r1, unop(Iop_I32StoD128, mkexpr(op2)));
}
return "cxftr";
}
if (! s390_host_has_dfp) {
emulation_failure(EmFail_S390X_DFP_insn);
} else {
+ s390_insn_assert("cxgtra", is_valid_fpr_pair(r1));
+
IRTemp op2 = newTemp(Ity_I64);
/* No emulation warning here about an non-zero m3 on hosts without
if (! s390_host_has_fpext) {
emulation_failure(EmFail_S390X_fpext);
} else {
+ s390_insn_assert("cxlftr", is_valid_fpr_pair(r1));
+
IRTemp op2 = newTemp(Ity_I32);
assign(op2, get_gpr_w1(r2));
if (! s390_host_has_fpext) {
emulation_failure(EmFail_S390X_fpext);
} else {
+ s390_insn_assert("cxlgtr", is_valid_fpr_pair(r1));
+
IRTemp op2 = newTemp(Ity_I64);
assign(op2, get_gpr_dw0(r2));
if (! s390_host_has_fpext) {
emulation_failure(EmFail_S390X_fpext);
} else {
+ s390_insn_assert("cfxtr", is_valid_fpr_pair(r2));
+
IRTemp op = newTemp(Ity_D128);
IRTemp result = newTemp(Ity_I32);
IRTemp rounding_mode = encode_dfp_rounding_mode(m3);
if (! s390_host_has_dfp) {
emulation_failure(EmFail_S390X_DFP_insn);
} else {
- IRTemp op = newTemp(Ity_D64);
- IRTemp rounding_mode = encode_dfp_rounding_mode(m3);
+ if (! s390_host_has_fpext) {
+ emulation_failure(EmFail_S390X_fpext);
+ } else {
+ IRTemp op = newTemp(Ity_D64);
+ IRTemp rounding_mode = encode_dfp_rounding_mode(m3);
- /* If fpext is not installed and m3 is in 1:7,
- rounding mode performed is unpredictable */
- if (! s390_host_has_fpext && m3 > 0 && m3 < 8) {
- emulation_warning(EmWarn_S390X_fpext_rounding);
- m3 = S390_DFP_ROUND_PER_FPC_0;
+ 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";
}
if (! s390_host_has_dfp) {
emulation_failure(EmFail_S390X_DFP_insn);
} else {
- IRTemp op = newTemp(Ity_D128);
- IRTemp rounding_mode = encode_dfp_rounding_mode(m3);
+ if (! s390_host_has_fpext) {
+ emulation_failure(EmFail_S390X_fpext);
+ } else {
+ s390_insn_assert("cgxtra", is_valid_fpr_pair(r2));
- /* If fpext is not installed and m3 is in 1:7,
- rounding mode performed is unpredictable */
- if (! s390_host_has_fpext && m3 > 0 && m3 < 8) {
- emulation_warning(EmWarn_S390X_fpext_rounding);
- m3 = S390_DFP_ROUND_PER_FPC_0;
+ 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";
}
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));
+
IRTemp op1 = newTemp(Ity_D128);
IRTemp op2 = newTemp(Ity_D128);
IRTemp cc_vex = newTemp(Ity_I32);
if (! s390_host_has_fpext) {
emulation_failure(EmFail_S390X_fpext);
} else {
+ s390_insn_assert("clfxtr", is_valid_fpr_pair(r2));
+
IRTemp op = newTemp(Ity_D128);
IRTemp result = newTemp(Ity_I32);
IRTemp rounding_mode = encode_dfp_rounding_mode(m3);
if (! s390_host_has_fpext) {
emulation_failure(EmFail_S390X_fpext);
} else {
+ s390_insn_assert("clgxtr", is_valid_fpr_pair(r2));
+
IRTemp op = newTemp(Ity_D128);
IRTemp result = newTemp(Ity_I64);
IRTemp rounding_mode = encode_dfp_rounding_mode(m3);
mkexpr(op2)));
put_dpr_dw0(r1, mkexpr(result));
}
- return (m4 == 0) ? "ddtr" : "ddtra";
+ return "ddtra";
}
static const HChar *
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);
mkexpr(op2)));
put_dpr_pair(r1, mkexpr(result));
}
- return (m4 == 0) ? "dxtr" : "dxtra";
+ return "dxtra";
}
static const HChar *
if (! s390_host_has_dfp) {
emulation_failure(EmFail_S390X_DFP_insn);
} else {
+ s390_insn_assert("eextr", is_valid_fpr_pair(r2));
+
put_gpr_dw0(r1, unop(Iop_ExtractExpD128, get_dpr_pair(r2)));
}
return "eextr";
if (! s390_host_has_dfp) {
emulation_failure(EmFail_S390X_DFP_insn);
} else {
+ s390_insn_assert("esxtr", is_valid_fpr_pair(r2));
+
put_gpr_dw0(r1, unop(Iop_ExtractSigD128, get_dpr_pair(r2)));
}
return "esxtr";
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));
+
IRTemp op1 = newTemp(Ity_I64);
IRTemp op2 = newTemp(Ity_D128);
IRTemp result = newTemp(Ity_D128);
static const HChar *
s390_irgen_LXDTR(UChar m4 __attribute__((unused)), UChar r1, UChar r2)
{
- IRTemp op = newTemp(Ity_D64);
+ if (! s390_host_has_dfp) {
+ emulation_failure(EmFail_S390X_DFP_insn);
+ } else {
+ s390_insn_assert("lxdtr", is_valid_fpr_pair(r1));
- assign(op, get_dpr_dw0(r2));
- put_dpr_pair(r1, unop(Iop_D64toD128, mkexpr(op)));
+ IRTemp op = newTemp(Ity_D64);
+ assign(op, get_dpr_dw0(r2));
+ put_dpr_pair(r1, unop(Iop_D64toD128, mkexpr(op)));
+ }
return "lxdtr";
}
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));
+
/* If fpext is not installed and m3 is in 1:7,
rounding mode performed is unpredictable */
if (! s390_host_has_fpext && m3 > 0 && m3 < 8) {
static const HChar *
s390_irgen_LTDTR(UChar r1, UChar r2)
{
- 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);
+ if (! s390_host_has_dfp) {
+ emulation_failure(EmFail_S390X_DFP_insn);
+ } else {
+ 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);
+ }
return "ltdtr";
}
static const HChar *
s390_irgen_LTXTR(UChar r1, UChar r2)
{
- IRTemp result = newTemp(Ity_D128);
+ 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));
- assign(result, get_dpr_pair(r2));
- put_dpr_pair(r1, mkexpr(result));
- s390_cc_thunk_put1d128(S390_CC_OP_DFP_RESULT_128, result);
+ 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);
+ }
return "ltxtr";
}
mkexpr(op2)));
put_dpr_dw0(r1, mkexpr(result));
}
- return (m4 == 0) ? "mdtr" : "mdtra";
+ return "mdtra";
}
static const HChar *
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);
mkexpr(op2)));
put_dpr_pair(r1, mkexpr(result));
}
- return (m4 == 0) ? "mxtr" : "mxtra";
+ return "mxtra";
}
static const HChar *
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);
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));
+
IRTemp op1 = newTemp(Ity_I8);
IRTemp op2 = newTemp(Ity_D128);
IRTemp result = newTemp(Ity_D128);
s390_cc_thunk_putF(S390_CC_OP_DFP_RESULT_64, result);
put_dpr_dw0(r1, mkexpr(result));
}
- return (m4 == 0) ? "sdtr" : "sdtra";
+ return "sdtra";
}
static const HChar *
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));
+
IRTemp op1 = newTemp(Ity_D128);
IRTemp op2 = newTemp(Ity_D128);
IRTemp result = newTemp(Ity_D128);
s390_cc_thunk_put1d128(S390_CC_OP_DFP_RESULT_128, result);
}
- return (m4 == 0) ? "sxtr" : "sxtra";
+ return "sxtra";
}
static const HChar *
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));
+
IRTemp op = newTemp(Ity_D128);
assign(op, get_dpr_pair(r3));
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));
+
IRTemp op = newTemp(Ity_D128);
assign(op, get_dpr_pair(r3));
if (! s390_host_has_dfp) {
emulation_failure(EmFail_S390X_DFP_insn);
} else {
+ s390_insn_assert("tdcxt", is_valid_fpr_pair(r1));
+
IRTemp value = newTemp(Ity_D128);
assign(value, get_dpr_pair(r1));
if (! s390_host_has_dfp) {
emulation_failure(EmFail_S390X_DFP_insn);
} else {
+ s390_insn_assert("tdgxt", is_valid_fpr_pair(r1));
+
IRTemp value = newTemp(Ity_D128);
assign(value, get_dpr_pair(r1));
static const HChar *
s390_irgen_CLCL(UChar r1, UChar r2)
{
+ s390_insn_assert("clcl", is_valid_gpr_pair(r1));
+ s390_insn_assert("clcl", is_valid_gpr_pair(r2));
+
IRTemp addr1 = newTemp(Ity_I64);
IRTemp addr2 = newTemp(Ity_I64);
IRTemp addr1_load = newTemp(Ity_I64);
static const HChar *
s390_irgen_CLCLE(UChar r1, UChar r3, IRTemp pad2)
{
+ s390_insn_assert("clcle", is_valid_gpr_pair(r1));
+ s390_insn_assert("clcle", is_valid_gpr_pair(r3));
+
IRTemp addr1, addr3, addr1_load, addr3_load, len1, len3, single1, single3;
addr1 = newTemp(Ity_I64);
static const HChar *
s390_irgen_MVCL(UChar r1, UChar r2)
{
+ s390_insn_assert("mvcl", is_valid_gpr_pair(r1));
+ s390_insn_assert("mvcl", is_valid_gpr_pair(r2));
+
IRTemp addr1 = newTemp(Ity_I64);
IRTemp addr2 = newTemp(Ity_I64);
IRTemp addr2_load = newTemp(Ity_I64);
static const HChar *
s390_irgen_MVCLE(UChar r1, UChar r3, IRTemp pad2)
{
+ s390_insn_assert("mvcle", is_valid_gpr_pair(r1));
+ s390_insn_assert("mvcle", is_valid_gpr_pair(r3));
+
IRTemp addr1, addr3, addr3_load, len1, len3, single;
addr1 = newTemp(Ity_I64);
static const HChar *
s390_irgen_DR(UChar r1, UChar r2)
{
+ s390_insn_assert("dr", is_valid_gpr_pair(r1));
+
IRTemp op2 = newTemp(Ity_I32);
assign(op2, get_gpr_w1(r2));
static const HChar *
s390_irgen_D(UChar r1, IRTemp op2addr)
{
+ s390_insn_assert("d", is_valid_gpr_pair(r1));
+
IRTemp op2 = newTemp(Ity_I32);
assign(op2, load(Ity_I32, mkexpr(op2addr)));
static const HChar *
s390_irgen_DLR(UChar r1, UChar r2)
{
+ s390_insn_assert("dlr", is_valid_gpr_pair(r1));
+
IRTemp op2 = newTemp(Ity_I32);
assign(op2, get_gpr_w1(r2));
static const HChar *
s390_irgen_DL(UChar r1, IRTemp op2addr)
{
+ s390_insn_assert("dl", is_valid_gpr_pair(r1));
+
IRTemp op2 = newTemp(Ity_I32);
assign(op2, load(Ity_I32, mkexpr(op2addr)));
static const HChar *
s390_irgen_DLG(UChar r1, IRTemp op2addr)
{
+ s390_insn_assert("dlg", is_valid_gpr_pair(r1));
+
IRTemp op2 = newTemp(Ity_I64);
assign(op2, load(Ity_I64, mkexpr(op2addr)));
static const HChar *
s390_irgen_DLGR(UChar r1, UChar r2)
{
+ s390_insn_assert("dlgr", is_valid_gpr_pair(r1));
+
IRTemp op2 = newTemp(Ity_I64);
assign(op2, get_gpr_dw0(r2));
static const HChar *
s390_irgen_DSGR(UChar r1, UChar r2)
{
+ s390_insn_assert("dsgr", is_valid_gpr_pair(r1));
+
IRTemp op2 = newTemp(Ity_I64);
assign(op2, get_gpr_dw0(r2));
static const HChar *
s390_irgen_DSG(UChar r1, IRTemp op2addr)
{
+ s390_insn_assert("dsg", is_valid_gpr_pair(r1));
+
IRTemp op2 = newTemp(Ity_I64);
assign(op2, load(Ity_I64, mkexpr(op2addr)));
static const HChar *
s390_irgen_DSGFR(UChar r1, UChar r2)
{
+ s390_insn_assert("dsgfr", is_valid_gpr_pair(r1));
+
IRTemp op2 = newTemp(Ity_I64);
assign(op2, unop(Iop_32Sto64, get_gpr_w1(r2)));
static const HChar *
s390_irgen_DSGF(UChar r1, IRTemp op2addr)
{
+ s390_insn_assert("dsgf", is_valid_gpr_pair(r1));
+
IRTemp op2 = newTemp(Ity_I64);
assign(op2, unop(Iop_32Sto64, load(Ity_I32, mkexpr(op2addr))));
static const HChar *
s390_irgen_CDS(UChar r1, UChar r3, IRTemp op2addr)
{
+ s390_insn_assert("cds", is_valid_gpr_pair(r1));
+ s390_insn_assert("cds", is_valid_gpr_pair(r3));
s390_irgen_cdas_32(r1, r3, op2addr);
return "cds";
static const HChar *
s390_irgen_CDSY(UChar r1, UChar r3, IRTemp op2addr)
{
+ s390_insn_assert("cdsy", is_valid_gpr_pair(r1));
+ s390_insn_assert("cdsy", is_valid_gpr_pair(r3));
s390_irgen_cdas_32(r1, r3, op2addr);
return "cdsy";
static const HChar *
s390_irgen_CDSG(UChar r1, UChar r3, IRTemp op2addr)
{
+ s390_insn_assert("cdsg", is_valid_gpr_pair(r1));
+ s390_insn_assert("cdsg", is_valid_gpr_pair(r3));
+
IRCAS *cas;
IRTemp op1_high = newTemp(Ity_I64);
IRTemp op1_low = newTemp(Ity_I64);
static const HChar *
s390_irgen_AXBR(UChar r1, UChar r2)
{
+ s390_insn_assert("axbr", is_valid_fpr_pair(r1));
+ s390_insn_assert("axbr", is_valid_fpr_pair(r2));
+
IRTemp op1 = newTemp(Ity_F128);
IRTemp op2 = newTemp(Ity_F128);
IRTemp result = newTemp(Ity_F128);
static const HChar *
s390_irgen_CXBR(UChar r1, UChar r2)
{
+ s390_insn_assert("cxbr", is_valid_fpr_pair(r1));
+ s390_insn_assert("cxbr", is_valid_fpr_pair(r2));
+
return s390_irgen_CxBR("cxbr", r1, r2, Ity_F128, Iop_CmpF128);
}
static const HChar *
s390_irgen_KXBR(UChar r1, UChar r2)
{
+ s390_insn_assert("kxbr", is_valid_fpr_pair(r1));
+ s390_insn_assert("kxbr", is_valid_fpr_pair(r2));
+
return s390_irgen_CxBR("kxbr", r1, r2, Ity_F128, Iop_CmpF128);
}
}
static const HChar *
-s390_irgen_CXFBRA(UChar m3 __attribute__((unused)),
+s390_irgen_CXFBRA(UChar m3,
UChar m4 __attribute__((unused)), UChar r1, UChar r2)
{
+ s390_insn_assert("cxfbra", is_valid_fpr_pair(r1));
+ s390_insn_assert("cxfbra", is_valid_rounding_mode(m3));
+
IRTemp op2 = newTemp(Ity_I32);
assign(op2, get_gpr_w1(r2));
}
static const HChar *
-s390_irgen_CXLFBR(UChar m3 __attribute__((unused)),
+s390_irgen_CXLFBR(UChar m3,
UChar m4 __attribute__((unused)), UChar r1, UChar r2)
{
if (! s390_host_has_fpext) {
emulation_failure(EmFail_S390X_fpext);
} else {
+ s390_insn_assert("cxlfbr", is_valid_fpr_pair(r1));
+ s390_insn_assert("cxlfbr", is_valid_rounding_mode(m3));
+
IRTemp op2 = newTemp(Ity_I32);
assign(op2, get_gpr_w1(r2));
static const HChar *
-s390_irgen_CXGBRA(UChar m3 __attribute__((unused)),
+s390_irgen_CXGBRA(UChar m3,
UChar m4 __attribute__((unused)), UChar r1, UChar r2)
{
+ s390_insn_assert("cxgbra", is_valid_fpr_pair(r1));
+ s390_insn_assert("cxgbra", is_valid_rounding_mode(m3));
+
IRTemp op2 = newTemp(Ity_I64);
assign(op2, get_gpr_dw0(r2));
}
static const HChar *
-s390_irgen_CXLGBR(UChar m3 __attribute__((unused)),
+s390_irgen_CXLGBR(UChar m3,
UChar m4 __attribute__((unused)), UChar r1, UChar r2)
{
if (! s390_host_has_fpext) {
emulation_failure(EmFail_S390X_fpext);
} else {
+ s390_insn_assert("cxlgbr", is_valid_fpr_pair(r1));
+ s390_insn_assert("cxlgbr", is_valid_rounding_mode(m3));
+
IRTemp op2 = newTemp(Ity_I64);
assign(op2, get_gpr_dw0(r2));
s390_irgen_CFXBRA(UChar m3, UChar m4 __attribute__((unused)),
UChar r1, UChar r2)
{
+ s390_insn_assert("cfxbra", is_valid_fpr_pair(r2));
+ s390_insn_assert("cfxbra", is_valid_rounding_mode(m3));
+
IRTemp op = newTemp(Ity_F128);
IRTemp result = newTemp(Ity_I32);
IRTemp rounding_mode = encode_bfp_rounding_mode(m3);
if (! s390_host_has_fpext) {
emulation_failure(EmFail_S390X_fpext);
} else {
+ s390_insn_assert("clfxbr", is_valid_fpr_pair(r2));
+ s390_insn_assert("clfxbr", is_valid_rounding_mode(m3));
+
IRTemp op = newTemp(Ity_F128);
IRTemp result = newTemp(Ity_I32);
IRTemp rounding_mode = encode_bfp_rounding_mode(m3);
s390_irgen_CGXBRA(UChar m3, UChar m4 __attribute__((unused)),
UChar r1, UChar r2)
{
+ s390_insn_assert("cgxbra", is_valid_fpr_pair(r2));
+ s390_insn_assert("cgxbra", is_valid_rounding_mode(m3));
+
IRTemp op = newTemp(Ity_F128);
IRTemp result = newTemp(Ity_I64);
IRTemp rounding_mode = encode_bfp_rounding_mode(m3);
if (! s390_host_has_fpext) {
emulation_failure(EmFail_S390X_fpext);
} else {
+ s390_insn_assert("clgxbr", is_valid_fpr_pair(r2));
+ s390_insn_assert("clgxbr", is_valid_rounding_mode(m3));
+
IRTemp op = newTemp(Ity_F128);
IRTemp result = newTemp(Ity_I64);
IRTemp rounding_mode = encode_bfp_rounding_mode(m3);
static const HChar *
s390_irgen_DXBR(UChar r1, UChar r2)
{
+ s390_insn_assert("dxbr", is_valid_fpr_pair(r1));
+ s390_insn_assert("dxbr", is_valid_fpr_pair(r2));
+
IRTemp op1 = newTemp(Ity_F128);
IRTemp op2 = newTemp(Ity_F128);
IRTemp result = newTemp(Ity_F128);
static const HChar *
s390_irgen_LTXBR(UChar r1, UChar r2)
{
+ s390_insn_assert("ltxbr", is_valid_fpr_pair(r1));
+ s390_insn_assert("ltxbr", is_valid_fpr_pair(r2));
+
IRTemp result = newTemp(Ity_F128);
assign(result, get_fpr_pair(r2));
static const HChar *
s390_irgen_LCXBR(UChar r1, UChar r2)
{
+ s390_insn_assert("lcxbr", is_valid_fpr_pair(r1));
+ s390_insn_assert("lcxbr", is_valid_fpr_pair(r2));
+
IRTemp result = newTemp(Ity_F128);
assign(result, unop(Iop_NegF128, get_fpr_pair(r2)));
static const HChar *
s390_irgen_LXDBR(UChar r1, UChar r2)
{
+ s390_insn_assert("lxdbr", is_valid_fpr_pair(r1));
+
IRTemp op = newTemp(Ity_F64);
assign(op, get_fpr_dw0(r2));
static const HChar *
s390_irgen_LXEBR(UChar r1, UChar r2)
{
+ s390_insn_assert("lxebr", is_valid_fpr_pair(r1));
+
IRTemp op = newTemp(Ity_F32);
assign(op, get_fpr_w0(r2));
static const HChar *
s390_irgen_LXDB(UChar r1, IRTemp op2addr)
{
+ s390_insn_assert("lxdb", is_valid_fpr_pair(r1));
+
IRTemp op = newTemp(Ity_F64);
assign(op, load(Ity_F64, mkexpr(op2addr)));
static const HChar *
s390_irgen_LXEB(UChar r1, IRTemp op2addr)
{
+ s390_insn_assert("lxeb", is_valid_fpr_pair(r1));
+
IRTemp op = newTemp(Ity_F32);
assign(op, load(Ity_F32, mkexpr(op2addr)));
s390_irgen_FIEBRA(UChar m3, UChar m4 __attribute__((unused)),
UChar r1, UChar r2)
{
+ s390_insn_assert("fiebra", is_valid_rounding_mode(m3));
+
IRTemp result = newTemp(Ity_F32);
assign(result, binop(Iop_RoundF32toInt, mkexpr(encode_bfp_rounding_mode(m3)),
s390_irgen_FIDBRA(UChar m3, UChar m4 __attribute__((unused)),
UChar r1, UChar r2)
{
+ s390_insn_assert("fidbra", is_valid_rounding_mode(m3));
+
IRTemp result = newTemp(Ity_F64);
assign(result, binop(Iop_RoundF64toInt, mkexpr(encode_bfp_rounding_mode(m3)),
s390_irgen_FIXBRA(UChar m3, UChar m4 __attribute__((unused)),
UChar r1, UChar r2)
{
+ s390_insn_assert("fixbra", is_valid_fpr_pair(r1));
+ s390_insn_assert("fixbra", is_valid_fpr_pair(r2));
+ s390_insn_assert("fixbra", is_valid_rounding_mode(m3));
+
IRTemp result = newTemp(Ity_F128);
assign(result, binop(Iop_RoundF128toInt, mkexpr(encode_bfp_rounding_mode(m3)),
static const HChar *
s390_irgen_LNXBR(UChar r1, UChar r2)
{
+ s390_insn_assert("lnxbr", is_valid_fpr_pair(r1));
+ s390_insn_assert("lnxbr", is_valid_fpr_pair(r2));
+
IRTemp result = newTemp(Ity_F128);
assign(result, unop(Iop_NegF128, unop(Iop_AbsF128, get_fpr_pair(r2))));
static const HChar *
s390_irgen_LPXBR(UChar r1, UChar r2)
{
+ s390_insn_assert("lpxbr", is_valid_fpr_pair(r1));
+ s390_insn_assert("lpxbr", is_valid_fpr_pair(r2));
+
IRTemp result = newTemp(Ity_F128);
assign(result, unop(Iop_AbsF128, get_fpr_pair(r2)));
emulation_warning(EmWarn_S390X_fpext_rounding);
m3 = S390_BFP_ROUND_PER_FPC;
}
+ s390_insn_assert("ldxbra", is_valid_fpr_pair(r1));
+ s390_insn_assert("ldxbra", is_valid_fpr_pair(r2));
+ s390_insn_assert("ldxbra", is_valid_rounding_mode(m3));
+
IRTemp result = newTemp(Ity_F64);
assign(result, binop(Iop_F128toF64, mkexpr(encode_bfp_rounding_mode(m3)),
emulation_warning(EmWarn_S390X_fpext_rounding);
m3 = S390_BFP_ROUND_PER_FPC;
}
+ s390_insn_assert("lexbra", is_valid_fpr_pair(r1));
+ s390_insn_assert("lexbra", is_valid_fpr_pair(r2));
+ s390_insn_assert("lexbra", is_valid_rounding_mode(m3));
+
IRTemp result = newTemp(Ity_F32);
assign(result, binop(Iop_F128toF32, mkexpr(encode_bfp_rounding_mode(m3)),
static const HChar *
s390_irgen_MXBR(UChar r1, UChar r2)
{
+ s390_insn_assert("mxbr", is_valid_fpr_pair(r1));
+ s390_insn_assert("mxbr", is_valid_fpr_pair(r2));
+
IRTemp op1 = newTemp(Ity_F128);
IRTemp op2 = newTemp(Ity_F128);
IRTemp result = newTemp(Ity_F128);
static const HChar *
s390_irgen_SQXBR(UChar r1, UChar r2)
{
+ s390_insn_assert("sqxbr", is_valid_fpr_pair(r1));
+ s390_insn_assert("sqxbr", is_valid_fpr_pair(r2));
+
IRTemp result = newTemp(Ity_F128);
IRTemp rounding_mode = encode_bfp_rounding_mode(S390_BFP_ROUND_PER_FPC);
static const HChar *
s390_irgen_SXBR(UChar r1, UChar r2)
{
+ s390_insn_assert("sxbr", is_valid_fpr_pair(r1));
+ s390_insn_assert("sxbr", is_valid_fpr_pair(r2));
+
IRTemp op1 = newTemp(Ity_F128);
IRTemp op2 = newTemp(Ity_F128);
IRTemp result = newTemp(Ity_F128);
static const HChar *
s390_irgen_TCXB(UChar r1, IRTemp op2addr)
{
+ s390_insn_assert("tcxb", is_valid_fpr_pair(r1));
+
IRTemp value = newTemp(Ity_F128);
assign(value, get_fpr_pair(r1));
static const HChar *
s390_irgen_FLOGR(UChar r1, UChar r2)
{
+ s390_insn_assert("flogr", is_valid_gpr_pair(r1));
+
IRTemp input = newTemp(Ity_I64);
IRTemp num = newTemp(Ity_I64);
IRTemp shift_amount = newTemp(Ity_I8);
static const HChar *
s390_irgen_CKSM(UChar r1,UChar r2)
{
+ s390_insn_assert("cksm", is_valid_gpr_pair(r2));
+
IRTemp addr = newTemp(Ity_I64);
IRTemp op = newTemp(Ity_I32);
IRTemp len = newTemp(Ity_I64);
static const HChar *
s390_irgen_TROO(UChar m3, UChar r1, UChar r2)
{
+ s390_insn_assert("troo", is_valid_gpr_pair(r1));
+
IRTemp src_addr, des_addr, tab_addr, src_len, test_byte;
src_addr = newTemp(Ity_I64);
des_addr = newTemp(Ity_I64);
static const HChar *
s390_irgen_TRTO(UChar m3, UChar r1, UChar r2)
{
+ s390_insn_assert("trto", is_valid_gpr_pair(r1));
+
IRTemp src_addr, des_addr, tab_addr, src_len, test_byte;
src_addr = newTemp(Ity_I64);
des_addr = newTemp(Ity_I64);
static const HChar *
s390_irgen_TROT(UChar m3, UChar r1, UChar r2)
{
+ s390_insn_assert("trot", is_valid_gpr_pair(r1));
+
IRTemp src_addr, des_addr, tab_addr, src_len, test_byte;
src_addr = newTemp(Ity_I64);
des_addr = newTemp(Ity_I64);
static const HChar *
s390_irgen_TRTT(UChar m3, UChar r1, UChar r2)
{
+ s390_insn_assert("trtt", is_valid_gpr_pair(r1));
+
IRTemp src_addr, des_addr, tab_addr, src_len, test_byte;
src_addr = newTemp(Ity_I64);
des_addr = newTemp(Ity_I64);
static const HChar *
s390_irgen_TRE(UChar r1,UChar r2)
{
+ s390_insn_assert("tre", is_valid_gpr_pair(r1));
+
IRTemp src_addr, tab_addr, src_len, test_byte;
src_addr = newTemp(Ity_I64);
tab_addr = newTemp(Ity_I64);
static const HChar *
s390_irgen_CU21(UChar m3, UChar r1, UChar r2)
{
+ s390_insn_assert("cu21", is_valid_gpr_pair(r1));
+ s390_insn_assert("cu21", is_valid_gpr_pair(r2));
+
IRTemp addr1 = newTemp(Ity_I64);
IRTemp addr2 = newTemp(Ity_I64);
IRTemp len1 = newTemp(Ity_I64);
static const HChar *
s390_irgen_CU24(UChar m3, UChar r1, UChar r2)
{
+ s390_insn_assert("cu24", is_valid_gpr_pair(r1));
+ s390_insn_assert("cu24", is_valid_gpr_pair(r2));
+
IRTemp addr1 = newTemp(Ity_I64);
IRTemp addr2 = newTemp(Ity_I64);
IRTemp len1 = newTemp(Ity_I64);
static const HChar *
s390_irgen_CU42(UChar r1, UChar r2)
{
+ s390_insn_assert("cu42", is_valid_gpr_pair(r1));
+ s390_insn_assert("cu42", is_valid_gpr_pair(r2));
+
IRTemp addr1 = newTemp(Ity_I64);
IRTemp addr2 = newTemp(Ity_I64);
IRTemp len1 = newTemp(Ity_I64);
static const HChar *
s390_irgen_CU41(UChar r1, UChar r2)
{
+ s390_insn_assert("cu41", is_valid_gpr_pair(r1));
+ s390_insn_assert("cu41", is_valid_gpr_pair(r2));
+
IRTemp addr1 = newTemp(Ity_I64);
IRTemp addr2 = newTemp(Ity_I64);
IRTemp len1 = newTemp(Ity_I64);
static const HChar *
s390_irgen_CU12(UChar m3, UChar r1, UChar r2)
{
+ s390_insn_assert("cu12", is_valid_gpr_pair(r1));
+ s390_insn_assert("cu12", is_valid_gpr_pair(r2));
+
s390_irgen_cu12_cu14(m3, r1, r2, /* is_cu12 = */ 1);
return "cu12";
static const HChar *
s390_irgen_CU14(UChar m3, UChar r1, UChar r2)
{
+ s390_insn_assert("cu14", is_valid_gpr_pair(r1));
+ s390_insn_assert("cu14", is_valid_gpr_pair(r2));
+
s390_irgen_cu12_cu14(m3, r1, r2, /* is_cu12 = */ 0);
return "cu14";
static const HChar *
s390_irgen_LCBB(UChar r1, IRTemp op2addr, UChar m3)
{
+ s390_insn_assert("lcbb", m3 <= 6);
+
IRTemp op2 = newTemp(Ity_I32);
assign(op2, s390_getCountToBlockBoundary(op2addr, m3));
put_gpr_w1(r1, mkexpr(op2));
return "kma";
}
s390_insn_assert("kma", r1 % 2 == 0 && r1 != 0 && r2 % 2 == 0 && r2 != 0 &&
- r3 % 2 == 0 && r3 != 0);
+ r3 % 2 == 0 && r3 != 0 && r3 != r1 && r3 != r2);
extension(S390_EXT_KMA, r1 | (r2 << 4) | (r3 << 8));
return "kma";
}