s390_print(HChar *text, IRExpr *value)
{
IRDirty *d;
-
+
d = unsafeIRDirty_0_N(0 /* regparms */, "s390_do_print", &s390_do_print,
mkIRExprVec_2(mkU64((ULong)text), value));
stmt(IRStmt_Dirty(d));
}
static const HChar *
-s390_irgen_CEFBRA(UChar m3, UChar m4 __attribute__((unused)),
- UChar r1, UChar r2)
+s390_irgen_CEFBRA(UChar m3, UChar m4, UChar r1, UChar r2)
{
if (! s390_host_has_fpext && m3 != S390_BFP_ROUND_PER_FPC) {
emulation_warning(EmWarn_S390X_fpext_rounding);
m3 = S390_BFP_ROUND_PER_FPC;
}
+ if (s390_host_has_fpext && (m4 & 0x4) != 0)
+ emulation_warning(EmWarn_S390X_XxC_not_zero);
s390_insn_assert("cefbra", is_valid_rounding_mode(m3));
IRTemp op2 = newTemp(Ity_I32);
}
static const HChar *
-s390_irgen_CDFBRA(UChar m3,
- UChar m4 __attribute__((unused)), UChar r1, UChar r2)
+s390_irgen_CDFBRA(UChar m3, UChar m4, UChar r1, UChar r2)
{
s390_insn_assert("cdfbra", is_valid_rounding_mode(m3));
+ if (s390_host_has_fpext && (m4 & 0x4) != 0)
+ emulation_warning(EmWarn_S390X_XxC_not_zero);
IRTemp op2 = newTemp(Ity_I32);
}
static const HChar *
-s390_irgen_CEGBRA(UChar m3, UChar m4 __attribute__((unused)),
- UChar r1, UChar r2)
+s390_irgen_CEGBRA(UChar m3, UChar m4, UChar r1, UChar r2)
{
if (! s390_host_has_fpext && m3 != S390_BFP_ROUND_PER_FPC) {
emulation_warning(EmWarn_S390X_fpext_rounding);
m3 = S390_BFP_ROUND_PER_FPC;
}
+ if (s390_host_has_fpext && (m4 & 0x4) != 0)
+ emulation_warning(EmWarn_S390X_XxC_not_zero);
s390_insn_assert("cegbra", is_valid_rounding_mode(m3));
IRTemp op2 = newTemp(Ity_I64);
}
static const HChar *
-s390_irgen_CDGBRA(UChar m3, UChar m4 __attribute__((unused)),
- UChar r1, UChar r2)
+s390_irgen_CDGBRA(UChar m3, UChar m4, UChar r1, UChar r2)
{
if (! s390_host_has_fpext && m3 != S390_BFP_ROUND_PER_FPC) {
emulation_warning(EmWarn_S390X_fpext_rounding);
m3 = S390_BFP_ROUND_PER_FPC;
}
+ if (s390_host_has_fpext && (m4 & 0x4) != 0)
+ emulation_warning(EmWarn_S390X_XxC_not_zero);
s390_insn_assert("cdgbra", is_valid_rounding_mode(m3));
IRTemp op2 = newTemp(Ity_I64);
}
static const HChar *
-s390_irgen_CELFBR(UChar m3, UChar m4 __attribute__((unused)),
- UChar r1, UChar r2)
+s390_irgen_CELFBR(UChar m3, UChar m4, UChar r1, UChar r2)
{
if (! s390_host_has_fpext) {
emulation_failure(EmFail_S390X_fpext);
} else {
s390_insn_assert("celfbr", is_valid_rounding_mode(m3));
+ if ((m4 & 0x4) != 0)
+ emulation_warning(EmWarn_S390X_XxC_not_zero);
IRTemp op2 = newTemp(Ity_I32);
}
static const HChar *
-s390_irgen_CDLFBR(UChar m3,
- UChar m4 __attribute__((unused)), UChar r1, UChar r2)
+s390_irgen_CDLFBR(UChar m3, UChar m4, UChar r1, UChar r2)
{
if (! s390_host_has_fpext) {
emulation_failure(EmFail_S390X_fpext);
} else {
s390_insn_assert("cdlfbr", is_valid_rounding_mode(m3));
+ if ((m4 & 0x4) != 0)
+ emulation_warning(EmWarn_S390X_XxC_not_zero);
IRTemp op2 = newTemp(Ity_I32);
}
static const HChar *
-s390_irgen_CELGBR(UChar m3, UChar m4 __attribute__((unused)),
- UChar r1, UChar r2)
+s390_irgen_CELGBR(UChar m3, UChar m4, UChar r1, UChar r2)
{
if (! s390_host_has_fpext) {
emulation_failure(EmFail_S390X_fpext);
} else {
s390_insn_assert("celgbr", is_valid_rounding_mode(m3));
+ if ((m4 & 0x4) != 0)
+ emulation_warning(EmWarn_S390X_XxC_not_zero);
IRTemp op2 = newTemp(Ity_I64);
}
static const HChar *
-s390_irgen_CDLGBR(UChar m3, UChar m4 __attribute__((unused)),
- UChar r1, UChar r2)
+s390_irgen_CDLGBR(UChar m3, UChar m4, UChar r1, UChar r2)
{
if (! s390_host_has_fpext) {
emulation_failure(EmFail_S390X_fpext);
} else {
s390_insn_assert("cdlgbr", is_valid_rounding_mode(m3));
+ if ((m4 & 0x4) != 0)
+ emulation_warning(EmWarn_S390X_XxC_not_zero);
IRTemp op2 = newTemp(Ity_I64);
}
static const HChar *
-s390_irgen_CLFEBR(UChar m3, UChar m4 __attribute__((unused)),
- UChar r1, UChar r2)
+s390_irgen_CLFEBR(UChar m3, UChar m4, UChar r1, UChar r2)
{
if (! s390_host_has_fpext) {
emulation_failure(EmFail_S390X_fpext);
} else {
s390_insn_assert("clfebr", is_valid_rounding_mode(m3));
+ if ((m4 & 0x4) != 0)
+ emulation_warning(EmWarn_S390X_XxC_not_zero);
IRTemp op = newTemp(Ity_F32);
IRTemp result = newTemp(Ity_I32);
}
static const HChar *
-s390_irgen_CLFDBR(UChar m3, UChar m4 __attribute__((unused)),
- UChar r1, UChar r2)
+s390_irgen_CLFDBR(UChar m3, UChar m4, UChar r1, UChar r2)
{
if (! s390_host_has_fpext) {
emulation_failure(EmFail_S390X_fpext);
} else {
s390_insn_assert("clfdbr", is_valid_rounding_mode(m3));
+ if ((m4 & 0x4) != 0)
+ emulation_warning(EmWarn_S390X_XxC_not_zero);
IRTemp op = newTemp(Ity_F64);
IRTemp result = newTemp(Ity_I32);
}
static const HChar *
-s390_irgen_CLGEBR(UChar m3, UChar m4 __attribute__((unused)),
- UChar r1, UChar r2)
+s390_irgen_CLGEBR(UChar m3, UChar m4, UChar r1, UChar r2)
{
if (! s390_host_has_fpext) {
emulation_failure(EmFail_S390X_fpext);
} else {
s390_insn_assert("clgebr", is_valid_rounding_mode(m3));
+ if ((m4 & 0x4) != 0)
+ emulation_warning(EmWarn_S390X_XxC_not_zero);
IRTemp op = newTemp(Ity_F32);
IRTemp result = newTemp(Ity_I64);
}
static const HChar *
-s390_irgen_CLGDBR(UChar m3, UChar m4 __attribute__((unused)),
- UChar r1, UChar r2)
+s390_irgen_CLGDBR(UChar m3, UChar m4, UChar r1, UChar r2)
{
if (! s390_host_has_fpext) {
emulation_failure(EmFail_S390X_fpext);
} else {
s390_insn_assert("clgdbr", is_valid_rounding_mode(m3));
+ if ((m4 & 0x4) != 0)
+ emulation_warning(EmWarn_S390X_XxC_not_zero);
IRTemp op = newTemp(Ity_F64);
IRTemp result = newTemp(Ity_I64);
}
static const HChar *
-s390_irgen_CFEBRA(UChar m3, UChar m4 __attribute__((unused)),
- UChar r1, UChar r2)
+s390_irgen_CFEBRA(UChar m3, UChar m4, UChar r1, UChar r2)
{
s390_insn_assert("cfebra", is_valid_rounding_mode(m3));
+ if (s390_host_has_fpext && (m4 & 0x4) != 0)
+ emulation_warning(EmWarn_S390X_XxC_not_zero);
IRTemp op = newTemp(Ity_F32);
IRTemp result = newTemp(Ity_I32);
}
static const HChar *
-s390_irgen_CFDBRA(UChar m3, UChar m4 __attribute__((unused)),
- UChar r1, UChar r2)
+s390_irgen_CFDBRA(UChar m3, UChar m4, UChar r1, UChar r2)
{
s390_insn_assert("cfdbra", is_valid_rounding_mode(m3));
+ if (s390_host_has_fpext && (m4 & 0x4) != 0)
+ emulation_warning(EmWarn_S390X_XxC_not_zero);
IRTemp op = newTemp(Ity_F64);
IRTemp result = newTemp(Ity_I32);
}
static const HChar *
-s390_irgen_CGEBRA(UChar m3, UChar m4 __attribute__((unused)),
- UChar r1, UChar r2)
+s390_irgen_CGEBRA(UChar m3, UChar m4, UChar r1, UChar r2)
{
s390_insn_assert("cgebra", is_valid_rounding_mode(m3));
+ if (s390_host_has_fpext && (m4 & 0x4) != 0)
+ emulation_warning(EmWarn_S390X_XxC_not_zero);
IRTemp op = newTemp(Ity_F32);
IRTemp result = newTemp(Ity_I64);
}
static const HChar *
-s390_irgen_CGDBRA(UChar m3, UChar m4 __attribute__((unused)),
- UChar r1, UChar r2)
+s390_irgen_CGDBRA(UChar m3, UChar m4, UChar r1, UChar r2)
{
s390_insn_assert("cgdbra", is_valid_rounding_mode(m3));
+ if (s390_host_has_fpext && (m4 & 0x4) != 0)
+ emulation_warning(EmWarn_S390X_XxC_not_zero);
IRTemp op = newTemp(Ity_F64);
IRTemp result = newTemp(Ity_I64);
}
static const HChar *
-s390_irgen_LEDBRA(UChar m3, UChar m4 __attribute__((unused)),
- UChar r1, UChar r2)
+s390_irgen_LEDBRA(UChar m3, UChar m4, UChar r1, UChar r2)
{
if (! s390_host_has_fpext && m3 != S390_BFP_ROUND_PER_FPC) {
emulation_warning(EmWarn_S390X_fpext_rounding);
m3 = S390_BFP_ROUND_PER_FPC;
}
+ if (s390_host_has_fpext && (m4 & 0x4) != 0)
+ emulation_warning(EmWarn_S390X_XxC_not_zero);
s390_insn_assert("ledbra", is_valid_rounding_mode(m3));
IRTemp op = newTemp(Ity_F64);
static const HChar *
s390_irgen_CDFTR(UChar m3 __attribute__((unused)),
- UChar m4 __attribute__((unused)), UChar r1, UChar r2)
+ UChar m4, UChar r1, UChar r2)
{
if (! s390_host_has_dfp) {
emulation_failure(EmFail_S390X_DFP_insn);
} else {
+ if (s390_host_has_fpext && (m4 & 0x4) != 0)
+ emulation_warning(EmWarn_S390X_XxC_not_zero);
IRTemp op2 = newTemp(Ity_I32);
assign(op2, get_gpr_w1(r2));
static const HChar *
s390_irgen_CXFTR(UChar m3 __attribute__((unused)),
- UChar m4 __attribute__((unused)), UChar r1, UChar r2)
+ 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 (s390_host_has_fpext && (m4 & 0x4) != 0)
+ emulation_warning(EmWarn_S390X_XxC_not_zero);
IRTemp op2 = newTemp(Ity_I32);
}
static const HChar *
-s390_irgen_CDGTRA(UChar m3, UChar m4 __attribute__((unused)),
- UChar r1, UChar r2)
+s390_irgen_CDGTRA(UChar m3, UChar m4, UChar r1, UChar r2)
{
if (! s390_host_has_dfp) {
emulation_failure(EmFail_S390X_DFP_insn);
emulation_warning(EmWarn_S390X_fpext_rounding);
m3 = S390_DFP_ROUND_PER_FPC_0;
}
+ if (s390_host_has_fpext && (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)),
static const HChar *
s390_irgen_CXGTRA(UChar m3 __attribute__((unused)),
- UChar m4 __attribute__((unused)), UChar r1, UChar r2)
+ 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 (s390_host_has_fpext && (m4 & 0x4) != 0)
+ emulation_warning(EmWarn_S390X_XxC_not_zero);
IRTemp op2 = newTemp(Ity_I64);
static const HChar *
s390_irgen_CDLFTR(UChar m3 __attribute__((unused)),
- UChar m4 __attribute__((unused)), UChar r1, UChar r2)
+ UChar m4, UChar r1, UChar r2)
{
if (! s390_host_has_dfp) {
emulation_failure(EmFail_S390X_DFP_insn);
if (! s390_host_has_fpext) {
emulation_failure(EmFail_S390X_fpext);
} else {
+ if ((m4 & 0x4) != 0)
+ emulation_warning(EmWarn_S390X_XxC_not_zero);
IRTemp op2 = newTemp(Ity_I32);
assign(op2, get_gpr_w1(r2));
static const HChar *
s390_irgen_CXLFTR(UChar m3 __attribute__((unused)),
- UChar m4 __attribute__((unused)), UChar r1, UChar r2)
+ UChar m4, UChar r1, UChar r2)
{
if (! s390_host_has_dfp) {
emulation_failure(EmFail_S390X_DFP_insn);
emulation_failure(EmFail_S390X_fpext);
} else {
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);
}
static const HChar *
-s390_irgen_CDLGTR(UChar m3, UChar m4 __attribute__((unused)),
- UChar r1, UChar r2)
+s390_irgen_CDLGTR(UChar m3, UChar m4, UChar r1, UChar r2)
{
if (! s390_host_has_dfp) {
emulation_failure(EmFail_S390X_DFP_insn);
if (! s390_host_has_fpext) {
emulation_failure(EmFail_S390X_fpext);
} else {
+ if ((m4 & 0x4) != 0)
+ emulation_warning(EmWarn_S390X_XxC_not_zero);
IRTemp op2 = newTemp(Ity_I64);
assign(op2, get_gpr_dw0(r2));
static const HChar *
s390_irgen_CXLGTR(UChar m3 __attribute__((unused)),
- UChar m4 __attribute__((unused)), UChar r1, UChar r2)
+ UChar m4, UChar r1, UChar r2)
{
if (! s390_host_has_dfp) {
emulation_failure(EmFail_S390X_DFP_insn);
emulation_failure(EmFail_S390X_fpext);
} else {
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);
}
static const HChar *
-s390_irgen_CFDTR(UChar m3, UChar m4 __attribute__((unused)),
- UChar r1, UChar r2)
+s390_irgen_CFDTR(UChar m3, UChar m4, UChar r1, UChar r2)
{
if (! s390_host_has_dfp) {
emulation_failure(EmFail_S390X_DFP_insn);
if (! s390_host_has_fpext) {
emulation_failure(EmFail_S390X_fpext);
} 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);
}
static const HChar *
-s390_irgen_CFXTR(UChar m3, UChar m4 __attribute__((unused)),
- UChar r1, UChar r2)
+s390_irgen_CFXTR(UChar m3, UChar m4, UChar r1, UChar r2)
{
if (! s390_host_has_dfp) {
emulation_failure(EmFail_S390X_DFP_insn);
emulation_failure(EmFail_S390X_fpext);
} else {
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);
}
static const HChar *
-s390_irgen_CGDTRA(UChar m3, UChar m4 __attribute__((unused)),
- UChar r1, UChar r2)
+s390_irgen_CGDTRA(UChar m3, UChar m4, UChar r1, UChar r2)
{
if (! s390_host_has_dfp) {
emulation_failure(EmFail_S390X_DFP_insn);
if (! s390_host_has_fpext) {
emulation_failure(EmFail_S390X_fpext);
} 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);
}
static const HChar *
-s390_irgen_CGXTRA(UChar m3, UChar m4 __attribute__((unused)),
- UChar r1, UChar r2)
+s390_irgen_CGXTRA(UChar m3, UChar m4, UChar r1, UChar r2)
{
if (! s390_host_has_dfp) {
emulation_failure(EmFail_S390X_DFP_insn);
emulation_failure(EmFail_S390X_fpext);
} else {
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);
}
static const HChar *
-s390_irgen_CLFDTR(UChar m3, UChar m4 __attribute__((unused)),
- UChar r1, UChar r2)
+s390_irgen_CLFDTR(UChar m3, UChar m4, UChar r1, UChar r2)
{
if (! s390_host_has_dfp) {
emulation_failure(EmFail_S390X_DFP_insn);
if (! s390_host_has_fpext) {
emulation_failure(EmFail_S390X_fpext);
} 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);
}
static const HChar *
-s390_irgen_CLFXTR(UChar m3, UChar m4 __attribute__((unused)),
- UChar r1, UChar r2)
+s390_irgen_CLFXTR(UChar m3, UChar m4, UChar r1, UChar r2)
{
if (! s390_host_has_dfp) {
emulation_failure(EmFail_S390X_DFP_insn);
emulation_failure(EmFail_S390X_fpext);
} else {
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);
}
static const HChar *
-s390_irgen_CLGDTR(UChar m3, UChar m4 __attribute__((unused)),
- UChar r1, UChar r2)
+s390_irgen_CLGDTR(UChar m3, UChar m4, UChar r1, UChar r2)
{
if (! s390_host_has_dfp) {
emulation_failure(EmFail_S390X_DFP_insn);
if (! s390_host_has_fpext) {
emulation_failure(EmFail_S390X_fpext);
} 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);
}
static const HChar *
-s390_irgen_CLGXTR(UChar m3, UChar m4 __attribute__((unused)),
- UChar r1, UChar r2)
+s390_irgen_CLGXTR(UChar m3, UChar m4, UChar r1, UChar r2)
{
if (! s390_host_has_dfp) {
emulation_failure(EmFail_S390X_DFP_insn);
emulation_failure(EmFail_S390X_fpext);
} else {
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);
}
static const HChar *
-s390_irgen_LDETR(UChar m4 __attribute__((unused)), UChar r1, UChar r2)
+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);
assign(op, get_dpr_w0(r2));
}
static const HChar *
-s390_irgen_LXDTR(UChar m4 __attribute__((unused)), UChar r1, UChar r2)
+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));
IRTemp op = newTemp(Ity_D64);
}
static const HChar *
-s390_irgen_LDXTR(UChar m3, UChar m4 __attribute__((unused)),
- UChar r1, UChar r2)
+s390_irgen_LDXTR(UChar m3, UChar m4, UChar r1, UChar r2)
{
if (! s390_host_has_dfp) {
emulation_failure(EmFail_S390X_DFP_insn);
emulation_warning(EmWarn_S390X_fpext_rounding);
m3 = S390_DFP_ROUND_PER_FPC_0;
}
+ if ((m4 & 0x8) != 0)
+ emulation_warning(EmWarn_S390X_XiC_not_zero);
+ if (s390_host_has_fpext && (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)),
}
static const HChar *
-s390_irgen_LEDTR(UChar m3, UChar m4 __attribute__((unused)),
- UChar r1, UChar r2)
+s390_irgen_LEDTR(UChar m3, UChar m4, UChar r1, UChar r2)
{
if (! s390_host_has_dfp) {
emulation_failure(EmFail_S390X_DFP_insn);
emulation_warning(EmWarn_S390X_fpext_rounding);
m3 = S390_DFP_ROUND_PER_FPC_0;
}
+ if ((m4 & 0x8) != 0)
+ emulation_warning(EmWarn_S390X_XiC_not_zero);
+ if (s390_host_has_fpext && (m4 & 0x4) != 0)
+ emulation_warning(EmWarn_S390X_XxC_not_zero);
IRTemp op = newTemp(Ity_D64);
assign(op, get_dpr_dw0(r2));
}
static const HChar *
-s390_irgen_CXFBRA(UChar m3,
- UChar m4 __attribute__((unused)), UChar r1, UChar r2)
+s390_irgen_CXFBRA(UChar m3, UChar m4, UChar r1, UChar r2)
{
s390_insn_assert("cxfbra", is_valid_fpr_pair(r1));
s390_insn_assert("cxfbra", is_valid_rounding_mode(m3));
+ if (s390_host_has_fpext && (m4 & 0x4) != 0)
+ emulation_warning(EmWarn_S390X_XxC_not_zero);
IRTemp op2 = newTemp(Ity_I32);
}
static const HChar *
-s390_irgen_CXLFBR(UChar m3,
- UChar m4 __attribute__((unused)), UChar r1, UChar r2)
+s390_irgen_CXLFBR(UChar m3, UChar m4, 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));
+ if ((m4 & 0x4) != 0)
+ emulation_warning(EmWarn_S390X_XxC_not_zero);
IRTemp op2 = newTemp(Ity_I32);
static const HChar *
-s390_irgen_CXGBRA(UChar m3,
- UChar m4 __attribute__((unused)), UChar r1, UChar r2)
+s390_irgen_CXGBRA(UChar m3, UChar m4, UChar r1, UChar r2)
{
s390_insn_assert("cxgbra", is_valid_fpr_pair(r1));
s390_insn_assert("cxgbra", is_valid_rounding_mode(m3));
+ if (s390_host_has_fpext && (m4 & 0x4) != 0)
+ emulation_warning(EmWarn_S390X_XxC_not_zero);
IRTemp op2 = newTemp(Ity_I64);
}
static const HChar *
-s390_irgen_CXLGBR(UChar m3,
- UChar m4 __attribute__((unused)), UChar r1, UChar r2)
+s390_irgen_CXLGBR(UChar m3, UChar m4, 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));
+ if ((m4 & 0x4) != 0)
+ emulation_warning(EmWarn_S390X_XxC_not_zero);
IRTemp op2 = newTemp(Ity_I64);
}
static const HChar *
-s390_irgen_CFXBRA(UChar m3, UChar m4 __attribute__((unused)),
- UChar r1, UChar r2)
+s390_irgen_CFXBRA(UChar m3, UChar m4, UChar r1, UChar r2)
{
s390_insn_assert("cfxbra", is_valid_fpr_pair(r2));
s390_insn_assert("cfxbra", is_valid_rounding_mode(m3));
+ if (s390_host_has_fpext && (m4 & 0x4) != 0)
+ emulation_warning(EmWarn_S390X_XxC_not_zero);
IRTemp op = newTemp(Ity_F128);
IRTemp result = newTemp(Ity_I32);
}
static const HChar *
-s390_irgen_CLFXBR(UChar m3, UChar m4 __attribute__((unused)),
- UChar r1, UChar r2)
+s390_irgen_CLFXBR(UChar m3, UChar m4, UChar r1, UChar r2)
{
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));
+ if ((m4 & 0x4) != 0)
+ emulation_warning(EmWarn_S390X_XxC_not_zero);
IRTemp op = newTemp(Ity_F128);
IRTemp result = newTemp(Ity_I32);
static const HChar *
-s390_irgen_CGXBRA(UChar m3, UChar m4 __attribute__((unused)),
- UChar r1, UChar r2)
+s390_irgen_CGXBRA(UChar m3, UChar m4, UChar r1, UChar r2)
{
s390_insn_assert("cgxbra", is_valid_fpr_pair(r2));
s390_insn_assert("cgxbra", is_valid_rounding_mode(m3));
+ if (s390_host_has_fpext && (m4 & 0x4) != 0)
+ emulation_warning(EmWarn_S390X_XxC_not_zero);
IRTemp op = newTemp(Ity_F128);
IRTemp result = newTemp(Ity_I64);
}
static const HChar *
-s390_irgen_CLGXBR(UChar m3, UChar m4 __attribute__((unused)),
- UChar r1, UChar r2)
+s390_irgen_CLGXBR(UChar m3, UChar m4, UChar r1, UChar r2)
{
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));
+ if ((m4 & 0x4) != 0)
+ emulation_warning(EmWarn_S390X_XxC_not_zero);
IRTemp op = newTemp(Ity_F128);
IRTemp result = newTemp(Ity_I64);
}
static const HChar *
-s390_irgen_FIEBRA(UChar m3, UChar m4 __attribute__((unused)),
- UChar r1, UChar r2)
+s390_irgen_FIEBRA(UChar m3, UChar m4, UChar r1, UChar r2)
{
s390_insn_assert("fiebra", is_valid_rounding_mode(m3));
+ if (s390_host_has_fpext && (m4 & 0x4) != 0)
+ emulation_warning(EmWarn_S390X_XxC_not_zero);
IRTemp result = newTemp(Ity_F32);
}
static const HChar *
-s390_irgen_FIDBRA(UChar m3, UChar m4 __attribute__((unused)),
- UChar r1, UChar r2)
+s390_irgen_FIDBRA(UChar m3, UChar m4, UChar r1, UChar r2)
{
s390_insn_assert("fidbra", is_valid_rounding_mode(m3));
+ if (s390_host_has_fpext && (m4 & 0x4) != 0)
+ emulation_warning(EmWarn_S390X_XxC_not_zero);
IRTemp result = newTemp(Ity_F64);
}
static const HChar *
-s390_irgen_FIXBRA(UChar m3, UChar m4 __attribute__((unused)),
- UChar r1, UChar r2)
+s390_irgen_FIXBRA(UChar m3, UChar m4, 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));
+ if (s390_host_has_fpext && (m4 & 0x4) != 0)
+ emulation_warning(EmWarn_S390X_XxC_not_zero);
IRTemp result = newTemp(Ity_F128);
}
static const HChar *
-s390_irgen_LDXBRA(UChar m3, UChar m4 __attribute__((unused)),
- UChar r1, UChar r2)
+s390_irgen_LDXBRA(UChar m3, UChar m4, UChar r1, UChar r2)
{
if (! s390_host_has_fpext && m3 != S390_BFP_ROUND_PER_FPC) {
emulation_warning(EmWarn_S390X_fpext_rounding);
m3 = S390_BFP_ROUND_PER_FPC;
}
+ if (s390_host_has_fpext && (m4 & 0x4) != 0)
+ emulation_warning(EmWarn_S390X_XxC_not_zero);
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));
}
static const HChar *
-s390_irgen_LEXBRA(UChar m3, UChar m4 __attribute__((unused)),
- UChar r1, UChar r2)
+s390_irgen_LEXBRA(UChar m3, UChar m4, UChar r1, UChar r2)
{
if (! s390_host_has_fpext && m3 != S390_BFP_ROUND_PER_FPC) {
emulation_warning(EmWarn_S390X_fpext_rounding);
m3 = S390_BFP_ROUND_PER_FPC;
}
+ if (s390_host_has_fpext && (m4 & 0x4) != 0)
+ emulation_warning(EmWarn_S390X_XxC_not_zero);
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));
/* Load character from source string and compare with test byte */
assign(op, load(Ity_I8, mkexpr(src_addr)));
-
+
s390_cc_set_val(1);
next_insn_if(binop(Iop_CmpEQ8, mkexpr(op), mkexpr(test_byte)));
--- /dev/null
+
+============================================================
+BFP CONVERT FROM FIXED
+============================================================
+Testing: cefbra 0,0,0,4
+Emulation warning: unsupported action:
+ Encountered an insn with the IEEE-inexact-exception control
+ (XxC) bit set to 1. This is not supported. Continuing anyway.
+ IEEE-inexact exceptions will not be suppressed.
+ at 0x........: (below main)
+
+Testing: cdfbra 0,0,0,4
+Emulation warning: unsupported action:
+ Encountered an insn with the IEEE-inexact-exception control
+ (XxC) bit set to 1. This is not supported. Continuing anyway.
+ IEEE-inexact exceptions will not be suppressed.
+ at 0x........: (below main)
+
+Testing: cxfbra 0,0,0,4
+Emulation warning: unsupported action:
+ Encountered an insn with the IEEE-inexact-exception control
+ (XxC) bit set to 1. This is not supported. Continuing anyway.
+ IEEE-inexact exceptions will not be suppressed.
+ at 0x........: (below main)
+
+Testing: cegbra 0,0,0,4
+Emulation warning: unsupported action:
+ Encountered an insn with the IEEE-inexact-exception control
+ (XxC) bit set to 1. This is not supported. Continuing anyway.
+ IEEE-inexact exceptions will not be suppressed.
+ at 0x........: (below main)
+
+Testing: cdgbra 0,0,0,4
+Emulation warning: unsupported action:
+ Encountered an insn with the IEEE-inexact-exception control
+ (XxC) bit set to 1. This is not supported. Continuing anyway.
+ IEEE-inexact exceptions will not be suppressed.
+ at 0x........: (below main)
+
+Testing: cxgbra 0,0,0,4
+Emulation warning: unsupported action:
+ Encountered an insn with the IEEE-inexact-exception control
+ (XxC) bit set to 1. This is not supported. Continuing anyway.
+ IEEE-inexact exceptions will not be suppressed.
+ at 0x........: (below main)
+
+
+============================================================
+BFP CONVERT FROM LOGICAL
+============================================================
+Testing: celfbr 0,0,0,4
+Emulation warning: unsupported action:
+ Encountered an insn with the IEEE-inexact-exception control
+ (XxC) bit set to 1. This is not supported. Continuing anyway.
+ IEEE-inexact exceptions will not be suppressed.
+ at 0x........: (below main)
+
+Testing: cdlfbr 0,0,0,4
+Emulation warning: unsupported action:
+ Encountered an insn with the IEEE-inexact-exception control
+ (XxC) bit set to 1. This is not supported. Continuing anyway.
+ IEEE-inexact exceptions will not be suppressed.
+ at 0x........: (below main)
+
+Testing: cxlfbr 0,0,0,4
+Emulation warning: unsupported action:
+ Encountered an insn with the IEEE-inexact-exception control
+ (XxC) bit set to 1. This is not supported. Continuing anyway.
+ IEEE-inexact exceptions will not be suppressed.
+ at 0x........: (below main)
+
+Testing: celgbr 0,0,0,4
+Emulation warning: unsupported action:
+ Encountered an insn with the IEEE-inexact-exception control
+ (XxC) bit set to 1. This is not supported. Continuing anyway.
+ IEEE-inexact exceptions will not be suppressed.
+ at 0x........: (below main)
+
+Testing: cdlgbr 0,0,0,4
+Emulation warning: unsupported action:
+ Encountered an insn with the IEEE-inexact-exception control
+ (XxC) bit set to 1. This is not supported. Continuing anyway.
+ IEEE-inexact exceptions will not be suppressed.
+ at 0x........: (below main)
+
+Testing: cxlgbr 0,0,0,4
+Emulation warning: unsupported action:
+ Encountered an insn with the IEEE-inexact-exception control
+ (XxC) bit set to 1. This is not supported. Continuing anyway.
+ IEEE-inexact exceptions will not be suppressed.
+ at 0x........: (below main)
+
+
+============================================================
+BFP CONVERT TO FIXED
+============================================================
+Testing: cfebra 0,0,0,4
+Emulation warning: unsupported action:
+ Encountered an insn with the IEEE-inexact-exception control
+ (XxC) bit set to 1. This is not supported. Continuing anyway.
+ IEEE-inexact exceptions will not be suppressed.
+ at 0x........: (below main)
+
+Testing: cfdbra 0,0,0,4
+Emulation warning: unsupported action:
+ Encountered an insn with the IEEE-inexact-exception control
+ (XxC) bit set to 1. This is not supported. Continuing anyway.
+ IEEE-inexact exceptions will not be suppressed.
+ at 0x........: (below main)
+
+Testing: cfxbra 0,0,0,4
+Emulation warning: unsupported action:
+ Encountered an insn with the IEEE-inexact-exception control
+ (XxC) bit set to 1. This is not supported. Continuing anyway.
+ IEEE-inexact exceptions will not be suppressed.
+ at 0x........: (below main)
+
+Testing: cgebra 0,0,0,4
+Emulation warning: unsupported action:
+ Encountered an insn with the IEEE-inexact-exception control
+ (XxC) bit set to 1. This is not supported. Continuing anyway.
+ IEEE-inexact exceptions will not be suppressed.
+ at 0x........: (below main)
+
+Testing: cgdbra 0,0,0,4
+Emulation warning: unsupported action:
+ Encountered an insn with the IEEE-inexact-exception control
+ (XxC) bit set to 1. This is not supported. Continuing anyway.
+ IEEE-inexact exceptions will not be suppressed.
+ at 0x........: (below main)
+
+Testing: cgxbra 0,0,0,4
+Emulation warning: unsupported action:
+ Encountered an insn with the IEEE-inexact-exception control
+ (XxC) bit set to 1. This is not supported. Continuing anyway.
+ IEEE-inexact exceptions will not be suppressed.
+ at 0x........: (below main)
+
+
+============================================================
+BFP CONVERT TO LOGICAL
+============================================================
+Testing: clfebr 0,0,0,4
+Emulation warning: unsupported action:
+ Encountered an insn with the IEEE-inexact-exception control
+ (XxC) bit set to 1. This is not supported. Continuing anyway.
+ IEEE-inexact exceptions will not be suppressed.
+ at 0x........: (below main)
+
+Testing: clfdbr 0,0,0,4
+Emulation warning: unsupported action:
+ Encountered an insn with the IEEE-inexact-exception control
+ (XxC) bit set to 1. This is not supported. Continuing anyway.
+ IEEE-inexact exceptions will not be suppressed.
+ at 0x........: (below main)
+
+Testing: clfxbr 0,0,0,4
+Emulation warning: unsupported action:
+ Encountered an insn with the IEEE-inexact-exception control
+ (XxC) bit set to 1. This is not supported. Continuing anyway.
+ IEEE-inexact exceptions will not be suppressed.
+ at 0x........: (below main)
+
+Testing: clgebr 0,0,0,4
+Emulation warning: unsupported action:
+ Encountered an insn with the IEEE-inexact-exception control
+ (XxC) bit set to 1. This is not supported. Continuing anyway.
+ IEEE-inexact exceptions will not be suppressed.
+ at 0x........: (below main)
+
+Testing: clgdbr 0,0,0,4
+Emulation warning: unsupported action:
+ Encountered an insn with the IEEE-inexact-exception control
+ (XxC) bit set to 1. This is not supported. Continuing anyway.
+ IEEE-inexact exceptions will not be suppressed.
+ at 0x........: (below main)
+
+Testing: clgxbr 0,0,0,4
+Emulation warning: unsupported action:
+ Encountered an insn with the IEEE-inexact-exception control
+ (XxC) bit set to 1. This is not supported. Continuing anyway.
+ IEEE-inexact exceptions will not be suppressed.
+ at 0x........: (below main)
+
+
+============================================================
+BFP LOAD FP INTEGER
+============================================================
+Testing: fiebra 0,0,0,4
+Emulation warning: unsupported action:
+ Encountered an insn with the IEEE-inexact-exception control
+ (XxC) bit set to 1. This is not supported. Continuing anyway.
+ IEEE-inexact exceptions will not be suppressed.
+ at 0x........: (below main)
+
+Testing: fidbra 0,0,0,4
+Emulation warning: unsupported action:
+ Encountered an insn with the IEEE-inexact-exception control
+ (XxC) bit set to 1. This is not supported. Continuing anyway.
+ IEEE-inexact exceptions will not be suppressed.
+ at 0x........: (below main)
+
+Testing: fixbra 0,0,0,4
+Emulation warning: unsupported action:
+ Encountered an insn with the IEEE-inexact-exception control
+ (XxC) bit set to 1. This is not supported. Continuing anyway.
+ IEEE-inexact exceptions will not be suppressed.
+ at 0x........: (below main)
+
+
+============================================================
+BFP LOAD ROUNDED
+============================================================
+Testing: ledbra 0,0,0,4
+Emulation warning: unsupported action:
+ Encountered an insn with the IEEE-inexact-exception control
+ (XxC) bit set to 1. This is not supported. Continuing anyway.
+ IEEE-inexact exceptions will not be suppressed.
+ at 0x........: (below main)
+
+Testing: ldxbra 0,0,0,4
+Emulation warning: unsupported action:
+ Encountered an insn with the IEEE-inexact-exception control
+ (XxC) bit set to 1. This is not supported. Continuing anyway.
+ IEEE-inexact exceptions will not be suppressed.
+ at 0x........: (below main)
+
+Testing: lexbra 0,0,0,4
+Emulation warning: unsupported action:
+ Encountered an insn with the IEEE-inexact-exception control
+ (XxC) bit set to 1. This is not supported. Continuing anyway.
+ IEEE-inexact exceptions will not be suppressed.
+ at 0x........: (below main)
+
--- /dev/null
+#!/usr/bin/env perl
+
+#--------------------------------------------------------------------
+# Create testcases for checking BFP/DFP emulation warnings
+#
+# This machinery is to circumwent valgrind's limitation of at most
+# 3 emulation warnings per emulation kind.
+#--------------------------------------------------------------------
+
+use strict;
+use warnings;
+use Cwd 'abs_path';
+use Getopt::Long;
+
+my $rootdir = get_rootdir();
+my $runone = "$rootdir/auxprogs/s390-runone";
+my $valgrind = "$rootdir/coregrind/valgrind";
+my $valargs = "-q --tool=none --show-emwarns=yes";
+
+&main;
+
+sub main
+{
+ GetOptions("bfp-XxC" => sub { test_bfp_XxC(); },
+ "dfp-XiC" => sub { test_dfp_XiC(); },
+ "dfp-XxC" => sub { test_dfp_XxC(); },
+ ) or exit 1;
+ exit 0;
+}
+
+sub test_bfp_XxC
+{
+ header("BFP CONVERT FROM FIXED");
+ run_insn_test("cefbra 0,0,0,4");
+ run_insn_test("cdfbra 0,0,0,4");
+ run_insn_test("cxfbra 0,0,0,4");
+ run_insn_test("cegbra 0,0,0,4");
+ run_insn_test("cdgbra 0,0,0,4");
+ run_insn_test("cxgbra 0,0,0,4");
+
+ header("BFP CONVERT FROM LOGICAL");
+ run_insn_test("celfbr 0,0,0,4");
+ run_insn_test("cdlfbr 0,0,0,4");
+ run_insn_test("cxlfbr 0,0,0,4");
+ run_insn_test("celgbr 0,0,0,4");
+ run_insn_test("cdlgbr 0,0,0,4");
+ run_insn_test("cxlgbr 0,0,0,4");
+
+ header("BFP CONVERT TO FIXED");
+ run_insn_test("cfebra 0,0,0,4");
+ run_insn_test("cfdbra 0,0,0,4");
+ run_insn_test("cfxbra 0,0,0,4");
+ run_insn_test("cgebra 0,0,0,4");
+ run_insn_test("cgdbra 0,0,0,4");
+ run_insn_test("cgxbra 0,0,0,4");
+
+ header("BFP CONVERT TO LOGICAL");
+ run_insn_test("clfebr 0,0,0,4");
+ run_insn_test("clfdbr 0,0,0,4");
+ run_insn_test("clfxbr 0,0,0,4");
+ run_insn_test("clgebr 0,0,0,4");
+ run_insn_test("clgdbr 0,0,0,4");
+ run_insn_test("clgxbr 0,0,0,4");
+
+ header("BFP LOAD FP INTEGER");
+ run_insn_test("fiebra 0,0,0,4");
+ run_insn_test("fidbra 0,0,0,4");
+ run_insn_test("fixbra 0,0,0,4");
+
+ header("BFP LOAD ROUNDED");
+ run_insn_test("ledbra 0,0,0,4");
+ run_insn_test("ldxbra 0,0,0,4");
+ run_insn_test("lexbra 0,0,0,4");
+}
+
+sub test_dfp_XxC
+{
+ header("DFP CONVERT FROM FIXED");
+ run_insn_test("cdgtra 0,0,0,4");
+ run_insn_test("cxgtra 0,0,0,4");
+ run_insn_test("cdftr 0,0,0,4");
+ run_insn_test("cxftr 0,0,0,4");
+
+ header("DFP CONVERT FROM LOGICAL");
+ run_insn_test("cdlgtr 0,0,0,4");
+ run_insn_test("cxlgtr 0,0,0,4");
+ run_insn_test("cdlftr 0,0,0,4");
+ run_insn_test("cxlftr 0,0,0,4");
+
+ header("DFP CONVERT TO FIXED");
+ run_insn_test("cgdtra 0,0,0,4");
+ run_insn_test("cgxtra 0,0,0,4");
+ run_insn_test("cfdtr 0,0,0,4");
+ run_insn_test("cfxtr 0,0,0,4");
+
+ header("DFP CONVERT TO LOGICAL");
+ run_insn_test("clgdtr 0,0,0,4");
+ run_insn_test("clgxtr 0,0,0,4");
+ run_insn_test("clfdtr 0,0,0,4");
+ run_insn_test("clfxtr 0,0,0,4");
+
+ header("DFP LOAD ROUNDED");
+ run_insn_test("ledtr 0,0,0,4");
+ run_insn_test("ldxtr 0,0,0,4");
+}
+
+sub test_dfp_XiC
+{
+ header("DFP LOAD LENGTHENED");
+ run_insn_test("ldetr 0,0,8");
+ run_insn_test("lxdtr 0,0,8");
+
+ header("DFP LOAD ROUNDED");
+ run_insn_test("ledtr 0,0,0,8");
+ run_insn_test("ldxtr 0,0,0,8");
+}
+
+sub run_insn_test
+{
+ my ($insn) = @_;
+ $insn =~ s/\s+/ /g;
+ my ($mnm) = $insn;
+
+ $mnm =~ s/\s.*//;
+ print "Testing: $insn\n";
+
+ my $exe = "xxemwarn-$mnm";
+ my $cfile = "$exe.c";
+
+ # Create template
+ `$runone --template --insn=\"$insn\" > $cfile`;
+
+ # Compile
+ my $stderr = `$runone --build $cfile 2>&1`;
+ if ($? != 0) {
+ error("runone failed\n$stderr");
+ return;
+ }
+
+ # Run valgrind
+ my $output = `$valgrind $valargs ./$exe 2>&1 | ./filter_stderr`;
+ print STDOUT "$output\n";
+
+ # Remove files
+ unlink ($exe, $cfile, "$exe.s", "$exe.s.orig");
+}
+
+sub get_rootdir
+{
+ my $dir = ".";
+ while (abs_path($dir) ne "/") {
+ if (-e "$dir/AUTHORS") {
+ return abs_path($dir);
+ }
+ $dir = "$dir/..";
+ }
+ fatal("Coud not determine root directory. \"AUTHORS\" file not found\n");
+}
+
+sub header
+{
+ my ($txt) = @_;
+
+ print "\n";
+ print "============================================================\n";
+ print "$txt\n";
+ print "============================================================\n";
+}
+
+sub error
+{
+ print STDERR "*** $_[0]\n";
+}
+
+sub fatal
+{
+ error($_[0]);
+ exit 1;
+}