From patchwork Tue Apr 22 19:25:50 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 883009 Delivered-To: patch@linaro.org Received: by 2002:a5d:474d:0:b0:38f:210b:807b with SMTP id o13csp2584684wrs; Tue, 22 Apr 2025 12:29:55 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWC0T9Cvzj7o8MQMZivNH2oYDMSfIron3cGK5QzmtkYD2Jfq/6qSNn+cVhBVdn9tFDIIVfdIQ==@linaro.org X-Google-Smtp-Source: AGHT+IEYjUnOM0DxQG6d7/CsYVDZHAKb6CfQ00+lfxNUcVEUYFTHlcIZI5wwLuSU1Oj7M1KHRoKL X-Received: by 2002:ad4:5d43:0:b0:6d8:8fbf:d1b7 with SMTP id 6a1803df08f44-6f2c468839amr285885176d6.43.1745350195194; Tue, 22 Apr 2025 12:29:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1745350195; cv=none; d=google.com; s=arc-20240605; b=bDJAvtmiXubJwmTH1a4SyratWk1EI6f9nIcOr0GZ5mZiCnuukD6TgckE1y8myKs3nn tLkouEyNR5Nz0zkyeOvnpDQnl+fYKyDihyWTHK1IZZWqRgMCQC8udUcDOQXftOLYE6CQ vkNVfQSl7DfCDxw1ES+ag6oVxu8xYaQj20aWjn9laQL+GLFQcrVRqG41/FQU+3xWNdGW lmkj3+4lZxsPgBV/ryGTKAg40Qj+hEPS/7JpXGwcAtl3iyn/juENtdPVykPAjwcTx2iO POCPWHBBQUkOVd1ko00aaD9nAo/qj8ftWE/JnoC5OFlFipKLpTwq/aaQqfEfF61ogQvX EwdQ== 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=sOXb/HC4BV8O7xeI6J7gLNVlc4Uon6AIhH5cPrLF7Cw=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=LCEpE+kiuTTcxL4Z5eNZm45Q3mDYG0piC1NW7fHy3dpLrteOqKNQWyQXSyTRLytdvq Y1i0rlVe9NeXgVIKiyxz9fLULWxxbf2QDrPlPmP3eVHz2TO1rw+aqj8oRjo8v4axvkmT lzmAzpKXrMnSy7HQDjPlLZMnP+OQA5n5CXo28TrbSVJ7IjdPUENYsPWJwjWgJic0QFB/ 9y4JOq7g/0hZduqodpCZIrae78w8lVjKWEMiN4rZtl4fg3/wTsXHoMVKY7f2AIhQFX5K xdwzhyk9fiRHltRl+HiZLDezLt2OUAM2kP+Ok8kUbp22CUlNjejWynErtUvfURHvVKTo E65A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MrZQUbE9; 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 6a1803df08f44-6f2c2b0356bsi116929876d6.4.2025.04.22.12.29.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 22 Apr 2025 12:29:55 -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=MrZQUbE9; 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 1u7JIB-0002MP-2i; Tue, 22 Apr 2025 15:28:27 -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 1u7JI8-0002M6-LY for qemu-devel@nongnu.org; Tue, 22 Apr 2025 15:28:25 -0400 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u7JI6-00068w-J2 for qemu-devel@nongnu.org; Tue, 22 Apr 2025 15:28:24 -0400 Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-736bfa487c3so5230141b3a.1 for ; Tue, 22 Apr 2025 12:28:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1745350101; x=1745954901; 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=sOXb/HC4BV8O7xeI6J7gLNVlc4Uon6AIhH5cPrLF7Cw=; b=MrZQUbE9Hy8vGPPpwsQ65SKZ6qPNgijIZnXow720adB+/weHMEHEBV3cSHCpWkmgxi DoQ1MaC//9j61ts8Nyw+Zt4ODwlK7PAQUug5tCk70v7a8bmx82ga2fHcNHH+CMFjckDt 80+nMUkUpL65P4+/lSC5hV4hOY8HF/6UKWcNRIF7x91xXwjv3Y48n4uawbmtI0/RWT67 fvQNp9WSxV4Z1WsSt6oWivdmjB6N+bVhpX/WqkThR//JUWrDP1+N8kVjfK+mRybnO1Rx A9kmm5zD1K4VM+jolDx+JmmE3M7ChNmmuIwETQcXqROjhcJDc0QcbAOoOPyuP9shdjpO GCvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745350101; x=1745954901; 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=sOXb/HC4BV8O7xeI6J7gLNVlc4Uon6AIhH5cPrLF7Cw=; b=S2p8o9FpvF8eEQTIITuyqEdkSxCIjlcIQbsSlJn3P0qKoWoNPs7H/04ZKv4R5QF6z5 qk/EQsRfffeUMrI+EYZzc81hVtIbGKsChYnYyfbYbrqdX8aIpK4GqdxNEC3jGsATYQmm Sr60aX/1KEFFAubvIsEeA0HoYbVqlA+aBtsBydUyKGHsGE2TNvFh5f259+uVW13g1UKO foGqdAMRL1OfjG740LhbS1LY+tTMb4EhHSuRnSffuiVffn+26AAeYz975EyrRuko2uO6 5MXN7JBDaBYe+X1MSZ4lSj0oYmyAEBnEcw1JZGhVGOqqWN7bOGF8jpnAuuQqsBLPUG8D gW0A== X-Gm-Message-State: AOJu0Yw98DBNLrdr4wBDKW+wtMhipP4jJzVw9z9l2ap5uQWKwNR0SoTV IRPFGzUA8PRpPG5G9BhhQUtSDtH2zKa+e+ERcgfvuhHDKP8+oD5HgpTkP9BbtcdAhimE+XDReqN h X-Gm-Gg: ASbGnctDDQelXxZMo1CComBiTQehP8GU5fd9xrNHI0yf0fIv99OWEPICgJpIJFvWaL/ B1tivphQXmrDY8ITXhDPpsxdKj6mxurTyt2Rub0evu+ktU5gTaIdix12lW3sR2VX49gTOkEiQgP DsrLzDmrIU7qe61/K4eWRvXTkUeFhvxQ6U6OXPkgJ+oX2YGrMUPezkW6SyLDsS42I6etJXwOk8q ltlP4mBosXfZ69UHdB7YCiVMXRqhtgl6nGg1mtlg+5vy1XzmGlyCmF3DrrzcYIbIhZ1o+y81gNO tF1RFE7HRKaJ2WZCfPr2hAGMV6uCAqj/NlSoOtEh5aq2xNvNkrUigPKZC6xwFUUy/q+pBopc0xs = X-Received: by 2002:a17:90b:5646:b0:2ee:f80c:6889 with SMTP id 98e67ed59e1d1-3087bcc8a9dmr27042451a91.33.1745350101084; Tue, 22 Apr 2025 12:28:21 -0700 (PDT) Received: from stoup.. (71-212-47-143.tukw.qwest.net. [71.212.47.143]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3087df21278sm9146865a91.29.2025.04.22.12.28.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Apr 2025 12:28:20 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH 001/147] exec/tswap: target code can use TARGET_BIG_ENDIAN instead of target_words_bigendian() Date: Tue, 22 Apr 2025 12:25:50 -0700 Message-ID: <20250422192819.302784-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250422192819.302784-1-richard.henderson@linaro.org> References: <20250422192819.302784-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42a; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42a.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 From: Pierrick Bouvier Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier Signed-off-by: Richard Henderson Message-ID: <20250317183417.285700-2-pierrick.bouvier@linaro.org> Reviewed-by: Philippe Mathieu-Daudé --- include/exec/tswap.h | 11 ++++++----- cpu-target.c | 1 + 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/include/exec/tswap.h b/include/exec/tswap.h index ecd4faef01..2683da0adb 100644 --- a/include/exec/tswap.h +++ b/include/exec/tswap.h @@ -13,13 +13,14 @@ /** * target_words_bigendian: * Returns true if the (default) endianness of the target is big endian, - * false otherwise. Note that in target-specific code, you can use - * TARGET_BIG_ENDIAN directly instead. On the other hand, common - * code should normally never need to know about the endianness of the - * target, so please do *not* use this function unless you know very well - * what you are doing! + * false otherwise. Common code should normally never need to know about the + * endianness of the target, so please do *not* use this function unless you + * know very well what you are doing! */ bool target_words_bigendian(void); +#ifdef COMPILING_PER_TARGET +#define target_words_bigendian() TARGET_BIG_ENDIAN +#endif /* * If we're in target-specific code, we can hard-code the swapping diff --git a/cpu-target.c b/cpu-target.c index cae77374b3..519b0f8900 100644 --- a/cpu-target.c +++ b/cpu-target.c @@ -155,6 +155,7 @@ void cpu_abort(CPUState *cpu, const char *fmt, ...) abort(); } +#undef target_words_bigendian bool target_words_bigendian(void) { return TARGET_BIG_ENDIAN;