From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Lgo4D-0001TC-VA for qemu-devel@nongnu.org; Mon, 09 Mar 2009 18:35:26 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Lgo4D-0001SQ-4m for qemu-devel@nongnu.org; Mon, 09 Mar 2009 18:35:25 -0400 Received: from [199.232.76.173] (port=32859 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lgo4C-0001SB-SY for qemu-devel@nongnu.org; Mon, 09 Mar 2009 18:35:24 -0400 Received: from mx20.gnu.org ([199.232.41.8]:6810) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Lgo4C-0004o8-LX for qemu-devel@nongnu.org; Mon, 09 Mar 2009 18:35:24 -0400 Received: from savannah.gnu.org ([199.232.41.3] helo=sv.gnu.org) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Lgo4C-0003tC-1Y for qemu-devel@nongnu.org; Mon, 09 Mar 2009 18:35:24 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Lgo4B-0007T2-I5 for qemu-devel@nongnu.org; Mon, 09 Mar 2009 22:35:23 +0000 Received: from aurel32 by cvs.savannah.gnu.org with local (Exim 4.69) (envelope-from ) id 1Lgo4B-0007Sy-47 for qemu-devel@nongnu.org; Mon, 09 Mar 2009 22:35:23 +0000 MIME-Version: 1.0 Errors-To: aurel32 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Aurelien Jarno Message-Id: Date: Mon, 09 Mar 2009 22:35:23 +0000 Subject: [Qemu-devel] [6798] tcg: optimize nor(X, Y, Y), used on PPC for not(X, Y) 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: 6798 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6798 Author: aurel32 Date: 2009-03-09 22:35:22 +0000 (Mon, 09 Mar 2009) Log Message: ----------- tcg: optimize nor(X, Y, Y), used on PPC for not(X, Y) Signed-off-by: Aurelien Jarno Modified Paths: -------------- trunk/tcg/tcg-op.h Modified: trunk/tcg/tcg-op.h =================================================================== --- trunk/tcg/tcg-op.h 2009-03-09 22:35:13 UTC (rev 6797) +++ trunk/tcg/tcg-op.h 2009-03-09 22:35:22 UTC (rev 6798) @@ -1545,20 +1545,28 @@ static inline void tcg_gen_nor_i32(TCGv_i32 ret, TCGv_i32 arg1, TCGv_i32 arg2) { - TCGv_i32 t0; - t0 = tcg_temp_new_i32(); - tcg_gen_or_i32(t0, arg1, arg2); - tcg_gen_not_i32(ret, t0); - tcg_temp_free_i32(t0); + if (GET_TCGV_I32(arg1) != GET_TCGV_I32(arg2)) { + TCGv_i32 t0; + t0 = tcg_temp_new_i32(); + tcg_gen_or_i32(t0, arg1, arg2); + tcg_gen_not_i32(ret, t0); + tcg_temp_free_i32(t0); + } else { + tcg_gen_not_i32(ret, arg1); + } } static inline void tcg_gen_nor_i64(TCGv_i64 ret, TCGv_i64 arg1, TCGv_i64 arg2) { - TCGv_i64 t0; - t0 = tcg_temp_new_i64(); - tcg_gen_or_i64(t0, arg1, arg2); - tcg_gen_not_i64(ret, t0); - tcg_temp_free_i64(t0); + if (GET_TCGV_I64(arg1) != GET_TCGV_I64(arg2)) { + TCGv_i64 t0; + t0 = tcg_temp_new_i64(); + tcg_gen_or_i64(t0, arg1, arg2); + tcg_gen_not_i64(ret, t0); + tcg_temp_free_i64(t0); + } else { + tcg_gen_not_i64(ret, arg1); + } } static inline void tcg_gen_orc_i32(TCGv_i32 ret, TCGv_i32 arg1, TCGv_i32 arg2)