From patchwork Wed Oct 9 00:04:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 833825 Delivered-To: patch@linaro.org Received: by 2002:adf:a1d9:0:b0:367:895a:4699 with SMTP id v25csp556204wrv; Tue, 8 Oct 2024 17:07:25 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUvEK5VOKEO9PSfpaMgGrpypvEQQknZE2Rxlv7zo2P6aZ8C86udsNeNXIYP8d3ZZXZTTqaftA==@linaro.org X-Google-Smtp-Source: AGHT+IEsbZ1IwuMqVRnw9ljVk1/MVnAjB1fxE4TR371UoLwHez7gEONcaCy8HW6O6wqPsclsjXZb X-Received: by 2002:a05:622a:1886:b0:45f:762:2e31 with SMTP id d75a77b69052e-45fa5ef4d99mr12106781cf.20.1728432445095; Tue, 08 Oct 2024 17:07:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1728432445; cv=none; d=google.com; s=arc-20240605; b=GZO/H5iQP6ul4Ez8rEDz0DgQUmR0pq5KqHWTQVJQdJyiDEqy5dVy8uhJCdDYLHbLoB VpunCOAGOb8a1sKhCshdD2CX1Tfdzs+GqxZeG5jAHb5KVpAbGzA1RPk6XhbbgCa39LbR qKn48u3SE4H5Mhkc9W+Z/APoU+T7m9LMNuaVc/7w3wewW2eI/MsKRnF4LEqioytCPeC1 5PeGFtXdQCu0bGdZCzDdSyOmPwWLfUk0sv1sHZvw9bpafzXZkd0CBkA6X0pfKUxmSKzw sX/RTp3Q5JOpzATCAMIyTVeQPWXuZbRS8CYeFJC4dh8LlgdDdpFU8qGeCOCboKhnJLhe PF3g== 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=O9DVukvxY0Nz2lbOkkF1UGxIJ0HiyrlwFe+DiEN47Z4=; fh=3RK8noKPsRgJpwHDkrKY6p9N6ePZuLOt1ZjdS1VodvU=; b=FP0EXPtUZcq7MlOqkBlHhDu0vefhaUC0hFZHuDsjNNaqSkYb0cQ5F9rnuWRwNva9Mm 4PUaiWXjHheJEX6IWMlPSuG0X09E+C7YeY1CyRK8c/Z/1KS85LQcRY7Za8fsKGfWB7Es tgkDl4bVIV+ENr0awnNEh592ByW6CwvloDbki+sECJqTq35Z1D7N8HkJkoHVfUb0QHMf EH2b5ehA6Lr5JvItw/grW8hUKT0MBloDgGpvexEDSf44bix1nbGj4hE71mqavuyQsdM/ MTIOIJKtSMXj2KYam1USlxnVS+b6KvsBXFzEuUf7i8CKthzDUUhRA2JKodfL3D2Xr2OM Uphw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HlZTf1Mw; 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-45f0991f20dsi8120941cf.203.2024.10.08.17.07.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 08 Oct 2024 17:07:25 -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=HlZTf1Mw; 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 1syKCM-0004Cm-Pv; Tue, 08 Oct 2024 20:05:02 -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 1syKCK-0004Ay-QH for qemu-devel@nongnu.org; Tue, 08 Oct 2024 20:05:00 -0400 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1syKCI-0002dy-Oj for qemu-devel@nongnu.org; Tue, 08 Oct 2024 20:05:00 -0400 Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-20b86298710so53278845ad.1 for ; Tue, 08 Oct 2024 17:04:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1728432297; x=1729037097; 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=O9DVukvxY0Nz2lbOkkF1UGxIJ0HiyrlwFe+DiEN47Z4=; b=HlZTf1MwHzSnBNjJ8f++lS5BBrVXyYw6+YKEWJSbB3YURcVLpjWueYhAT3Ihz0g2a4 w7zJ48GaD1b4akJhQlWwayw+D134lR2t1OFEn3tnNslKh3hWFyA/UuVAVpzTTNMOUY/s NXt9HXr9GQc8jQ4wDfTfVx3Ns+71wVMcjN2GeE2deYLWNzxrgZlsegAdBpeNJ5+BKPEH GkXJHHxyqWi8XuBknoaJZDHKtGNoOAWNIkzrF5xMzmzALeVJB90Q5VHuBgD7xq9GcbTF PJ0us3nr0kyCdAM6AznB+D9oC7yHqRGS5V1y9iDRuksCJ/jNTdgjFAH8AluxFhrh1FKB KLVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728432297; x=1729037097; 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=O9DVukvxY0Nz2lbOkkF1UGxIJ0HiyrlwFe+DiEN47Z4=; b=HMnEni/f1Dbg7s6BtEkCqM3LE+UIQXZKzDzi3sSM4X8T8lr/MWg4rqRBF/RYWAG4os 0+y8FWEZs+XhkLu8l/T/U3Ek5R58grLNxomPtW3e99/Sf+p0YqJWftOXlugpzYMo4E9E w9bdWoEgThSlQW0rWTphhKJBg0ikMUKMvIcf0wGNmxNpTuMjTlEOFt+OgJjIFHglgbep sH1fh7dyMf7yae22JgKo3MsPjfgwN99PwMYF1BXFdwrzkcFUfgOO+4Prkzvywuq0KRCs GwN5yICHpSHItuLCMKocWSYtNfjkCgl+vQvIEnpgXr5OS8Osr4EWJ0fIlj+taIUMA8C9 aTOg== X-Gm-Message-State: AOJu0YwzK9ni7pZqQWvpxpXK8Lf7nqevQWNOsDcRdU3UFMhkjenlYIiO CCNnpHqzzHG5Ss/rxYhBQTUH/ZeoojFPrPHrA2vDYsgWGNRs6z4SzVWb9RSpS0WNiXWd+4AihSY W X-Received: by 2002:a17:902:c40b:b0:20b:bf17:e497 with SMTP id d9443c01a7336-20c63780107mr10371935ad.46.1728432297083; Tue, 08 Oct 2024 17:04:57 -0700 (PDT) Received: from stoup.. (174-21-81-121.tukw.qwest.net. [174.21.81.121]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20c138cecf2sm60705105ad.104.2024.10.08.17.04.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Oct 2024 17:04:56 -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, Helge Deller , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v3 02/20] include/exec/memop: Move get_alignment_bits from tcg.h Date: Tue, 8 Oct 2024 17:04:35 -0700 Message-ID: <20241009000453.315652-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241009000453.315652-1-richard.henderson@linaro.org> References: <20241009000453.315652-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::636; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x636.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=unavailable 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. Reviewed-by: Helge Deller Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Peter Maydell 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.