From patchwork Fri Feb 11 12:26:48 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 82749 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id A4D28B7136 for ; Fri, 11 Feb 2011 23:29:24 +1100 (EST) Received: from localhost ([127.0.0.1]:58177 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pns7U-0008Qp-It for incoming@patchwork.ozlabs.org; Fri, 11 Feb 2011 07:29:04 -0500 Received: from [140.186.70.92] (port=57081 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pns5Y-0007YF-Ay for qemu-devel@nongnu.org; Fri, 11 Feb 2011 07:27:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pns5L-0003nV-3j for qemu-devel@nongnu.org; Fri, 11 Feb 2011 07:26:52 -0500 Received: from mnementh.archaic.org.uk ([81.2.115.146]:18824) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pns5K-0003mn-QI for qemu-devel@nongnu.org; Fri, 11 Feb 2011 07:26:51 -0500 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.69) (envelope-from ) id 1Pns5I-0004R8-Ck; Fri, 11 Feb 2011 12:26:48 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Fri, 11 Feb 2011 12:26:48 +0000 Message-Id: <1297427208-17029-3-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1297427208-17029-1-git-send-email-peter.maydell@linaro.org> References: <1297427208-17029-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 81.2.115.146 Cc: patches@linaro.org Subject: [Qemu-devel] [PATCH 2/2] target-arm: Fix Neon VQDMLSL instruction X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org For VQDMLSL, negation has to occur after saturation, not before. Signed-off-by: Peter Maydell --- target-arm/translate.c | 22 ++++++++++++++-------- 1 files changed, 14 insertions(+), 8 deletions(-) diff --git a/target-arm/translate.c b/target-arm/translate.c index cf5c3f0..2db2544 100644 --- a/target-arm/translate.c +++ b/target-arm/translate.c @@ -5135,16 +5135,19 @@ static int disas_neon_data_insn(CPUState * env, DisasContext *s, uint32_t insn) neon_store_reg64(cpu_V0, rd + pass); } else if (op == 5 || (op >= 8 && op <= 11)) { /* Accumulate. */ - if (op == 10 || op == 11) { - gen_neon_negl(cpu_V0, size); - } neon_load_reg64(cpu_V1, rd + pass); switch (op) { - case 5: case 8: case 10: /* VABAL, VMLAL, VMLSL */ + case 10: /* VMLSL */ + gen_neon_negl(cpu_V0, size); + /* Fall through */ + case 5: case 8: /* VABAL, VMLAL */ gen_neon_addl(size); break; case 9: case 11: /* VQDMLAL, VQDMLSL */ gen_neon_addl_saturate(cpu_V0, cpu_V0, size); + if (op == 11) { + gen_neon_negl(cpu_V0, size); + } gen_neon_addl_saturate(cpu_V0, cpu_V1, size); break; default: @@ -5282,18 +5285,21 @@ static int disas_neon_data_insn(CPUState * env, DisasContext *s, uint32_t insn) tmp2 = tmp4; } gen_neon_mull(cpu_V0, tmp, tmp2, size, u); - if (op == 6 || op == 7) { - gen_neon_negl(cpu_V0, size); - } if (op != 11) { neon_load_reg64(cpu_V1, rd + pass); } switch (op) { - case 2: case 6: + case 6: + gen_neon_negl(cpu_V0, size); + /* Fall through */ + case 2: gen_neon_addl(size); break; case 3: case 7: gen_neon_addl_saturate(cpu_V0, cpu_V0, size); + if (op == 7) { + gen_neon_negl(cpu_V0, size); + } gen_neon_addl_saturate(cpu_V0, cpu_V1, size); break; case 10: