Stub out more load/stores with immediates
Jeffrey Pfau jeffrey@endrift.com
Tue, 09 Apr 2013 23:34:25 -0700
1 files changed,
20 insertions(+),
7 deletions(-)
jump to
M
src/isa-thumb.c
→
src/isa-thumb.c
@@ -61,17 +61,24 @@ static void _ThumbInstruction ## NAME (struct ARMCore* cpu, uint16_t opcode) { \
BODY; \ } -#define DEFINE_SHIFT_1_INSTRUCTION_EX_THUMB(NAME, IMMEDIATE, BODY) \ +#define DEFINE_IMMEDIATE_5_INSTRUCTION_EX_THUMB(NAME, IMMEDIATE, BODY) \ DEFINE_INSTRUCTION_THUMB(NAME, \ int immediate = IMMEDIATE; \ BODY;) -#define DEFINE_SHIFT_1_INSTRUCTION_THUMB(NAME, BODY) \ - COUNT_5(DEFINE_SHIFT_1_INSTRUCTION_EX_THUMB, NAME ## 1_, BODY) +#define DEFINE_IMMEDIATE_5_INSTRUCTION_THUMB(NAME, BODY) \ + COUNT_5(DEFINE_IMMEDIATE_5_INSTRUCTION_EX_THUMB, NAME ## _, BODY) + +DEFINE_IMMEDIATE_5_INSTRUCTION_THUMB(LSL1, ) +DEFINE_IMMEDIATE_5_INSTRUCTION_THUMB(LSR1, ) +DEFINE_IMMEDIATE_5_INSTRUCTION_THUMB(ASR1, ) -DEFINE_SHIFT_1_INSTRUCTION_THUMB(LSL, ) -DEFINE_SHIFT_1_INSTRUCTION_THUMB(LSR, ) -DEFINE_SHIFT_1_INSTRUCTION_THUMB(ASR, ) +DEFINE_IMMEDIATE_5_INSTRUCTION_THUMB(LDR1, ) +DEFINE_IMMEDIATE_5_INSTRUCTION_THUMB(LDRB1, ) +DEFINE_IMMEDIATE_5_INSTRUCTION_THUMB(LDRH1, ) +DEFINE_IMMEDIATE_5_INSTRUCTION_THUMB(STR1, ) +DEFINE_IMMEDIATE_5_INSTRUCTION_THUMB(STRB1, ) +DEFINE_IMMEDIATE_5_INSTRUCTION_THUMB(STRH1, ) #define DEFINE_DATA_FORM_1_INSTRUCTION_EX_THUMB(NAME, RM, BODY) \ DEFINE_INSTRUCTION_THUMB(NAME, \@@ -236,7 +243,13 @@ 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)) + APPLY(COUNT_3, DUMMY, DECLARE_INSTRUCTION_THUMB(EMITTER, LDRSH_R)) \ + APPLY(COUNT_5, DUMMY, DECLARE_INSTRUCTION_THUMB(EMITTER, STR1_)) \ + APPLY(COUNT_5, DUMMY, DECLARE_INSTRUCTION_THUMB(EMITTER, LDR1_)) \ + APPLY(COUNT_5, DUMMY, DECLARE_INSTRUCTION_THUMB(EMITTER, STRB1_)) \ + APPLY(COUNT_5, DUMMY, DECLARE_INSTRUCTION_THUMB(EMITTER, LDRB1_)) \ + APPLY(COUNT_5, DUMMY, DECLARE_INSTRUCTION_THUMB(EMITTER, STRH1_)) \ + APPLY(COUNT_5, DUMMY, DECLARE_INSTRUCTION_THUMB(EMITTER, LDRH1_)) \ static const ThumbInstruction _thumbTable[0x400] = { DECLARE_THUMB_EMITTER_BLOCK(_ThumbInstruction)