From patchwork Sun Mar 7 01:39:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 395138 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp649814jai; Sat, 6 Mar 2021 17:42:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJwZSD5Px0VGHBfU35PNQdsGS99OVclx3E/nO0iG3YpLLY0YvnsZK4vUkGpG6DR4wkcyKIuz X-Received: by 2002:a92:d18e:: with SMTP id z14mr15237203ilz.130.1615081346304; Sat, 06 Mar 2021 17:42:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615081346; cv=none; d=google.com; s=arc-20160816; b=L9ydAQF1yz23RHhXFZ1jam+7s+j5GKzErnVdVdzAgpOGTKTBBzV3ERjySdzVb/0T7k wQ/PAvF64Erve8A4nAe0hEph5lmqOv+uwG0TiyKmhczhgMerjtfstgBTzG5O+DEtx14G kKr8CW7toWRl3Wf+4oG8WBdUNdfzvgq4VgLjXsSKcVTuuiK808R3iLHJ1pCR8KQM37qR BYXcjS/TisR3nvV0yDUi304J8Ug1N5AC/mvyKVE/W4XPtSzIcb9IeZeWPwuNxu3DQ8yr LMRkus8Kk8UszLfF4z2yZBzceT52gSn4VbUJUW6ZelsegvE3Te2y2S+Bmy+v2SgaSIDO htaA== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=Ghpdt26qcrbgy2OSaWqHre3TiZBxfghqLDZzAialyXE=; b=R9WbNvKhWyw1W0r6H5zs+BJfAeEd69wV6FCQlh8xYNeF5kfk2VvAsh+hirKQ9OEPDV 28cZVsZe2+WauIkk5Ot4Gr4Ll4gHYE2raBBMr0fvTTeLRcQdpyPjrW4Q6/76lloiSzuE 2C9BfPeW7hChvasTIU3EseBVimS8ueS6BhHfjhMAPRPMa2GXswOrTkUoHsQkdg2N6JYU j84d0HHKWhh4jxzJ9JgAoE8aIv49zO26cq79wTEzoKYT4PEhgOYv6CoX1SnT6QDAPA4d 4/D8ck7GuT7uP2MzN67+DvmTvNU+2cPeEM9i7/mhpfGUZh2V2orINZQH1q7QZcBZK5pI RhCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MNscHIEQ; 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=pass (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 k23si6804339ios.16.2021.03.06.17.42.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 06 Mar 2021 17:42:26 -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=pass header.i=@linaro.org header.s=google header.b=MNscHIEQ; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:60776 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lIiR7-0005fK-On for patch@linaro.org; Sat, 06 Mar 2021 20:42:25 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:54824) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lIiNz-0002v8-Lq for qemu-devel@nongnu.org; Sat, 06 Mar 2021 20:39:11 -0500 Received: from mail-pj1-x1031.google.com ([2607:f8b0:4864:20::1031]:43878) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lIiNy-0005OR-4F for qemu-devel@nongnu.org; Sat, 06 Mar 2021 20:39:11 -0500 Received: by mail-pj1-x1031.google.com with SMTP id mz6-20020a17090b3786b02900c16cb41d63so1208022pjb.2 for ; Sat, 06 Mar 2021 17:39:09 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=Ghpdt26qcrbgy2OSaWqHre3TiZBxfghqLDZzAialyXE=; b=MNscHIEQGcvkYYMLI8SjIicZ2GDIWV0rzHcuu7oc7jr6pCA0dLsS8bQVXQIgzIIsE+ EKKY1G+qxbyVEI2pC4FkTDeF9QlWm6Vi+27ygBnqdq9ilglpZ4ztWRUxZFNKxhSq59bS 9VSx6vNOyvQ75WI4407aAKwjVpg+9UNv9n2VpqT2MkCJDGzR4c8HT4so+JrDu0ZqZ1P8 ljYbs/cp4h6inHbYscth5xcv2edepHl0Lkp9ExebXcUfQVP234h1dzdB9jb734H5p3md hJEa6lPhrq32lxFPJxF5+PWZskHfs2kVk9S9tNCGp4R8QYdA3kFU5LZVj4Fnzj59qzw0 7jWQ== 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:mime-version:content-transfer-encoding; bh=Ghpdt26qcrbgy2OSaWqHre3TiZBxfghqLDZzAialyXE=; b=b4yQysnZMkfvWs284e30wKvtxDri62DEMANi33qcR2Yjucg+er+0ARejWHO/YhhEcd D+ezTCPW52rl3EEU+CUqtqXpaMo9J3Toenjj/R6A+byLhDcYl4JfAx1mwFxkvNV+5z+Y wqjCubwwDEnZSRrkIGeRSq8drn2AuEfe7h8NWalt7Oxal336kuJBJHrSAsedTFXw14Tq KhfvRdRpeZC/hBy9HHzy9M69hs5MQTtYroVPwXzoVYU5N7kZMrfVIjRJzaxaWlmIudgP KpkOBWvItg05xWw1z5f0iYXqDJyDiFSZyL/s+rp6Q5wPCCg1bia3CZoU37GVxMKYVpJ3 rmPA== X-Gm-Message-State: AOAM531m+o7pr6Etv5akxQlv3ngUoAiFNz+oFQ9BpA8lftC1O9wPecC1 cU6S5R/2lrP8dfhIvwmlslqD/r9EVtwLzQ== X-Received: by 2002:a17:90a:d682:: with SMTP id x2mr18564431pju.139.1615081148649; Sat, 06 Mar 2021 17:39:08 -0800 (PST) Received: from localhost.localdomain ([71.212.131.83]) by smtp.gmail.com with ESMTPSA id v14sm6518044pju.19.2021.03.06.17.39.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 Mar 2021 17:39:08 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 2/3] target/hexagon: Fix shift amount check in fASHIFTL/fLSHIFTR Date: Sat, 6 Mar 2021 17:39:04 -0800 Message-Id: <20210307013905.115019-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210307013905.115019-1-richard.henderson@linaro.org> References: <20210307013905.115019-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1031; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1031.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, Taylor Simpson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Taylor Simpson Fixes: a646e99cb90 ("Hexagon (target/hexagon) macros") Eliminate the following Coverity CIDs (Bad bit shift operation) 325227 325292 325425 325526 325561 325564 325578 325637 325736 325748 325786 325815 325837 Signed-off-by: Taylor Simpson Message-Id: <1614879425-9259-1-git-send-email-tsimpson@quicinc.com> Signed-off-by: Richard Henderson --- target/hexagon/macros.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.25.1 diff --git a/target/hexagon/macros.h b/target/hexagon/macros.h index 78c4efb5cb..cfcb8173ba 100644 --- a/target/hexagon/macros.h +++ b/target/hexagon/macros.h @@ -459,7 +459,7 @@ static inline void gen_logical_not(TCGv dest, TCGv src) : (fCAST##REGSTYPE##s(SRC) >> (SHAMT))) #define fASHIFTR(SRC, SHAMT, REGSTYPE) (fCAST##REGSTYPE##s(SRC) >> (SHAMT)) #define fLSHIFTR(SRC, SHAMT, REGSTYPE) \ - (((SHAMT) >= 64) ? 0 : (fCAST##REGSTYPE##u(SRC) >> (SHAMT))) + (((SHAMT) >= (sizeof(SRC) * 8)) ? 0 : (fCAST##REGSTYPE##u(SRC) >> (SHAMT))) #define fROTL(SRC, SHAMT, REGSTYPE) \ (((SHAMT) == 0) ? (SRC) : ((fCAST##REGSTYPE##u(SRC) << (SHAMT)) | \ ((fCAST##REGSTYPE##u(SRC) >> \ @@ -469,7 +469,7 @@ static inline void gen_logical_not(TCGv dest, TCGv src) ((fCAST##REGSTYPE##u(SRC) << \ ((sizeof(SRC) * 8) - (SHAMT)))))) #define fASHIFTL(SRC, SHAMT, REGSTYPE) \ - (((SHAMT) >= 64) ? 0 : (fCAST##REGSTYPE##s(SRC) << (SHAMT))) + (((SHAMT) >= (sizeof(SRC) * 8)) ? 0 : (fCAST##REGSTYPE##s(SRC) << (SHAMT))) #ifdef QEMU_GENERATE #define fLOAD(NUM, SIZE, SIGN, EA, DST) MEM_LOAD##SIZE##SIGN(DST, EA)