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;