From 175dfeea02e4d9e66098cd2283c1222396687d81 Mon Sep 17 00:00:00 2001 From: gbeauche <> Date: Tue, 4 Nov 2003 20:56:21 +0000 Subject: [PATCH] fix lfs/stfs breakage introduced with latest FPR type change --- .../src/kpx_cpu/src/cpu/ppc/ppc-execute.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/SheepShaver/src/kpx_cpu/src/cpu/ppc/ppc-execute.cpp b/SheepShaver/src/kpx_cpu/src/cpu/ppc/ppc-execute.cpp index fc84ff71..02c0e6a3 100644 --- a/SheepShaver/src/kpx_cpu/src/cpu/ppc/ppc-execute.cpp +++ b/SheepShaver/src/kpx_cpu/src/cpu/ppc/ppc-execute.cpp @@ -607,14 +607,20 @@ void powerpc_cpu::execute_fp_loadstore(uint32 opcode) if (LD) { if (DB) operand_fp_dw_RD::set(this, opcode, vm_read_memory_8(ea)); - else - operand_fp_dw_RD::set(this, opcode, vm_read_memory_4(ea)); + else { + any_register x; + x.i = vm_read_memory_4(ea); + operand_fp_RD::set(this, opcode, (double)x.f); + } } else { if (DB) vm_write_memory_8(ea, operand_fp_dw_RS::get(this, opcode)); - else - vm_write_memory_4(ea, operand_fp_dw_RS::get(this, opcode)); + else { + any_register x; + x.f = (float)operand_fp_RS::get(this, opcode); + vm_write_memory_4(ea, x.i); + } } if (UP)