Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KQnWH-0003Vs-7S for qemu-devel@nongnu.org; Wed, 06 Aug 2008 14:13:57 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KQnWG-0003VX-BJ for qemu-devel@nongnu.org; Wed, 06 Aug 2008 14:13:56 -0400 Received: from [199.232.76.173] (port=38353 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KQnWG-0003VS-5C for qemu-devel@nongnu.org; Wed, 06 Aug 2008 14:13:56 -0400 Received: from savannah.gnu.org ([199.232.41.3]:41434 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 1KQnWF-0000Xy-Ri for qemu-devel@nongnu.org; Wed, 06 Aug 2008 14:13:55 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KQnWF-0003l0-AL for qemu-devel@nongnu.org; Wed, 06 Aug 2008 18:13:55 +0000 Received: from blueswir1 by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KQnWF-0003kS-1W for qemu-devel@nongnu.org; Wed, 06 Aug 2008 18:13:55 +0000 MIME-Version: 1.0 Errors-To: blueswir1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Blue Swirl Message-Id: Date: Wed, 06 Aug 2008 18:13:55 +0000 Subject: [Qemu-devel] [4990] Fix Sparc64 shifts 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: 4990 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4990 Author: blueswir1 Date: 2008-08-06 18:13:54 +0000 (Wed, 06 Aug 2008) Log Message: ----------- Fix Sparc64 shifts Modified Paths: -------------- trunk/target-sparc/translate.c Modified: trunk/target-sparc/translate.c =================================================================== --- trunk/target-sparc/translate.c 2008-08-06 16:55:50 UTC (rev 4989) +++ trunk/target-sparc/translate.c 2008-08-06 18:13:54 UTC (rev 4990) @@ -2920,20 +2920,17 @@ if (insn & (1 << 12)) { tcg_gen_shli_i64(cpu_dst, cpu_src1, rs2 & 0x3f); } else { - tcg_gen_andi_i64(cpu_dst, cpu_src1, 0xffffffffULL); - tcg_gen_shli_i64(cpu_dst, cpu_dst, rs2 & 0x1f); + tcg_gen_shli_i64(cpu_dst, cpu_src1, rs2 & 0x1f); } } else { /* register */ rs2 = GET_FIELD(insn, 27, 31); gen_movl_reg_TN(rs2, cpu_src2); if (insn & (1 << 12)) { tcg_gen_andi_i64(cpu_tmp0, cpu_src2, 0x3f); - tcg_gen_shl_i64(cpu_dst, cpu_src1, cpu_tmp0); } else { tcg_gen_andi_i64(cpu_tmp0, cpu_src2, 0x1f); - tcg_gen_andi_i64(cpu_dst, cpu_src1, 0xffffffffULL); - tcg_gen_shl_i64(cpu_dst, cpu_dst, cpu_tmp0); } + tcg_gen_shl_i64(cpu_dst, cpu_src1, cpu_tmp0); } gen_movl_TN_reg(rd, cpu_dst); } else if (xop == 0x26) { /* srl, V9 srlx */ @@ -2979,6 +2976,7 @@ } else { tcg_gen_andi_i64(cpu_tmp0, cpu_src2, 0x1f); tcg_gen_andi_i64(cpu_dst, cpu_src1, 0xffffffffULL); + tcg_gen_ext_i32_i64(cpu_dst, cpu_dst); tcg_gen_sar_i64(cpu_dst, cpu_dst, cpu_tmp0); } }