コード例 #1
0
int
main (int argc, char **argv)
{
/* BEGIN GCC-XML MODIFICATIONS ($Date: 2007-10-31 15:07:06 $) */
  gccxml_fix_printf();
/* END GCC-XML MODIFICATIONS ($Date: 2007-10-31 15:07:06 $) */

  progname = "genconstants";

  if (init_md_reader_args (argc, argv) != SUCCESS_EXIT_CODE)
    return (FATAL_EXIT_CODE);

  /* Initializing the MD reader has the side effect of loading up
     the constants table that we wish to scan.  */

  puts ("/* Generated automatically by the program `genconstants'");
  puts ("   from the machine description file `md'.  */\n");
  puts ("#ifndef GCC_INSN_CONSTANTS_H");
  puts ("#define GCC_INSN_CONSTANTS_H\n");

  traverse_md_constants (print_md_constant, stdout);

  puts ("\n#endif /* GCC_INSN_CONSTANTS_H */");

  if (ferror (stdout) || fflush (stdout) || fclose (stdout))
    return FATAL_EXIT_CODE;

  return SUCCESS_EXIT_CODE;
}
コード例 #2
0
int
main (int argc, char ** argv)
{
/* BEGIN GCC-XML MODIFICATIONS ($Date: 2007-10-31 15:07:06 $) */
  gccxml_fix_printf();
/* END GCC-XML MODIFICATIONS ($Date: 2007-10-31 15:07:06 $) */

  if (argc != 2)
    {
      usage ();
      return 1;
    }

  dosum (argv[1]);

  return 0;
}
コード例 #3
0
ファイル: gencodes.c プロジェクト: wqren/pymc-1
int
main (int argc, char **argv)
{
  rtx desc;

/* BEGIN GCC-XML MODIFICATIONS ($Date: 2007-10-31 15:07:06 $) */
  gccxml_fix_printf();
/* END GCC-XML MODIFICATIONS ($Date: 2007-10-31 15:07:06 $) */

  progname = "gencodes";

  /* We need to see all the possibilities.  Elided insns may have
     direct references to CODE_FOR_xxx in C code.  */
  insn_elision = 0;

  if (init_md_reader_args (argc, argv) != SUCCESS_EXIT_CODE)
    return (FATAL_EXIT_CODE);

  puts ("\
/* Generated automatically by the program `gencodes'\n\
   from the machine description file `md'.  */\n\
\n\
#ifndef GCC_INSN_CODES_H\n\
#define GCC_INSN_CODES_H\n\
\n\
enum insn_code {");

  /* Read the machine description.  */

  while (1)
    {
      int line_no;
      int insn_code_number;

      desc = read_md_rtx (&line_no, &insn_code_number);
      if (desc == NULL)
        break;

      if (GET_CODE (desc) == DEFINE_INSN || GET_CODE (desc) == DEFINE_EXPAND)
        gen_insn (desc, insn_code_number);
    }

  puts ("  CODE_FOR_nothing\n\
};\n\
コード例 #4
0
ファイル: gengenrtl.c プロジェクト: GeekOffTheStreet/gccxml
int
main (int argc, char **argv)
{
/* BEGIN GCC-XML MODIFICATIONS (2007/10/31 15:07:06) */
  gccxml_fix_printf();
/* END GCC-XML MODIFICATIONS (2007/10/31 15:07:06) */

  find_formats ();
  genlegend ();

  if (argc == 2 && argv[1][0] == '-' && argv[1][1] == 'h')
    genheader ();
  else
    gencode ();

  if (ferror (stdout) || fflush (stdout) || fclose (stdout))
    return FATAL_EXIT_CODE;

  return SUCCESS_EXIT_CODE;
}
コード例 #5
0
ファイル: genconfig.c プロジェクト: wqren/pymc-1
int
main (int argc, char **argv)
{
  rtx desc;

/* BEGIN GCC-XML MODIFICATIONS ($Date: 2007-10-31 15:07:06 $) */
  gccxml_fix_printf();
/* END GCC-XML MODIFICATIONS ($Date: 2007-10-31 15:07:06 $) */

  progname = "genconfig";

  if (init_md_reader_args (argc, argv) != SUCCESS_EXIT_CODE)
    return (FATAL_EXIT_CODE);

  puts ("/* Generated automatically by the program `genconfig'");
  puts ("   from the machine description file `md'.  */\n");
  puts ("#ifndef GCC_INSN_CONFIG_H");
  puts ("#define GCC_INSN_CONFIG_H\n");

  /* Allow at least 30 operands for the sake of asm constructs.  */
  /* ??? We *really* ought to reorganize things such that there
     is no fixed upper bound.  */
  max_recog_operands = 29;  /* We will add 1 later.  */
  max_dup_operands = 1;

  /* Read the machine description.  */

  while (1)
    {
      int line_no, insn_code_number = 0;

      desc = read_md_rtx (&line_no, &insn_code_number);
      if (desc == NULL)
        break;
        
      switch (GET_CODE (desc)) 
        {
            case DEFINE_INSN:
            gen_insn (desc);
            break;
          
          case DEFINE_EXPAND:
            gen_expand (desc);
            break;

          case DEFINE_SPLIT:
            gen_split (desc);
            break;

          case DEFINE_PEEPHOLE2:
            have_peephole2_flag = 1;
            gen_peephole2 (desc);
            break;

          case DEFINE_PEEPHOLE:
            have_peephole_flag = 1;
            gen_peephole (desc);
            break;

          default:
            break;
        }
    }

  printf ("#define MAX_RECOG_OPERANDS %d\n", max_recog_operands + 1);
  printf ("#define MAX_DUP_OPERANDS %d\n", max_dup_operands);

  /* This is conditionally defined, in case the user writes code which emits
     more splits than we can readily see (and knows s/he does it).  */
  printf ("#ifndef MAX_INSNS_PER_SPLIT\n");
  printf ("#define MAX_INSNS_PER_SPLIT %d\n", max_insns_per_split);
  printf ("#endif\n");

  if (have_cc0_flag)
    {
      printf ("#define HAVE_cc0 1\n");
      printf ("#define CC0_P(X) ((X) == cc0_rtx)\n");
    }
  else
    {
      /* We output CC0_P this way to make sure that X is declared
         somewhere.  */
      printf ("#define CC0_P(X) ((X) ? 0 : 0)\n");
    }

  if (have_cmove_flag)
    printf ("#define HAVE_conditional_move 1\n");

  if (have_cond_exec_flag)
    printf ("#define HAVE_conditional_execution 1\n");

  if (have_lo_sum_flag)
    printf ("#define HAVE_lo_sum 1\n");

  if (have_peephole_flag)
    printf ("#define HAVE_peephole 1\n");

  if (have_peephole2_flag)
    {
      printf ("#define HAVE_peephole2 1\n");
      printf ("#define MAX_INSNS_PER_PEEP2 %d\n", max_insns_per_peep2);
    }

  puts("\n#endif /* GCC_INSN_CONFIG_H */");

  if (ferror (stdout) || fflush (stdout) || fclose (stdout))
    return FATAL_EXIT_CODE;

  return SUCCESS_EXIT_CODE;
}