]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Fix a bug in insn selection. For some reason Iop_1UtoXYZ did no
authorFlorian Krohm <florian@eich-krohm.de>
Sat, 4 Aug 2012 04:25:30 +0000 (04:25 +0000)
committerFlorian Krohm <florian@eich-krohm.de>
Sat, 4 Aug 2012 04:25:30 +0000 (04:25 +0000)
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

VEX/priv/host_s390_isel.c

index e54dd21e5e5c4ef4f5a0b4481d6d36860cb6af92..565111ab3cba401a39bb631c3d7b9e3bed92ca1e 100644 (file)
@@ -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: