From 2d90aff408b9307d86c44f91e9580b41713e15e4 Mon Sep 17 00:00:00 2001 From: Mihai Parparita Date: Thu, 28 Nov 2024 16:27:00 +0100 Subject: [PATCH] ppc: Remove unncesessary function declarations ppc_opcode16 and other functions are only needed in the implementation in ppcexec.cpp, they don't need to be in the header. fp_return_double and fp_return_uint64 have no uses (as of 2141a72b873763995b3428353dc7fd9d5bb47abb) can can thus be removed altogether. Similarly ppc_fpu_off has no uses (as of bb3f4e596e3f18f9414daa94e3639d2c192e93ec) and can be removed. --- cpu/ppc/ppcemu.h | 12 ------------ cpu/ppc/ppcexec.cpp | 16 ++++++---------- cpu/ppc/ppcfpopcodes.cpp | 10 ---------- 3 files changed, 6 insertions(+), 32 deletions(-) diff --git a/cpu/ppc/ppcemu.h b/cpu/ppc/ppcemu.h index f98e77e..1bf4e8f 100644 --- a/cpu/ppc/ppcemu.h +++ b/cpu/ppc/ppcemu.h @@ -406,23 +406,11 @@ extern void ppc_cpu_init(MemCtrlBase* mem_ctrl, uint32_t cpu_version, bool inclu extern void ppc_mmu_init(); void ppc_illegalop(); -void ppc_fpu_off(); void ppc_assert_int(); void ppc_release_int(); -//void ppc_opcode4(); -void ppc_opcode16(); -void ppc_opcode18(); -template void ppc_opcode19(); -void ppc_opcode31(); -void ppc_opcode59(); -void ppc_opcode63(); - void initialize_ppc_opcode_tables(); -extern double fp_return_double(uint32_t reg); -extern uint64_t fp_return_uint64(uint32_t reg); - void ppc_changecrf0(uint32_t set_result); void set_host_rounding_mode(uint8_t mode); void update_fpscr(uint32_t new_fpscr); diff --git a/cpu/ppc/ppcexec.cpp b/cpu/ppc/ppcexec.cpp index 84d6059..f6aadb7 100644 --- a/cpu/ppc/ppcexec.cpp +++ b/cpu/ppc/ppcexec.cpp @@ -212,10 +212,6 @@ void ppc_illegalop() { ppc_exception_handler(Except_Type::EXC_PROGRAM, Exc_Cause::ILLEGAL_OP); } -void ppc_fpu_off() { - ppc_exception_handler(Except_Type::EXC_PROGRAM, Exc_Cause::FPU_OFF); -} - void ppc_assert_int() { int_pin = true; if (ppc_state.msr & MSR::EE) { @@ -232,16 +228,16 @@ void ppc_release_int() { /** Opcode decoding functions. */ -void ppc_opcode16() { +static void ppc_opcode16() { SubOpcode16Grabber[ppc_cur_instruction & 3](); } -void ppc_opcode18() { +static void ppc_opcode18() { SubOpcode18Grabber[ppc_cur_instruction & 3](); } template -void ppc_opcode19() { +static void ppc_opcode19() { uint16_t subop_grab = ppc_cur_instruction & 0x7FF; switch (subop_grab) { @@ -298,17 +294,17 @@ void ppc_opcode19() { template void ppc_opcode19(); template void ppc_opcode19(); -void ppc_opcode31() { +static void ppc_opcode31() { uint16_t subop_grab = ppc_cur_instruction & 0x7FFUL; SubOpcode31Grabber[subop_grab](); } -void ppc_opcode59() { +static void ppc_opcode59() { uint16_t subop_grab = ppc_cur_instruction & 0x3FUL; SubOpcode59Grabber[subop_grab](); } -void ppc_opcode63() { +static void ppc_opcode63() { uint16_t subop_grab = ppc_cur_instruction & 0x7FFUL; SubOpcode63Grabber[subop_grab](); } diff --git a/cpu/ppc/ppcfpopcodes.cpp b/cpu/ppc/ppcfpopcodes.cpp index a12caaf..b800a60 100644 --- a/cpu/ppc/ppcfpopcodes.cpp +++ b/cpu/ppc/ppcfpopcodes.cpp @@ -30,16 +30,6 @@ along with this program. If not, see . #include #include -// Storage and register retrieval functions for the floating point functions. - -double fp_return_double(uint32_t reg) { - return ppc_state.fpr[reg].dbl64_r; -} - -uint64_t fp_return_uint64(uint32_t reg) { - return ppc_state.fpr[reg].int64_r; -} - inline static void ppc_update_cr1() { // copy FPSCR[FX|FEX|VX|OX] to CR1 ppc_state.cr = (ppc_state.cr & ~CR_select::CR1_field) |