all repos — mgba @ e89f49459a64f9af74a28ac9c86bd77a3f2afeb8

mGBA Game Boy Advance Emulator

Stub out conditional branches
Jeffrey Pfau jeffrey@endrift.com
Wed, 10 Apr 2013 21:04:41 -0700
commit

e89f49459a64f9af74a28ac9c86bd77a3f2afeb8

parent

d5adcac319ca47b98fcc81e4c1699dc6510f41ee

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

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

@@ -199,6 +199,26 @@

DEFINE_LOAD_STORE_MULTIPLE_THUMB(LDMIA, ) DEFINE_LOAD_STORE_MULTIPLE_THUMB(STMIA, ) +#define DEFINE_CONDITIONAL_BRANCH_THUMB(COND) \ + DEFINE_INSTRUCTION_THUMB(B ## COND, \ + if (ARM_COND_ ## COND) { \ + }) + +DEFINE_CONDITIONAL_BRANCH_THUMB(EQ) +DEFINE_CONDITIONAL_BRANCH_THUMB(NE) +DEFINE_CONDITIONAL_BRANCH_THUMB(CS) +DEFINE_CONDITIONAL_BRANCH_THUMB(CC) +DEFINE_CONDITIONAL_BRANCH_THUMB(MI) +DEFINE_CONDITIONAL_BRANCH_THUMB(PL) +DEFINE_CONDITIONAL_BRANCH_THUMB(VS) +DEFINE_CONDITIONAL_BRANCH_THUMB(VC) +DEFINE_CONDITIONAL_BRANCH_THUMB(LS) +DEFINE_CONDITIONAL_BRANCH_THUMB(HI) +DEFINE_CONDITIONAL_BRANCH_THUMB(GE) +DEFINE_CONDITIONAL_BRANCH_THUMB(LT) +DEFINE_CONDITIONAL_BRANCH_THUMB(GT) +DEFINE_CONDITIONAL_BRANCH_THUMB(LE) + DEFINE_INSTRUCTION_THUMB(ADD7, ) DEFINE_INSTRUCTION_THUMB(SUB4, )

@@ -299,6 +319,21 @@ DO_4(DECLARE_INSTRUCTION_THUMB(EMITTER, BKPT)), \

DO_4(DECLARE_INSTRUCTION_THUMB(EMITTER, ILL)), \ APPLY(COUNT_3, DUMMY_4, DECLARE_INSTRUCTION_THUMB(EMITTER, STMIA_R)) \ APPLY(COUNT_3, DUMMY_4, DECLARE_INSTRUCTION_THUMB(EMITTER, LDMIA_R)) \ + DO_4(DECLARE_INSTRUCTION_THUMB(EMITTER, BEQ)), \ + DO_4(DECLARE_INSTRUCTION_THUMB(EMITTER, BNE)), \ + DO_4(DECLARE_INSTRUCTION_THUMB(EMITTER, BCS)), \ + DO_4(DECLARE_INSTRUCTION_THUMB(EMITTER, BCC)), \ + DO_4(DECLARE_INSTRUCTION_THUMB(EMITTER, BMI)), \ + DO_4(DECLARE_INSTRUCTION_THUMB(EMITTER, BPL)), \ + DO_4(DECLARE_INSTRUCTION_THUMB(EMITTER, BVS)), \ + DO_4(DECLARE_INSTRUCTION_THUMB(EMITTER, BVC)), \ + DO_4(DECLARE_INSTRUCTION_THUMB(EMITTER, BHI)), \ + DO_4(DECLARE_INSTRUCTION_THUMB(EMITTER, BLS)), \ + DO_4(DECLARE_INSTRUCTION_THUMB(EMITTER, BGE)), \ + DO_4(DECLARE_INSTRUCTION_THUMB(EMITTER, BLT)), \ + DO_4(DECLARE_INSTRUCTION_THUMB(EMITTER, BGT)), \ + DO_4(DECLARE_INSTRUCTION_THUMB(EMITTER, BLE)), \ + DO_4(DECLARE_INSTRUCTION_THUMB(EMITTER, ILL)), \ static const ThumbInstruction _thumbTable[0x400] = { DECLARE_THUMB_EMITTER_BLOCK(_ThumbInstruction)