From nobody Tue Feb 10 02:42:48 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1545371340133423.35811710442397; Thu, 20 Dec 2018 21:49:00 -0800 (PST) Received: from localhost ([::1]:42377 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gaDg4-000201-Ub for importer@patchew.org; Fri, 21 Dec 2018 00:48:52 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59893) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gaDdd-0000UO-Q7 for qemu-devel@nongnu.org; Fri, 21 Dec 2018 00:46:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gaDdc-0006tK-FV for qemu-devel@nongnu.org; Fri, 21 Dec 2018 00:46:21 -0500 Received: from ozlabs.org ([2401:3900:2:1::2]:39375) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gaDdY-0006kz-Ro; Fri, 21 Dec 2018 00:46:18 -0500 Received: by ozlabs.org (Postfix, from userid 1007) id 43Ld0L47KGz9s8r; Fri, 21 Dec 2018 16:46:10 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1545371170; bh=eE/DQE2QbxGrYav1d++u945z06iSeLv+e5f8AMpInCg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=A2Dfz1UYsF6Eli8YXXsapeUpqgmkUO/Saxol6XORDpQY/3lD9q0BzB2JHHtwNLQDp hz72UXO9NRhEoHGVAl9tKARyfxCQeEz6ITjK0AxV9sutk3IH8s46lnnlPzyknLVi4f XMovCIYUtmVjVzXmIpx0hZYDXBQBWJ6sCsIwhr9E= From: David Gibson To: peter.maydell@linaro.org Date: Fri, 21 Dec 2018 16:45:28 +1100 Message-Id: <20181221054606.22007-3-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181221054606.22007-1-david@gibson.dropbear.id.au> References: <20181221054606.22007-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2401:3900:2:1::2 Subject: [Qemu-devel] [PULL 02/40] target/ppc: Remove silly GETFIELD/SETFIELD/MASK_TO_LSH macros 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: gkurz@redhat.com, lvivier@redhat.com, qemu-devel@nongnu.org, qemu-ppc@nongnu.org, clg@kaod.org, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" The (only) obvious use for these macros is constructing and parsing guest visible register fields. But the way they're constructed, they're only valid when used on a *host* long, whose size shouldn't be visible to the guest at all. They also have no current users, so just get rid of them. Signed-off-by: David Gibson --- target/ppc/cpu.h | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h index 527181c0f0..d5f99f1fc7 100644 --- a/target/ppc/cpu.h +++ b/target/ppc/cpu.h @@ -78,18 +78,6 @@ PPC_BIT32(bs)) #define PPC_BITMASK8(bs, be) ((PPC_BIT8(bs) - PPC_BIT8(be)) | PPC_BIT8(= bs)) =20 -#if HOST_LONG_BITS =3D=3D 32 -# define MASK_TO_LSH(m) (__builtin_ffsll(m) - 1) -#elif HOST_LONG_BITS =3D=3D 64 -# define MASK_TO_LSH(m) (__builtin_ffsl(m) - 1) -#else -# error Unknown sizeof long -#endif - -#define GETFIELD(m, v) (((v) & (m)) >> MASK_TO_LSH(m)) -#define SETFIELD(m, v, val) \ - (((v) & ~(m)) | ((((typeof(v))(val)) << MASK_TO_LSH(m)) & (m))) - /*************************************************************************= ****/ /* Exception vectors definitions = */ enum { --=20 2.19.2