25 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
26 |
* |
* |
27 |
* |
* |
28 |
* $Id: generate_arm_loadstore.c,v 1.1 2005/08/29 14:36:41 debug Exp $ |
* $Id: generate_arm_loadstore.c,v 1.4 2005/10/22 12:22:14 debug Exp $ |
29 |
*/ |
*/ |
30 |
|
|
31 |
#include <stdio.h> |
#include <stdio.h> |
41 |
printf("\n/* AUTOMATICALLY GENERATED! Do not edit. */\n\n"); |
printf("\n/* AUTOMATICALLY GENERATED! Do not edit. */\n\n"); |
42 |
printf("#include <stdio.h>\n#include <stdlib.h>\n" |
printf("#include <stdio.h>\n#include <stdlib.h>\n" |
43 |
"#include \"cpu.h\"\n" |
"#include \"cpu.h\"\n" |
44 |
|
"#include \"machine.h\"\n" |
45 |
"#include \"memory.h\"\n" |
"#include \"memory.h\"\n" |
46 |
"#include \"misc.h\"\n" |
"#include \"misc.h\"\n" |
47 |
|
"#include \"arm_quick_pc_to_pointers.h\"\n" |
48 |
"#define reg(x) (*((uint32_t *)(x)))\n"); |
"#define reg(x) (*((uint32_t *)(x)))\n"); |
49 |
printf("extern void arm_instr_nop(struct cpu *, " |
printf("extern void arm_instr_nop(struct cpu *, " |
50 |
"struct arm_instr_call *);\n"); |
"struct arm_instr_call *);\n"); |
51 |
printf("extern void arm_instr_invalid(struct cpu *, " |
printf("extern void arm_instr_invalid(struct cpu *, " |
52 |
"struct arm_instr_call *);\n"); |
"struct arm_instr_call *);\n"); |
|
printf("extern uint32_t R(struct cpu *, struct arm_instr_call *," |
|
|
" uint32_t, int);\n"); |
|
|
printf("extern void arm_pc_to_pointers(struct cpu *);\n"); |
|
53 |
|
|
54 |
for (reg=0; reg<=1; reg++) |
for (reg=0; reg<=1; reg++) |
55 |
for (p=0; p<=1; p++) |
for (p=0; p<=1; p++) |
179 |
for (l=0; l<=1; l++) { |
for (l=0; l<=1; l++) { |
180 |
if (s==0 && h==0) |
if (s==0 && h==0) |
181 |
continue; |
continue; |
182 |
if (s==1 && l==0) |
if (l==0 && s==1 && h==0) |
183 |
continue; |
continue; |
184 |
|
/* l=0, s=1, h=1 means STRD */ |
185 |
|
|
186 |
printf("#define A__NAME__general arm_instr_%s_" |
printf("#define A__NAME__general arm_instr_%s_" |
187 |
"%s_%s_%s_%s_%s_%s__general\n", |
"%s_%s_%s_%s_%s_%s__general\n", |
257 |
printf("\tarm_instr_nop"); |
printf("\tarm_instr_nop"); |
258 |
else if (s==0 && h==0) |
else if (s==0 && h==0) |
259 |
printf("\tarm_instr_invalid"); |
printf("\tarm_instr_invalid"); |
260 |
else if (s==1 && l==0) |
else if (l==0 && s==1 && h==0) |
261 |
printf("\tarm_instr_invalid"); |
printf("\tarm_instr_invalid"); |
262 |
else |
else |
263 |
printf("\tarm_instr_%s_%s_%s_%s_%s_%s_%s%s%s", |
printf("\tarm_instr_%s_%s_%s_%s_%s_%s_%s%s%s", |
292 |
printf("\tarm_instr_nop"); |
printf("\tarm_instr_nop"); |
293 |
else if (s==0 && h==0) |
else if (s==0 && h==0) |
294 |
printf("\tarm_instr_invalid"); |
printf("\tarm_instr_invalid"); |
295 |
else if (s==1 && l==0) |
else if (l==0 && s==1 && h==0) |
296 |
printf("\tarm_instr_invalid"); |
printf("\tarm_instr_invalid"); |
297 |
else |
else |
298 |
printf("\tarm_instr_%s_%s_%s_%s_%s_%s_" |
printf("\tarm_instr_%s_%s_%s_%s_%s_%s_" |