From patchwork Sat Oct 5 20:05:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 833006 Delivered-To: patch@linaro.org Received: by 2002:adf:8b52:0:b0:367:895a:4699 with SMTP id v18csp1339127wra; Sat, 5 Oct 2024 13:09:33 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWGOJG+17L14ka9T0GLyEo0rkiGhEyBnC2JE0RBX5msUpGQogHF0XK/mOVifz1UbMYrZEpaRw==@linaro.org X-Google-Smtp-Source: AGHT+IF9FI4ca4o44MqkHvZv/Tk3YaKWLnT8CFb6Y0zzupdFSJ1Hn6Txz2YqwsZK3RgZMcLLJwo9 X-Received: by 2002:a05:622a:548e:b0:45d:8bd7:391a with SMTP id d75a77b69052e-45d9bad3311mr96920301cf.43.1728158973267; Sat, 05 Oct 2024 13:09:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1728158973; cv=none; d=google.com; s=arc-20240605; b=ZDxUDfQwJTiPA6mUf3aS1ojnVmiVYU0y96huJrf7G0GRoGIKjAE4QXwuY5Ny6g2nVC DmfJKD5r6Hlm93DUapWPmDIECQyjUDKBi98glJZfOxb1xYRk6slpTI2bOcVf9K4fr3O+ ueAB4frn5jA/eysYGZMqRwQMCa1fv/IRdaLXWjWHj0Md16MbeLfap484rf82an3wfmyx WYiEppdeyl1UeOvtKTFUzHVlzMusYfoRrIeA2iLDl99SbZ9ivXkEw1oih8bcRXHph9sr FNiE3D9Bq3r3awSsQd4RqG7I32Xn4e5qoa5HrjJqvVpPBLnbABVT1/mPDuA8NN0LFgEU O1vA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to: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:cc:to :from:dkim-signature; bh=js9k8IR/cEhAqGc5dKpCioG/n/UgV+piB56d5dg8Aiw=; fh=rQg8EQ8KH04w/0VkDYF6/ktgEyHJ2dqn1eatHCfBaLw=; b=YJYnCkCWvun/EXYzp1nBGZ656RtgZ77q1QLzWwoXsURVxdW85ZxZFyUDLTHvaYLnpe LW6LnjIKG/Sa1+G//oNJ1CsK7FXiAqsb9Z+P2EITbf4OVV1pSmSqP31ALMLIm4VykLjG gOtW9c/lDD24jzPG1L651ZUHbIzettJVq04ZlmjAWmRoDY+CfwgP/eUS2VQRdZKzO16v ZYoGY9y7ZJMYb8C5/9Xq7YwfrRtYrdslWFt0sIdd6EqZybFi82lrD57dqVy5bcPHvF4c JJ9La1vLRjuLM7cS/LShbSXpDqBoA4i/oAv79IE91WmvfJR/hfQUE/dl15saO+7GIpwY uH2w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="uiErL/iL"; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-45da76433a0si26083871cf.457.2024.10.05.13.09.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 05 Oct 2024 13:09:33 -0700 (PDT) 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="uiErL/iL"; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sxB2X-0006HX-SI; Sat, 05 Oct 2024 16:06:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sxB2V-0006Fs-9D for qemu-devel@nongnu.org; Sat, 05 Oct 2024 16:06:07 -0400 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sxB2T-0001iD-P9 for qemu-devel@nongnu.org; Sat, 05 Oct 2024 16:06:07 -0400 Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-20aff65aa37so27611155ad.1 for ; Sat, 05 Oct 2024 13:06:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1728158764; x=1728763564; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=js9k8IR/cEhAqGc5dKpCioG/n/UgV+piB56d5dg8Aiw=; b=uiErL/iL5fiZsmvpRKLEV3mSd4tKAGuHXDlECqRIZFX6tC7NTj3TrDzKnEoVl5IntU nIWzxlgGgcdeH5ayoyRpGmAn1p5XhzhPjaZe3DAsbq2lJ05T6bDPFsT+eGbWbkrsrP0q XtL3mUHYl3f72OqIlzpyjLpbhlnDmefJo6jXzh3sDPgEKxwgRj01ZXHZ0kXwAlhyPhD6 Ad5gEy55JNQG4LnIox0JOqcbVvxw0mvI/sa/V3e8+3p9HMGTaTB/JNIXeEBGJLP3dxVv yGxT6+8eto/YFjMNEeXTxImBqACYrpa04Kw7b5oZs3QbZWTJKA+LC5Tf+SAdkfEy37tc E5Og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728158764; x=1728763564; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=js9k8IR/cEhAqGc5dKpCioG/n/UgV+piB56d5dg8Aiw=; b=Tr/A8mpaiLBJN9JHJ42CMDhJTf/I6HQR1lAGWpbq8C732A9iYpSaqeaSlQ8fqLihbs yCpdkbIt/X3p7PcaNE2n0Jpqbd4QEUPSlpTfzTK4MPicBsEdBLtnuFKd1k6oNuyeVRp5 ljeUHp3U9petwn83zEyEtEea5jXzdR1RuRG3c13WkHo23zitNOiWNsupN/fkf5nIxWma 9p+q7pbzTtOPcR2obbvyMuO6kcOKqiJLtIuRsVSb7bH4PyNh0hUTqSeODj6o0uJcl4Km xHDCjZ1tKfZTciyO8Wqcy/EkEthKCTo3b01p9xJVjOhfbGgx7EeHZi3bDPwp1tZpKTZ/ VuHQ== X-Gm-Message-State: AOJu0YyEFhUq2clRFx2i5z5px2ofZxk5cxYd8XhPgf71swQPVRob28y2 MSB/9vFfTgUGQfr6n5KtRzUuYwuiG3QpKZma4PgX/Hl79ppXMMWpCDJaLadjZmegzffb32Gq+nM n X-Received: by 2002:a17:902:db0d:b0:20b:8642:9863 with SMTP id d9443c01a7336-20bfdfc268dmr105234565ad.18.1728158764343; Sat, 05 Oct 2024 13:06:04 -0700 (PDT) Received: from stoup.. (174-21-81-121.tukw.qwest.net. [174.21.81.121]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20c13931055sm16493405ad.139.2024.10.05.13.06.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Oct 2024 13:06:03 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@kernel.org, peter.maydell@linaro.org, alex.bennee@linaro.org, linux-parisc@vger.kernel.org, qemu-arm@nongnu.org Subject: [PATCH v2 03/21] include/exec/memop: Move get_alignment_bits from tcg.h Date: Sat, 5 Oct 2024 13:05:42 -0700 Message-ID: <20241005200600.493604-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241005200600.493604-1-richard.henderson@linaro.org> References: <20241005200600.493604-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62f; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62f.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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org This function is specific to MemOp, not TCG in general. Signed-off-by: Richard Henderson --- include/exec/memop.h | 23 +++++++++++++++++++++++ include/tcg/tcg.h | 23 ----------------------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/include/exec/memop.h b/include/exec/memop.h index f881fe7af4..97720a8ee7 100644 --- a/include/exec/memop.h +++ b/include/exec/memop.h @@ -170,4 +170,27 @@ static inline bool memop_big_endian(MemOp op) return (op & MO_BSWAP) == MO_BE; } +/** + * get_alignment_bits + * @memop: MemOp value + * + * Extract the alignment size from the memop. + */ +static inline unsigned get_alignment_bits(MemOp memop) +{ + unsigned a = memop & MO_AMASK; + + if (a == MO_UNALN) { + /* No alignment required. */ + a = 0; + } else if (a == MO_ALIGN) { + /* A natural alignment requirement. */ + a = memop & MO_SIZE; + } else { + /* A specific alignment requirement. */ + a = a >> MO_ASHIFT; + } + return a; +} + #endif diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h index 21d5884741..824fb3560d 100644 --- a/include/tcg/tcg.h +++ b/include/tcg/tcg.h @@ -281,29 +281,6 @@ static inline int tcg_type_size(TCGType t) return 4 << i; } -/** - * get_alignment_bits - * @memop: MemOp value - * - * Extract the alignment size from the memop. - */ -static inline unsigned get_alignment_bits(MemOp memop) -{ - unsigned a = memop & MO_AMASK; - - if (a == MO_UNALN) { - /* No alignment required. */ - a = 0; - } else if (a == MO_ALIGN) { - /* A natural alignment requirement. */ - a = memop & MO_SIZE; - } else { - /* A specific alignment requirement. */ - a = a >> MO_ASHIFT; - } - return a; -} - typedef tcg_target_ulong TCGArg; /* Define type and accessor macros for TCG variables.