]> rtime.felk.cvut.cz Git - lisovros/qemu_apohw.git/commitdiff
tcg/optimize: improve known-zero bits for 32-bit ops
authorAurelien Jarno <aurelien@aurel32.net>
Tue, 3 Sep 2013 06:27:38 +0000 (08:27 +0200)
committerRichard Henderson <rth@twiddle.net>
Mon, 17 Feb 2014 16:12:28 +0000 (10:12 -0600)
The shl_i32 op might set some bits of the unused 32 high bits of the
mask. Fix that by clearing the unused 32 high bits for all 32-bit ops
except load/store which operate on tl values.

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Richard Henderson <rth@twiddle.net>
tcg/optimize.c

index 7838be2c50b0a6851d8ff25d0e2cec395ac3853e..1cf017aab8c3193523793759c77d38588537b366 100644 (file)
@@ -783,6 +783,12 @@ static TCGArg *tcg_constant_folding(TCGContext *s, uint16_t *tcg_opc_ptr,
             break;
         }
 
+        /* 32-bit ops (non 64-bit ops and non load/store ops) generate 32-bit
+           results */
+        if (!(tcg_op_defs[op].flags & (TCG_OPF_CALL_CLOBBER | TCG_OPF_64BIT))) {
+            mask &= 0xffffffffu;
+        }
+
         if (mask == 0) {
             assert(def->nb_oargs == 1);
             s->gen_opc_buf[op_index] = op_to_movi(op);