Exemplo n.º 1
0
int
main (int argc, char **argv)
{
  rtx desc;
  int pattern_lineno;
  int code; /* not used */
  progname = "genmddump";

  if (!init_rtx_reader_args (argc, argv))
    return (FATAL_EXIT_CODE);

  /* Read the machine description.  */
  while (1)
    {
      desc = read_md_rtx (&pattern_lineno, &code);
      if (desc == NULL)
	break;
      printf (";; %s: %d\n", read_md_filename, pattern_lineno);
      print_inline_rtx (stdout, desc, 0);
      printf ("\n\n");
    }

  fflush (stdout);
  return (ferror (stdout) != 0 ? FATAL_EXIT_CODE : SUCCESS_EXIT_CODE);
}
Exemplo n.º 2
0
int
main (int argc, char **argv)
{
  rtx desc;
  bool have_delay = false;
  bool have_sched = false;

  progname = "genattr-common";

  if (!init_rtx_reader_args (argc, argv))
    return (FATAL_EXIT_CODE);

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

  /* Read the machine description.  */

  while (1)
    {
      int line_no, insn_code_number;

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

      if (GET_CODE (desc) == DEFINE_ATTR)
	gen_attr (desc);

      if (GET_CODE (desc) == DEFINE_DELAY)
        {
	  if (!have_delay)
	    {
	      printf ("#define DELAY_SLOTS\n");
	      have_delay = true;
	    }
	}
      else if (GET_CODE (desc) == DEFINE_INSN_RESERVATION)
	{
	  if (!have_sched)
	    {
	      printf ("#define INSN_SCHEDULING\n");
	      have_sched = true;
	    }
	}
    }
  puts ("\n#endif /* GCC_INSN_ATTR_COMMON_H */");

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

  return SUCCESS_EXIT_CODE;
}
Exemplo n.º 3
0
int
main (int argc, char **argv)
{
  bool have_delay = false;
  bool have_sched = false;

  progname = "genattr-common";

  if (!init_rtx_reader_args (argc, argv))
    return (FATAL_EXIT_CODE);

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

  /* Read the machine description.  */

  md_rtx_info info;
  while (read_md_rtx (&info))
    switch (GET_CODE (info.def))
      {
      case DEFINE_ATTR:
	gen_attr (&info);
	break;

      case DEFINE_DELAY:
	have_delay = true;
	break;

      case DEFINE_INSN_RESERVATION:
	if (!have_sched)
	  {
	    printf ("#define INSN_SCHEDULING\n");
	    have_sched = true;
	  }
	break;

      default:
	break;
      }

	    printf ("#define DELAY_SLOTS %d\n", have_delay);
  puts ("\n#endif /* GCC_INSN_ATTR_COMMON_H */");

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

  return SUCCESS_EXIT_CODE;
}
Exemplo n.º 4
0
int
main (int argc, char **argv)
{
  progname = "genmddump";

  if (!init_rtx_reader_args (argc, argv))
    return (FATAL_EXIT_CODE);

  /* Read the machine description.  */
  md_rtx_info info;
  while (read_md_rtx (&info))
    {
      printf (";; %s: %d\n", info.loc.filename, info.loc.lineno);
      print_inline_rtx (stdout, info.def, 0);
      printf ("\n\n");
    }

  fflush (stdout);
  return (ferror (stdout) != 0 ? FATAL_EXIT_CODE : SUCCESS_EXIT_CODE);
}
Exemplo n.º 5
0
int
main (int argc, char **argv)
{
  rtx desc;

  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_rtx_reader_args (argc, argv))
    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 {\n\
  CODE_FOR_nothing = 0,\n");

  /* 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 ("  LAST_INSN_CODE\n\
};\n\
Exemplo n.º 6
0
int
main (int argc, const char **argv)
{
  progname = "genconfig";

  if (!init_rtx_reader_args (argc, argv))
    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.  */

  md_rtx_info info;
  while (read_md_rtx (&info))
    switch (GET_CODE (info.def))
      {
      case DEFINE_INSN:
	gen_insn (&info);
	break;

      case DEFINE_EXPAND:
	gen_expand (&info);
	break;

      case DEFINE_SPLIT:
	gen_split (&info);
	break;

      case DEFINE_PEEPHOLE2:
	have_peephole2_flag = 1;
	gen_peephole2 (&info);
	break;

      case DEFINE_PEEPHOLE:
	have_peephole_flag = 1;
	gen_peephole (&info);
	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 HAVE_cc0 0\n");
      printf ("#define CC0_P(X) ((X) ? 0 : 0)\n");
    }

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

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

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

  if (have_rotate_flag)
    printf ("#define HAVE_rotate 1\n");

  if (have_rotatert_flag)
    printf ("#define HAVE_rotatert 1\n");

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

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

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

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

  return SUCCESS_EXIT_CODE;
}