Define data format 5

This commit is contained in:
Jeffrey Pfau 2013-04-09 22:35:51 -07:00
parent e577df2142
commit be021605bc
1 changed files with 39 additions and 0 deletions

View File

@ -110,6 +110,29 @@ DEFINE_DATA_FORM_3_INSTRUCTION_THUMB(CMP1, )
DEFINE_DATA_FORM_3_INSTRUCTION_THUMB(MOV1, )
DEFINE_DATA_FORM_3_INSTRUCTION_THUMB(SUB2, )
#define DEFINE_DATA_FORM_5_INSTRUCTION_THUMB(NAME, BODY) \
DEFINE_INSTRUCTION_THUMB(NAME, \
int rd = opcode & 0x0007; \
int rn = (opcode >> 3) & 0x0007; \
BODY;)
DEFINE_DATA_FORM_5_INSTRUCTION_THUMB(AND, )
DEFINE_DATA_FORM_5_INSTRUCTION_THUMB(EOR, )
DEFINE_DATA_FORM_5_INSTRUCTION_THUMB(LSL2, )
DEFINE_DATA_FORM_5_INSTRUCTION_THUMB(LSR2, )
DEFINE_DATA_FORM_5_INSTRUCTION_THUMB(ASR2, )
DEFINE_DATA_FORM_5_INSTRUCTION_THUMB(ADC, )
DEFINE_DATA_FORM_5_INSTRUCTION_THUMB(SBC, )
DEFINE_DATA_FORM_5_INSTRUCTION_THUMB(ROR, )
DEFINE_DATA_FORM_5_INSTRUCTION_THUMB(TST, )
DEFINE_DATA_FORM_5_INSTRUCTION_THUMB(NEG, )
DEFINE_DATA_FORM_5_INSTRUCTION_THUMB(CMP2, )
DEFINE_DATA_FORM_5_INSTRUCTION_THUMB(CMN, )
DEFINE_DATA_FORM_5_INSTRUCTION_THUMB(ORR, )
DEFINE_DATA_FORM_5_INSTRUCTION_THUMB(MUL, )
DEFINE_DATA_FORM_5_INSTRUCTION_THUMB(BIC, )
DEFINE_DATA_FORM_5_INSTRUCTION_THUMB(MVN, )
#define DUMMY(X, ...) X,
#define DUMMY_4(...) \
DUMMY(__VA_ARGS__) \
@ -129,6 +152,22 @@ DEFINE_DATA_FORM_3_INSTRUCTION_THUMB(SUB2, )
APPLY(COUNT_3, DUMMY_4, DECLARE_INSTRUCTION_THUMB(EMITTER, CMP1_R)) \
APPLY(COUNT_3, DUMMY_4, DECLARE_INSTRUCTION_THUMB(EMITTER, ADD2_R)) \
APPLY(COUNT_3, DUMMY_4, DECLARE_INSTRUCTION_THUMB(EMITTER, SUB2_R)) \
DECLARE_INSTRUCTION_THUMB(EMITTER, AND), \
DECLARE_INSTRUCTION_THUMB(EMITTER, EOR), \
DECLARE_INSTRUCTION_THUMB(EMITTER, LSL2), \
DECLARE_INSTRUCTION_THUMB(EMITTER, LSR2), \
DECLARE_INSTRUCTION_THUMB(EMITTER, ASR2), \
DECLARE_INSTRUCTION_THUMB(EMITTER, ADC), \
DECLARE_INSTRUCTION_THUMB(EMITTER, SBC), \
DECLARE_INSTRUCTION_THUMB(EMITTER, ROR), \
DECLARE_INSTRUCTION_THUMB(EMITTER, TST), \
DECLARE_INSTRUCTION_THUMB(EMITTER, NEG), \
DECLARE_INSTRUCTION_THUMB(EMITTER, CMP2), \
DECLARE_INSTRUCTION_THUMB(EMITTER, CMN), \
DECLARE_INSTRUCTION_THUMB(EMITTER, ORR), \
DECLARE_INSTRUCTION_THUMB(EMITTER, MUL), \
DECLARE_INSTRUCTION_THUMB(EMITTER, BIC), \
DECLARE_INSTRUCTION_THUMB(EMITTER, MVN), \
static const ThumbInstruction _thumbTable[0x400] = {
DECLARE_THUMB_EMITTER_BLOCK(_ThumbInstruction)