From 701e2bbf501229175d8ef210d3ed985db757567b Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 12 Dec 2014 06:48:20 +0100 Subject: CPU interpreter - group THUMB cases 0x38 to 0x3F (SUB) together --- cpu.c | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/cpu.c b/cpu.c index 1c3447d..9b1f3c2 100644 --- a/cpu.c +++ b/cpu.c @@ -3360,42 +3360,21 @@ thumb_loop: case 0x38: /* SUB r0, imm */ - thumb_sub(imm, 0, reg[0], imm); - break; - case 0x39: /* SUB r1, imm */ - thumb_sub(imm, 1, reg[1], imm); - break; - case 0x3A: /* SUB r2, imm */ - thumb_sub(imm, 2, reg[2], imm); - break; - case 0x3B: /* SUB r3, imm */ - thumb_sub(imm, 3, reg[3], imm); - break; - case 0x3C: /* SUB r4, imm */ - thumb_sub(imm, 4, reg[4], imm); - break; - case 0x3D: /* SUB r5, imm */ - thumb_sub(imm, 5, reg[5], imm); - break; - case 0x3E: /* SUB r6, imm */ - thumb_sub(imm, 6, reg[6], imm); - break; - case 0x3F: /* SUB r7, imm */ - thumb_sub(imm, 7, reg[7], imm); + thumb_sub(imm, thumb_opcode_val & 0x7, reg[thumb_opcode_val & 0x7], imm); break; case 0x40: -- cgit v1.2.3