From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JzAnH-0005GF-Kc for qemu-devel@nongnu.org; Thu, 22 May 2008 09:25:19 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JzAnH-0005Fb-4D for qemu-devel@nongnu.org; Thu, 22 May 2008 09:25:19 -0400 Received: from [199.232.76.173] (port=47053 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JzAnG-0005FU-OS for qemu-devel@nongnu.org; Thu, 22 May 2008 09:25:18 -0400 Received: from savannah.gnu.org ([199.232.41.3]:37307 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JzAnE-0003vE-4O for qemu-devel@nongnu.org; Thu, 22 May 2008 09:25:16 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1JzAnD-00083l-Gj for qemu-devel@nongnu.org; Thu, 22 May 2008 13:25:15 +0000 Received: from bellard by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1JzAnD-00083h-8G for qemu-devel@nongnu.org; Thu, 22 May 2008 13:25:15 +0000 MIME-Version: 1.0 Errors-To: bellard Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Fabrice Bellard Message-Id: Date: Thu, 22 May 2008 13:25:15 +0000 Subject: [Qemu-devel] [4525] small shift opts Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Revision: 4525 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4525 Author: bellard Date: 2008-05-22 13:25:14 +0000 (Thu, 22 May 2008) Log Message: ----------- small shift opts Modified Paths: -------------- trunk/tcg/tcg-op.h Modified: trunk/tcg/tcg-op.h =================================================================== --- trunk/tcg/tcg-op.h 2008-05-22 12:36:31 UTC (rev 4524) +++ trunk/tcg/tcg-op.h 2008-05-22 13:25:14 UTC (rev 4525) @@ -404,7 +404,11 @@ static inline void tcg_gen_shli_i32(TCGv ret, TCGv arg1, int32_t arg2) { - tcg_gen_shl_i32(ret, arg1, tcg_const_i32(arg2)); + if (arg2 == 0) { + tcg_gen_mov_i32(ret, arg1); + } else { + tcg_gen_shl_i32(ret, arg1, tcg_const_i32(arg2)); + } } static inline void tcg_gen_shr_i32(TCGv ret, TCGv arg1, TCGv arg2) @@ -414,7 +418,11 @@ static inline void tcg_gen_shri_i32(TCGv ret, TCGv arg1, int32_t arg2) { - tcg_gen_shr_i32(ret, arg1, tcg_const_i32(arg2)); + if (arg2 == 0) { + tcg_gen_mov_i32(ret, arg1); + } else { + tcg_gen_shr_i32(ret, arg1, tcg_const_i32(arg2)); + } } static inline void tcg_gen_sar_i32(TCGv ret, TCGv arg1, TCGv arg2) @@ -424,7 +432,11 @@ static inline void tcg_gen_sari_i32(TCGv ret, TCGv arg1, int32_t arg2) { - tcg_gen_sar_i32(ret, arg1, tcg_const_i32(arg2)); + if (arg2 == 0) { + tcg_gen_mov_i32(ret, arg1); + } else { + tcg_gen_sar_i32(ret, arg1, tcg_const_i32(arg2)); + } } static inline void tcg_gen_brcond_i32(int cond, TCGv arg1, TCGv arg2, @@ -862,7 +874,11 @@ static inline void tcg_gen_shli_i64(TCGv ret, TCGv arg1, int64_t arg2) { - tcg_gen_shl_i64(ret, arg1, tcg_const_i64(arg2)); + if (arg2 == 0) { + tcg_gen_mov_i64(ret, arg1); + } else { + tcg_gen_shl_i64(ret, arg1, tcg_const_i64(arg2)); + } } static inline void tcg_gen_shr_i64(TCGv ret, TCGv arg1, TCGv arg2) @@ -872,7 +888,11 @@ static inline void tcg_gen_shri_i64(TCGv ret, TCGv arg1, int64_t arg2) { - tcg_gen_shr_i64(ret, arg1, tcg_const_i64(arg2)); + if (arg2 == 0) { + tcg_gen_mov_i64(ret, arg1); + } else { + tcg_gen_shr_i64(ret, arg1, tcg_const_i64(arg2)); + } } static inline void tcg_gen_sar_i64(TCGv ret, TCGv arg1, TCGv arg2) @@ -882,7 +902,11 @@ static inline void tcg_gen_sari_i64(TCGv ret, TCGv arg1, int64_t arg2) { - tcg_gen_sar_i64(ret, arg1, tcg_const_i64(arg2)); + if (arg2 == 0) { + tcg_gen_mov_i64(ret, arg1); + } else { + tcg_gen_sar_i64(ret, arg1, tcg_const_i64(arg2)); + } } static inline void tcg_gen_brcond_i64(int cond, TCGv arg1, TCGv arg2,