From nobody Fri May 17 09:18:22 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail header.i=@quicinc.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=quicinc.com ARC-Seal: i=1; a=rsa-sha256; t=1614879625; cv=none; d=zohomail.com; s=zohoarc; b=IgRtR/OyxDLkw17QUpWXS5UvCKP+hDRhu4/zjj4DyepwTIJ2pcrWkxVe9Ykc4BLxnsgGuwG7/mozG4LI8c+BGmmXeUpX/wTkX5Xh2btbC6Ug1MbNF3mcR3xeWwsEJUh0MUQDLHJ9t9bSMfQjeLnkqO8FlP5qRGTFOmFZ86lfocc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614879625; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=D4AUK6nBAXfYFOr08lOzrjAgphJM+kIBAUuhF4nQFCw=; b=VwmjN/36Hx5uumjS6EnyUCeTCe66bh2GffOIyBfQ6jQ4n6fxBXtrCAvbeK+DxpTFLN/qbEKOvT9INmo1c5O0RrC6nQDPNyl0gHNqN0f8wTbETlSP787Ks5jA+WIsZV2RXG6hlysR8AuuvxzrIiG6u5lmaC2L26Qi9yInYeBsYM4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail header.i=@quicinc.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1614879625720576.5416100258311; Thu, 4 Mar 2021 09:40:25 -0800 (PST) Received: from localhost ([::1]:57084 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lHrxY-00017q-IA for importer@patchew.org; Thu, 04 Mar 2021 12:40:24 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51838) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lHruT-0008HT-7s for qemu-devel@nongnu.org; Thu, 04 Mar 2021 12:37:14 -0500 Received: from alexa-out-sd-02.qualcomm.com ([199.106.114.39]:42905) by eggs.gnu.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1lHruP-0002Gq-Sl for qemu-devel@nongnu.org; Thu, 04 Mar 2021 12:37:12 -0500 Received: from unknown (HELO ironmsg03-sd.qualcomm.com) ([10.53.140.143]) by alexa-out-sd-02.qualcomm.com with ESMTP; 04 Mar 2021 09:37:08 -0800 Received: from vm-tsimpson-sd.qualcomm.com ([10.53.72.70]) by ironmsg03-sd.qualcomm.com with ESMTP; 04 Mar 2021 09:37:07 -0800 Received: by vm-tsimpson-sd.qualcomm.com (Postfix, from userid 47164) id BB9AD15C8; Thu, 4 Mar 2021 09:37:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1614879429; x=1646415429; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=j+vhrETH4Feioqk6sIRwxzAMv345E1jouq6KvY/6c6o=; b=WJofJdz+0aVXNVXYMv0qe7kLbUKKasZfkjMnw3E/F7QPxnkWhDSVzsyV QgKAll0uf5/NO/snayZV9k4lcWehQgpUQO1UZ6MkJiiXIPb+ZZmCc5LLi WQtGW7R+oHiyPZtHx9SnO1lj1g17x5h3b0QTX76wS98nWKheuHE7fOpLI I=; X-QCInternal: smtphost From: Taylor Simpson To: qemu-devel@nongnu.org Subject: [PATCH v2] Hexagon (target/hexagon) Fix shift amount check in fASHIFTL/fLSHIFTR Date: Thu, 4 Mar 2021 09:37:05 -0800 Message-Id: <1614879425-9259-1-git-send-email-tsimpson@quicinc.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=199.106.114.39; envelope-from=tsimpson@qualcomm.com; helo=alexa-out-sd-02.qualcomm.com X-Spam_score_int: -40 X-Spam_score: -4.1 X-Spam_bar: ---- X-Spam_report: (-4.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_MED=-2.3, 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: ale@rev.ng, bcain@quicinc.com, peter.maydell@linaro.org, richard.henderson@linaro.org, tsimpson@quicinc.com, philmd@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) 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 --- target/hexagon/macros.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/hexagon/macros.h b/target/hexagon/macros.h index 78c4efb..cfcb817 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) >=3D 64) ? 0 : (fCAST##REGSTYPE##u(SRC) >> (SHAMT))) + (((SHAMT) >=3D (sizeof(SRC) * 8)) ? 0 : (fCAST##REGSTYPE##u(SRC) >> (S= HAMT))) #define fROTL(SRC, SHAMT, REGSTYPE) \ (((SHAMT) =3D=3D 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) >=3D 64) ? 0 : (fCAST##REGSTYPE##s(SRC) << (SHAMT))) + (((SHAMT) >=3D (sizeof(SRC) * 8)) ? 0 : (fCAST##REGSTYPE##s(SRC) << (S= HAMT))) =20 #ifdef QEMU_GENERATE #define fLOAD(NUM, SIZE, SIGN, EA, DST) MEM_LOAD##SIZE##SIGN(DST, EA) --=20 2.7.4