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, 2007 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 3, 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 COPYING3. If not see
19 <http://www.gnu.org/licenses/>. */
24 #include "coretypes.h"
28 #include "gensupport.h"
32 static int max_dup_opno
;
33 static int max_scratch_opno
;
34 static int insn_code_number
;
35 static int insn_index_number
;
37 /* Data structure for recording the patterns of insns that have CLOBBERs.
38 We use this to output a function that adds these CLOBBERs to a
39 previously-allocated PARALLEL expression. */
43 struct clobber_ent
*insns
;
46 struct clobber_pat
*next
;
50 /* Records one insn that uses the clobber list. */
54 int code_number
; /* Counts only insns. */
55 struct clobber_ent
*next
;
58 static void max_operand_1 (rtx
);
59 static int max_operand_vec (rtx
, int);
60 static void print_code (RTX_CODE
);
61 static void gen_exp (rtx
, enum rtx_code
, char *);
62 static void gen_insn (rtx
, int);
63 static void gen_expand (rtx
);
64 static void gen_split (rtx
);
65 static void output_add_clobbers (void);
66 static void output_added_clobbers_hard_reg_p (void);
67 static void gen_rtx_scratch (rtx
, enum rtx_code
);
68 static void output_peephole2_scratches (rtx
);
84 if (code
== MATCH_OPERAND
|| code
== MATCH_OPERATOR
85 || code
== MATCH_PARALLEL
)
86 max_opno
= MAX (max_opno
, XINT (x
, 0));
87 if (code
== MATCH_DUP
|| code
== MATCH_OP_DUP
|| code
== MATCH_PAR_DUP
)
88 max_dup_opno
= MAX (max_dup_opno
, XINT (x
, 0));
89 if (code
== MATCH_SCRATCH
)
90 max_scratch_opno
= MAX (max_scratch_opno
, XINT (x
, 0));
92 fmt
= GET_RTX_FORMAT (code
);
93 len
= GET_RTX_LENGTH (code
);
94 for (i
= 0; i
< len
; i
++)
96 if (fmt
[i
] == 'e' || fmt
[i
] == 'u')
97 max_operand_1 (XEXP (x
, i
));
98 else if (fmt
[i
] == 'E')
101 for (j
= 0; j
< XVECLEN (x
, i
); j
++)
102 max_operand_1 (XVECEXP (x
, i
, j
));
108 max_operand_vec (rtx insn
, int arg
)
110 int len
= XVECLEN (insn
, arg
);
115 max_scratch_opno
= -1;
117 for (i
= 0; i
< len
; i
++)
118 max_operand_1 (XVECEXP (insn
, arg
, i
));
124 print_code (RTX_CODE code
)
127 for (p1
= GET_RTX_NAME (code
); *p1
; p1
++)
128 putchar (TOUPPER(*p1
));
132 gen_rtx_scratch (rtx x
, enum rtx_code subroutine_type
)
134 if (subroutine_type
== DEFINE_PEEPHOLE2
)
136 printf ("operand%d", XINT (x
, 0));
140 printf ("gen_rtx_SCRATCH (%smode)", GET_MODE_NAME (GET_MODE (x
)));
144 /* Print a C expression to construct an RTX just like X,
145 substituting any operand references appearing within. */
148 gen_exp (rtx x
, enum rtx_code subroutine_type
, char *used
)
169 if (used
[XINT (x
, 0)])
171 printf ("copy_rtx (operand%d)", XINT (x
, 0));
174 used
[XINT (x
, 0)] = 1;
176 printf ("operand%d", XINT (x
, 0));
180 printf ("gen_rtx_fmt_");
181 for (i
= 0; i
< XVECLEN (x
, 1); i
++)
183 printf (" (GET_CODE (operand%d), ", XINT (x
, 0));
184 if (GET_MODE (x
) == VOIDmode
)
185 printf ("GET_MODE (operand%d)", XINT (x
, 0));
187 printf ("%smode", GET_MODE_NAME (GET_MODE (x
)));
188 for (i
= 0; i
< XVECLEN (x
, 1); i
++)
191 gen_exp (XVECEXP (x
, 1, i
), subroutine_type
, used
);
197 printf ("gen_rtx_fmt_");
198 for (i
= 0; i
< XVECLEN (x
, 2); i
++)
200 printf (" (GET_CODE (operand%d)", XINT (x
, 0));
201 printf (", %smode", GET_MODE_NAME (GET_MODE (x
)));
202 for (i
= 0; i
< XVECLEN (x
, 2); i
++)
205 gen_exp (XVECEXP (x
, 2, i
), subroutine_type
, used
);
212 printf ("operand%d", XINT (x
, 0));
216 gen_rtx_scratch (x
, subroutine_type
);
220 fatal ("ADDRESS expression code used in named instruction pattern");
226 if (REG_P (XEXP (x
, 0)))
228 printf ("gen_hard_reg_clobber (%smode, %i)", GET_MODE_NAME (GET_MODE (XEXP (x
, 0))),
229 REGNO (XEXP (x
, 0)));
240 printf ("const0_rtx");
241 else if (INTVAL (x
) == 1)
242 printf ("const1_rtx");
243 else if (INTVAL (x
) == -1)
244 printf ("constm1_rtx");
245 else if (-MAX_SAVED_CONST_INT
<= INTVAL (x
)
246 && INTVAL (x
) <= MAX_SAVED_CONST_INT
)
247 printf ("const_int_rtx[MAX_SAVED_CONST_INT + (%d)]",
249 else if (INTVAL (x
) == STORE_FLAG_VALUE
)
250 printf ("const_true_rtx");
253 printf ("GEN_INT (");
254 printf (HOST_WIDE_INT_PRINT_DEC_C
, INTVAL (x
));
260 /* These shouldn't be written in MD files. Instead, the appropriate
261 routines in varasm.c should be called. */
270 printf (" (%smode", GET_MODE_NAME (GET_MODE (x
)));
272 fmt
= GET_RTX_FORMAT (code
);
273 len
= GET_RTX_LENGTH (code
);
274 for (i
= 0; i
< len
; i
++)
282 gen_exp (XEXP (x
, i
), subroutine_type
, used
);
286 printf ("%u", XINT (x
, i
));
290 printf ("\"%s\"", XSTR (x
, i
));
296 printf ("gen_rtvec (%d", XVECLEN (x
, i
));
297 for (j
= 0; j
< XVECLEN (x
, i
); j
++)
300 gen_exp (XVECEXP (x
, i
, j
), subroutine_type
, used
);
313 /* Generate the `gen_...' function for a DEFINE_INSN. */
316 gen_insn (rtx insn
, int lineno
)
321 /* See if the pattern for this insn ends with a group of CLOBBERs of (hard)
322 registers or MATCH_SCRATCHes. If so, store away the information for
327 int has_hard_reg
= 0;
329 for (i
= XVECLEN (insn
, 1) - 1; i
> 0; i
--)
331 if (GET_CODE (XVECEXP (insn
, 1, i
)) != CLOBBER
)
334 if (REG_P (XEXP (XVECEXP (insn
, 1, i
), 0)))
336 else if (GET_CODE (XEXP (XVECEXP (insn
, 1, i
), 0)) != MATCH_SCRATCH
)
340 if (i
!= XVECLEN (insn
, 1) - 1)
342 struct clobber_pat
*p
;
343 struct clobber_ent
*link
= XNEW (struct clobber_ent
);
346 link
->code_number
= insn_code_number
;
348 /* See if any previous CLOBBER_LIST entry is the same as this
351 for (p
= clobber_list
; p
; p
= p
->next
)
353 if (p
->first_clobber
!= i
+ 1
354 || XVECLEN (p
->pattern
, 1) != XVECLEN (insn
, 1))
357 for (j
= i
+ 1; j
< XVECLEN (insn
, 1); j
++)
359 rtx old
= XEXP (XVECEXP (p
->pattern
, 1, j
), 0);
360 rtx
new = XEXP (XVECEXP (insn
, 1, j
), 0);
362 /* OLD and NEW are the same if both are to be a SCRATCH
364 or if both are registers of the same mode and number. */
365 if (! (GET_MODE (old
) == GET_MODE (new)
366 && ((GET_CODE (old
) == MATCH_SCRATCH
367 && GET_CODE (new) == MATCH_SCRATCH
)
368 || (REG_P (old
) && REG_P (new)
369 && REGNO (old
) == REGNO (new)))))
373 if (j
== XVECLEN (insn
, 1))
379 p
= XNEW (struct clobber_pat
);
383 p
->first_clobber
= i
+ 1;
384 p
->next
= clobber_list
;
385 p
->has_hard_reg
= has_hard_reg
;
389 link
->next
= p
->insns
;
394 /* Don't mention instructions whose names are the null string
395 or begin with '*'. They are in the machine description just
397 if (XSTR (insn
, 0)[0] == 0 || XSTR (insn
, 0)[0] == '*')
400 printf ("/* %s:%d */\n", read_rtx_filename
, lineno
);
402 /* Find out how many operands this function has. */
403 operands
= max_operand_vec (insn
, 1);
404 if (max_dup_opno
>= operands
)
405 fatal ("match_dup operand number has no match_operand");
407 /* Output the function name and argument declarations. */
408 printf ("rtx\ngen_%s (", XSTR (insn
, 0));
410 for (i
= 0; i
< operands
; i
++)
412 printf (",\n\trtx operand%d ATTRIBUTE_UNUSED", i
);
414 printf ("rtx operand%d ATTRIBUTE_UNUSED", i
);
420 /* Output code to construct and return the rtl for the instruction body. */
422 if (XVECLEN (insn
, 1) == 1)
425 gen_exp (XVECEXP (insn
, 1, 0), DEFINE_INSN
, NULL
);
430 char *used
= XCNEWVEC (char, operands
);
432 printf (" return gen_rtx_PARALLEL (VOIDmode, gen_rtvec (%d",
435 for (i
= 0; i
< XVECLEN (insn
, 1); i
++)
438 gen_exp (XVECEXP (insn
, 1, i
), DEFINE_INSN
, used
);
440 printf ("));\n}\n\n");
445 /* Generate the `gen_...' function for a DEFINE_EXPAND. */
448 gen_expand (rtx expand
)
454 if (strlen (XSTR (expand
, 0)) == 0)
455 fatal ("define_expand lacks a name");
456 if (XVEC (expand
, 1) == 0)
457 fatal ("define_expand for %s lacks a pattern", XSTR (expand
, 0));
459 /* Find out how many operands this function has. */
460 operands
= max_operand_vec (expand
, 1);
462 /* Output the function name and argument declarations. */
463 printf ("rtx\ngen_%s (", XSTR (expand
, 0));
465 for (i
= 0; i
< operands
; i
++)
467 printf (",\n\trtx operand%d", i
);
469 printf ("rtx operand%d", i
);
475 /* If we don't have any C code to write, only one insn is being written,
476 and no MATCH_DUPs are present, we can just return the desired insn
477 like we do for a DEFINE_INSN. This saves memory. */
478 if ((XSTR (expand
, 3) == 0 || *XSTR (expand
, 3) == '\0')
479 && operands
> max_dup_opno
480 && XVECLEN (expand
, 1) == 1)
483 gen_exp (XVECEXP (expand
, 1, 0), DEFINE_EXPAND
, NULL
);
488 /* For each operand referred to only with MATCH_DUPs,
489 make a local variable. */
490 for (i
= operands
; i
<= max_dup_opno
; i
++)
491 printf (" rtx operand%d;\n", i
);
492 for (; i
<= max_scratch_opno
; i
++)
493 printf (" rtx operand%d ATTRIBUTE_UNUSED;\n", i
);
494 printf (" rtx _val = 0;\n");
495 printf (" start_sequence ();\n");
497 /* The fourth operand of DEFINE_EXPAND is some code to be executed
498 before the actual construction.
499 This code expects to refer to `operands'
500 just as the output-code in a DEFINE_INSN does,
501 but here `operands' is an automatic array.
502 So copy the operand values there before executing it. */
503 if (XSTR (expand
, 3) && *XSTR (expand
, 3))
506 if (operands
> 0 || max_dup_opno
>= 0 || max_scratch_opno
>= 0)
507 printf (" rtx operands[%d];\n",
508 MAX (operands
, MAX (max_scratch_opno
, max_dup_opno
) + 1));
509 /* Output code to copy the arguments into `operands'. */
510 for (i
= 0; i
< operands
; i
++)
511 printf (" operands[%d] = operand%d;\n", i
, i
);
513 /* Output the special code to be executed before the sequence
515 print_rtx_ptr_loc (XSTR (expand
, 3));
516 printf ("%s\n", XSTR (expand
, 3));
518 /* Output code to copy the arguments back out of `operands'
519 (unless we aren't going to use them at all). */
520 if (XVEC (expand
, 1) != 0)
522 for (i
= 0; i
< operands
; i
++)
523 printf (" operand%d = operands[%d];\n", i
, i
);
524 for (; i
<= max_dup_opno
; i
++)
525 printf (" operand%d = operands[%d];\n", i
, i
);
526 for (; i
<= max_scratch_opno
; i
++)
527 printf (" operand%d = operands[%d];\n", i
, i
);
532 /* Output code to construct the rtl for the instruction bodies.
533 Use emit_insn to add them to the sequence being accumulated.
534 But don't do this if the user's code has set `no_more' nonzero. */
536 used
= XCNEWVEC (char,
537 MAX (operands
, MAX (max_scratch_opno
, max_dup_opno
) + 1));
539 for (i
= 0; i
< XVECLEN (expand
, 1); i
++)
541 rtx next
= XVECEXP (expand
, 1, i
);
542 if ((GET_CODE (next
) == SET
&& GET_CODE (SET_DEST (next
)) == PC
)
543 || (GET_CODE (next
) == PARALLEL
544 && ((GET_CODE (XVECEXP (next
, 0, 0)) == SET
545 && GET_CODE (SET_DEST (XVECEXP (next
, 0, 0))) == PC
)
546 || GET_CODE (XVECEXP (next
, 0, 0)) == RETURN
))
547 || GET_CODE (next
) == RETURN
)
548 printf (" emit_jump_insn (");
549 else if ((GET_CODE (next
) == SET
&& GET_CODE (SET_SRC (next
)) == CALL
)
550 || GET_CODE (next
) == CALL
551 || (GET_CODE (next
) == PARALLEL
552 && GET_CODE (XVECEXP (next
, 0, 0)) == SET
553 && GET_CODE (SET_SRC (XVECEXP (next
, 0, 0))) == CALL
)
554 || (GET_CODE (next
) == PARALLEL
555 && GET_CODE (XVECEXP (next
, 0, 0)) == CALL
))
556 printf (" emit_call_insn (");
557 else if (LABEL_P (next
))
558 printf (" emit_label (");
559 else if (GET_CODE (next
) == MATCH_OPERAND
560 || GET_CODE (next
) == MATCH_DUP
561 || GET_CODE (next
) == MATCH_OPERATOR
562 || GET_CODE (next
) == MATCH_OP_DUP
563 || GET_CODE (next
) == MATCH_PARALLEL
564 || GET_CODE (next
) == MATCH_PAR_DUP
565 || GET_CODE (next
) == PARALLEL
)
568 printf (" emit_insn (");
569 gen_exp (next
, DEFINE_EXPAND
, used
);
571 if (GET_CODE (next
) == SET
&& GET_CODE (SET_DEST (next
)) == PC
572 && GET_CODE (SET_SRC (next
)) == LABEL_REF
)
573 printf (" emit_barrier ();");
578 /* Call `get_insns' to extract the list of all the
579 insns emitted within this gen_... function. */
581 printf (" _val = get_insns ();\n");
582 printf (" end_sequence ();\n");
583 printf (" return _val;\n}\n\n");
586 /* Like gen_expand, but generates insns resulting from splitting SPLIT. */
589 gen_split (rtx split
)
593 const char *const name
=
594 ((GET_CODE (split
) == DEFINE_PEEPHOLE2
) ? "peephole2" : "split");
598 if (XVEC (split
, 0) == 0)
599 fatal ("define_%s (definition %d) lacks a pattern", name
,
601 else if (XVEC (split
, 2) == 0)
602 fatal ("define_%s (definition %d) lacks a replacement pattern", name
,
605 /* Find out how many operands this function has. */
607 max_operand_vec (split
, 2);
608 operands
= MAX (max_opno
, MAX (max_dup_opno
, max_scratch_opno
)) + 1;
609 unused
= (operands
== 0 ? " ATTRIBUTE_UNUSED" : "");
610 used
= XCNEWVEC (char, operands
);
612 /* Output the prototype, function name and argument declarations. */
613 if (GET_CODE (split
) == DEFINE_PEEPHOLE2
)
615 printf ("extern rtx gen_%s_%d (rtx, rtx *);\n",
616 name
, insn_code_number
);
617 printf ("rtx\ngen_%s_%d (rtx curr_insn ATTRIBUTE_UNUSED, rtx *operands%s)\n",
618 name
, insn_code_number
, unused
);
622 printf ("extern rtx gen_split_%d (rtx, rtx *);\n", insn_code_number
);
623 printf ("rtx\ngen_split_%d (rtx curr_insn ATTRIBUTE_UNUSED, rtx *operands%s)\n",
624 insn_code_number
, unused
);
628 /* Declare all local variables. */
629 for (i
= 0; i
< operands
; i
++)
630 printf (" rtx operand%d;\n", i
);
631 printf (" rtx _val = 0;\n");
633 if (GET_CODE (split
) == DEFINE_PEEPHOLE2
)
634 output_peephole2_scratches (split
);
636 printf (" start_sequence ();\n");
638 /* The fourth operand of DEFINE_SPLIT is some code to be executed
639 before the actual construction. */
643 print_rtx_ptr_loc (XSTR (split
, 3));
644 printf ("%s\n", XSTR (split
, 3));
647 /* Output code to copy the arguments back out of `operands' */
648 for (i
= 0; i
< operands
; i
++)
649 printf (" operand%d = operands[%d];\n", i
, i
);
651 /* Output code to construct the rtl for the instruction bodies.
652 Use emit_insn to add them to the sequence being accumulated.
653 But don't do this if the user's code has set `no_more' nonzero. */
655 for (i
= 0; i
< XVECLEN (split
, 2); i
++)
657 rtx next
= XVECEXP (split
, 2, i
);
658 if ((GET_CODE (next
) == SET
&& GET_CODE (SET_DEST (next
)) == PC
)
659 || (GET_CODE (next
) == PARALLEL
660 && GET_CODE (XVECEXP (next
, 0, 0)) == SET
661 && GET_CODE (SET_DEST (XVECEXP (next
, 0, 0))) == PC
)
662 || GET_CODE (next
) == RETURN
)
663 printf (" emit_jump_insn (");
664 else if ((GET_CODE (next
) == SET
&& GET_CODE (SET_SRC (next
)) == CALL
)
665 || GET_CODE (next
) == CALL
666 || (GET_CODE (next
) == PARALLEL
667 && GET_CODE (XVECEXP (next
, 0, 0)) == SET
668 && GET_CODE (SET_SRC (XVECEXP (next
, 0, 0))) == CALL
)
669 || (GET_CODE (next
) == PARALLEL
670 && GET_CODE (XVECEXP (next
, 0, 0)) == CALL
))
671 printf (" emit_call_insn (");
672 else if (LABEL_P (next
))
673 printf (" emit_label (");
674 else if (GET_CODE (next
) == MATCH_OPERAND
675 || GET_CODE (next
) == MATCH_OPERATOR
676 || GET_CODE (next
) == MATCH_PARALLEL
677 || GET_CODE (next
) == MATCH_OP_DUP
678 || GET_CODE (next
) == MATCH_DUP
679 || GET_CODE (next
) == PARALLEL
)
682 printf (" emit_insn (");
683 gen_exp (next
, GET_CODE (split
), used
);
685 if (GET_CODE (next
) == SET
&& GET_CODE (SET_DEST (next
)) == PC
686 && GET_CODE (SET_SRC (next
)) == LABEL_REF
)
687 printf (" emit_barrier ();");
690 /* Call `get_insns' to make a list of all the
691 insns emitted within this gen_... function. */
693 printf (" _val = get_insns ();\n");
694 printf (" end_sequence ();\n");
695 printf (" return _val;\n}\n\n");
700 /* Write a function, `add_clobbers', that is given a PARALLEL of sufficient
701 size for the insn and an INSN_CODE, and inserts the required CLOBBERs at
702 the end of the vector. */
705 output_add_clobbers (void)
707 struct clobber_pat
*clobber
;
708 struct clobber_ent
*ent
;
711 printf ("\n\nvoid\nadd_clobbers (rtx pattern ATTRIBUTE_UNUSED, int insn_code_number)\n");
713 printf (" switch (insn_code_number)\n");
716 for (clobber
= clobber_list
; clobber
; clobber
= clobber
->next
)
718 for (ent
= clobber
->insns
; ent
; ent
= ent
->next
)
719 printf (" case %d:\n", ent
->code_number
);
721 for (i
= clobber
->first_clobber
; i
< XVECLEN (clobber
->pattern
, 1); i
++)
723 printf (" XVECEXP (pattern, 0, %d) = ", i
);
724 gen_exp (XVECEXP (clobber
->pattern
, 1, i
),
725 GET_CODE (clobber
->pattern
), NULL
);
729 printf (" break;\n\n");
732 printf (" default:\n");
733 printf (" gcc_unreachable ();\n");
738 /* Write a function, `added_clobbers_hard_reg_p' that is given an insn_code
739 number that will have clobbers added (as indicated by `recog') and returns
740 1 if those include a clobber of a hard reg or 0 if all of them just clobber
744 output_added_clobbers_hard_reg_p (void)
746 struct clobber_pat
*clobber
;
747 struct clobber_ent
*ent
;
750 printf ("\n\nint\nadded_clobbers_hard_reg_p (int insn_code_number)\n");
752 printf (" switch (insn_code_number)\n");
755 for (clobber_p
= 0; clobber_p
<= 1; clobber_p
++)
758 for (clobber
= clobber_list
; clobber
; clobber
= clobber
->next
)
759 if (clobber
->has_hard_reg
== clobber_p
)
760 for (ent
= clobber
->insns
; ent
; ent
= ent
->next
)
762 printf (" case %d:\n", ent
->code_number
);
767 printf (" return %d;\n\n", clobber_p
);
770 printf (" default:\n");
771 printf (" gcc_unreachable ();\n");
776 /* Generate code to invoke find_free_register () as needed for the
777 scratch registers used by the peephole2 pattern in SPLIT. */
780 output_peephole2_scratches (rtx split
)
785 printf (" HARD_REG_SET _regs_allocated;\n");
786 printf (" CLEAR_HARD_REG_SET (_regs_allocated);\n");
788 for (i
= 0; i
< XVECLEN (split
, 0); i
++)
790 rtx elt
= XVECEXP (split
, 0, i
);
791 if (GET_CODE (elt
) == MATCH_SCRATCH
)
793 int last_insn_nr
= insn_nr
;
794 int cur_insn_nr
= insn_nr
;
796 for (j
= i
+ 1; j
< XVECLEN (split
, 0); j
++)
797 if (GET_CODE (XVECEXP (split
, 0, j
)) == MATCH_DUP
)
799 if (XINT (XVECEXP (split
, 0, j
), 0) == XINT (elt
, 0))
800 last_insn_nr
= cur_insn_nr
;
802 else if (GET_CODE (XVECEXP (split
, 0, j
)) != MATCH_SCRATCH
)
805 printf (" if ((operands[%d] = peep2_find_free_register (%d, %d, \"%s\", %smode, &_regs_allocated)) == NULL_RTX)\n\
808 insn_nr
, last_insn_nr
,
810 GET_MODE_NAME (GET_MODE (elt
)));
813 else if (GET_CODE (elt
) != MATCH_DUP
)
819 main (int argc
, char **argv
)
823 progname
= "genemit";
825 if (init_md_reader_args (argc
, argv
) != SUCCESS_EXIT_CODE
)
826 return (FATAL_EXIT_CODE
);
828 /* Assign sequential codes to all entries in the machine description
829 in parallel with the tables in insn-output.c. */
831 insn_code_number
= 0;
832 insn_index_number
= 0;
834 printf ("/* Generated automatically by the program `genemit'\n\
835 from the machine description file `md'. */\n\n");
837 printf ("#include \"config.h\"\n");
838 printf ("#include \"system.h\"\n");
839 printf ("#include \"coretypes.h\"\n");
840 printf ("#include \"tm.h\"\n");
841 printf ("#include \"rtl.h\"\n");
842 printf ("#include \"tm_p.h\"\n");
843 printf ("#include \"function.h\"\n");
844 printf ("#include \"expr.h\"\n");
845 printf ("#include \"optabs.h\"\n");
846 printf ("#include \"real.h\"\n");
847 printf ("#include \"dfp.h\"\n");
848 printf ("#include \"flags.h\"\n");
849 printf ("#include \"output.h\"\n");
850 printf ("#include \"insn-config.h\"\n");
851 printf ("#include \"hard-reg-set.h\"\n");
852 printf ("#include \"recog.h\"\n");
853 printf ("#include \"resource.h\"\n");
854 printf ("#include \"reload.h\"\n");
855 printf ("#include \"toplev.h\"\n");
856 printf ("#include \"regs.h\"\n");
857 printf ("#include \"tm-constrs.h\"\n");
858 printf ("#include \"ggc.h\"\n");
859 printf ("#include \"basic-block.h\"\n");
860 printf ("#include \"integrate.h\"\n\n");
861 printf ("#define FAIL return (end_sequence (), _val)\n");
862 printf ("#define DONE return (_val = get_insns (), end_sequence (), _val)\n\n");
864 /* Read the machine description. */
870 desc
= read_md_rtx (&line_no
, &insn_code_number
);
874 switch (GET_CODE (desc
))
877 gen_insn (desc
, line_no
);
881 printf ("/* %s:%d */\n", read_rtx_filename
, line_no
);
886 printf ("/* %s:%d */\n", read_rtx_filename
, line_no
);
890 case DEFINE_PEEPHOLE2
:
891 printf ("/* %s:%d */\n", read_rtx_filename
, line_no
);
901 /* Write out the routines to add CLOBBERs to a pattern and say whether they
902 clobber a hard reg. */
903 output_add_clobbers ();
904 output_added_clobbers_hard_reg_p ();
907 return (ferror (stdout
) != 0 ? FATAL_EXIT_CODE
: SUCCESS_EXIT_CODE
);