From patchwork Fri Feb 1 16:06:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 157288 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp652324jaa; Fri, 1 Feb 2019 08:36:20 -0800 (PST) X-Google-Smtp-Source: ALg8bN4Vb0wvtxook+EHju58k15kM6I/c++Heyfptuurk4mMbXHMzMGJ93bR1bMjBIF62gxL+euy X-Received: by 2002:a81:2fce:: with SMTP id v197mr40189927ywv.173.1549038979952; Fri, 01 Feb 2019 08:36:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549038979; cv=none; d=google.com; s=arc-20160816; b=UyrXdW/k2P52DAvtGjhgZzrNfvCj1MPvDdWztr/ie0xcQnEv49XeMY0kID23E5oNdJ MyElBL8dcLafDuvqNZ7wEw7cU35yeODblU7OLuVNqEyFS1n6srv9ZTczPb+nbT1Oufsp txwvLNpLRIXbdNHbZA8AccyzogF38kESHSnDg7L2cuEvhn9Q0wVDop8vc12xkyhBDZL/ 08D+JTpWsaH1ZPHFI37JLlib3ScDyiNFktjJ2F053p8KH4Zx6tFGWfSbu26FP+uEUQ0/ /RPrsVcdkUk3dMT9QpAhr6TAs6vlul9w4mhh47QMk+LOgVmk+F92GrTHivcGM/jqRcqM tsQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=AU8CM7A0fPWZhlFKejWk44jg2TGHytwFxFHoUuMveXA=; b=PCj5phr+h+CZPaLkPAseE5Axp0jnqt1qEVQePGNlKzTDOzsLlRdv/+jaJZiIxqAzaH 0GZrjEu9g0ybwi80F47EcgmlJPKlRdgFSGUETo1UsOJywvk6a7qvWiotdtPpYolF0D4V Ltk4AyZGGjnK9mrW5NghYEeP3Yk1AfruUk7izEJeJA5JI/NSbJZxF3M1qprKuJC3c9Bo YY2KFzvtSfGl19UOtrqAJ0FN5jx5dU2M2dTYJswXbnMUU3hY/3DxNHVrvA84U/cA3gBW hAT8N/hCPebmhA0o96U3UPYU5g0MYgJwwhOAN5ueRpUNJALxHd/DZL1AmHRX1fxKrnH1 9hCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=kAOFiCvD; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id h3si5418962ywj.84.2019.02.01.08.36.19 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 01 Feb 2019 08:36:19 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=kAOFiCvD; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1]:57663 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gpbnf-0006vr-D2 for patch@linaro.org; Fri, 01 Feb 2019 11:36:19 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59182) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gpbMH-0008J5-Sf for qemu-devel@nongnu.org; Fri, 01 Feb 2019 11:08:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gpbMC-0003m4-A4 for qemu-devel@nongnu.org; Fri, 01 Feb 2019 11:08:01 -0500 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]:43405) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gpbMB-0003ae-UY for qemu-devel@nongnu.org; Fri, 01 Feb 2019 11:07:56 -0500 Received: by mail-wr1-x430.google.com with SMTP id b4so751821wrq.10 for ; Fri, 01 Feb 2019 08:07:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=AU8CM7A0fPWZhlFKejWk44jg2TGHytwFxFHoUuMveXA=; b=kAOFiCvDernRlLa/IJZZm8U4KMq84i54JMCWklVB/iXYoxJolipDsmFjXU3kXzTvNB GdBHWt1dFGu913iPIzlU8HQXZOJAwpbI+L9Bf+3wnBLnzDz71VHaPklrHfGM4gd15L2n V0v3GN8nF/qNCQdB1mgirfQ5b4V7ayVbRwisU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=AU8CM7A0fPWZhlFKejWk44jg2TGHytwFxFHoUuMveXA=; b=jvQDdUIbZQzxDR3cibTJ6IZquBagvBxqd+S8wx4apr9HXUEIXXSd0QlQ52chEQtk+m XEcCDyQfL6m8hn9spnEl6mVeQBDALFQ+eXzoz/yagr6nONzAV9kMBQo/eax89bk/9NN+ NpsT0j4yKNRaOtP8ryJybSChp9JMpa12JsxyQvn1Z9Eyu3YpbRyNA8AiAE/i+/oe7tv/ HB0+zGjW5SFrzTtkVnM9HOzBOGGjS+LdP+KNplbM3D9WbnvhyKuWBrX3M6Bc2sCdGIBj oA5t9RTNgzuSpl7CfKcpIu/LApl7LqsGRBmS2gCw7FIKV0EuHNiH5F595hCmNKve/TLF HcDA== X-Gm-Message-State: AJcUukfQcPNvOwwPuEdI1GWW7Pi8tXfQ+qdUrx4QN1q4RATMHhRBzjIO Gy08fbZrYMjo2/pEfDcRc50oMey13Jtwiw== X-Received: by 2002:adf:bc87:: with SMTP id g7mr38244487wrh.250.1549037258973; Fri, 01 Feb 2019 08:07:38 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id n6sm2847250wmk.9.2019.02.01.08.07.37 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 01 Feb 2019 08:07:38 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Date: Fri, 1 Feb 2019 16:06:40 +0000 Message-Id: <20190201160653.13829-35-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190201160653.13829-1-peter.maydell@linaro.org> References: <20190201160653.13829-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::430 Subject: [Qemu-devel] [PULL 34/47] target/arm/translate-a64: Fix mishandling of size in FCMLA decode X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" In disas_simd_indexed(), for the case of "complex fp", each indexable element is a complex pair, so the total size is twice that indicated in the 'size' field in the encoding. We were trying to do this "double the size" operation with a left shift by 1, but this is incorrect because the 'size' field is a MO_8/MO_16/MO_32/MO_64 value, and doubling the size should be done by a simple increment. This meant we were mishandling FCMLA (by element) of values where the real and imaginary parts are 32-bit floats, and would incorrectly UNDEF this encoding. (No other insns take this code path, and for 16-bit floats it happens that 1 << 1 and 1 + 1 are both the same). Reported-by: Laurent Desnogues Signed-off-by: Peter Maydell Reviewed-by: Laurent Desnogues Message-id: 20190129140411.682-3-peter.maydell@linaro.org --- target/arm/translate-a64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.20.1 diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index d46ea9f64e7..b864ac7a69f 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -12680,7 +12680,7 @@ static void disas_simd_indexed(DisasContext *s, uint32_t insn) case 2: /* complex fp */ /* Each indexable element is a complex pair. */ - size <<= 1; + size += 1; switch (size) { case MO_32: if (h && !is_q) {