From nobody Sun Nov 24 00:26:33 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1728059675; cv=none; d=zohomail.com; s=zohoarc; b=EAiliuxVBMpppUnJJw4ToFl3LEoGGpFBvcd6hQbWnWgcKZrLRFqEbeK9L5BcDuEP6LNh7gxNG6ylYebgsy0YDbZWSyo8yye2PVQZpn6QaYZ/uJzBmGr05X7Oe9ydlJT9WNqiL4bvjSCFlwEDNYRehL5S3cJZKD6pikAnf/bubCo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728059675; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=uKaUzar4CyW9b+VidODguwjQPRzdI1IQfcANAiFe0bI=; b=JRB+jyLMvGucoj10SgvBwj617XgZ31zKQjK3lbBjoU9Rjwbl3LY0viEX0viSST0yg7lE8Zw+e1SxJil1vDX99h8IeKXKg7VwFJvjLI3c0ue/w2fJUHfe8Gszp/Rvp4ToeIvqz/jDlZ8B4TlpoBZOipZiNhkz/FBAzpmoP7qR/aY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1728059675411867.354196839635; Fri, 4 Oct 2024 09:34:35 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1swlFt-0002Y5-IP; Fri, 04 Oct 2024 12:34:13 -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 1swlFo-0001vu-9d for qemu-devel@nongnu.org; Fri, 04 Oct 2024 12:34:08 -0400 Received: from mail-lf1-x134.google.com ([2a00:1450:4864:20::134]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1swlFl-00061M-SK for qemu-devel@nongnu.org; Fri, 04 Oct 2024 12:34:08 -0400 Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-5398a26b64fso2386005e87.3 for ; Fri, 04 Oct 2024 09:34:04 -0700 (PDT) Received: from localhost.localdomain ([91.223.100.150]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-539b0025812sm766e87.307.2024.10.04.09.33.56 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 04 Oct 2024 09:34:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1728059643; x=1728664443; 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=uKaUzar4CyW9b+VidODguwjQPRzdI1IQfcANAiFe0bI=; b=WupiJwVHeCXB6aPmjNqYTZQbwDvic76JnBZYSNwJcF6NcAnh5iuWAJYBTnkXvvT1/u 1LKwvMKpx5NG+nkDD3hIT9ZhdNLM4Ynd5LkvF0VuIpzDmWGEBTmCvuCq89h+cWAGtSBu pl7dPt2xRYfNE3HfjbIbThhcWzicmn0U5rtFys5Tt5Sbpfuka87E3dCO/v19YoC9K0Rr WHX5RvUtRad2mIaM/U9VV7elCk05c5urP93tZezjGLuijrUVJX+aqF4T/n/EhmJ+LeWq TCYu6wA2z2ptkWwQQgntaXGr1/TFF989nVW438YvhK+nRfr0YhKKKWgOdy2I5rT5csx5 LKng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728059643; x=1728664443; 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=uKaUzar4CyW9b+VidODguwjQPRzdI1IQfcANAiFe0bI=; b=K2OBCgWA2Qs6R/VxyGikl52Xs4yZIuilad0q4PVSgyiHu3gp0XKQlI6JYE8MStV3xw J4swRm/UG1ojC5edXaamaU7gGVZzzIldsf9nqpzFEQKOSYSfWCPPdBOiWd/+p/Ukqdi6 +px1nAxnwXS4qEpCGCZPg5lnh8874H7+oQ5KKqT670b1lx0xWrE+EKboGIf/QZXP0DEO IBCRdU/62qXLaY0aic+0ZQz+2eUqjMYbsNaFYH4nLJh1ozanfoYlhe0V5Qq4l5YIHREr ULEn+zE8uWOXl9H5tQFAjFV07AkYWpIL/xuLZaM2PvMdGVypU7gmUEQoXV92vJNOGL/q XF3g== X-Gm-Message-State: AOJu0YwwynnQ9XOpSJczXScnMZw4VY7R47kh6Wfa0o/KNJKiWLp0LkhE a9510h1QnC5d7RPor9Pcep5Se/JdqBebMQ8afuCvUK6FBVWi4cXfzCxPr04rWhzuJ2jzwwJS1DG nZia4zw== X-Google-Smtp-Source: AGHT+IFuVaVw2FeEj02CoP4GD4TKrUCRAAI2yJWWIn245ZaDyKf2L+98Bsw33FI6NNiG3GQCT3c70w== X-Received: by 2002:a05:6512:318e:b0:536:7cfb:6998 with SMTP id 2adb3069b0e04-539ab89e01bmr2589237e87.35.1728059642951; Fri, 04 Oct 2024 09:34:02 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-riscv@nongnu.org, qemu-s390x@nongnu.org, Thomas Huth , Richard Henderson , Pierrick Bouvier , qemu-ppc@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 13/25] target/sh4: Use explicit little-endian LD/ST API Date: Fri, 4 Oct 2024 13:30:29 -0300 Message-ID: <20241004163042.85922-14-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241004163042.85922-1-philmd@linaro.org> References: <20241004163042.85922-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::134; envelope-from=philmd@linaro.org; helo=mail-lf1-x134.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1728059677213116600 Since commit 73ceb12960e ("Remove the unused sh4eb target") we only build the SH4 architecture for little endianness. Directly use the little-endian LD/ST API. Mechanical change using: $ end=3Dle; \ for acc in uw w l q tul; do \ sed -i -e "s/ld${acc}_p(/ld${acc}_${end}_p(/" \ -e "s/st${acc}_p(/st${acc}_${end}_p(/" \ $(git grep -wlE '(ld|st)t?u?[wlq]_p' target/sh4/); \ done Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/sh4/gdbstub.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/target/sh4/gdbstub.c b/target/sh4/gdbstub.c index 75926d4e049..194be1d5db3 100644 --- a/target/sh4/gdbstub.c +++ b/target/sh4/gdbstub.c @@ -80,59 +80,59 @@ int superh_cpu_gdb_write_register(CPUState *cs, uint8_t= *mem_buf, int n) switch (n) { case 0 ... 7: if ((env->sr & (1u << SR_MD)) && (env->sr & (1u << SR_RB))) { - env->gregs[n + 16] =3D ldl_p(mem_buf); + env->gregs[n + 16] =3D ldl_le_p(mem_buf); } else { - env->gregs[n] =3D ldl_p(mem_buf); + env->gregs[n] =3D ldl_le_p(mem_buf); } break; case 8 ... 15: - env->gregs[n] =3D ldl_p(mem_buf); + env->gregs[n] =3D ldl_le_p(mem_buf); break; case 16: - env->pc =3D ldl_p(mem_buf); + env->pc =3D ldl_le_p(mem_buf); break; case 17: - env->pr =3D ldl_p(mem_buf); + env->pr =3D ldl_le_p(mem_buf); break; case 18: - env->gbr =3D ldl_p(mem_buf); + env->gbr =3D ldl_le_p(mem_buf); break; case 19: - env->vbr =3D ldl_p(mem_buf); + env->vbr =3D ldl_le_p(mem_buf); break; case 20: - env->mach =3D ldl_p(mem_buf); + env->mach =3D ldl_le_p(mem_buf); break; case 21: - env->macl =3D ldl_p(mem_buf); + env->macl =3D ldl_le_p(mem_buf); break; case 22: - cpu_write_sr(env, ldl_p(mem_buf)); + cpu_write_sr(env, ldl_le_p(mem_buf)); break; case 23: - env->fpul =3D ldl_p(mem_buf); + env->fpul =3D ldl_le_p(mem_buf); break; case 24: - env->fpscr =3D ldl_p(mem_buf); + env->fpscr =3D ldl_le_p(mem_buf); break; case 25 ... 40: if (env->fpscr & FPSCR_FR) { - env->fregs[n - 9] =3D ldl_p(mem_buf); + env->fregs[n - 9] =3D ldl_le_p(mem_buf); } else { - env->fregs[n - 25] =3D ldl_p(mem_buf); + env->fregs[n - 25] =3D ldl_le_p(mem_buf); } break; case 41: - env->ssr =3D ldl_p(mem_buf); + env->ssr =3D ldl_le_p(mem_buf); break; case 42: - env->spc =3D ldl_p(mem_buf); + env->spc =3D ldl_le_p(mem_buf); break; case 43 ... 50: - env->gregs[n - 43] =3D ldl_p(mem_buf); + env->gregs[n - 43] =3D ldl_le_p(mem_buf); break; case 51 ... 58: - env->gregs[n - (51 - 16)] =3D ldl_p(mem_buf); + env->gregs[n - (51 - 16)] =3D ldl_le_p(mem_buf); break; default: return 0; --=20 2.45.2