/[gxemul]/trunk/src/cpus/generate_alpha_misc.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/src/cpus/generate_alpha_misc.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 27 by dpavlin, Mon Oct 8 16:19:56 2007 UTC revision 28 by dpavlin, Mon Oct 8 16:20:26 2007 UTC
# Line 1  Line 1 
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:
# Line 25  Line 25 
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>
# Line 42  char *cmov[N_CMOV] = { "lbs", "lbc", "eq Line 42  char *cmov[N_CMOV] = { "lbs", "lbc", "eq
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");
# Line 267  int main(int argc, char *argv[]) Line 267  int main(int argc, char *argv[])
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)
# Line 304  int main(int argc, char *argv[]) Line 301  int main(int argc, char *argv[])
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");
# Line 324  int main(int argc, char *argv[]) Line 319  int main(int argc, char *argv[])
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          /*          /*
# Line 363  int main(int argc, char *argv[]) Line 356  int main(int argc, char *argv[])
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)) {
# Line 382  int main(int argc, char *argv[]) Line 374  int main(int argc, char *argv[])
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                          }                          }

Legend:
Removed from v.27  
changed lines
  Added in v.28

  ViewVC Help
Powered by ViewVC 1.1.26