[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 18/25] target/m68k: Use explicit big-endian LD/ST API
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v2 18/25] target/m68k: Use explicit big-endian LD/ST API |
Date: |
Fri, 4 Oct 2024 13:30:34 -0300 |
The M68K architecture uses big endianness. Directly use
the big-endian LD/ST API.
Mechanical change using:
$ end=be; \
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/m68k/); \
done
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
target/m68k/gdbstub.c | 2 +-
target/m68k/helper.c | 10 +++++-----
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/target/m68k/gdbstub.c b/target/m68k/gdbstub.c
index 15547e2313c..136159f98f2 100644
--- a/target/m68k/gdbstub.c
+++ b/target/m68k/gdbstub.c
@@ -52,7 +52,7 @@ int m68k_cpu_gdb_write_register(CPUState *cs, uint8_t
*mem_buf, int n)
CPUM68KState *env = cpu_env(cs);
uint32_t tmp;
- tmp = ldl_p(mem_buf);
+ tmp = ldl_be_p(mem_buf);
if (n < 8) {
/* D0-D7 */
diff --git a/target/m68k/helper.c b/target/m68k/helper.c
index 4c85badd5d3..9d3db8419de 100644
--- a/target/m68k/helper.c
+++ b/target/m68k/helper.c
@@ -57,15 +57,15 @@ static int cf_fpu_gdb_set_reg(CPUState *cs, uint8_t
*mem_buf, int n)
if (n < 8) {
float_status s;
- env->fregs[n].d = float64_to_floatx80(ldq_p(mem_buf), &s);
+ env->fregs[n].d = float64_to_floatx80(ldq_be_p(mem_buf), &s);
return 8;
}
switch (n) {
case 8: /* fpcontrol */
- cpu_m68k_set_fpcr(env, ldl_p(mem_buf));
+ cpu_m68k_set_fpcr(env, ldl_be_p(mem_buf));
return 4;
case 9: /* fpstatus */
- env->fpsr = ldl_p(mem_buf);
+ env->fpsr = ldl_be_p(mem_buf);
return 4;
case 10: /* fpiar, not implemented */
return 4;
@@ -107,10 +107,10 @@ static int m68k_fpu_gdb_set_reg(CPUState *cs, uint8_t
*mem_buf, int n)
}
switch (n) {
case 8: /* fpcontrol */
- cpu_m68k_set_fpcr(env, ldl_p(mem_buf));
+ cpu_m68k_set_fpcr(env, ldl_be_p(mem_buf));
return 4;
case 9: /* fpstatus */
- cpu_m68k_set_fpsr(env, ldl_p(mem_buf));
+ cpu_m68k_set_fpsr(env, ldl_be_p(mem_buf));
return 4;
case 10: /* fpiar, not implemented */
return 4;
--
2.45.2
- Re: [PATCH v2 12/25] target/loongarch: Use explicit little-endian LD/ST API, (continued)
- [PATCH v2 13/25] target/sh4: Use explicit little-endian LD/ST API, Philippe Mathieu-Daudé, 2024/10/04
- [PATCH v2 14/25] target/tricore: Use explicit little-endian LD/ST API, Philippe Mathieu-Daudé, 2024/10/04
- [PATCH v2 15/25] target/rx: Use explicit little-endian LD/ST API, Philippe Mathieu-Daudé, 2024/10/04
- [PATCH v2 16/25] target/riscv: Use explicit little-endian LD/ST API, Philippe Mathieu-Daudé, 2024/10/04
- [PATCH v2 17/25] hw/m68k: Use explicit big-endian LD/ST API, Philippe Mathieu-Daudé, 2024/10/04
- [PATCH v2 18/25] target/m68k: Use explicit big-endian LD/ST API,
Philippe Mathieu-Daudé <=
- [PATCH v2 20/25] target/sparc: Use explicit big-endian LD/ST API, Philippe Mathieu-Daudé, 2024/10/04
- [PATCH v2 19/25] hw/sparc: Use explicit big-endian LD/ST API, Philippe Mathieu-Daudé, 2024/10/04
- [PATCH v2 22/25] hw/s390x: Use explicit big-endian LD/ST API, Philippe Mathieu-Daudé, 2024/10/04
- [PATCH v2 23/25] target/s390x: Use explicit big-endian LD/ST API, Philippe Mathieu-Daudé, 2024/10/04
- [PATCH v2 21/25] target/hppa: Use explicit big-endian LD/ST API, Philippe Mathieu-Daudé, 2024/10/04
- [PATCH v2 24/25] target/openrisc: Use explicit big-endian LD/ST API, Philippe Mathieu-Daudé, 2024/10/04
- [PATCH v2 25/25] hw/ppc/e500: Use explicit big-endian LD/ST API, Philippe Mathieu-Daudé, 2024/10/04