ARM7: Add ARMv5+ CLZ instruction

This commit is contained in:
R. Belmont 2009-07-17 04:29:37 +00:00
parent 0fa02f401f
commit 7111f1aece
2 changed files with 13 additions and 0 deletions

View File

@ -231,6 +231,10 @@ UINT32 arm7_disasm( char *pBuf, UINT32 pc, UINT32 opcode )
if ((opcode & 0x0f) == 14)
dasmflags = DASMFLAG_STEP_OUT;
}
else if ((opcode & 0x0ff000f0) == 0x01600010) // CLZ - v5
{
pBuf += sprintf(pBuf, "CLZ R%d, R%d", (opcode>>12)&0xf, opcode&0xf);
}
else if( (opcode&0x0e000000)==0 && (opcode&0x80) && (opcode&0x10) ) //bits 27-25 == 000, bit 7=1, bit 4=1
{
/* multiply or swap or half word data transfer */

View File

@ -1248,6 +1248,15 @@
R15--;
}
}
else if ((insn & 0x0ff000f0) == 0x01600010) // CLZ - v5
{
UINT32 rm = insn&0xf;
UINT32 rd = (insn>>12)&0xf;
SET_REGISTER(cpustate, rd, count_leading_zeros(GET_REGISTER(cpustate, rm)));
R15 += 4;
}
else
/* Multiply OR Swap OR Half Word Data Transfer */
if ((insn & 0x0e000000) == 0 && (insn & 0x80) && (insn & 0x10)) // bits 27-25=000 bit 7=1 bit 4=1