From patchwork Tue May 1 18:04:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 134786 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp5236580lji; Tue, 1 May 2018 11:06:28 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpNmndZhBFMZTVU+EPSoYH9vYBgXSHMHeY2XfLMyfoXAWJG3ehbLtFvDhNHNpVZ+vJRhURl X-Received: by 10.55.17.137 with SMTP id 9mr12509879qkr.392.1525197988311; Tue, 01 May 2018 11:06:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525197988; cv=none; d=google.com; s=arc-20160816; b=PN5G800sofoQwWoZbk0bFZeWam+Pa9sNIGfiEsRMIZLTXEcFSeTeq96W1CkM3nwub6 M60UTa5FsAfRbcHeLTtn/g0jxxt07jMGLWL5NX4lJPP1IHb/GhVRJSniok9E/pSbKHbN IMFmaXCUn9sqSa4tfSPoLmKcw3bdg1ljp48l4216YXznvzKHDodgondgkaNDcFlyz3NV jA/ZQd9BXinVykMyno1TwwLOmiJSMdy+xWp2SiH9wOSjrK9zQMWwUgrRuIo2EigUgGfl A+Kavo81b6tSY8+CYMKBRz+6XOqZc/DMoeLDKU7rssGYyhtMQBwQrbLMluZOnMI/96DF Cssg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=1BZd8qt69qVsAYir59uUIsDXmGXzpo1zdM1CqHLvln0=; b=jLZnT0epmlOFyCW/51jaLymRJeKUN86Vf04ATUUDAFUHlENgCNTtUeIwOvyNFG/o5R QulqJKgGkMDX47tr3Cw/xD1OI/3ezdkbL9OQ/cvbbb28Aj/C+4L0dSxQPyevFMVaWUzJ i+J6hXZkHD/NOCm0o9IOcHZE0rGMcXIyMWZmJ8ruxJJt6XHCXTqPiK930CgaY6BYggUq 2UMgrau3LaVhCL5X1g8W9lbiu0AQjJRfGwRh01XXosSw3Fxt1FzwgnU63g7nyk6fYLm3 zaCn1AdXt2YuOJA/SZp1oLzGsTnhw6d/Z8gCPp8USAafM5GNB8iFkOMdQ887738s0eBs wiXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=cpsbgN4w; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 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. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id c40-v6si9601537qte.106.2018.05.01.11.06.28 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 01 May 2018 11:06:28 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=cpsbgN4w; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 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 ([::1]:45542 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fDZfX-0000h3-Sr for patch@linaro.org; Tue, 01 May 2018 14:06:27 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57534) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fDZeC-0008HV-FN for qemu-devel@nongnu.org; Tue, 01 May 2018 14:05:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fDZeA-0000ZQ-15 for qemu-devel@nongnu.org; Tue, 01 May 2018 14:05:04 -0400 Received: from mail-pg0-x243.google.com ([2607:f8b0:400e:c05::243]:41032) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fDZe9-0000Yc-RP for qemu-devel@nongnu.org; Tue, 01 May 2018 14:05:01 -0400 Received: by mail-pg0-x243.google.com with SMTP id m21-v6so8776089pgv.8 for ; Tue, 01 May 2018 11:05:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=1BZd8qt69qVsAYir59uUIsDXmGXzpo1zdM1CqHLvln0=; b=cpsbgN4wCvlh5AiaCipr8uLhp202mZDfEhwjZUhGaoMlAsCPAVWm0YkN7PHewXdNyq FsU51h0yVchr6OmWXuzzjjDE8L5GmRiFgocBWbnPiOEjJJVRtk2VvWnYNt/eQ8scU36c q6Qu2+haPioQQcjwS8BV/vn9TLTURsz4nET3E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=1BZd8qt69qVsAYir59uUIsDXmGXzpo1zdM1CqHLvln0=; b=D8xQQ+Ye4HnynmYXUVhAIcLqgsqIwyVH5i77XdpQD1x183+OHzzgO43VBCI84hU1to BHno+ecXo48txBJsc8bIXJ1l7FyxNGgCMm4bAsB7YEmPD+/hqsB5uZEqpcIChddZzS8I gbUJp2dxxM5fdLDNefIB5F20AXFPlORjFRhppU3fhlwXmmFpXnvJCHQwv8f4f9qCYEzv SCczV3s8liWy5XNyfqfqbtqiAo0gNeR0l4WbmBHAN69oukFCXJt5IlNUI5Koxw7FnoQK vJXWslcysZ4IF0QgZgx1XshHa0Vd4HuUxbrdyu3AJWQewjWJminLL8VuMHgI5ZkorUBv 7xLA== X-Gm-Message-State: ALQs6tCg0F9ACPrTim+nQE1gm8/dCAdunLw5h+HQ05Nirik2hq6wVoiR R4wjefpzkBniinRQ/7IHFxwEt8/lj4c= X-Received: by 2002:a63:8c0e:: with SMTP id m14-v6mr13896306pgd.320.1525197900555; Tue, 01 May 2018 11:05:00 -0700 (PDT) Received: from cloudburst.twiddle.net (97-113-2-170.tukw.qwest.net. [97.113.2.170]) by smtp.gmail.com with ESMTPSA id j5sm23732224pfe.119.2018.05.01.11.04.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 01 May 2018 11:04:59 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 1 May 2018 11:04:54 -0700 Message-Id: <20180501180455.11214-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180501180455.11214-1-richard.henderson@linaro.org> References: <20180501180455.11214-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c05::243 Subject: [Qemu-devel] [PATCH 1/2] target/arm: Tidy conditions in handle_vec_simd_shri 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: , Cc: peter.maydell@linaro.org, qemu-arm@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The (size > 3 && !is_q) condition is identical to the preceeding test of bit 3 in immh; eliminate it. For the benefit of Coverity, assert that size is within the bounds we expect. Fixes: Coverity CID1385846 Fixes: Coverity CID1385849 Fixes: Coverity CID1385852 Fixes: Coverity CID1385857 Signed-off-by: Richard Henderson --- target/arm/translate-a64.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) -- 2.14.3 Reviewed-by: Alex Bennée diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index bff4e13bf6..97950dce1a 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -9019,11 +9019,7 @@ static void handle_vec_simd_shri(DisasContext *s, bool is_q, bool is_u, unallocated_encoding(s); return; } - - if (size > 3 && !is_q) { - unallocated_encoding(s); - return; - } + tcg_debug_assert(size <= 3); if (!fp_access_check(s)) { return; From patchwork Tue May 1 18:04:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 134788 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp5239115lji; Tue, 1 May 2018 11:09:01 -0700 (PDT) X-Google-Smtp-Source: AB8JxZop9N3QdvrKrpodEnPdzAs6P4uG0aD0OmH686Z1EGKFUS8Fwufce674Y6MLTgY3ujtQP7fn X-Received: by 10.55.24.96 with SMTP id j93mr12729810qkh.11.1525198141138; Tue, 01 May 2018 11:09:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525198141; cv=none; d=google.com; s=arc-20160816; b=rJqoq8HYfeYjq5jFSgT0T1LVItLbSaJJk7FQ5k8e+OvIYNlML2rTKFoXz/WDB0aODh crNkTNzRGNFe8bQ6Qq8GIA6ExScxaRdbMqzTXH6Vt0r/pDzZ+optkH2K5X4PvXoSFPaI v3fjo5SaomrOy+Y/7CxPgo9XDtmI2396lbJ/VXoSiNCrG+ax14JpRlIh5Uw/e/lK3HEb znkVDXNjOtJroMJBGqdRH+8LajAe9oYBJufcHfsoooOpYjDXrgwsQiBuUSIjtnbfxiSN kcFiHgUTZn8It6VMCIMLdxJCdnz7HpBc9Y+03Vd8yPoyLEWdAn5WzHVLPVuC2uweBe+F BHIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=B7Tp/8To9S3Hke3NcXQo34DBSqtfSx8QkH+6ZItMU0I=; b=gGB8q6wFv87scDjaK2aZu1TlGoddrINyuJg6FAbgBHVWJhwZo6gBBHSdGgHPXitdQB t2VlN4MK07uQwe4lpVK9d3KOR7KP8A54AsOJiEUHoXLzWKtS9t+SQ857X8qtylYLn8BQ Z7nfKzVXqHJgv3dPGU/1vEMm90gMRKHyl/QiHMDfjCVB3I2VvOeKLfPyIicARlNRdav+ wRd1ShjENVghUp/FzCjRBz/PJzFcuBZWHepJ5QwOCEWR9cSvKj8CUVHy57ezWxaRTt+d 1UpNgie2r2VRyOSRQYBesTCBfSUjPdpy6JlZftRz9DA/jOpwC6x8ja68sX2oWvo+gsgb f6DA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=GimsKsc3; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 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. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id b6si7767669qkg.359.2018.05.01.11.09.00 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 01 May 2018 11:09:01 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=GimsKsc3; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 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 ([::1]:45553 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fDZi0-0001tv-NW for patch@linaro.org; Tue, 01 May 2018 14:09:00 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57562) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fDZeF-0008Hs-Nx for qemu-devel@nongnu.org; Tue, 01 May 2018 14:05:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fDZeB-0000aZ-98 for qemu-devel@nongnu.org; Tue, 01 May 2018 14:05:07 -0400 Received: from mail-pg0-x243.google.com ([2607:f8b0:400e:c05::243]:34940) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fDZeB-0000Zt-3h for qemu-devel@nongnu.org; Tue, 01 May 2018 14:05:03 -0400 Received: by mail-pg0-x243.google.com with SMTP id j11-v6so8784915pgf.2 for ; Tue, 01 May 2018 11:05:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=B7Tp/8To9S3Hke3NcXQo34DBSqtfSx8QkH+6ZItMU0I=; b=GimsKsc3bAYbCkfo4EdomUuvX0X69H+j1yh/hrEVLj3Ef40ImYErixfn2X5q+xVZnT T0RcUc/CZzuuHn7dmbloEuOYl/8ZwBBmB7Ex+ET/wzplxXyfvvp8QlEGJDfa71G061v/ /K1Byvjg2eGpwUWy1HugnNqUHPdT79mpHM4ho= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=B7Tp/8To9S3Hke3NcXQo34DBSqtfSx8QkH+6ZItMU0I=; b=EVSHJw8I4zk2f73JmrhVqqPFo3LKwJ2/8KEGC9XnqHtxIbuHLzt8ZJoPrZNVY11EgJ x9hTtWdXxRaG17MwpydeNg0XAdA8wRWBH/dPDg2IWyiK6Dki2LpWVKiCJvnwbHGBmDCj /hjntXYCdQLdMmmp0MM/Dn818kZfBjuFCwaNdLlkgVrF8toUf+GmhNZ5Md7i4+88Ugbv k4hTissOjHEoMuUCiIX3CUKw3J6xnmHzrJeR6qon5CZXizDf3+zByBmYEAVGcxfwYChd gFT64j1fCtI0t+GRixGS5X0pB3qF0j1U+FJ9vGzdQDdLp0UBQ1TZ6qEvwahvs89s8Mpi NqPQ== X-Gm-Message-State: ALQs6tCP7Z8GqKBDg/mnquDZTiEHrfsbJvTPV6io7bGacdPgeteXAy9L yPS7epHjFYDUKQ+OIQuKbBXHKbMROZc= X-Received: by 2002:a63:7a05:: with SMTP id v5-v6mr13803160pgc.184.1525197901877; Tue, 01 May 2018 11:05:01 -0700 (PDT) Received: from cloudburst.twiddle.net (97-113-2-170.tukw.qwest.net. [97.113.2.170]) by smtp.gmail.com with ESMTPSA id j5sm23732224pfe.119.2018.05.01.11.05.00 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 01 May 2018 11:05:00 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 1 May 2018 11:04:55 -0700 Message-Id: <20180501180455.11214-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180501180455.11214-1-richard.henderson@linaro.org> References: <20180501180455.11214-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c05::243 Subject: [Qemu-devel] [PATCH 2/2] target/arm: Tidy condition in disas_simd_two_reg_misc 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: , Cc: peter.maydell@linaro.org, qemu-arm@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Path analysis shows that size == 3 && !is_q has been eliminated. Fixes: Coverity CID1385853 Signed-off-by: Richard Henderson --- target/arm/translate-a64.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) -- 2.14.3 Reviewed-by: Alex Bennée diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index 97950dce1a..6d49f30b4a 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -11473,7 +11473,11 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) /* All 64-bit element operations can be shared with scalar 2misc */ int pass; - for (pass = 0; pass < (is_q ? 2 : 1); pass++) { + /* Coverity claims (size == 3 && !is_q) has been eliminated + * from all paths leading to here. + */ + tcg_debug_assert(is_q); + for (pass = 0; pass < 2; pass++) { TCGv_i64 tcg_op = tcg_temp_new_i64(); TCGv_i64 tcg_res = tcg_temp_new_i64();