From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NzZQG-0006Am-7x for qemu-devel@nongnu.org; Wed, 07 Apr 2010 13:52:16 -0400 Received: from [140.186.70.92] (port=55362 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NzZPx-00062V-Vd for qemu-devel@nongnu.org; Wed, 07 Apr 2010 13:52:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NzZPi-0007JT-ND for qemu-devel@nongnu.org; Wed, 07 Apr 2010 13:51:57 -0400 Received: from hall.aurel32.net ([88.191.82.174]:45318) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NzZPi-0007Iu-3s for qemu-devel@nongnu.org; Wed, 07 Apr 2010 13:51:42 -0400 From: Aurelien Jarno Date: Wed, 7 Apr 2010 19:51:15 +0200 Message-Id: <1270662685-7379-9-git-send-email-aurelien@aurel32.net> In-Reply-To: <1270662685-7379-1-git-send-email-aurelien@aurel32.net> References: <1270662685-7379-1-git-send-email-aurelien@aurel32.net> Subject: [Qemu-devel] [PATCH 08/18] tcg/arm: use the blx instruction when possible List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Andrzej Zaborowski , Aurelien Jarno Signed-off-by: Aurelien Jarno --- tcg/arm/tcg-target.c | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-) diff --git a/tcg/arm/tcg-target.c b/tcg/arm/tcg-target.c index 777c4ac..3360c23 100644 --- a/tcg/arm/tcg-target.c +++ b/tcg/arm/tcg-target.c @@ -333,6 +333,11 @@ static inline void tcg_out_bl(TCGContext *s, int cond, int32_t offset) (((offset - 8) >> 2) & 0x00ffffff)); } +static inline void tcg_out_blx(TCGContext *s, int cond, int rn) +{ + tcg_out32(s, (cond << 28) | 0x012fff30 | rn); +} + static inline void tcg_out_dat_reg(TCGContext *s, int cond, int opc, int rd, int rn, int rm, int shift) { @@ -754,10 +759,13 @@ static inline void tcg_out_call(TCGContext *s, int cond, uint32_t addr) static inline void tcg_out_callr(TCGContext *s, int cond, int arg) { - /* TODO: on ARMv5 and ARMv6 replace with tcg_out_blx(s, cond, arg); */ +#ifdef USE_ARMV5_INSTRUCTIONS + tcg_out_blx(s, cond, arg); +#else tcg_out_dat_reg(s, cond, ARITH_MOV, TCG_REG_R14, 0, TCG_REG_PC, SHIFT_IMM_LSL(0)); tcg_out_bx(s, cond, arg); +#endif } static inline void tcg_out_goto_label(TCGContext *s, int cond, int label_index) -- 1.7.0.4