1 |
/* |
/* |
2 |
* Copyright (C) 2005 Anders Gavare. All rights reserved. |
* Copyright (C) 2005-2006 Anders Gavare. All rights reserved. |
3 |
* |
* |
4 |
* Redistribution and use in source and binary forms, with or without |
* Redistribution and use in source and binary forms, with or without |
5 |
* modification, are permitted provided that the following conditions are met: |
* modification, are permitted provided that the following conditions are met: |
25 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
26 |
* |
* |
27 |
* |
* |
28 |
* $Id: generate_alpha_misc.c,v 1.2 2006/06/03 06:46:44 debug Exp $ |
* $Id: generate_alpha_misc.c,v 1.3 2006/06/30 20:22:54 debug Exp $ |
29 |
*/ |
*/ |
30 |
|
|
31 |
#include <stdio.h> |
#include <stdio.h> |
42 |
|
|
43 |
int main(int argc, char *argv[]) |
int main(int argc, char *argv[]) |
44 |
{ |
{ |
45 |
int load, size, zero, aligncheck, n, msk, llsc; |
int load, size, zero, n, msk, llsc; |
46 |
int ra, rc, lo, scale, imm, not, op, quad; |
int ra, rc, lo, scale, imm, not, op, quad; |
47 |
|
|
48 |
printf("\n/* AUTOMATICALLY GENERATED! Do not edit. */\n\n"); |
printf("\n/* AUTOMATICALLY GENERATED! Do not edit. */\n\n"); |
267 |
* Normal load/store: |
* Normal load/store: |
268 |
*/ |
*/ |
269 |
for (llsc=0; llsc<=1; llsc++) |
for (llsc=0; llsc<=1; llsc++) |
|
for (aligncheck=0; aligncheck<=1; aligncheck++) |
|
270 |
for (load=0; load<=1; load++) |
for (load=0; load<=1; load++) |
271 |
for (zero=0; zero<=1; zero++) |
for (zero=0; zero<=1; zero++) |
272 |
for (size=0; size<4; size++) { |
for (size=0; size<4; size++) { |
273 |
if (llsc && size < 2) |
if (llsc && size < 2) |
274 |
continue; |
continue; |
|
if (aligncheck) |
|
|
printf("#define LS_ALIGN_CHECK\n"); |
|
275 |
if (zero) |
if (zero) |
276 |
printf("#define LS_IGNORE_OFFSET\n"); |
printf("#define LS_IGNORE_OFFSET\n"); |
277 |
if (load) |
if (load) |
301 |
printf("%s", sizechar[size]); |
printf("%s", sizechar[size]); |
302 |
if (zero) |
if (zero) |
303 |
printf("_0"); |
printf("_0"); |
|
if (aligncheck) |
|
|
printf("_aligncheck"); |
|
304 |
if (llsc) |
if (llsc) |
305 |
printf("_llsc"); |
printf("_llsc"); |
306 |
printf("\n"); |
printf("\n"); |
319 |
printf("#undef LS_LLSC\n"); |
printf("#undef LS_LLSC\n"); |
320 |
if (zero) |
if (zero) |
321 |
printf("#undef LS_IGNORE_OFFSET\n"); |
printf("#undef LS_IGNORE_OFFSET\n"); |
|
if (aligncheck) |
|
|
printf("#undef LS_ALIGN_CHECK\n"); |
|
322 |
} |
} |
323 |
|
|
324 |
/* |
/* |
356 |
printf("#undef LS_UNALIGNED\n"); |
printf("#undef LS_UNALIGNED\n"); |
357 |
|
|
358 |
/* Lookup table for most normal loads/stores: */ |
/* Lookup table for most normal loads/stores: */ |
359 |
printf("\n\nvoid (*alpha_loadstore[64])(struct cpu *, struct " |
printf("\n\nvoid (*alpha_loadstore[32])(struct cpu *, struct " |
360 |
"alpha_instr_call *) = {\n"); |
"alpha_instr_call *) = {\n"); |
361 |
|
|
362 |
for (llsc = 0; llsc <= 1; llsc ++) |
for (llsc = 0; llsc <= 1; llsc ++) |
363 |
for (aligncheck=0; aligncheck<=1; aligncheck++) |
for (load=0; load<=1; load++) |
364 |
for (load=0; load<=1; load++) |
for (zero=0; zero<=1; zero++) |
|
for (zero=0; zero<=1; zero++) |
|
365 |
for (size=0; size<4; size++) { |
for (size=0; size<4; size++) { |
366 |
printf("\talpha_instr_"); |
printf("\talpha_instr_"); |
367 |
if (llsc && (size != 2 && size != 3)) { |
if (llsc && (size != 2 && size != 3)) { |
374 |
printf("%s", sizechar[size]); |
printf("%s", sizechar[size]); |
375 |
if (zero) |
if (zero) |
376 |
printf("_0"); |
printf("_0"); |
|
if (aligncheck) |
|
|
printf("_aligncheck"); |
|
377 |
if (llsc) |
if (llsc) |
378 |
printf("_llsc"); |
printf("_llsc"); |
379 |
} |
} |