+static int t2ev_mul32(uint32_t opcode, uint32_t address,
+ arm_instruction_t *instruction, char *cp)
+{
+ int ra = (opcode >> 12) & 0xf;
+
+
+ switch (opcode & 0x007000f0) {
+ case 0:
+ if (ra == 0xf)
+ sprintf(cp, "MUL\tr%d, r%d, r%d",
+ (opcode >> 8) & 0xf, (opcode >> 16) & 0xf,
+ (opcode >> 0) & 0xf);
+ else
+ sprintf(cp, "MLA\tr%d, r%d, r%d, r%d",
+ (opcode >> 8) & 0xf, (opcode >> 16) & 0xf,
+ (opcode >> 0) & 0xf, ra);
+ break;
+ case 0x10:
+ sprintf(cp, "MLS\tr%d, r%d, r%d, r%d",
+ (opcode >> 8) & 0xf, (opcode >> 16) & 0xf,
+ (opcode >> 0) & 0xf, ra);
+ break;
+ default:
+ return ERROR_INVALID_ARGUMENTS;
+ }
+ return ERROR_OK;
+}
+
+static int t2ev_mul64_div(uint32_t opcode, uint32_t address,
+ arm_instruction_t *instruction, char *cp)
+{
+ int op = (opcode >> 4) & 0xf;
+ char *infix = "MUL";
+
+ op += (opcode >> 16) & 0x70;
+ switch (op) {
+ case 0x40:
+ case 0x60:
+ infix = "MLA";
+ /* FALLTHROUGH */
+ case 0:
+ case 0x20:
+ sprintf(cp, "%c%sL\tr%d, r%d, r%d, r%d",
+ (op & 0x20) ? 'U' : 'S',
+ infix,
+ (opcode >> 12) & 0xf,
+ (opcode >> 8) & 0xf,
+ (opcode >> 16) & 0xf,
+ (opcode >> 0) & 0xf);
+ break;
+ case 0x1f:
+ case 0x3f:
+ sprintf(cp, "%cDIV\tr%d, r%d, r%d",
+ (op & 0x20) ? 'U' : 'S',
+ (opcode >> 8) & 0xf,
+ (opcode >> 16) & 0xf,
+ (opcode >> 0) & 0xf);
+ break;
+ default:
+ return ERROR_INVALID_ARGUMENTS;
+ }
+
+ return ERROR_OK;
+}
+