From patchwork Wed Jan 19 19:29:53 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 3 Return-Path: Delivered-To: unknown Received: from imap.gmail.com (74.125.159.109) by localhost6.localdomain6 with IMAP4-SSL; 08 Jun 2011 14:39:09 -0000 Delivered-To: patches@linaro.org Received: by 10.147.124.10 with SMTP id b10cs119387yan; Wed, 19 Jan 2011 11:29:58 -0800 (PST) Received: by 10.216.188.67 with SMTP id z45mr1086642wem.7.1295465397364; Wed, 19 Jan 2011 11:29:57 -0800 (PST) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk [81.2.115.146]) by mx.google.com with ESMTPS id u30si11367939wei.171.2011.01.19.11.29.56 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 19 Jan 2011 11:29:57 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 81.2.115.146 as permitted sender) client-ip=81.2.115.146; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 81.2.115.146 as permitted sender) smtp.mail=pm215@archaic.org.uk Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.69) (envelope-from ) id 1Pfdj7-0000QX-4b; Wed, 19 Jan 2011 19:29:53 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Christophe Lyon Subject: [PATCH] target-arm: Fix loading of scalar value for Neon multiply-by-scalar Date: Wed, 19 Jan 2011 19:29:53 +0000 Message-Id: <1295465393-1620-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.1 Fix the register and part of register we get the scalar from in the various "multiply vector by scalar" ops (VMUL by scalar and friends). Signed-off-by: Peter Maydell --- target-arm/translate.c | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/target-arm/translate.c b/target-arm/translate.c index c60cd18..0c2856a 100644 --- a/target-arm/translate.c +++ b/target-arm/translate.c @@ -3608,14 +3608,14 @@ static inline TCGv neon_get_scalar(int size, int reg) { TCGv tmp; if (size == 1) { - tmp = neon_load_reg(reg >> 1, reg & 1); - } else { - tmp = neon_load_reg(reg >> 2, (reg >> 1) & 1); - if (reg & 1) { - gen_neon_dup_low16(tmp); - } else { + tmp = neon_load_reg(reg & 7, reg >> 4); + if (reg & 8) { gen_neon_dup_high16(tmp); + } else { + gen_neon_dup_low16(tmp); } + } else { + tmp = neon_load_reg(reg & 15, reg >> 4); } return tmp; }