implement mcrxr instruction

This commit is contained in:
gbeauche 2004-12-18 22:13:47 +00:00
parent 61e223471b
commit a8a235345c
4 changed files with 17 additions and 0 deletions

View File

@ -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);

View File

@ -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,

View File

@ -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)];

View File

@ -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),