From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38780) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VF9Bx-0002Yy-8i for qemu-devel@nongnu.org; Thu, 29 Aug 2013 16:51:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VF9Bw-0004BJ-By for qemu-devel@nongnu.org; Thu, 29 Aug 2013 16:51:45 -0400 Received: from hall.aurel32.net ([2001:470:1f0b:4a8::1]:40406) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VF9Bw-0004BF-4m for qemu-devel@nongnu.org; Thu, 29 Aug 2013 16:51:44 -0400 From: Aurelien Jarno Date: Thu, 29 Aug 2013 22:51:25 +0200 Message-Id: <1377809485-24004-4-git-send-email-aurelien@aurel32.net> In-Reply-To: <1377809485-24004-1-git-send-email-aurelien@aurel32.net> References: <1377809485-24004-1-git-send-email-aurelien@aurel32.net> Subject: [Qemu-devel] [PATCH v3 3/3] tcg/mips: only enable ext8s/ext16s ops on MIPS32R2 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Aurelien Jarno On MIPS ext8s and ext16s ops are implemented with a dedicated instruction only on MIPS32R2, otherwise the same kind of implementation than at TCG level (shift left followed by shift right) is used. Change that by only implementing the ext8s and ext16s ops on MIPS32R2 so that optimizations can be done by the optimizer. Use an inline version to avoid having to test again for MIPS32R2 instructions. Keep the shift implementation for the ld/st routines. Signed-off-by: Aurelien Jarno --- tcg/mips/tcg-target.c | 4 ++-- tcg/mips/tcg-target.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tcg/mips/tcg-target.c b/tcg/mips/tcg-target.c index daaf722..f32bea7 100644 --- a/tcg/mips/tcg-target.c +++ b/tcg/mips/tcg-target.c @@ -1515,10 +1515,10 @@ static inline void tcg_out_op(TCGContext *s, TCGOpcode opc, break; case INDEX_op_ext8s_i32: - tcg_out_ext8s(s, args[0], args[1]); + tcg_out_opc_reg(s, OPC_SEB, args[0], 0, args[1]); break; case INDEX_op_ext16s_i32: - tcg_out_ext16s(s, args[0], args[1]); + tcg_out_opc_reg(s, OPC_SEH, args[0], 0, args[1]); break; case INDEX_op_deposit_i32: diff --git a/tcg/mips/tcg-target.h b/tcg/mips/tcg-target.h index 43072e3..76ee831 100644 --- a/tcg/mips/tcg-target.h +++ b/tcg/mips/tcg-target.h @@ -105,8 +105,6 @@ extern bool use_mips32r2_instructions; #define TCG_TARGET_HAS_rem_i32 1 #define TCG_TARGET_HAS_not_i32 1 #define TCG_TARGET_HAS_nor_i32 1 -#define TCG_TARGET_HAS_ext8s_i32 1 -#define TCG_TARGET_HAS_ext16s_i32 1 #define TCG_TARGET_HAS_andc_i32 0 #define TCG_TARGET_HAS_orc_i32 0 #define TCG_TARGET_HAS_eqv_i32 0 @@ -118,6 +116,8 @@ extern bool use_mips32r2_instructions; #define TCG_TARGET_HAS_bswap16_i32 use_mips32r2_instructions #define TCG_TARGET_HAS_bswap32_i32 use_mips32r2_instructions #define TCG_TARGET_HAS_deposit_i32 use_mips32r2_instructions +#define TCG_TARGET_HAS_ext8s_i32 use_mips32r2_instructions +#define TCG_TARGET_HAS_ext16s_i32 use_mips32r2_instructions #define TCG_TARGET_HAS_rot_i32 use_mips32r2_instructions /* optional instructions automatically implemented */ -- 1.7.10.4