diff --git a/SheepShaver/src/kpx_cpu/src/cpu/ppc/ppc-cpu.hpp b/SheepShaver/src/kpx_cpu/src/cpu/ppc/ppc-cpu.hpp index 55616152..1049a2e5 100644 --- a/SheepShaver/src/kpx_cpu/src/cpu/ppc/ppc-cpu.hpp +++ b/SheepShaver/src/kpx_cpu/src/cpu/ppc/ppc-cpu.hpp @@ -390,6 +390,7 @@ private: void execute_stwcx(uint32 opcode); void execute_mcrf(uint32 opcode); void execute_mcrfs(uint32 opcode); + void execute_mcrxr(uint32 opcode); void execute_mtcrf(uint32 opcode); template< class FM, class RB, class Rc > void execute_mtfsf(uint32 opcode); diff --git a/SheepShaver/src/kpx_cpu/src/cpu/ppc/ppc-decode.cpp b/SheepShaver/src/kpx_cpu/src/cpu/ppc/ppc-decode.cpp index bd4190bd..e7a79a53 100644 --- a/SheepShaver/src/kpx_cpu/src/cpu/ppc/ppc-decode.cpp +++ b/SheepShaver/src/kpx_cpu/src/cpu/ppc/ppc-decode.cpp @@ -814,6 +814,12 @@ const powerpc_cpu::instr_info_t powerpc_cpu::powerpc_ii_table[] = { PPC_I(MCRFS), X_form, 63, 64, CFLOW_NORMAL }, + { "mcrxr", + EXECUTE_0(mcrxr), + NULL, + PPC_I(MCRXR), + X_form, 31, 512, CFLOW_NORMAL + }, { "mfcr", EXECUTE_GENERIC_ARITH(nop, RD, CR, NONE, NONE, OE_BIT_0, RC_BIT_0), NULL, 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 8816ae8e..91090cd6 100644 --- a/SheepShaver/src/kpx_cpu/src/cpu/ppc/ppc-execute.cpp +++ b/SheepShaver/src/kpx_cpu/src/cpu/ppc/ppc-execute.cpp @@ -953,6 +953,15 @@ void powerpc_cpu::execute_mcrfs(uint32 opcode) increment_pc(4); } +void powerpc_cpu::execute_mcrxr(uint32 opcode) +{ + const int crfD = crfD_field::extract(opcode); + const uint32 x = xer().get(); + cr().set(crfD, x >> 28); + xer().set(x & 0x0fffffff); + increment_pc(4); +} + void powerpc_cpu::execute_mtcrf(uint32 opcode) { uint32 mask = field2mask[CRM_field::extract(opcode)]; diff --git a/SheepShaver/src/kpx_cpu/src/cpu/ppc/ppc-instructions.hpp b/SheepShaver/src/kpx_cpu/src/cpu/ppc/ppc-instructions.hpp index e4a609b0..5a4554cb 100644 --- a/SheepShaver/src/kpx_cpu/src/cpu/ppc/ppc-instructions.hpp +++ b/SheepShaver/src/kpx_cpu/src/cpu/ppc/ppc-instructions.hpp @@ -141,6 +141,7 @@ enum powerpc_instruction { PPC_I(LWZX), PPC_I(MCRF), PPC_I(MCRFS), + PPC_I(MCRXR), PPC_I(MFCR), PPC_I(MFFS), PPC_I(MFMSR),