From patchwork Sat Apr 10 01:33:01 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aurelien Jarno X-Patchwork-Id: 49894 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id E91A1B7C8E for ; Sat, 10 Apr 2010 12:10:52 +1000 (EST) Received: from localhost ([127.0.0.1]:47652 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O0Q9Z-0004GC-CX for incoming@patchwork.ozlabs.org; Fri, 09 Apr 2010 22:10:33 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O0Pa2-0004sO-3b for qemu-devel@nongnu.org; Fri, 09 Apr 2010 21:33:50 -0400 Received: from [140.186.70.92] (port=49553 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O0PZu-0004lu-OF for qemu-devel@nongnu.org; Fri, 09 Apr 2010 21:33:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O0PZl-0007Id-Jz for qemu-devel@nongnu.org; Fri, 09 Apr 2010 21:33:42 -0400 Received: from hall.aurel32.net ([88.191.82.174]:35060) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O0PZk-0007IE-Rw for qemu-devel@nongnu.org; Fri, 09 Apr 2010 21:33:33 -0400 Received: from [10.243.122.2] (helo=volta.aurel32.net) by hall.aurel32.net with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1O0PZk-0005Mq-6N; Sat, 10 Apr 2010 03:33:32 +0200 Received: from aurel32 by volta.aurel32.net with local (Exim 4.71) (envelope-from ) id 1O0PZU-0004kf-Mw; Sat, 10 Apr 2010 03:33:16 +0200 From: Aurelien Jarno To: qemu-devel@nongnu.org Date: Sat, 10 Apr 2010 03:33:01 +0200 Message-Id: <1270863186-10180-14-git-send-email-aurelien@aurel32.net> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1270863186-10180-1-git-send-email-aurelien@aurel32.net> References: <1270863186-10180-1-git-send-email-aurelien@aurel32.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) Cc: Andrzej Zaborowski , Aurelien Jarno Subject: [Qemu-devel] [PATCH v2 13/18] tcg/arm: use ext* ops in qemu_ld X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Aurelien Jarno --- tcg/arm/tcg-target.c | 30 ++++++++++++------------------ 1 files changed, 12 insertions(+), 18 deletions(-) diff --git a/tcg/arm/tcg-target.c b/tcg/arm/tcg-target.c index 2b560f6..b6f5803 100644 --- a/tcg/arm/tcg-target.c +++ b/tcg/arm/tcg-target.c @@ -499,6 +499,12 @@ static inline void tcg_out_ext8s(TCGContext *s, int cond, } } +static inline void tcg_out_ext8u(TCGContext *s, int cond, + int rd, int rn) +{ + tcg_out_dat_imm(s, cond, ARITH_AND, rd, rn, 0xff); +} + static inline void tcg_out_ext16s(TCGContext *s, int cond, int rd, int rn) { @@ -1017,16 +1023,10 @@ static inline void tcg_out_qemu_ld(TCGContext *s, const TCGArg *args, int opc) switch (opc) { case 0 | 4: - tcg_out_dat_reg(s, COND_AL, ARITH_MOV, - TCG_REG_R0, 0, TCG_REG_R0, SHIFT_IMM_LSL(24)); - tcg_out_dat_reg(s, COND_AL, ARITH_MOV, - data_reg, 0, TCG_REG_R0, SHIFT_IMM_ASR(24)); + tcg_out_ext8s(s, COND_AL, data_reg, TCG_REG_R0); break; case 1 | 4: - tcg_out_dat_reg(s, COND_AL, ARITH_MOV, - TCG_REG_R0, 0, TCG_REG_R0, SHIFT_IMM_LSL(16)); - tcg_out_dat_reg(s, COND_AL, ARITH_MOV, - data_reg, 0, TCG_REG_R0, SHIFT_IMM_ASR(16)); + tcg_out_ext16s(s, COND_AL, data_reg, TCG_REG_R0); break; case 0: case 1: @@ -1191,14 +1191,11 @@ static inline void tcg_out_qemu_st(TCGContext *s, const TCGArg *args, int opc) # if TARGET_LONG_BITS == 32 switch (opc) { case 0: - tcg_out_dat_imm(s, COND_AL, ARITH_AND, TCG_REG_R1, data_reg, 0xff); + tcg_out_ext8u(s, COND_AL, TCG_REG_R1, data_reg); tcg_out_dat_imm(s, COND_AL, ARITH_MOV, TCG_REG_R2, 0, mem_index); break; case 1: - tcg_out_dat_reg(s, COND_AL, ARITH_MOV, - TCG_REG_R1, 0, data_reg, SHIFT_IMM_LSL(16)); - tcg_out_dat_reg(s, COND_AL, ARITH_MOV, - TCG_REG_R1, 0, TCG_REG_R1, SHIFT_IMM_LSR(16)); + tcg_out_ext16u(s, COND_AL, TCG_REG_R1, data_reg); tcg_out_dat_imm(s, COND_AL, ARITH_MOV, TCG_REG_R2, 0, mem_index); break; case 2: @@ -1227,14 +1224,11 @@ static inline void tcg_out_qemu_st(TCGContext *s, const TCGArg *args, int opc) } switch (opc) { case 0: - tcg_out_dat_imm(s, COND_AL, ARITH_AND, TCG_REG_R2, data_reg, 0xff); + tcg_out_ext8u(s, COND_AL, TCG_REG_R2, data_reg); tcg_out_dat_imm(s, COND_AL, ARITH_MOV, TCG_REG_R3, 0, mem_index); break; case 1: - tcg_out_dat_reg(s, COND_AL, ARITH_MOV, - TCG_REG_R2, 0, data_reg, SHIFT_IMM_LSL(16)); - tcg_out_dat_reg(s, COND_AL, ARITH_MOV, - TCG_REG_R2, 0, TCG_REG_R2, SHIFT_IMM_LSR(16)); + tcg_out_ext16u(s, COND_AL, TCG_REG_R2, data_reg); tcg_out_dat_imm(s, COND_AL, ARITH_MOV, TCG_REG_R3, 0, mem_index); break; case 2: