1 /* Generate code from machine description to emit insns as rtl.
2 Copyright (C) 1987, 1988, 1991, 1994, 1995, 1997, 1998, 1999, 2000, 2001,
3 2003, 2004, 2005 Free Software Foundation, Inc.
5 This file is part of GCC.
7 GCC is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 2, or (at your option) any later
12 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING. If not, write to the Free
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
25 #include "coretypes.h"
29 #include "gensupport.h"
33 static int max_dup_opno
;
34 static int max_scratch_opno
;
35 static int insn_code_number
;
36 static int insn_index_number
;
38 /* Data structure for recording the patterns of insns that have CLOBBERs.
39 We use this to output a function that adds these CLOBBERs to a
40 previously-allocated PARALLEL expression. */
44 struct clobber_ent
*insns
;
47 struct clobber_pat
*next
;
51 /* Records one insn that uses the clobber list. */
55 int code_number
; /* Counts only insns. */
56 struct clobber_ent
*next
;
59 static void max_operand_1 (rtx
);
60 static int max_operand_vec (rtx
, int);
61 static void print_code (RTX_CODE
);
62 static void gen_exp (rtx
, enum rtx_code
, char *);
63 static void gen_insn (rtx
, int);
64 static void gen_expand (rtx
);
65 static void gen_split (rtx
);
66 static void output_add_clobbers (void);
67 static void output_added_clobbers_hard_reg_p (void);
68 static void gen_rtx_scratch (rtx
, enum rtx_code
);
69 static void output_peephole2_scratches (rtx
);
85 if (code
== MATCH_OPERAND
|| code
== MATCH_OPERATOR
86 || code
== MATCH_PARALLEL
)
87 max_opno
= MAX (max_opno
, XINT (x
, 0));
88 if (code
== MATCH_DUP
|| code
== MATCH_OP_DUP
|| code
== MATCH_PAR_DUP
)
89 max_dup_opno
= MAX (max_dup_opno
, XINT (x
, 0));
90 if (code
== MATCH_SCRATCH
)
91 max_scratch_opno
= MAX (max_scratch_opno
, XINT (x
, 0));
93 fmt
= GET_RTX_FORMAT (code
);
94 len
= GET_RTX_LENGTH (code
);
95 for (i
= 0; i
< len
; i
++)
97 if (fmt
[i
] == 'e' || fmt
[i
] == 'u')
98 max_operand_1 (XEXP (x
, i
));
99 else if (fmt
[i
] == 'E')
102 for (j
= 0; j
< XVECLEN (x
, i
); j
++)
103 max_operand_1 (XVECEXP (x
, i
, j
));
109 max_operand_vec (rtx insn
, int arg
)
111 int len
= XVECLEN (insn
, arg
);
116 max_scratch_opno
= -1;
118 for (i
= 0; i
< len
; i
++)
119 max_operand_1 (XVECEXP (insn
, arg
, i
));
125 print_code (RTX_CODE code
)
128 for (p1
= GET_RTX_NAME (code
); *p1
; p1
++)
129 putchar (TOUPPER(*p1
));
133 gen_rtx_scratch (rtx x
, enum rtx_code subroutine_type
)
135 if (subroutine_type
== DEFINE_PEEPHOLE2
)
137 printf ("operand%d", XINT (x
, 0));
141 printf ("gen_rtx_SCRATCH (%smode)", GET_MODE_NAME (GET_MODE (x
)));
145 /* Print a C expression to construct an RTX just like X,
146 substituting any operand references appearing within. */
149 gen_exp (rtx x
, enum rtx_code subroutine_type
, char *used
)
170 if (used
[XINT (x
, 0)])
172 printf ("copy_rtx (operand%d)", XINT (x
, 0));
175 used
[XINT (x
, 0)] = 1;
177 printf ("operand%d", XINT (x
, 0));
181 printf ("gen_rtx_fmt_");
182 for (i
= 0; i
< XVECLEN (x
, 1); i
++)
184 printf (" (GET_CODE (operand%d), ", XINT (x
, 0));
185 if (GET_MODE (x
) == VOIDmode
)
186 printf ("GET_MODE (operand%d)", XINT (x
, 0));
188 printf ("%smode", GET_MODE_NAME (GET_MODE (x
)));
189 for (i
= 0; i
< XVECLEN (x
, 1); i
++)
192 gen_exp (XVECEXP (x
, 1, i
), subroutine_type
, used
);
198 printf ("gen_rtx_fmt_");
199 for (i
= 0; i
< XVECLEN (x
, 2); i
++)
201 printf (" (GET_CODE (operand%d)", XINT (x
, 0));
202 printf (", %smode", GET_MODE_NAME (GET_MODE (x
)));
203 for (i
= 0; i
< XVECLEN (x
, 2); i
++)
206 gen_exp (XVECEXP (x
, 2, i
), subroutine_type
, used
);
213 printf ("operand%d", XINT (x
, 0));
217 gen_rtx_scratch (x
, subroutine_type
);
221 fatal ("ADDRESS expression code used in named instruction pattern");
227 if (REG_P (XEXP (x
, 0)))
229 printf ("gen_hard_reg_clobber (%smode, %i)", GET_MODE_NAME (GET_MODE (XEXP (x
, 0))),
230 REGNO (XEXP (x
, 0)));
241 printf ("const0_rtx");
242 else if (INTVAL (x
) == 1)
243 printf ("const1_rtx");
244 else if (INTVAL (x
) == -1)
245 printf ("constm1_rtx");
246 else if (-MAX_SAVED_CONST_INT
<= INTVAL (x
)
247 && INTVAL (x
) <= MAX_SAVED_CONST_INT
)
248 printf ("const_int_rtx[MAX_SAVED_CONST_INT + (%d)]",
250 else if (INTVAL (x
) == STORE_FLAG_VALUE
)
251 printf ("const_true_rtx");
254 printf ("GEN_INT (");
255 printf (HOST_WIDE_INT_PRINT_DEC_C
, INTVAL (x
));
261 /* These shouldn't be written in MD files. Instead, the appropriate
262 routines in varasm.c should be called. */
271 printf (" (%smode", GET_MODE_NAME (GET_MODE (x
)));
273 fmt
= GET_RTX_FORMAT (code
);
274 len
= GET_RTX_LENGTH (code
);
275 for (i
= 0; i
< len
; i
++)
283 gen_exp (XEXP (x
, i
), subroutine_type
, used
);
287 printf ("%u", XINT (x
, i
));
291 printf ("\"%s\"", XSTR (x
, i
));
297 printf ("gen_rtvec (%d", XVECLEN (x
, i
));
298 for (j
= 0; j
< XVECLEN (x
, i
); j
++)
301 gen_exp (XVECEXP (x
, i
, j
), subroutine_type
, used
);
314 /* Generate the `gen_...' function for a DEFINE_INSN. */
317 gen_insn (rtx insn
, int lineno
)
322 /* See if the pattern for this insn ends with a group of CLOBBERs of (hard)
323 registers or MATCH_SCRATCHes. If so, store away the information for
328 int has_hard_reg
= 0;
330 for (i
= XVECLEN (insn
, 1) - 1; i
> 0; i
--)
332 if (GET_CODE (XVECEXP (insn
, 1, i
)) != CLOBBER
)
335 if (REG_P (XEXP (XVECEXP (insn
, 1, i
), 0)))
337 else if (GET_CODE (XEXP (XVECEXP (insn
, 1, i
), 0)) != MATCH_SCRATCH
)
341 if (i
!= XVECLEN (insn
, 1) - 1)
343 struct clobber_pat
*p
;
344 struct clobber_ent
*link
= xmalloc (sizeof (struct clobber_ent
));
347 link
->code_number
= insn_code_number
;
349 /* See if any previous CLOBBER_LIST entry is the same as this
352 for (p
= clobber_list
; p
; p
= p
->next
)
354 if (p
->first_clobber
!= i
+ 1
355 || XVECLEN (p
->pattern
, 1) != XVECLEN (insn
, 1))
358 for (j
= i
+ 1; j
< XVECLEN (insn
, 1); j
++)
360 rtx old
= XEXP (XVECEXP (p
->pattern
, 1, j
), 0);
361 rtx
new = XEXP (XVECEXP (insn
, 1, j
), 0);
363 /* OLD and NEW are the same if both are to be a SCRATCH
365 or if both are registers of the same mode and number. */
366 if (! (GET_MODE (old
) == GET_MODE (new)
367 && ((GET_CODE (old
) == MATCH_SCRATCH
368 && GET_CODE (new) == MATCH_SCRATCH
)
369 || (REG_P (old
) && REG_P (new)
370 && REGNO (old
) == REGNO (new)))))
374 if (j
== XVECLEN (insn
, 1))
380 p
= xmalloc (sizeof (struct clobber_pat
));
384 p
->first_clobber
= i
+ 1;
385 p
->next
= clobber_list
;
386 p
->has_hard_reg
= has_hard_reg
;
390 link
->next
= p
->insns
;
395 /* Don't mention instructions whose names are the null string
396 or begin with '*'. They are in the machine description just
398 if (XSTR (insn
, 0)[0] == 0 || XSTR (insn
, 0)[0] == '*')
401 printf ("/* %s:%d */\n", read_rtx_filename
, lineno
);
403 /* Find out how many operands this function has. */
404 operands
= max_operand_vec (insn
, 1);
405 if (max_dup_opno
>= operands
)
406 fatal ("match_dup operand number has no match_operand");
408 /* Output the function name and argument declarations. */
409 printf ("rtx\ngen_%s (", XSTR (insn
, 0));
411 for (i
= 0; i
< operands
; i
++)
413 printf (",\n\trtx operand%d ATTRIBUTE_UNUSED", i
);
415 printf ("rtx operand%d ATTRIBUTE_UNUSED", i
);
421 /* Output code to construct and return the rtl for the instruction body. */
423 if (XVECLEN (insn
, 1) == 1)
426 gen_exp (XVECEXP (insn
, 1, 0), DEFINE_INSN
, NULL
);
431 printf (" return gen_rtx_PARALLEL (VOIDmode, gen_rtvec (%d",
434 for (i
= 0; i
< XVECLEN (insn
, 1); i
++)
437 gen_exp (XVECEXP (insn
, 1, i
), DEFINE_INSN
, NULL
);
439 printf ("));\n}\n\n");
443 /* Generate the `gen_...' function for a DEFINE_EXPAND. */
446 gen_expand (rtx expand
)
451 if (strlen (XSTR (expand
, 0)) == 0)
452 fatal ("define_expand lacks a name");
453 if (XVEC (expand
, 1) == 0)
454 fatal ("define_expand for %s lacks a pattern", XSTR (expand
, 0));
456 /* Find out how many operands this function has. */
457 operands
= max_operand_vec (expand
, 1);
459 /* Output the function name and argument declarations. */
460 printf ("rtx\ngen_%s (", XSTR (expand
, 0));
462 for (i
= 0; i
< operands
; i
++)
464 printf (",\n\trtx operand%d", i
);
466 printf ("rtx operand%d", i
);
472 /* If we don't have any C code to write, only one insn is being written,
473 and no MATCH_DUPs are present, we can just return the desired insn
474 like we do for a DEFINE_INSN. This saves memory. */
475 if ((XSTR (expand
, 3) == 0 || *XSTR (expand
, 3) == '\0')
476 && operands
> max_dup_opno
477 && XVECLEN (expand
, 1) == 1)
480 gen_exp (XVECEXP (expand
, 1, 0), DEFINE_EXPAND
, NULL
);
485 /* For each operand referred to only with MATCH_DUPs,
486 make a local variable. */
487 for (i
= operands
; i
<= max_dup_opno
; i
++)
488 printf (" rtx operand%d;\n", i
);
489 for (; i
<= max_scratch_opno
; i
++)
490 printf (" rtx operand%d ATTRIBUTE_UNUSED;\n", i
);
491 printf (" rtx _val = 0;\n");
492 printf (" start_sequence ();\n");
494 /* The fourth operand of DEFINE_EXPAND is some code to be executed
495 before the actual construction.
496 This code expects to refer to `operands'
497 just as the output-code in a DEFINE_INSN does,
498 but here `operands' is an automatic array.
499 So copy the operand values there before executing it. */
500 if (XSTR (expand
, 3) && *XSTR (expand
, 3))
503 if (operands
> 0 || max_dup_opno
>= 0 || max_scratch_opno
>= 0)
504 printf (" rtx operands[%d];\n",
505 MAX (operands
, MAX (max_scratch_opno
, max_dup_opno
) + 1));
506 /* Output code to copy the arguments into `operands'. */
507 for (i
= 0; i
< operands
; i
++)
508 printf (" operands[%d] = operand%d;\n", i
, i
);
510 /* Output the special code to be executed before the sequence
512 print_rtx_ptr_loc (XSTR (expand
, 3));
513 printf ("%s\n", XSTR (expand
, 3));
515 /* Output code to copy the arguments back out of `operands'
516 (unless we aren't going to use them at all). */
517 if (XVEC (expand
, 1) != 0)
519 for (i
= 0; i
< operands
; i
++)
520 printf (" operand%d = operands[%d];\n", i
, i
);
521 for (; i
<= max_dup_opno
; i
++)
522 printf (" operand%d = operands[%d];\n", i
, i
);
523 for (; i
<= max_scratch_opno
; i
++)
524 printf (" operand%d = operands[%d];\n", i
, i
);
529 /* Output code to construct the rtl for the instruction bodies.
530 Use emit_insn to add them to the sequence being accumulated.
531 But don't do this if the user's code has set `no_more' nonzero. */
533 for (i
= 0; i
< XVECLEN (expand
, 1); i
++)
535 rtx next
= XVECEXP (expand
, 1, i
);
536 if ((GET_CODE (next
) == SET
&& GET_CODE (SET_DEST (next
)) == PC
)
537 || (GET_CODE (next
) == PARALLEL
538 && ((GET_CODE (XVECEXP (next
, 0, 0)) == SET
539 && GET_CODE (SET_DEST (XVECEXP (next
, 0, 0))) == PC
)
540 || GET_CODE (XVECEXP (next
, 0, 0)) == RETURN
))
541 || GET_CODE (next
) == RETURN
)
542 printf (" emit_jump_insn (");
543 else if ((GET_CODE (next
) == SET
&& GET_CODE (SET_SRC (next
)) == CALL
)
544 || GET_CODE (next
) == CALL
545 || (GET_CODE (next
) == PARALLEL
546 && GET_CODE (XVECEXP (next
, 0, 0)) == SET
547 && GET_CODE (SET_SRC (XVECEXP (next
, 0, 0))) == CALL
)
548 || (GET_CODE (next
) == PARALLEL
549 && GET_CODE (XVECEXP (next
, 0, 0)) == CALL
))
550 printf (" emit_call_insn (");
551 else if (LABEL_P (next
))
552 printf (" emit_label (");
553 else if (GET_CODE (next
) == MATCH_OPERAND
554 || GET_CODE (next
) == MATCH_DUP
555 || GET_CODE (next
) == MATCH_OPERATOR
556 || GET_CODE (next
) == MATCH_OP_DUP
557 || GET_CODE (next
) == MATCH_PARALLEL
558 || GET_CODE (next
) == MATCH_PAR_DUP
559 || GET_CODE (next
) == PARALLEL
)
562 printf (" emit_insn (");
563 gen_exp (next
, DEFINE_EXPAND
, NULL
);
565 if (GET_CODE (next
) == SET
&& GET_CODE (SET_DEST (next
)) == PC
566 && GET_CODE (SET_SRC (next
)) == LABEL_REF
)
567 printf (" emit_barrier ();");
570 /* Call `get_insns' to extract the list of all the
571 insns emitted within this gen_... function. */
573 printf (" _val = get_insns ();\n");
574 printf (" end_sequence ();\n");
575 printf (" return _val;\n}\n\n");
578 /* Like gen_expand, but generates insns resulting from splitting SPLIT. */
581 gen_split (rtx split
)
585 const char *const name
=
586 ((GET_CODE (split
) == DEFINE_PEEPHOLE2
) ? "peephole2" : "split");
590 if (XVEC (split
, 0) == 0)
591 fatal ("define_%s (definition %d) lacks a pattern", name
,
593 else if (XVEC (split
, 2) == 0)
594 fatal ("define_%s (definition %d) lacks a replacement pattern", name
,
597 /* Find out how many operands this function has. */
599 max_operand_vec (split
, 2);
600 operands
= MAX (max_opno
, MAX (max_dup_opno
, max_scratch_opno
)) + 1;
601 unused
= (operands
== 0 ? " ATTRIBUTE_UNUSED" : "");
602 used
= xcalloc (1, operands
);
604 /* Output the prototype, function name and argument declarations. */
605 if (GET_CODE (split
) == DEFINE_PEEPHOLE2
)
607 printf ("extern rtx gen_%s_%d (rtx, rtx *);\n",
608 name
, insn_code_number
);
609 printf ("rtx\ngen_%s_%d (rtx curr_insn ATTRIBUTE_UNUSED, rtx *operands%s)\n",
610 name
, insn_code_number
, unused
);
614 printf ("extern rtx gen_split_%d (rtx, rtx *);\n", insn_code_number
);
615 printf ("rtx\ngen_split_%d (rtx curr_insn ATTRIBUTE_UNUSED, rtx *operands%s)\n",
616 insn_code_number
, unused
);
620 /* Declare all local variables. */
621 for (i
= 0; i
< operands
; i
++)
622 printf (" rtx operand%d;\n", i
);
623 printf (" rtx _val = 0;\n");
625 if (GET_CODE (split
) == DEFINE_PEEPHOLE2
)
626 output_peephole2_scratches (split
);
628 printf (" start_sequence ();\n");
630 /* The fourth operand of DEFINE_SPLIT is some code to be executed
631 before the actual construction. */
635 print_rtx_ptr_loc (XSTR (split
, 3));
636 printf ("%s\n", XSTR (split
, 3));
639 /* Output code to copy the arguments back out of `operands' */
640 for (i
= 0; i
< operands
; i
++)
641 printf (" operand%d = operands[%d];\n", i
, i
);
643 /* Output code to construct the rtl for the instruction bodies.
644 Use emit_insn to add them to the sequence being accumulated.
645 But don't do this if the user's code has set `no_more' nonzero. */
647 for (i
= 0; i
< XVECLEN (split
, 2); i
++)
649 rtx next
= XVECEXP (split
, 2, i
);
650 if ((GET_CODE (next
) == SET
&& GET_CODE (SET_DEST (next
)) == PC
)
651 || (GET_CODE (next
) == PARALLEL
652 && GET_CODE (XVECEXP (next
, 0, 0)) == SET
653 && GET_CODE (SET_DEST (XVECEXP (next
, 0, 0))) == PC
)
654 || GET_CODE (next
) == RETURN
)
655 printf (" emit_jump_insn (");
656 else if ((GET_CODE (next
) == SET
&& GET_CODE (SET_SRC (next
)) == CALL
)
657 || GET_CODE (next
) == CALL
658 || (GET_CODE (next
) == PARALLEL
659 && GET_CODE (XVECEXP (next
, 0, 0)) == SET
660 && GET_CODE (SET_SRC (XVECEXP (next
, 0, 0))) == CALL
)
661 || (GET_CODE (next
) == PARALLEL
662 && GET_CODE (XVECEXP (next
, 0, 0)) == CALL
))
663 printf (" emit_call_insn (");
664 else if (LABEL_P (next
))
665 printf (" emit_label (");
666 else if (GET_CODE (next
) == MATCH_OPERAND
667 || GET_CODE (next
) == MATCH_OPERATOR
668 || GET_CODE (next
) == MATCH_PARALLEL
669 || GET_CODE (next
) == MATCH_OP_DUP
670 || GET_CODE (next
) == MATCH_DUP
671 || GET_CODE (next
) == PARALLEL
)
674 printf (" emit_insn (");
675 gen_exp (next
, GET_CODE (split
), used
);
677 if (GET_CODE (next
) == SET
&& GET_CODE (SET_DEST (next
)) == PC
678 && GET_CODE (SET_SRC (next
)) == LABEL_REF
)
679 printf (" emit_barrier ();");
682 /* Call `get_insns' to make a list of all the
683 insns emitted within this gen_... function. */
685 printf (" _val = get_insns ();\n");
686 printf (" end_sequence ();\n");
687 printf (" return _val;\n}\n\n");
692 /* Write a function, `add_clobbers', that is given a PARALLEL of sufficient
693 size for the insn and an INSN_CODE, and inserts the required CLOBBERs at
694 the end of the vector. */
697 output_add_clobbers (void)
699 struct clobber_pat
*clobber
;
700 struct clobber_ent
*ent
;
703 printf ("\n\nvoid\nadd_clobbers (rtx pattern ATTRIBUTE_UNUSED, int insn_code_number)\n");
705 printf (" switch (insn_code_number)\n");
708 for (clobber
= clobber_list
; clobber
; clobber
= clobber
->next
)
710 for (ent
= clobber
->insns
; ent
; ent
= ent
->next
)
711 printf (" case %d:\n", ent
->code_number
);
713 for (i
= clobber
->first_clobber
; i
< XVECLEN (clobber
->pattern
, 1); i
++)
715 printf (" XVECEXP (pattern, 0, %d) = ", i
);
716 gen_exp (XVECEXP (clobber
->pattern
, 1, i
),
717 GET_CODE (clobber
->pattern
), NULL
);
721 printf (" break;\n\n");
724 printf (" default:\n");
725 printf (" gcc_unreachable ();\n");
730 /* Write a function, `added_clobbers_hard_reg_p' that is given an insn_code
731 number that will have clobbers added (as indicated by `recog') and returns
732 1 if those include a clobber of a hard reg or 0 if all of them just clobber
736 output_added_clobbers_hard_reg_p (void)
738 struct clobber_pat
*clobber
;
739 struct clobber_ent
*ent
;
742 printf ("\n\nint\nadded_clobbers_hard_reg_p (int insn_code_number)\n");
744 printf (" switch (insn_code_number)\n");
747 for (clobber_p
= 0; clobber_p
<= 1; clobber_p
++)
750 for (clobber
= clobber_list
; clobber
; clobber
= clobber
->next
)
751 if (clobber
->has_hard_reg
== clobber_p
)
752 for (ent
= clobber
->insns
; ent
; ent
= ent
->next
)
754 printf (" case %d:\n", ent
->code_number
);
759 printf (" return %d;\n\n", clobber_p
);
762 printf (" default:\n");
763 printf (" gcc_unreachable ();\n");
768 /* Generate code to invoke find_free_register () as needed for the
769 scratch registers used by the peephole2 pattern in SPLIT. */
772 output_peephole2_scratches (rtx split
)
777 printf (" HARD_REG_SET _regs_allocated;\n");
778 printf (" CLEAR_HARD_REG_SET (_regs_allocated);\n");
780 for (i
= 0; i
< XVECLEN (split
, 0); i
++)
782 rtx elt
= XVECEXP (split
, 0, i
);
783 if (GET_CODE (elt
) == MATCH_SCRATCH
)
785 int last_insn_nr
= insn_nr
;
786 int cur_insn_nr
= insn_nr
;
788 for (j
= i
+ 1; j
< XVECLEN (split
, 0); j
++)
789 if (GET_CODE (XVECEXP (split
, 0, j
)) == MATCH_DUP
)
791 if (XINT (XVECEXP (split
, 0, j
), 0) == XINT (elt
, 0))
792 last_insn_nr
= cur_insn_nr
;
794 else if (GET_CODE (XVECEXP (split
, 0, j
)) != MATCH_SCRATCH
)
797 printf (" if ((operands[%d] = peep2_find_free_register (%d, %d, \"%s\", %smode, &_regs_allocated)) == NULL_RTX)\n\
800 insn_nr
, last_insn_nr
,
802 GET_MODE_NAME (GET_MODE (elt
)));
805 else if (GET_CODE (elt
) != MATCH_DUP
)
811 main (int argc
, char **argv
)
815 progname
= "genemit";
817 if (init_md_reader_args (argc
, argv
) != SUCCESS_EXIT_CODE
)
818 return (FATAL_EXIT_CODE
);
820 /* Assign sequential codes to all entries in the machine description
821 in parallel with the tables in insn-output.c. */
823 insn_code_number
= 0;
824 insn_index_number
= 0;
826 printf ("/* Generated automatically by the program `genemit'\n\
827 from the machine description file `md'. */\n\n");
829 printf ("#include \"config.h\"\n");
830 printf ("#include \"system.h\"\n");
831 printf ("#include \"coretypes.h\"\n");
832 printf ("#include \"tm.h\"\n");
833 printf ("#include \"rtl.h\"\n");
834 printf ("#include \"tm_p.h\"\n");
835 printf ("#include \"function.h\"\n");
836 printf ("#include \"expr.h\"\n");
837 printf ("#include \"optabs.h\"\n");
838 printf ("#include \"real.h\"\n");
839 printf ("#include \"flags.h\"\n");
840 printf ("#include \"output.h\"\n");
841 printf ("#include \"insn-config.h\"\n");
842 printf ("#include \"hard-reg-set.h\"\n");
843 printf ("#include \"recog.h\"\n");
844 printf ("#include \"resource.h\"\n");
845 printf ("#include \"reload.h\"\n");
846 printf ("#include \"toplev.h\"\n");
847 printf ("#include \"ggc.h\"\n\n");
848 printf ("#include \"basic-block.h\"\n\n");
849 printf ("#define FAIL return (end_sequence (), _val)\n");
850 printf ("#define DONE return (_val = get_insns (), end_sequence (), _val)\n\n");
852 /* Read the machine description. */
858 desc
= read_md_rtx (&line_no
, &insn_code_number
);
862 switch (GET_CODE (desc
))
865 gen_insn (desc
, line_no
);
869 printf ("/* %s:%d */\n", read_rtx_filename
, line_no
);
874 printf ("/* %s:%d */\n", read_rtx_filename
, line_no
);
878 case DEFINE_PEEPHOLE2
:
879 printf ("/* %s:%d */\n", read_rtx_filename
, line_no
);
889 /* Write out the routines to add CLOBBERs to a pattern and say whether they
890 clobber a hard reg. */
891 output_add_clobbers ();
892 output_added_clobbers_hard_reg_p ();
895 return (ferror (stdout
) != 0 ? FATAL_EXIT_CODE
: SUCCESS_EXIT_CODE
);
898 /* Define this so we can link with print-rtl.o to get debug_rtx function. */
900 get_insn_name (int code ATTRIBUTE_UNUSED
)