all repos — mgba @ 53212baee52f95c80a06eebe758e621167b0d30f

mGBA Game Boy Advance Emulator

Implement SUB(2)
Jeffrey Pfau jeffrey@endrift.com
Sun, 14 Apr 2013 03:03:19 -0700
commit

53212baee52f95c80a06eebe758e621167b0d30f

parent

5be88fe123e15daf372ecf46398f90907feebfad

1 files changed, 7 insertions(+), 3 deletions(-)

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

@@ -38,6 +38,12 @@ int m = M; \

D = M + N; \ THUMB_ADDITION_S(m, n, D) +#define THUMB_SUBTRACTION(D, M, N) \ + int n = N; \ + int m = M; \ + D = M - N; \ + THUMB_SUBTRACTION_S(m, n, D) + #define APPLY(F, ...) F(__VA_ARGS__) #define COUNT_1(EMITTER, PREFIX, ...) \

@@ -166,11 +172,9 @@ #define DEFINE_DATA_FORM_3_INSTRUCTION_THUMB(NAME, BODY) \

COUNT_3(DEFINE_DATA_FORM_3_INSTRUCTION_EX_THUMB, NAME ## _R, BODY) DEFINE_DATA_FORM_3_INSTRUCTION_THUMB(ADD2, THUMB_ADDITION(cpu->gprs[rd], cpu->gprs[rd], immediate)) - - DEFINE_DATA_FORM_3_INSTRUCTION_THUMB(CMP1, int aluOut = cpu->gprs[rd] - immediate; THUMB_SUBTRACTION_S(cpu->gprs[rd], immediate, aluOut)) DEFINE_DATA_FORM_3_INSTRUCTION_THUMB(MOV1, cpu->gprs[rd] = immediate; THUMB_NEUTRAL_S(, , cpu->gprs[rd])) -DEFINE_DATA_FORM_3_INSTRUCTION_THUMB(SUB2, ARM_STUB) +DEFINE_DATA_FORM_3_INSTRUCTION_THUMB(SUB2, THUMB_SUBTRACTION(cpu->gprs[rd], cpu->gprs[rd], immediate)) #define DEFINE_DATA_FORM_5_INSTRUCTION_THUMB(NAME, BODY) \ DEFINE_INSTRUCTION_THUMB(NAME, \