From: Florian Krohm Date: Sat, 4 Aug 2012 04:25:30 +0000 (+0000) Subject: Fix a bug in insn selection. For some reason Iop_1UtoXYZ did no X-Git-Tag: svn/VALGRIND_3_8_1^2~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d05e1e0828f117fe14d19ada316a91c81fd5fb3d;p=thirdparty%2Fvalgrind.git Fix a bug in insn selection. For some reason Iop_1UtoXYZ did no zero-extension. That is essential, as not all computation is donw using 8-byte values. For example - do a 64-bit computation in r1; assume leftmost 4 bytes != 0 - do a 32-bit computation in r1; leftmost 4 bytes are untouched != 0 - do 32to1 on r1; rightmost 4 bytes == 1; leftmost 4 bytes != 0 - do 1Uto64 on r1 Without zero-extension r1 will contain a value that is not boolean git-svn-id: svn://svn.valgrind.org/vex/trunk@2458 --- diff --git a/VEX/priv/host_s390_isel.c b/VEX/priv/host_s390_isel.c index e54dd21e5e..565111ab3c 100644 --- a/VEX/priv/host_s390_isel.c +++ b/VEX/priv/host_s390_isel.c @@ -1144,8 +1144,15 @@ s390_isel_int_expr_wrk(ISelEnv *env, IRExpr *expr) switch (unop) { case Iop_1Uto8: case Iop_1Uto32: + /* Zero extend */ + mask.variant.imm = 1; + addInstr(env, s390_insn_alu(4, S390_ALU_AND, dst, mask)); + break; + case Iop_1Uto64: - /* Nothing to do */ + /* Zero extend */ + mask.variant.imm = 1; + addInstr(env, s390_insn_alu(8, S390_ALU_AND, dst, mask)); break; case Iop_1Sto8: