65 lines
2.0 KiB
Diff
65 lines
2.0 KiB
Diff
|
|
From 43ac751187131f91b043ecf611ec795422b42c6c Mon Sep 17 00:00:00 2001
|
||
|
|
From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= <philmd@linaro.org>
|
||
|
|
Date: Fri, 4 Oct 2024 11:59:56 +0200
|
||
|
|
Subject: [PATCH 54/78] target/loongarch: Use explicit little-endian LD/ST API
|
||
|
|
MIME-Version: 1.0
|
||
|
|
Content-Type: text/plain; charset=UTF-8
|
||
|
|
Content-Transfer-Encoding: 8bit
|
||
|
|
|
||
|
|
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>
|
||
|
|
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
|
||
|
|
Message-Id: <20241004163042.85922-13-philmd@linaro.org>
|
||
|
|
Signed-off-by: Xianglai Li <lixianglai@loongson.cn>
|
||
|
|
---
|
||
|
|
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 f8e3324bae..cc72680c38 100644
|
||
|
|
--- a/target/loongarch/gdbstub.c
|
||
|
|
+++ b/target/loongarch/gdbstub.c
|
||
|
|
@@ -68,10 +68,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;
|
||
|
|
}
|
||
|
|
|
||
|
|
@@ -104,13 +104,13 @@ static int loongarch_gdb_set_fpu(CPULoongArchState *env,
|
||
|
|
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.39.1
|
||
|
|
|