From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=58600 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q6kpT-0003Xe-7c for qemu-devel@nongnu.org; Mon, 04 Apr 2011 10:32:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q6kpP-00037x-A1 for qemu-devel@nongnu.org; Mon, 04 Apr 2011 10:32:30 -0400 Received: from cantor2.suse.de ([195.135.220.15]:37673 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q6kpP-000379-4I for qemu-devel@nongnu.org; Mon, 04 Apr 2011 10:32:27 -0400 From: Alexander Graf Date: Mon, 4 Apr 2011 16:32:24 +0200 Message-Id: <1301927544-32767-16-git-send-email-agraf@suse.de> In-Reply-To: <1301927544-32767-1-git-send-email-agraf@suse.de> References: <1301927544-32767-1-git-send-email-agraf@suse.de> Subject: [Qemu-devel] [PATCH 15/15] tcg: use ext op for deposit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: QEMU-devel Developers Cc: peter.maydell@linaro.org, Aurelien Jarno , Richard Henderson With the s390x target we use the deposit instruction to store 32bit values into 64bit registers without clobbering the upper 32 bits. This specific operation can be optimized slightly by using the ext operation instead of an explicit and in the deposit instruction. This patch adds that special case to the generic deposit implementation. Signed-off-by: Alexander Graf --- tcg/tcg-op.h | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/tcg/tcg-op.h b/tcg/tcg-op.h index 207a89f..88575e7 100644 --- a/tcg/tcg-op.h +++ b/tcg/tcg-op.h @@ -2124,7 +2124,11 @@ static inline void tcg_gen_deposit_i64(TCGv_i64 ret, TCGv_i64 arg1, uint64_t mask = (1ull << len) - 1; TCGv_i64 t1 = tcg_temp_new_i64 (); - tcg_gen_andi_i64(t1, arg2, mask); + if (len == 32) { + tcg_gen_ext32u_i64(t1, arg2); + } else { + tcg_gen_andi_i64(t1, arg2, mask); + } tcg_gen_shli_i64(t1, t1, ofs); tcg_gen_andi_i64(ret, arg1, ~(mask << ofs)); tcg_gen_or_i64(ret, ret, t1); -- 1.6.0.2