Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KNcPr-0001p8-Mi for qemu-devel@nongnu.org; Mon, 28 Jul 2008 19:46:11 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KNcPq-0001ok-SS for qemu-devel@nongnu.org; Mon, 28 Jul 2008 19:46:11 -0400 Received: from [199.232.76.173] (port=41745 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KNcPq-0001oh-N8 for qemu-devel@nongnu.org; Mon, 28 Jul 2008 19:46:10 -0400 Received: from savannah.gnu.org ([199.232.41.3]:45136 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 1KNcPq-00082Y-9s for qemu-devel@nongnu.org; Mon, 28 Jul 2008 19:46:10 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KNcPk-0007kT-Am for qemu-devel@nongnu.org; Mon, 28 Jul 2008 23:46:04 +0000 Received: from malc by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KNcPk-0007kP-0j for qemu-devel@nongnu.org; Mon, 28 Jul 2008 23:46:04 +0000 MIME-Version: 1.0 Errors-To: malc Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: malc Message-Id: Date: Mon, 28 Jul 2008 23:46:04 +0000 Subject: [Qemu-devel] [4961] Do not try handle "special" arguments of and/or/xor/shl/shr, upper level does it 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: 4961 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4961 Author: malc Date: 2008-07-28 23:46:03 +0000 (Mon, 28 Jul 2008) Log Message: ----------- Do not try handle "special" arguments of and/or/xor/shl/shr, upper level does it Modified Paths: -------------- trunk/tcg/ppc/tcg-target.c trunk/tcg/ppc64/tcg-target.c Modified: trunk/tcg/ppc/tcg-target.c =================================================================== --- trunk/tcg/ppc/tcg-target.c 2008-07-28 19:42:23 UTC (rev 4960) +++ trunk/tcg/ppc/tcg-target.c 2008-07-28 23:46:03 UTC (rev 4961) @@ -1113,22 +1113,14 @@ case INDEX_op_and_i32: if (const_args[2]) { - if (!args[2]) - tcg_out_movi (s, TCG_TYPE_I32, args[0], 0); + if ((args[2] & 0xffff) == args[2]) + tcg_out32 (s, ANDI | RS (args[1]) | RA (args[0]) | args[2]); + else if ((args[2] & 0xffff0000) == args[2]) + tcg_out32 (s, ANDIS | RS (args[1]) | RA (args[0]) + | ((args[2] >> 16) & 0xffff)); else { - if ((args[2] & 0xffff) == args[2]) - tcg_out32 (s, ANDI | RS (args[1]) | RA (args[0]) | args[2]); - else if ((args[2] & 0xffff0000) == args[2]) - tcg_out32 (s, ANDIS | RS (args[1]) | RA (args[0]) - | ((args[2] >> 16) & 0xffff)); - else if (args[2] == 0xffffffff) { - if (args[0] != args[1]) - tcg_out_mov (s, args[0], args[1]); - } - else { - tcg_out_movi (s, TCG_TYPE_I32, 0, args[2]); - tcg_out32 (s, AND | SAB (args[1], args[0], 0)); - } + tcg_out_movi (s, TCG_TYPE_I32, 0, args[2]); + tcg_out32 (s, AND | SAB (args[1], args[0], 0)); } } else @@ -1136,22 +1128,16 @@ break; case INDEX_op_or_i32: if (const_args[2]) { - if (args[2]) { - if (args[2] & 0xffff) { - tcg_out32 (s, ORI | RS (args[1]) | RA (args[0]) - | (args[2] & 0xffff)); - if (args[2] >> 16) - tcg_out32 (s, ORIS | RS (args[0]) | RA (args[0]) - | ((args[2] >> 16) & 0xffff)); - } - else { - tcg_out32 (s, ORIS | RS (args[1]) | RA (args[0]) + if (args[2] & 0xffff) { + tcg_out32 (s, ORI | RS (args[1]) | RA (args[0]) + | (args[2] & 0xffff)); + if (args[2] >> 16) + tcg_out32 (s, ORIS | RS (args[0]) | RA (args[0]) | ((args[2] >> 16) & 0xffff)); - } } else { - if (args[0] != args[1]) - tcg_out_mov (s, args[0], args[1]); + tcg_out32 (s, ORIS | RS (args[1]) | RA (args[0]) + | ((args[2] >> 16) & 0xffff)); } } else @@ -1159,21 +1145,15 @@ break; case INDEX_op_xor_i32: if (const_args[2]) { - if (args[2]) { - if ((args[2] & 0xffff) == args[2]) - tcg_out32 (s, XORI | RS (args[1]) | RA (args[0]) - | (args[2] & 0xffff)); - else if ((args[2] & 0xffff0000) == args[2]) - tcg_out32 (s, XORIS | RS (args[1]) | RA (args[0]) - | ((args[2] >> 16) & 0xffff)); - else { - tcg_out_movi (s, TCG_TYPE_I32, 0, args[2]); - tcg_out32 (s, XOR | SAB (args[1], args[0], 0)); - } - } + if ((args[2] & 0xffff) == args[2]) + tcg_out32 (s, XORI | RS (args[1]) | RA (args[0]) + | (args[2] & 0xffff)); + else if ((args[2] & 0xffff0000) == args[2]) + tcg_out32 (s, XORIS | RS (args[1]) | RA (args[0]) + | ((args[2] >> 16) & 0xffff)); else { - if (args[0] != args[1]) - tcg_out_mov (s, args[0], args[1]); + tcg_out_movi (s, TCG_TYPE_I32, 0, args[2]); + tcg_out32 (s, XOR | SAB (args[1], args[0], 0)); } } else @@ -1228,34 +1208,28 @@ case INDEX_op_shl_i32: if (const_args[2]) { - if (args[2]) - tcg_out32 (s, (RLWINM - | RA (args[0]) - | RS (args[1]) - | SH (args[2]) - | MB (0) - | ME (31 - args[2]) - ) - ); - else - tcg_out_mov (s, args[0], args[1]); + tcg_out32 (s, (RLWINM + | RA (args[0]) + | RS (args[1]) + | SH (args[2]) + | MB (0) + | ME (31 - args[2]) + ) + ); } else tcg_out32 (s, SLW | SAB (args[1], args[0], args[2])); break; case INDEX_op_shr_i32: if (const_args[2]) { - if (args[2]) - tcg_out32 (s, (RLWINM - | RA (args[0]) - | RS (args[1]) - | SH (32 - args[2]) - | MB (args[2]) - | ME (31) - ) - ); - else - tcg_out_mov (s, args[0], args[1]); + tcg_out32 (s, (RLWINM + | RA (args[0]) + | RS (args[1]) + | SH (32 - args[2]) + | MB (args[2]) + | ME (31) + ) + ); } else tcg_out32 (s, SRW | SAB (args[1], args[0], args[2])); Modified: trunk/tcg/ppc64/tcg-target.c =================================================================== --- trunk/tcg/ppc64/tcg-target.c 2008-07-28 19:42:23 UTC (rev 4960) +++ trunk/tcg/ppc64/tcg-target.c 2008-07-28 23:46:03 UTC (rev 4961) @@ -1104,22 +1104,14 @@ case INDEX_op_and_i32: if (const_args[2]) { - if (!args[2]) - tcg_out_movi (s, TCG_TYPE_I32, args[0], 0); + if ((args[2] & 0xffff) == args[2]) + tcg_out32 (s, ANDI | RS (args[1]) | RA (args[0]) | args[2]); + else if ((args[2] & 0xffff0000) == args[2]) + tcg_out32 (s, ANDIS | RS (args[1]) | RA (args[0]) + | ((args[2] >> 16) & 0xffff)); else { - if ((args[2] & 0xffff) == args[2]) - tcg_out32 (s, ANDI | RS (args[1]) | RA (args[0]) | args[2]); - else if ((args[2] & 0xffff0000) == args[2]) - tcg_out32 (s, ANDIS | RS (args[1]) | RA (args[0]) - | ((args[2] >> 16) & 0xffff)); - else if (args[2] == 0xffffffff) { - if (args[0] != args[1]) - tcg_out_mov (s, args[0], args[1]); - } - else { - tcg_out_movi (s, TCG_TYPE_I32, 0, args[2]); - tcg_out32 (s, AND | SAB (args[1], args[0], 0)); - } + tcg_out_movi (s, TCG_TYPE_I32, 0, args[2]); + tcg_out32 (s, AND | SAB (args[1], args[0], 0)); } } else @@ -1127,22 +1119,16 @@ break; case INDEX_op_or_i32: if (const_args[2]) { - if (args[2]) { - if (args[2] & 0xffff) { - tcg_out32 (s, ORI | RS (args[1]) | RA (args[0]) - | (args[2] & 0xffff)); - if (args[2] >> 16) - tcg_out32 (s, ORIS | RS (args[0]) | RA (args[0]) - | ((args[2] >> 16) & 0xffff)); - } - else { - tcg_out32 (s, ORIS | RS (args[1]) | RA (args[0]) + if (args[2] & 0xffff) { + tcg_out32 (s, ORI | RS (args[1]) | RA (args[0]) + | (args[2] & 0xffff)); + if (args[2] >> 16) + tcg_out32 (s, ORIS | RS (args[0]) | RA (args[0]) | ((args[2] >> 16) & 0xffff)); - } } else { - if (args[0] != args[1]) - tcg_out_mov (s, args[0], args[1]); + tcg_out32 (s, ORIS | RS (args[1]) | RA (args[0]) + | ((args[2] >> 16) & 0xffff)); } } else @@ -1150,21 +1136,15 @@ break; case INDEX_op_xor_i32: if (const_args[2]) { - if (args[2]) { - if ((args[2] & 0xffff) == args[2]) - tcg_out32 (s, XORI | RS (args[1]) | RA (args[0]) - | (args[2] & 0xffff)); - else if ((args[2] & 0xffff0000) == args[2]) - tcg_out32 (s, XORIS | RS (args[1]) | RA (args[0]) - | ((args[2] >> 16) & 0xffff)); - else { - tcg_out_movi (s, TCG_TYPE_I32, 0, args[2]); - tcg_out32 (s, XOR | SAB (args[1], args[0], 0)); - } - } + if ((args[2] & 0xffff) == args[2]) + tcg_out32 (s, XORI | RS (args[1]) | RA (args[0]) + | (args[2] & 0xffff)); + else if ((args[2] & 0xffff0000) == args[2]) + tcg_out32 (s, XORIS | RS (args[1]) | RA (args[0]) + | ((args[2] >> 16) & 0xffff)); else { - if (args[0] != args[1]) - tcg_out_mov (s, args[0], args[1]); + tcg_out_movi (s, TCG_TYPE_I32, 0, args[2]); + tcg_out32 (s, XOR | SAB (args[1], args[0], 0)); } } else @@ -1207,34 +1187,28 @@ case INDEX_op_shl_i32: if (const_args[2]) { - if (args[2]) - tcg_out32 (s, (RLWINM - | RA (args[0]) - | RS (args[1]) - | SH (args[2]) - | MB (0) - | ME (31 - args[2]) - ) - ); - else - tcg_out_mov (s, args[0], args[1]); + tcg_out32 (s, (RLWINM + | RA (args[0]) + | RS (args[1]) + | SH (args[2]) + | MB (0) + | ME (31 - args[2]) + ) + ); } else tcg_out32 (s, SLW | SAB (args[1], args[0], args[2])); break; case INDEX_op_shr_i32: if (const_args[2]) { - if (args[2]) - tcg_out32 (s, (RLWINM - | RA (args[0]) - | RS (args[1]) - | SH (32 - args[2]) - | MB (args[2]) - | ME (31) - ) - ); - else - tcg_out_mov (s, args[0], args[1]); + tcg_out32 (s, (RLWINM + | RA (args[0]) + | RS (args[1]) + | SH (32 - args[2]) + | MB (args[2]) + | ME (31) + ) + ); } else tcg_out32 (s, SRW | SAB (args[1], args[0], args[2]));