From patchwork Sun Mar 23 22:50:46 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 875644 Delivered-To: patch@linaro.org Received: by 2002:a5d:5f4c:0:b0:38f:210b:807b with SMTP id cm12csp1882849wrb; Sun, 23 Mar 2025 15:51:28 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUDo0UfgetHPa0+xR5zWKq+f0UUp7XX9ze2yKLbWl1bKraDKErCofoI1BYsiZESoQB+4PlmUA==@linaro.org X-Google-Smtp-Source: AGHT+IG5Kz56JpvKs2Tjzd1+lw5sjiGq5u0R4pZft4bAFNikQA5UzvAFiSDrUXOuO0dCj0L/jvax X-Received: by 2002:a05:622a:228f:b0:476:8288:9558 with SMTP id d75a77b69052e-4771de61266mr136257331cf.46.1742770288087; Sun, 23 Mar 2025 15:51:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1742770288; cv=none; d=google.com; s=arc-20240605; b=FX4f1kbaywO7fyOE7bCGYVaM8a4grMCkOl61W4NZEG7vK4E/Hf/5HBnQAHv6Mqhk0Z lKtWwt+/inzza33B9P0UBnZIzWN0yIlDfzf9VuYxl+xUxrbEZNn2w8ix7hPnDA+nntOc lwfErrkFywP0Aqh2JXRO6ESxr5nC+Fhx0jktwWElJrxScvHZzA1ewdpkVQOG5cHqgUV6 A1Wtt97XZlSDSbWBIrIz+YjuAdQhmEfgI6S239k4RGVoMtaUIOyjr7/2nx5stZGQyzh5 J82ERdtyi+Tu9y8PaFz5lLyaq4nw5vUKJIWzGy217O/rDrKC5S7N1O+yVaCPouXZWvuj q9gw== 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=2ONHD5d7pAXIaEH45P/RlmSMtYEst+nDWdheP9MRJb4=; fh=vck2nDYxqcFlydCmWbI+Nh5uhp2JVAcrdICqGSnk6Bo=; b=Qd8CbzNvthuLVutrRs0vd5IBXo77+r7Pe6jxLeYS6+aGVN8+3A80euLQQVhorllP2n r2FQBS974c+X5ctOXXVeEsIJRUgvwb6BxN1smVkWDdqEzteWpj9v/lolK6n3hLT8iFot q86KXlJ4lbFjVM9cilp2DsAowahZsWTF0Y4V19Qes62vsaXHHsck1xOb7oOVtuj+Phhu MRpKSy91W9H3+amdqeHVF8xWreaAzbgf4EktzXrqLl+3umDfrtCrTSnKnlMF6V24tHYq 9ybRrb3C+Yi7UlE/8VUsLjeu24ymPNvSaGQgtQmUCCj5eGWKUJkphoBFtdY09Z41AhRS nguQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bHerPZeR; 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-477409d2198si11535031cf.115.2025.03.23.15.51.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 23 Mar 2025 15:51:28 -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=bHerPZeR; 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 1twU9o-0003qu-58; Sun, 23 Mar 2025 18:51:04 -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 1twU9m-0003qh-K6 for qemu-devel@nongnu.org; Sun, 23 Mar 2025 18:51:02 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450: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 1twU9l-0007EO-30 for qemu-devel@nongnu.org; Sun, 23 Mar 2025 18:51:02 -0400 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-39141ffa9fcso3277188f8f.0 for ; Sun, 23 Mar 2025 15:51:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1742770259; x=1743375059; 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=2ONHD5d7pAXIaEH45P/RlmSMtYEst+nDWdheP9MRJb4=; b=bHerPZeRvZbS6/1ml7IZckksN5V92FsNnyLTh8FpZY449Ay5WU7yF9wKnZBwd9MYLc 4bf7fKrZwfvo4AT1zESGpD2GYBr3U687svh5USRYowCZAgR5j3H35YYCtqnYJUmif5pn kNjUbEp4hdXiHpia3qdGroMiuWv0vB8P2f0w6oy5eo/pmsq7HxPBl47ws41q1R8KqYM4 aPoFM76rB0kb+JdytJtY6zO+AmaRe2FZ0QbYClP4zByZ7byn4wmLbuJi8KZz1feFycb/ K0PzKTOrDtX0DFdtS1sFsfEprZN6CCJls/82neCTlemTDp8AHkhigDGsWieq+0KkcrGa KIRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742770259; x=1743375059; 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=2ONHD5d7pAXIaEH45P/RlmSMtYEst+nDWdheP9MRJb4=; b=IhbGN22uu1ytHSxNn1u0jYjvgZ2+Y7EyNHoaIRrzJlISjdnuST2ebY63huwMbtH7eS 6qBU8MD46l+jYwtUnEg2T8WNV0aK/voZpnxdO4P9DnNknub33XlM5bQ1CAPNiUsmxza+ YGp2iLAfCUQbhSMy4rhZbwyNhz+sP+WvSAXEZOw0O8wMprYah/v9Sv3DHjQoCXNMDIcU RYIRfBF2MPBgVyVgsQge4SXX3iE2ooafwjYTCo0Qtc5nsS0j1oeR2B8gZDzToT19FL4j aIMRftBArUd1drn6AmRNKBwRcCKtqXhHIyZ5WYCSdUDrGPcvZbpQal9ixE0+e8YlDbwB 7E/g== X-Gm-Message-State: AOJu0Yzpt8vyMX8AbAvqos1YymwgYkv4aPXNVotaOsvNiV7vGkHYqQJF x/Hi9vXuR++VyXH5bBGwdJZkhodu4gma318Q7V+x445ecqxEzagcx4g1diL1Ngj1mTc9MASjFvB E X-Gm-Gg: ASbGncvCiYbWr3EEzH3Gjra20HeDcpVg2+By0+y+EQmWCbC67ihWkTBoraZgwyqRKWr 3gKXRslOdxKSvC8V5uWE8yllX9W18E3LmTmirRb3ZA8jXcZb5kQb3s/YzlNsEBGuWTaCTd7lp/0 N8sy3k+JS2Le6JqDQ045uW4czGQ6lz/Ds4ISQzdZ/8wfhZAvnZ/FBo8ak4f2C3i/AL2J3TIJ04Y g46exVbeTh6Yd63zzc9IFAwUzTB42QalSrAA5Q6xgU+lNNyiWsulPb2VGSVMJ5xMIvLvBCph/fF 7sV2CR6WsRBsvDu6KvSdJorJBVe6qgHS5XAyFZIJMpvom5UEM55nyZaruGaUO4wicYBxQaJDaTc gXVegLoUFA3/B3xNFZxnpvzYC X-Received: by 2002:a5d:64e7:0:b0:391:13ef:1af8 with SMTP id ffacd0b85a97d-3997f9423admr9035105f8f.54.1742770259316; Sun, 23 Mar 2025 15:50:59 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43d4fd277c9sm102906645e9.22.2025.03.23.15.50.57 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 23 Mar 2025 15:50:58 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Pierrick Bouvier , Huacai Chen , Peter Xu , Jiaxun Yang , Fabiano Rosas , Aleksandar Rikalo , =?utf-8?q?Alex_Benn=C3=A9e?= , Aurelien Jarno , Artyom Tarasenko , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PATCH-for-10.1 2/3] target/sparc: Inline qemu_get_betl() and qemu_put_betl() Date: Sun, 23 Mar 2025 23:50:46 +0100 Message-ID: <20250323225047.35419-3-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250323225047.35419-1-philmd@linaro.org> References: <20250323225047.35419-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=philmd@linaro.org; helo=mail-wr1-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 We only use qemu_get_betl() and qemu_put_betl() once in the whole code base. Inline them (checking TARGET_SPARC64 instead of TARGET_LONG_BITS == 64) so we can remove them later as unused. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier --- target/sparc/machine.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/target/sparc/machine.c b/target/sparc/machine.c index 222e5709c55..cc58812781b 100644 --- a/target/sparc/machine.c +++ b/target/sparc/machine.c @@ -87,7 +87,13 @@ static int get_fsr(QEMUFile *f, void *opaque, size_t size, const VMStateField *field) { SPARCCPU *cpu = opaque; - target_ulong val = qemu_get_betl(f); + target_ulong val; + +#ifdef TARGET_SPARC64 + val = qemu_get_be64(f); +#else + val = qemu_get_be32(f); +#endif cpu_put_fsr(&cpu->env, val); return 0; @@ -99,7 +105,11 @@ static int put_fsr(QEMUFile *f, void *opaque, size_t size, SPARCCPU *cpu = opaque; target_ulong val = cpu_get_fsr(&cpu->env); - qemu_put_betl(f, val); +#ifdef TARGET_SPARC64 + qemu_put_be64(f, val); +#else + qemu_put_be32(f, val); +#endif return 0; }