From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KhZfU-0004Zy-QF for qemu-devel@nongnu.org; Sun, 21 Sep 2008 20:52:48 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KhZfS-0004Zg-Cv for qemu-devel@nongnu.org; Sun, 21 Sep 2008 20:52:47 -0400 Received: from [199.232.76.173] (port=58135 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KhZfS-0004Zd-6w for qemu-devel@nongnu.org; Sun, 21 Sep 2008 20:52:46 -0400 Received: from savannah.gnu.org ([199.232.41.3]:36729 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 1KhZfS-0005Bz-1X for qemu-devel@nongnu.org; Sun, 21 Sep 2008 20:52:46 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KhZfQ-0001GI-Jl for qemu-devel@nongnu.org; Mon, 22 Sep 2008 00:52:44 +0000 Received: from pbrook by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KhZfP-0001GE-Ry for qemu-devel@nongnu.org; Mon, 22 Sep 2008 00:52:44 +0000 MIME-Version: 1.0 Errors-To: pbrook Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Paul Brook Message-Id: Date: Mon, 22 Sep 2008 00:52:43 +0000 Subject: [Qemu-devel] [5286] Fix ARM NEON vdup and vtbl bugs. 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: 5286 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5286 Author: pbrook Date: 2008-09-22 00:52:42 +0000 (Mon, 22 Sep 2008) Log Message: ----------- Fix ARM NEON vdup and vtbl bugs. Signed-off-by: Paul Brook Modified Paths: -------------- trunk/target-arm/op_helper.c trunk/target-arm/translate.c Modified: trunk/target-arm/op_helper.c =================================================================== --- trunk/target-arm/op_helper.c 2008-09-21 23:15:38 UTC (rev 5285) +++ trunk/target-arm/op_helper.c 2008-09-22 00:52:42 UTC (rev 5286) @@ -56,7 +56,7 @@ for (shift = 0; shift < 32; shift += 8) { index = (ireg >> shift) & 0xff; if (index < maxindex) { - tmp = (table[index >> 3] >> (index & 7)) & 0xff; + tmp = (table[index >> 3] >> ((index & 7) << 3)) & 0xff; val |= tmp << shift; } else { val |= def & (0xff << shift); Modified: trunk/target-arm/translate.c =================================================================== --- trunk/target-arm/translate.c 2008-09-21 23:15:38 UTC (rev 5285) +++ trunk/target-arm/translate.c 2008-09-22 00:52:42 UTC (rev 5286) @@ -2807,7 +2807,7 @@ tmp2 = new_tmp(); tcg_gen_mov_i32(tmp2, tmp); neon_store_reg(rn, 0, tmp2); - neon_store_reg(rn, 0, tmp); + neon_store_reg(rn, 1, tmp); } else { /* VMOV */ switch (size) { @@ -3814,7 +3814,7 @@ tmp2 = new_tmp(); tcg_gen_mov_i32(tmp2, tmp); neon_store_reg(rd, 0, tmp2); - neon_store_reg(rd, 0, tmp); + neon_store_reg(rd, 1, tmp); rd += stride; } stride = (1 << size) * nregs; @@ -5498,7 +5498,7 @@ } } else if ((insn & (1 << 10)) == 0) { /* VTBL, VTBX. */ - n = (insn >> 5) & 0x18; + n = ((insn >> 5) & 0x18) + 8; if (insn & (1 << 6)) { tmp = neon_load_reg(rd, 0); } else { @@ -5508,6 +5508,7 @@ tmp2 = neon_load_reg(rm, 0); gen_helper_neon_tbl(tmp2, tmp2, tmp, tcg_const_i32(rn), tcg_const_i32(n)); + dead_tmp(tmp); if (insn & (1 << 6)) { tmp = neon_load_reg(rd, 1); } else { @@ -5518,7 +5519,8 @@ gen_helper_neon_tbl(tmp3, tmp3, tmp, tcg_const_i32(rn), tcg_const_i32(n)); neon_store_reg(rd, 0, tmp2); - neon_store_reg(rd, 1, tmp2); + neon_store_reg(rd, 1, tmp3); + dead_tmp(tmp); } else if ((insn & 0x380) == 0) { /* VDUP */ if (insn & (1 << 19)) {