Implement ADD(1)
Jeffrey Pfau jeffrey@endrift.com
Fri, 12 Apr 2013 22:17:37 -0700
1 files changed,
7 insertions(+),
1 deletions(-)
jump to
M
src/isa-thumb.c
→
src/isa-thumb.c
@@ -122,12 +122,18 @@
#define DEFINE_DATA_FORM_2_INSTRUCTION_EX_THUMB(NAME, IMMEDIATE, BODY) \ DEFINE_INSTRUCTION_THUMB(NAME, \ int immediate = IMMEDIATE; \ + int rd = opcode & 0x0007; \ + int rn = (opcode >> 3) & 0x0007; \ BODY;) #define DEFINE_DATA_FORM_2_INSTRUCTION_THUMB(NAME, BODY) \ COUNT_3(DEFINE_DATA_FORM_2_INSTRUCTION_EX_THUMB, NAME ## 1_, BODY) -DEFINE_DATA_FORM_2_INSTRUCTION_THUMB(ADD, ARM_STUB) +DEFINE_DATA_FORM_2_INSTRUCTION_THUMB(ADD, \ + int n = cpu->gprs[rn]; \ + cpu->gprs[rd] = n + immediate; \ + THUMB_ADDITION_S(n, immediate, cpu->gprs[rd])) + DEFINE_DATA_FORM_2_INSTRUCTION_THUMB(SUB, ARM_STUB) #define DEFINE_DATA_FORM_3_INSTRUCTION_EX_THUMB(NAME, RD, BODY) \