diff --git a/src/isa-thumb.c b/src/isa-thumb.c index dcb1f8842..ce04af92c 100644 --- a/src/isa-thumb.c +++ b/src/isa-thumb.c @@ -73,6 +73,17 @@ DEFINE_SHIFT_1_INSTRUCTION_THUMB(LSL, ) DEFINE_SHIFT_1_INSTRUCTION_THUMB(LSR, ) DEFINE_SHIFT_1_INSTRUCTION_THUMB(ASR, ) +#define DEFINE_ADD_SUB_1_INSTRUCTION_EX_THUMB(NAME, IMMEDIATE, BODY) \ + DEFINE_INSTRUCTION_THUMB(NAME, \ + int immediate = IMMEDIATE; \ + BODY;) + +#define DEFINE_ADD_SUB_1_INSTRUCTION_THUMB(NAME, BODY) \ + COUNT_3(DEFINE_ADD_SUB_1_INSTRUCTION_EX_THUMB, NAME ## 1_, BODY) + +DEFINE_ADD_SUB_1_INSTRUCTION_THUMB(ADD, ) +DEFINE_ADD_SUB_1_INSTRUCTION_THUMB(SUB, ) + #define DEFINE_ADD_SUB_3_INSTRUCTION_EX_THUMB(NAME, RM, BODY) \ DEFINE_INSTRUCTION_THUMB(NAME, \ int rm = RM; \ @@ -94,6 +105,8 @@ DEFINE_ADD_SUB_3_INSTRUCTION_THUMB(SUB, ) APPLY(COUNT_5, DUMMY, DECLARE_INSTRUCTION_THUMB(EMITTER, ASR1_)) \ APPLY(COUNT_3, DUMMY, DECLARE_INSTRUCTION_THUMB(EMITTER, ADD3_R)) \ APPLY(COUNT_3, DUMMY, DECLARE_INSTRUCTION_THUMB(EMITTER, SUB3_R)) \ + APPLY(COUNT_3, DUMMY, DECLARE_INSTRUCTION_THUMB(EMITTER, ADD1_)) \ + APPLY(COUNT_3, DUMMY, DECLARE_INSTRUCTION_THUMB(EMITTER, SUB1_)) \ static const ThumbInstruction _thumbTable[0x400] = { DECLARE_THUMB_EMITTER_BLOCK(_ThumbInstruction)