From 7dd8ea2ea52e9559609d5e521ade8d0d69e35eaa Mon Sep 17 00:00:00 2001 From: tkchia Date: Sat, 8 Jul 2023 19:47:00 +0000 Subject: [PATCH 1/2] plat/linuxppc/emu: fix fctiw & fctiwz emulation for AArch64 host Fixes https://github.com/davidgiven/ack/issues/287 --- plat/linuxppc/emu/instructions.dat | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plat/linuxppc/emu/instructions.dat b/plat/linuxppc/emu/instructions.dat index 9bd39af8e..5bf4411c6 100644 --- a/plat/linuxppc/emu/instructions.dat +++ b/plat/linuxppc/emu/instructions.dat @@ -207,5 +207,5 @@ # Floating point conversions -<63-->.....<14------>R setcr1(R, fpr(FRB)); cpu.fpr[FRT] = (uint32_t)fpr(FRB); -<63-->.....<15------>R setcr1(R, fpr(FRB)); cpu.fpr[FRT] = (uint32_t)fpr(FRB); +<63-->.....<14------>R setcr1(R, fpr(FRB)); cpu.fpr[FRT] = (uint32_t)(int32_t)fpr(FRB); +<63-->.....<15------>R setcr1(R, fpr(FRB)); cpu.fpr[FRT] = (uint32_t)(int32_t)fpr(FRB); From 56ebd1409bd5065fdef170440d754cfbef6acc6d Mon Sep 17 00:00:00 2001 From: tkchia Date: Sat, 8 Jul 2023 19:50:09 +0000 Subject: [PATCH 2/2] plat/linuxppc/emu: get dump_state( ) to also dump FP registers --- plat/linuxppc/emu/emu.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plat/linuxppc/emu/emu.c b/plat/linuxppc/emu/emu.c index 91ae87a8b..1cc17d1be 100644 --- a/plat/linuxppc/emu/emu.c +++ b/plat/linuxppc/emu/emu.c @@ -325,6 +325,12 @@ void dump_state(FILE* stream) fprintf(stream, "\n"); fprintf(stream, "gpr%02d=0x%08x ", i, cpu.gpr[i]); } + for (i=0; i<32; i++) + { + if ((i % 3) == 0) + fprintf(stream, "\n"); + fprintf(stream, "fpr%02d=0x%016lx ", i, cpu.fpr[i]); + } fprintf(stderr, "\n"); /* This might fail and cause a reentrant trap if cia is invalid, so