all repos — mgba @ e89a705419389c4b308af3d6b1c7616c34a37038

mGBA Game Boy Advance Emulator

src/arm/emitter-thumb.h (view raw)

  1#ifndef EMITTER_THUMB_H
  2#define EMITTER_THUMB_H
  3
  4#include "emitter-inlines.h"
  5
  6#define DECLARE_INSTRUCTION_THUMB(EMITTER, NAME) \
  7	EMITTER ## NAME
  8
  9#define DECLARE_INSTRUCTION_WITH_HIGH_THUMB(EMITTER, NAME) \
 10	DECLARE_INSTRUCTION_THUMB(EMITTER, NAME ## 00), \
 11	DECLARE_INSTRUCTION_THUMB(EMITTER, NAME ## 01), \
 12	DECLARE_INSTRUCTION_THUMB(EMITTER, NAME ## 10), \
 13	DECLARE_INSTRUCTION_THUMB(EMITTER, NAME ## 11)
 14
 15#define DECLARE_THUMB_EMITTER_BLOCK(EMITTER) \
 16	APPLY(COUNT_5, ECHO, DECLARE_INSTRUCTION_THUMB(EMITTER, LSL1_)) \
 17	APPLY(COUNT_5, ECHO, DECLARE_INSTRUCTION_THUMB(EMITTER, LSR1_)) \
 18	APPLY(COUNT_5, ECHO, DECLARE_INSTRUCTION_THUMB(EMITTER, ASR1_)) \
 19	APPLY(COUNT_3, ECHO, DECLARE_INSTRUCTION_THUMB(EMITTER, ADD3_R)) \
 20	APPLY(COUNT_3, ECHO, DECLARE_INSTRUCTION_THUMB(EMITTER, SUB3_R)) \
 21	APPLY(COUNT_3, ECHO, DECLARE_INSTRUCTION_THUMB(EMITTER, ADD1_)) \
 22	APPLY(COUNT_3, ECHO, DECLARE_INSTRUCTION_THUMB(EMITTER, SUB1_)) \
 23	APPLY(COUNT_3, ECHO_4, DECLARE_INSTRUCTION_THUMB(EMITTER, MOV1_R)) \
 24	APPLY(COUNT_3, ECHO_4, DECLARE_INSTRUCTION_THUMB(EMITTER, CMP1_R)) \
 25	APPLY(COUNT_3, ECHO_4, DECLARE_INSTRUCTION_THUMB(EMITTER, ADD2_R)) \
 26	APPLY(COUNT_3, ECHO_4, DECLARE_INSTRUCTION_THUMB(EMITTER, SUB2_R)) \
 27	DECLARE_INSTRUCTION_THUMB(EMITTER, AND), \
 28	DECLARE_INSTRUCTION_THUMB(EMITTER, EOR), \
 29	DECLARE_INSTRUCTION_THUMB(EMITTER, LSL2), \
 30	DECLARE_INSTRUCTION_THUMB(EMITTER, LSR2), \
 31	DECLARE_INSTRUCTION_THUMB(EMITTER, ASR2), \
 32	DECLARE_INSTRUCTION_THUMB(EMITTER, ADC), \
 33	DECLARE_INSTRUCTION_THUMB(EMITTER, SBC), \
 34	DECLARE_INSTRUCTION_THUMB(EMITTER, ROR), \
 35	DECLARE_INSTRUCTION_THUMB(EMITTER, TST), \
 36	DECLARE_INSTRUCTION_THUMB(EMITTER, NEG), \
 37	DECLARE_INSTRUCTION_THUMB(EMITTER, CMP2), \
 38	DECLARE_INSTRUCTION_THUMB(EMITTER, CMN), \
 39	DECLARE_INSTRUCTION_THUMB(EMITTER, ORR), \
 40	DECLARE_INSTRUCTION_THUMB(EMITTER, MUL), \
 41	DECLARE_INSTRUCTION_THUMB(EMITTER, BIC), \
 42	DECLARE_INSTRUCTION_THUMB(EMITTER, MVN), \
 43	DECLARE_INSTRUCTION_WITH_HIGH_THUMB(EMITTER, ADD4), \
 44	DECLARE_INSTRUCTION_WITH_HIGH_THUMB(EMITTER, CMP3), \
 45	DECLARE_INSTRUCTION_WITH_HIGH_THUMB(EMITTER, MOV3), \
 46	DECLARE_INSTRUCTION_THUMB(EMITTER, BX), \
 47	DECLARE_INSTRUCTION_THUMB(EMITTER, BX), \
 48	DECLARE_INSTRUCTION_THUMB(EMITTER, ILL), \
 49	DECLARE_INSTRUCTION_THUMB(EMITTER, ILL), \
 50	APPLY(COUNT_3, ECHO_4, DECLARE_INSTRUCTION_THUMB(EMITTER, LDR3_R)) \
 51	APPLY(COUNT_3, ECHO, DECLARE_INSTRUCTION_THUMB(EMITTER, STR2_R)) \
 52	APPLY(COUNT_3, ECHO, DECLARE_INSTRUCTION_THUMB(EMITTER, STRH2_R)) \
 53	APPLY(COUNT_3, ECHO, DECLARE_INSTRUCTION_THUMB(EMITTER, STRB2_R)) \
 54	APPLY(COUNT_3, ECHO, DECLARE_INSTRUCTION_THUMB(EMITTER, LDRSB_R)) \
 55	APPLY(COUNT_3, ECHO, DECLARE_INSTRUCTION_THUMB(EMITTER, LDR2_R)) \
 56	APPLY(COUNT_3, ECHO, DECLARE_INSTRUCTION_THUMB(EMITTER, LDRH2_R)) \
 57	APPLY(COUNT_3, ECHO, DECLARE_INSTRUCTION_THUMB(EMITTER, LDRB2_R)) \
 58	APPLY(COUNT_3, ECHO, DECLARE_INSTRUCTION_THUMB(EMITTER, LDRSH_R)) \
 59	APPLY(COUNT_5, ECHO, DECLARE_INSTRUCTION_THUMB(EMITTER, STR1_)) \
 60	APPLY(COUNT_5, ECHO, DECLARE_INSTRUCTION_THUMB(EMITTER, LDR1_)) \
 61	APPLY(COUNT_5, ECHO, DECLARE_INSTRUCTION_THUMB(EMITTER, STRB1_)) \
 62	APPLY(COUNT_5, ECHO, DECLARE_INSTRUCTION_THUMB(EMITTER, LDRB1_)) \
 63	APPLY(COUNT_5, ECHO, DECLARE_INSTRUCTION_THUMB(EMITTER, STRH1_)) \
 64	APPLY(COUNT_5, ECHO, DECLARE_INSTRUCTION_THUMB(EMITTER, LDRH1_)) \
 65	APPLY(COUNT_3, ECHO_4, DECLARE_INSTRUCTION_THUMB(EMITTER, STR3_R)) \
 66	APPLY(COUNT_3, ECHO_4, DECLARE_INSTRUCTION_THUMB(EMITTER, LDR4_R)) \
 67	APPLY(COUNT_3, ECHO_4, DECLARE_INSTRUCTION_THUMB(EMITTER, ADD5_R)) \
 68	APPLY(COUNT_3, ECHO_4, DECLARE_INSTRUCTION_THUMB(EMITTER, ADD6_R)) \
 69	DECLARE_INSTRUCTION_THUMB(EMITTER, ADD7), \
 70	DECLARE_INSTRUCTION_THUMB(EMITTER, ADD7), \
 71	DECLARE_INSTRUCTION_THUMB(EMITTER, SUB4), \
 72	DECLARE_INSTRUCTION_THUMB(EMITTER, SUB4), \
 73	DO_4(DECLARE_INSTRUCTION_THUMB(EMITTER, ILL)), \
 74	DO_4(DECLARE_INSTRUCTION_THUMB(EMITTER, ILL)), \
 75	DO_4(DECLARE_INSTRUCTION_THUMB(EMITTER, ILL)), \
 76	DO_4(DECLARE_INSTRUCTION_THUMB(EMITTER, PUSH)), \
 77	DO_4(DECLARE_INSTRUCTION_THUMB(EMITTER, PUSHR)), \
 78	DO_8(DECLARE_INSTRUCTION_THUMB(EMITTER, ILL)), \
 79	DO_8(DECLARE_INSTRUCTION_THUMB(EMITTER, ILL)), \
 80	DO_8(DECLARE_INSTRUCTION_THUMB(EMITTER, ILL)), \
 81	DO_4(DECLARE_INSTRUCTION_THUMB(EMITTER, POP)), \
 82	DO_4(DECLARE_INSTRUCTION_THUMB(EMITTER, POPR)), \
 83	DO_4(DECLARE_INSTRUCTION_THUMB(EMITTER, BKPT)), \
 84	DO_4(DECLARE_INSTRUCTION_THUMB(EMITTER, ILL)), \
 85	APPLY(COUNT_3, ECHO_4, DECLARE_INSTRUCTION_THUMB(EMITTER, STMIA_R)) \
 86	APPLY(COUNT_3, ECHO_4, DECLARE_INSTRUCTION_THUMB(EMITTER, LDMIA_R)) \
 87	DO_4(DECLARE_INSTRUCTION_THUMB(EMITTER, BEQ)), \
 88	DO_4(DECLARE_INSTRUCTION_THUMB(EMITTER, BNE)), \
 89	DO_4(DECLARE_INSTRUCTION_THUMB(EMITTER, BCS)), \
 90	DO_4(DECLARE_INSTRUCTION_THUMB(EMITTER, BCC)), \
 91	DO_4(DECLARE_INSTRUCTION_THUMB(EMITTER, BMI)), \
 92	DO_4(DECLARE_INSTRUCTION_THUMB(EMITTER, BPL)), \
 93	DO_4(DECLARE_INSTRUCTION_THUMB(EMITTER, BVS)), \
 94	DO_4(DECLARE_INSTRUCTION_THUMB(EMITTER, BVC)), \
 95	DO_4(DECLARE_INSTRUCTION_THUMB(EMITTER, BHI)), \
 96	DO_4(DECLARE_INSTRUCTION_THUMB(EMITTER, BLS)), \
 97	DO_4(DECLARE_INSTRUCTION_THUMB(EMITTER, BGE)), \
 98	DO_4(DECLARE_INSTRUCTION_THUMB(EMITTER, BLT)), \
 99	DO_4(DECLARE_INSTRUCTION_THUMB(EMITTER, BGT)), \
100	DO_4(DECLARE_INSTRUCTION_THUMB(EMITTER, BLE)), \
101	DO_4(DECLARE_INSTRUCTION_THUMB(EMITTER, ILL)), \
102	DO_4(DECLARE_INSTRUCTION_THUMB(EMITTER, SWI)), \
103	DO_8(DO_4(DECLARE_INSTRUCTION_THUMB(EMITTER, B))), \
104	DO_8(DO_4(DECLARE_INSTRUCTION_THUMB(EMITTER, ILL))), \
105	DO_8(DO_4(DECLARE_INSTRUCTION_THUMB(EMITTER, BL1))), \
106	DO_8(DO_4(DECLARE_INSTRUCTION_THUMB(EMITTER, BL2))) \
107
108#endif