From 074a760b6a2d1f83d51d288f08cb4e3f112f760b Mon Sep 17 00:00:00 2001 From: dingusdev <52434309+dingusdev@users.noreply.github.com> Date: Mon, 13 Nov 2023 07:30:31 -0700 Subject: [PATCH] FP compare fixes This is the start of several fixes for the floating point emulation. --- cpu/ppc/ppcfpopcodes.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/cpu/ppc/ppcfpopcodes.cpp b/cpu/ppc/ppcfpopcodes.cpp index 1041fa1..5a3769b 100644 --- a/cpu/ppc/ppcfpopcodes.cpp +++ b/cpu/ppc/ppcfpopcodes.cpp @@ -998,8 +998,7 @@ void dppc_interpreter::ppc_fcmpo() { cmp_c |= (1 << CRx_bit::CR_EQ); } - ppc_state.fpscr &= ~(FPSCR::FPRF); - ppc_state.fpscr |= (cmp_c << 12); + ppc_state.fpscr = (cmp_c >> 16); ppc_state.cr = ((ppc_state.cr & ~(0xF0000000 >> crf_d)) | ((cmp_c) >> crf_d)); if (std::isnan(db_test_a) || std::isnan(db_test_b)) { @@ -1032,8 +1031,7 @@ void dppc_interpreter::ppc_fcmpu() { cmp_c |= (1 << CRx_bit::CR_EQ); } - ppc_state.fpscr &= ~(FPSCR::FPRF); - ppc_state.fpscr |= (cmp_c << 12); + ppc_state.fpscr = (cmp_c >> 16); ppc_state.cr = ((ppc_state.cr & ~(0xF0000000 >> crf_d)) | ((cmp_c) >> crf_d)); //if (std::isnan(db_test_a) || std::isnan(db_test_b)) {