Received: from eggs.gnu.org ([2001:4830:134:3::10]:34686) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJ5G0-0004sX-9i for qemu-devel@nongnu.org; Mon, 09 Sep 2013 13:28:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VJ5Fu-0008TC-5B for qemu-devel@nongnu.org; Mon, 09 Sep 2013 13:28:12 -0400 Received: from hall.aurel32.net ([2001:470:1f0b:4a8::1]:38646) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJ5Ft-0008T2-UB for qemu-devel@nongnu.org; Mon, 09 Sep 2013 13:28:06 -0400 From: Aurelien Jarno Date: Mon, 9 Sep 2013 19:27:49 +0200 Message-Id: <1378747670-25512-4-git-send-email-aurelien@aurel32.net> In-Reply-To: <1378747670-25512-1-git-send-email-aurelien@aurel32.net> References: <1378747670-25512-1-git-send-email-aurelien@aurel32.net> Subject: [Qemu-devel] [PATCH v2 3/4] tcg/optimize: improve known-zero bits for 32-bit ops List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Aurelien Jarno , Richard Henderson 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. Cc: Richard Henderson Cc: Paolo Bonzini Signed-off-by: Aurelien Jarno --- tcg/optimize.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tcg/optimize.c b/tcg/optimize.c index 0ed8983..b1f736b 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -791,6 +791,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); -- 1.7.10.4