all repos — mgba @ 39c776eb37421f339ab121ed89949b7a115341ee

mGBA Game Boy Advance Emulator

Stub out more load/store format 2
Jeffrey Pfau jeffrey@endrift.com
Tue, 09 Apr 2013 23:27:37 -0700
commit

39c776eb37421f339ab121ed89949b7a115341ee

parent

5165e0131e727564182f37c5180c05010da17e3c

1 files changed, 20 insertions(+), 6 deletions(-)

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

@@ -157,15 +157,22 @@ COUNT_3(DEFINE_LOAD_WITH_IMMEDIATE_EX_THUMB, NAME ## 3_R, BODY)

DEFINE_LOAD_WITH_IMMEDIATE_THUMB(LDR, ) -#define DEFINE_STORE_WITH_IMMEDIATE_EX_THUMB(NAME, RM, BODY) \ +#define DEFINE_LOAD_STORE_WITH_REGISTER_EX_THUMB(NAME, RM, BODY) \ DEFINE_INSTRUCTION_THUMB(NAME, \ - int rd = RM; \ + int rm = RM; \ BODY;) -#define DEFINE_STORE_WITH_IMMEDIATE_THUMB(NAME, BODY) \ - COUNT_3(DEFINE_STORE_WITH_IMMEDIATE_EX_THUMB, NAME ## 2_R, BODY) +#define DEFINE_LOAD_STORE_WITH_REGISTER_THUMB(NAME, BODY) \ + COUNT_3(DEFINE_LOAD_STORE_WITH_REGISTER_EX_THUMB, NAME ## _R, BODY) -DEFINE_STORE_WITH_IMMEDIATE_THUMB(STR, ) +DEFINE_LOAD_STORE_WITH_REGISTER_THUMB(LDR2, ) +DEFINE_LOAD_STORE_WITH_REGISTER_THUMB(LDRB2, ) +DEFINE_LOAD_STORE_WITH_REGISTER_THUMB(LDRH2, ) +DEFINE_LOAD_STORE_WITH_REGISTER_THUMB(LDRSB, ) +DEFINE_LOAD_STORE_WITH_REGISTER_THUMB(LDRSH, ) +DEFINE_LOAD_STORE_WITH_REGISTER_THUMB(STR2, ) +DEFINE_LOAD_STORE_WITH_REGISTER_THUMB(STRB2, ) +DEFINE_LOAD_STORE_WITH_REGISTER_THUMB(STRH2, ) DEFINE_INSTRUCTION_THUMB(ILL, ) DEFINE_INSTRUCTION_THUMB(BX, )

@@ -222,7 +229,14 @@ DECLARE_INSTRUCTION_THUMB(EMITTER, BX), \

DECLARE_INSTRUCTION_THUMB(EMITTER, ILL), \ DECLARE_INSTRUCTION_THUMB(EMITTER, ILL), \ APPLY(COUNT_3, DUMMY_4, DECLARE_INSTRUCTION_THUMB(EMITTER, LDR3_R)) \ - APPLY(COUNT_3, DUMMY, DECLARE_INSTRUCTION_THUMB(EMITTER, STR2_R)) + APPLY(COUNT_3, DUMMY, DECLARE_INSTRUCTION_THUMB(EMITTER, STR2_R)) \ + APPLY(COUNT_3, DUMMY, DECLARE_INSTRUCTION_THUMB(EMITTER, STRH2_R)) \ + APPLY(COUNT_3, DUMMY, DECLARE_INSTRUCTION_THUMB(EMITTER, STRB2_R)) \ + APPLY(COUNT_3, DUMMY, DECLARE_INSTRUCTION_THUMB(EMITTER, LDRSB_R)) \ + APPLY(COUNT_3, DUMMY, DECLARE_INSTRUCTION_THUMB(EMITTER, LDR2_R)) \ + APPLY(COUNT_3, DUMMY, DECLARE_INSTRUCTION_THUMB(EMITTER, LDRH2_R)) \ + APPLY(COUNT_3, DUMMY, DECLARE_INSTRUCTION_THUMB(EMITTER, LDRB2_R)) \ + APPLY(COUNT_3, DUMMY, DECLARE_INSTRUCTION_THUMB(EMITTER, LDRSH_R)) static const ThumbInstruction _thumbTable[0x400] = { DECLARE_THUMB_EMITTER_BLOCK(_ThumbInstruction)