[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 12/25] target/loongarch: Use explicit little-endian LD/ST API
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v2 12/25] target/loongarch: Use explicit little-endian LD/ST API |
Date: |
Fri, 4 Oct 2024 13:30:28 -0300 |
The LoongArch architecture uses little endianness. Directly
use the little-endian LD/ST API.
Mechanical change using:
$ end=le; \
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/loongarch/); \
done
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
target/loongarch/gdbstub.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/target/loongarch/gdbstub.c b/target/loongarch/gdbstub.c
index 3a03cf9cba9..dafa4feb75d 100644
--- a/target/loongarch/gdbstub.c
+++ b/target/loongarch/gdbstub.c
@@ -67,10 +67,10 @@ int loongarch_cpu_gdb_write_register(CPUState *cs, uint8_t
*mem_buf, int n)
int length = 0;
if (is_la64(env)) {
- tmp = ldq_p(mem_buf);
+ tmp = ldq_le_p(mem_buf);
read_length = 8;
} else {
- tmp = ldl_p(mem_buf);
+ tmp = ldl_le_p(mem_buf);
read_length = 4;
}
@@ -106,13 +106,13 @@ static int loongarch_gdb_set_fpu(CPUState *cs, uint8_t
*mem_buf, int n)
int length = 0;
if (0 <= n && n < 32) {
- env->fpr[n].vreg.D(0) = ldq_p(mem_buf);
+ env->fpr[n].vreg.D(0) = ldq_le_p(mem_buf);
length = 8;
} else if (32 <= n && n < 40) {
env->cf[n - 32] = ldub_p(mem_buf);
length = 1;
} else if (n == 40) {
- env->fcsr0 = ldl_p(mem_buf);
+ env->fcsr0 = ldl_le_p(mem_buf);
length = 4;
}
return length;
--
2.45.2
- [PATCH v2 07/25] target/hexagon: Use explicit little-endian LD/ST API, (continued)
- [PATCH v2 07/25] target/hexagon: Use explicit little-endian LD/ST API, Philippe Mathieu-Daudé, 2024/10/04
- [PATCH v2 08/25] hw/i386: Use explicit little-endian LD/ST API, Philippe Mathieu-Daudé, 2024/10/04
- [PATCH v2 09/25] target/i386: Use explicit little-endian LD/ST API, Philippe Mathieu-Daudé, 2024/10/04
- [PATCH v2 10/25] target/avr: Use explicit little-endian LD/ST API, Philippe Mathieu-Daudé, 2024/10/04
- [PATCH v2 11/25] linux-user/i386: Use explicit little-endian LD/ST API, Philippe Mathieu-Daudé, 2024/10/04
- [PATCH v2 12/25] target/loongarch: Use explicit little-endian LD/ST API,
Philippe Mathieu-Daudé <=
- [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