[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH 3/7] target-ppc: gdbstub: fix float registers for litt
From: |
Greg Kurz |
Subject: |
[Qemu-ppc] [PATCH 3/7] target-ppc: gdbstub: fix float registers for little-endian guests |
Date: |
Fri, 15 Jan 2016 16:00:25 +0100 |
User-agent: |
StGit/0.17.1-dirty |
Let's reuse the ppc_maybe_bswap_register() helper, like we already do
with the general registers.
Signed-off-by: Greg Kurz <address@hidden>
---
target-ppc/translate_init.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c
index e88dc7fc7aa3..d31d7f6e9bd8 100644
--- a/target-ppc/translate_init.c
+++ b/target-ppc/translate_init.c
@@ -8755,10 +8755,12 @@ static int gdb_get_float_reg(CPUPPCState *env, uint8_t
*mem_buf, int n)
{
if (n < 32) {
stfq_p(mem_buf, env->fpr[n]);
+ ppc_maybe_bswap_register(env, mem_buf, 8);
return 8;
}
if (n == 32) {
stl_p(mem_buf, env->fpscr);
+ ppc_maybe_bswap_register(env, mem_buf, 4);
return 4;
}
return 0;
@@ -8767,10 +8769,12 @@ static int gdb_get_float_reg(CPUPPCState *env, uint8_t
*mem_buf, int n)
static int gdb_set_float_reg(CPUPPCState *env, uint8_t *mem_buf, int n)
{
if (n < 32) {
+ ppc_maybe_bswap_register(env, mem_buf, 8);
env->fpr[n] = ldfq_p(mem_buf);
return 8;
}
if (n == 32) {
+ ppc_maybe_bswap_register(env, mem_buf, 4);
helper_store_fpscr(env, ldl_p(mem_buf), 0xffffffff);
return 4;
}
[Qemu-ppc] [PATCH 2/7] target-ppc: rename and export maybe_bswap_register(), Greg Kurz, 2016/01/15
[Qemu-ppc] [PATCH 3/7] target-ppc: gdbstub: fix float registers for little-endian guests,
Greg Kurz <=
[Qemu-ppc] [PATCH 4/7] target-ppc: gdbstub: introduce avr_need_swap(), Greg Kurz, 2016/01/15
[Qemu-ppc] [PATCH 5/7] target-ppc: gdbstub: fix altivec registers for little-endian guests, Greg Kurz, 2016/01/15
[Qemu-ppc] [PATCH 7/7] target-ppc: gdbstub: Add VSX support, Greg Kurz, 2016/01/15
[Qemu-ppc] [PATCH 6/7] target-ppc: gdbstub: fix spe registers for little-endian guests, Greg Kurz, 2016/01/15