all repos — mgba @ be021605bc04cf61712cdc36bb77cd854d281350

mGBA Game Boy Advance Emulator

Define data format 5
Jeffrey Pfau jeffrey@endrift.com
Tue, 09 Apr 2013 22:35:51 -0700
commit

be021605bc04cf61712cdc36bb77cd854d281350

parent

e577df214280969049af85fcbce4f389fc59634a

1 files changed, 39 insertions(+), 0 deletions(-)

jump to
M src/isa-thumb.csrc/isa-thumb.c

@@ -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 @@ APPLY(COUNT_3, DUMMY_4, DECLARE_INSTRUCTION_THUMB(EMITTER, MOV1_R)) \

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)