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 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
27 #include "gensupport.h"
31 static int max_dup_opno
;
32 static int max_scratch_opno
;
33 static int register_constraints
;
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
PARAMS ((rtx
));
59 static int max_operand_vec
PARAMS ((rtx
, int));
60 static void print_code
PARAMS ((RTX_CODE
));
61 static void gen_exp
PARAMS ((rtx
, enum rtx_code
, char *));
62 static void gen_insn
PARAMS ((rtx
));
63 static void gen_expand
PARAMS ((rtx
));
64 static void gen_split
PARAMS ((rtx
));
65 static void output_add_clobbers
PARAMS ((void));
66 static void output_added_clobbers_hard_reg_p
PARAMS ((void));
67 static void gen_rtx_scratch
PARAMS ((rtx
, enum rtx_code
));
68 static void output_peephole2_scratches
PARAMS ((rtx
));
85 if (code
== MATCH_OPERAND
&& XSTR (x
, 2) != 0 && *XSTR (x
, 2) != '\0')
86 register_constraints
= 1;
87 if (code
== MATCH_SCRATCH
&& XSTR (x
, 1) != 0 && *XSTR (x
, 1) != '\0')
88 register_constraints
= 1;
89 if (code
== MATCH_OPERAND
|| code
== MATCH_OPERATOR
90 || code
== MATCH_PARALLEL
)
91 max_opno
= MAX (max_opno
, XINT (x
, 0));
92 if (code
== MATCH_DUP
|| code
== MATCH_OP_DUP
|| code
== MATCH_PAR_DUP
)
93 max_dup_opno
= MAX (max_dup_opno
, XINT (x
, 0));
94 if (code
== MATCH_SCRATCH
)
95 max_scratch_opno
= MAX (max_scratch_opno
, XINT (x
, 0));
97 fmt
= GET_RTX_FORMAT (code
);
98 len
= GET_RTX_LENGTH (code
);
99 for (i
= 0; i
< len
; i
++)
101 if (fmt
[i
] == 'e' || fmt
[i
] == 'u')
102 max_operand_1 (XEXP (x
, i
));
103 else if (fmt
[i
] == 'E')
106 for (j
= 0; j
< XVECLEN (x
, i
); j
++)
107 max_operand_1 (XVECEXP (x
, i
, j
));
113 max_operand_vec (insn
, arg
)
117 int len
= XVECLEN (insn
, arg
);
122 max_scratch_opno
= -1;
124 for (i
= 0; i
< len
; i
++)
125 max_operand_1 (XVECEXP (insn
, arg
, i
));
135 for (p1
= GET_RTX_NAME (code
); *p1
; p1
++)
136 putchar (TOUPPER(*p1
));
140 gen_rtx_scratch (x
, subroutine_type
)
142 enum rtx_code subroutine_type
;
144 if (subroutine_type
== DEFINE_PEEPHOLE2
)
146 printf ("operand%d", XINT (x
, 0));
150 printf ("gen_rtx_SCRATCH (%smode)", GET_MODE_NAME (GET_MODE (x
)));
154 /* Print a C expression to construct an RTX just like X,
155 substituting any operand references appearing within. */
158 gen_exp (x
, subroutine_type
, used
)
160 enum rtx_code subroutine_type
;
182 if (used
[XINT (x
, 0)])
184 printf ("copy_rtx (operand%d)", XINT (x
, 0));
187 used
[XINT (x
, 0)] = 1;
189 printf ("operand%d", XINT (x
, 0));
193 printf ("gen_rtx (GET_CODE (operand%d), ", XINT (x
, 0));
194 if (GET_MODE (x
) == VOIDmode
)
195 printf ("GET_MODE (operand%d)", XINT (x
, 0));
197 printf ("%smode", GET_MODE_NAME (GET_MODE (x
)));
198 for (i
= 0; i
< XVECLEN (x
, 1); i
++)
201 gen_exp (XVECEXP (x
, 1, i
), subroutine_type
, used
);
207 printf ("gen_rtx (GET_CODE (operand%d)", XINT (x
, 0));
208 printf (", %smode", GET_MODE_NAME (GET_MODE (x
)));
209 for (i
= 0; i
< XVECLEN (x
, 2); i
++)
212 gen_exp (XVECEXP (x
, 2, i
), subroutine_type
, used
);
219 printf ("operand%d", XINT (x
, 0));
223 gen_rtx_scratch (x
, subroutine_type
);
227 fatal ("ADDRESS expression code used in named instruction pattern");
239 printf ("const0_rtx");
240 else if (INTVAL (x
) == 1)
241 printf ("const1_rtx");
242 else if (INTVAL (x
) == -1)
243 printf ("constm1_rtx");
244 else if (INTVAL (x
) == STORE_FLAG_VALUE
)
245 printf ("const_true_rtx");
248 printf ("GEN_INT (");
249 printf (HOST_WIDE_INT_PRINT_DEC
, INTVAL (x
));
255 /* These shouldn't be written in MD files. Instead, the appropriate
256 routines in varasm.c should be called. */
265 printf (" (%smode", GET_MODE_NAME (GET_MODE (x
)));
267 fmt
= GET_RTX_FORMAT (code
);
268 len
= GET_RTX_LENGTH (code
);
269 for (i
= 0; i
< len
; i
++)
274 if (fmt
[i
] == 'e' || fmt
[i
] == 'u')
275 gen_exp (XEXP (x
, i
), subroutine_type
, used
);
276 else if (fmt
[i
] == 'i')
277 printf ("%u", XINT (x
, i
));
278 else if (fmt
[i
] == 's')
279 printf ("\"%s\"", XSTR (x
, i
));
280 else if (fmt
[i
] == 'E')
283 printf ("gen_rtvec (%d", XVECLEN (x
, i
));
284 for (j
= 0; j
< XVECLEN (x
, i
); j
++)
287 gen_exp (XVECEXP (x
, i
, j
), subroutine_type
, used
);
297 /* Generate the `gen_...' function for a DEFINE_INSN. */
306 /* See if the pattern for this insn ends with a group of CLOBBERs of (hard)
307 registers or MATCH_SCRATCHes. If so, store away the information for
312 int has_hard_reg
= 0;
314 for (i
= XVECLEN (insn
, 1) - 1; i
> 0; i
--)
316 if (GET_CODE (XVECEXP (insn
, 1, i
)) != CLOBBER
)
319 if (GET_CODE (XEXP (XVECEXP (insn
, 1, i
), 0)) == REG
)
321 else if (GET_CODE (XEXP (XVECEXP (insn
, 1, i
), 0)) != MATCH_SCRATCH
)
325 if (i
!= XVECLEN (insn
, 1) - 1)
327 struct clobber_pat
*p
;
328 struct clobber_ent
*link
329 = (struct clobber_ent
*) xmalloc (sizeof (struct clobber_ent
));
332 link
->code_number
= insn_code_number
;
334 /* See if any previous CLOBBER_LIST entry is the same as this
337 for (p
= clobber_list
; p
; p
= p
->next
)
339 if (p
->first_clobber
!= i
+ 1
340 || XVECLEN (p
->pattern
, 1) != XVECLEN (insn
, 1))
343 for (j
= i
+ 1; j
< XVECLEN (insn
, 1); j
++)
345 rtx old
= XEXP (XVECEXP (p
->pattern
, 1, j
), 0);
346 rtx
new = XEXP (XVECEXP (insn
, 1, j
), 0);
348 /* OLD and NEW are the same if both are to be a SCRATCH
350 or if both are registers of the same mode and number. */
351 if (! (GET_MODE (old
) == GET_MODE (new)
352 && ((GET_CODE (old
) == MATCH_SCRATCH
353 && GET_CODE (new) == MATCH_SCRATCH
)
354 || (GET_CODE (old
) == REG
&& GET_CODE (new) == REG
355 && REGNO (old
) == REGNO (new)))))
359 if (j
== XVECLEN (insn
, 1))
365 p
= (struct clobber_pat
*) xmalloc (sizeof (struct clobber_pat
));
369 p
->first_clobber
= i
+ 1;
370 p
->next
= clobber_list
;
371 p
->has_hard_reg
= has_hard_reg
;
375 link
->next
= p
->insns
;
380 /* Don't mention instructions whose names are the null string
381 or begin with '*'. They are in the machine description just
383 if (XSTR (insn
, 0)[0] == 0 || XSTR (insn
, 0)[0] == '*')
386 /* Find out how many operands this function has,
387 and also whether any of them have register constraints. */
388 register_constraints
= 0;
389 operands
= max_operand_vec (insn
, 1);
390 if (max_dup_opno
>= operands
)
391 fatal ("match_dup operand number has no match_operand");
393 /* Output the function name and argument declarations. */
394 printf ("rtx\ngen_%s (", XSTR (insn
, 0));
395 for (i
= 0; i
< operands
; i
++)
397 printf (", operand%d", i
);
399 printf ("operand%d", i
);
401 for (i
= 0; i
< operands
; i
++)
402 printf (" rtx operand%d;\n", i
);
405 /* Output code to construct and return the rtl for the instruction body */
407 if (XVECLEN (insn
, 1) == 1)
410 gen_exp (XVECEXP (insn
, 1, 0), DEFINE_INSN
, NULL
);
415 printf (" return gen_rtx_PARALLEL (VOIDmode, gen_rtvec (%d",
418 for (i
= 0; i
< XVECLEN (insn
, 1); i
++)
421 gen_exp (XVECEXP (insn
, 1, i
), DEFINE_INSN
, NULL
);
423 printf ("));\n}\n\n");
427 /* Generate the `gen_...' function for a DEFINE_EXPAND. */
436 if (strlen (XSTR (expand
, 0)) == 0)
437 fatal ("define_expand lacks a name");
438 if (XVEC (expand
, 1) == 0)
439 fatal ("define_expand for %s lacks a pattern", XSTR (expand
, 0));
441 /* Find out how many operands this function has,
442 and also whether any of them have register constraints. */
443 register_constraints
= 0;
445 operands
= max_operand_vec (expand
, 1);
447 /* Output the function name and argument declarations. */
448 printf ("rtx\ngen_%s (", XSTR (expand
, 0));
449 for (i
= 0; i
< operands
; i
++)
451 printf (", operand%d", i
);
453 printf ("operand%d", i
);
455 for (i
= 0; i
< operands
; i
++)
456 printf (" rtx operand%d;\n", i
);
459 /* If we don't have any C code to write, only one insn is being written,
460 and no MATCH_DUPs are present, we can just return the desired insn
461 like we do for a DEFINE_INSN. This saves memory. */
462 if ((XSTR (expand
, 3) == 0 || *XSTR (expand
, 3) == '\0')
463 && operands
> max_dup_opno
464 && XVECLEN (expand
, 1) == 1)
467 gen_exp (XVECEXP (expand
, 1, 0), DEFINE_EXPAND
, NULL
);
472 /* For each operand referred to only with MATCH_DUPs,
473 make a local variable. */
474 for (i
= operands
; i
<= max_dup_opno
; i
++)
475 printf (" rtx operand%d;\n", i
);
476 for (; i
<= max_scratch_opno
; i
++)
477 printf (" rtx operand%d ATTRIBUTE_UNUSED;\n", i
);
478 printf (" rtx _val = 0;\n");
479 printf (" start_sequence ();\n");
481 /* The fourth operand of DEFINE_EXPAND is some code to be executed
482 before the actual construction.
483 This code expects to refer to `operands'
484 just as the output-code in a DEFINE_INSN does,
485 but here `operands' is an automatic array.
486 So copy the operand values there before executing it. */
487 if (XSTR (expand
, 3) && *XSTR (expand
, 3))
490 if (operands
> 0 || max_dup_opno
>= 0 || max_scratch_opno
>= 0)
491 printf (" rtx operands[%d];\n",
492 MAX (operands
, MAX (max_scratch_opno
, max_dup_opno
) + 1));
493 /* Output code to copy the arguments into `operands'. */
494 for (i
= 0; i
< operands
; i
++)
495 printf (" operands[%d] = operand%d;\n", i
, i
);
497 /* Output the special code to be executed before the sequence
499 printf ("%s\n", XSTR (expand
, 3));
501 /* Output code to copy the arguments back out of `operands'
502 (unless we aren't going to use them at all). */
503 if (XVEC (expand
, 1) != 0)
505 for (i
= 0; i
< operands
; i
++)
506 printf (" operand%d = operands[%d];\n", i
, i
);
507 for (; i
<= max_dup_opno
; i
++)
508 printf (" operand%d = operands[%d];\n", i
, i
);
509 for (; i
<= max_scratch_opno
; i
++)
510 printf (" operand%d = operands[%d];\n", i
, i
);
515 /* Output code to construct the rtl for the instruction bodies.
516 Use emit_insn to add them to the sequence being accumulated.
517 But don't do this if the user's code has set `no_more' nonzero. */
519 for (i
= 0; i
< XVECLEN (expand
, 1); i
++)
521 rtx next
= XVECEXP (expand
, 1, i
);
522 if ((GET_CODE (next
) == SET
&& GET_CODE (SET_DEST (next
)) == PC
)
523 || (GET_CODE (next
) == PARALLEL
524 && GET_CODE (XVECEXP (next
, 0, 0)) == SET
525 && GET_CODE (SET_DEST (XVECEXP (next
, 0, 0))) == PC
)
526 || GET_CODE (next
) == RETURN
)
527 printf (" emit_jump_insn (");
528 else if ((GET_CODE (next
) == SET
&& GET_CODE (SET_SRC (next
)) == CALL
)
529 || GET_CODE (next
) == CALL
530 || (GET_CODE (next
) == PARALLEL
531 && GET_CODE (XVECEXP (next
, 0, 0)) == SET
532 && GET_CODE (SET_SRC (XVECEXP (next
, 0, 0))) == CALL
)
533 || (GET_CODE (next
) == PARALLEL
534 && GET_CODE (XVECEXP (next
, 0, 0)) == CALL
))
535 printf (" emit_call_insn (");
536 else if (GET_CODE (next
) == CODE_LABEL
)
537 printf (" emit_label (");
538 else if (GET_CODE (next
) == MATCH_OPERAND
539 || GET_CODE (next
) == MATCH_DUP
540 || GET_CODE (next
) == MATCH_OPERATOR
541 || GET_CODE (next
) == MATCH_OP_DUP
542 || GET_CODE (next
) == MATCH_PARALLEL
543 || GET_CODE (next
) == MATCH_PAR_DUP
544 || GET_CODE (next
) == PARALLEL
)
547 printf (" emit_insn (");
548 gen_exp (next
, DEFINE_EXPAND
, NULL
);
550 if (GET_CODE (next
) == SET
&& GET_CODE (SET_DEST (next
)) == PC
551 && GET_CODE (SET_SRC (next
)) == LABEL_REF
)
552 printf (" emit_barrier ();");
555 /* Call `gen_sequence' to make a SEQUENCE out of all the
556 insns emitted within this gen_... function. */
558 printf (" _val = gen_sequence ();\n");
559 printf (" end_sequence ();\n");
560 printf (" return _val;\n}\n\n");
563 /* Like gen_expand, but generates a SEQUENCE. */
571 const char *const name
=
572 ((GET_CODE (split
) == DEFINE_PEEPHOLE2
) ? "peephole2" : "split");
576 if (XVEC (split
, 0) == 0)
577 fatal ("define_%s (definition %d) lacks a pattern", name
,
579 else if (XVEC (split
, 2) == 0)
580 fatal ("define_%s (definition %d) lacks a replacement pattern", name
,
583 /* Find out how many operands this function has. */
585 max_operand_vec (split
, 2);
586 operands
= MAX (max_opno
, MAX (max_dup_opno
, max_scratch_opno
)) + 1;
587 unused
= (operands
== 0 ? " ATTRIBUTE_UNUSED" : "");
588 used
= xcalloc (1, operands
);
590 /* Output the prototype, function name and argument declarations. */
591 if (GET_CODE (split
) == DEFINE_PEEPHOLE2
)
593 printf ("extern rtx gen_%s_%d PARAMS ((rtx, rtx *));\n",
594 name
, insn_code_number
);
595 printf ("rtx\ngen_%s_%d (curr_insn, operands)\n",
596 name
, insn_code_number
);
597 printf (" rtx curr_insn ATTRIBUTE_UNUSED;\n");
598 printf (" rtx *operands%s;\n", unused
);
602 printf ("extern rtx gen_split_%d PARAMS ((rtx *));\n", insn_code_number
);
603 printf ("rtx\ngen_%s_%d (operands)\n", name
, insn_code_number
);
604 printf (" rtx *operands%s;\n", unused
);
608 /* Declare all local variables. */
609 for (i
= 0; i
< operands
; i
++)
610 printf (" rtx operand%d;\n", i
);
611 printf (" rtx _val = 0;\n");
613 if (GET_CODE (split
) == DEFINE_PEEPHOLE2
)
614 output_peephole2_scratches (split
);
616 printf (" start_sequence ();\n");
618 /* The fourth operand of DEFINE_SPLIT is some code to be executed
619 before the actual construction. */
622 printf ("%s\n", XSTR (split
, 3));
624 /* Output code to copy the arguments back out of `operands' */
625 for (i
= 0; i
< operands
; i
++)
626 printf (" operand%d = operands[%d];\n", i
, i
);
628 /* Output code to construct the rtl for the instruction bodies.
629 Use emit_insn to add them to the sequence being accumulated.
630 But don't do this if the user's code has set `no_more' nonzero. */
632 for (i
= 0; i
< XVECLEN (split
, 2); i
++)
634 rtx next
= XVECEXP (split
, 2, i
);
635 if ((GET_CODE (next
) == SET
&& GET_CODE (SET_DEST (next
)) == PC
)
636 || (GET_CODE (next
) == PARALLEL
637 && GET_CODE (XVECEXP (next
, 0, 0)) == SET
638 && GET_CODE (SET_DEST (XVECEXP (next
, 0, 0))) == PC
)
639 || GET_CODE (next
) == RETURN
)
640 printf (" emit_jump_insn (");
641 else if ((GET_CODE (next
) == SET
&& GET_CODE (SET_SRC (next
)) == CALL
)
642 || GET_CODE (next
) == CALL
643 || (GET_CODE (next
) == PARALLEL
644 && GET_CODE (XVECEXP (next
, 0, 0)) == SET
645 && GET_CODE (SET_SRC (XVECEXP (next
, 0, 0))) == CALL
)
646 || (GET_CODE (next
) == PARALLEL
647 && GET_CODE (XVECEXP (next
, 0, 0)) == CALL
))
648 printf (" emit_call_insn (");
649 else if (GET_CODE (next
) == CODE_LABEL
)
650 printf (" emit_label (");
651 else if (GET_CODE (next
) == MATCH_OPERAND
652 || GET_CODE (next
) == MATCH_OPERATOR
653 || GET_CODE (next
) == MATCH_PARALLEL
654 || GET_CODE (next
) == MATCH_OP_DUP
655 || GET_CODE (next
) == MATCH_DUP
656 || GET_CODE (next
) == PARALLEL
)
659 printf (" emit_insn (");
660 gen_exp (next
, GET_CODE (split
), used
);
662 if (GET_CODE (next
) == SET
&& GET_CODE (SET_DEST (next
)) == PC
663 && GET_CODE (SET_SRC (next
)) == LABEL_REF
)
664 printf (" emit_barrier ();");
667 /* Call `gen_sequence' to make a SEQUENCE out of all the
668 insns emitted within this gen_... function. */
670 printf (" _val = gen_sequence ();\n");
671 printf (" end_sequence ();\n");
672 printf (" return _val;\n}\n\n");
677 /* Write a function, `add_clobbers', that is given a PARALLEL of sufficient
678 size for the insn and an INSN_CODE, and inserts the required CLOBBERs at
679 the end of the vector. */
682 output_add_clobbers ()
684 struct clobber_pat
*clobber
;
685 struct clobber_ent
*ent
;
688 printf ("\n\nvoid\nadd_clobbers (pattern, insn_code_number)\n");
689 printf (" rtx pattern ATTRIBUTE_UNUSED;\n int insn_code_number;\n");
691 printf (" switch (insn_code_number)\n");
694 for (clobber
= clobber_list
; clobber
; clobber
= clobber
->next
)
696 for (ent
= clobber
->insns
; ent
; ent
= ent
->next
)
697 printf (" case %d:\n", ent
->code_number
);
699 for (i
= clobber
->first_clobber
; i
< XVECLEN (clobber
->pattern
, 1); i
++)
701 printf (" XVECEXP (pattern, 0, %d) = ", i
);
702 gen_exp (XVECEXP (clobber
->pattern
, 1, i
),
703 GET_CODE (clobber
->pattern
), NULL
);
707 printf (" break;\n\n");
710 printf (" default:\n");
711 printf (" abort ();\n");
716 /* Write a function, `added_clobbers_hard_reg_p' this is given an insn_code
717 number that needs clobbers and returns 1 if they include a clobber of a
718 hard reg and 0 if they just clobber SCRATCH. */
721 output_added_clobbers_hard_reg_p ()
723 struct clobber_pat
*clobber
;
724 struct clobber_ent
*ent
;
727 printf ("\n\nint\nadded_clobbers_hard_reg_p (insn_code_number)\n");
728 printf (" int insn_code_number;\n");
730 printf (" switch (insn_code_number)\n");
733 for (clobber_p
= 0; clobber_p
<= 1; clobber_p
++)
735 for (clobber
= clobber_list
; clobber
; clobber
= clobber
->next
)
736 if (clobber
->has_hard_reg
== clobber_p
)
737 for (ent
= clobber
->insns
; ent
; ent
= ent
->next
)
738 printf (" case %d:\n", ent
->code_number
);
740 printf (" return %d;\n\n", clobber_p
);
743 printf (" default:\n");
744 printf (" abort ();\n");
749 /* Generate code to invoke find_free_register () as needed for the
750 scratch registers used by the peephole2 pattern in SPLIT. */
753 output_peephole2_scratches (split
)
759 printf (" HARD_REG_SET _regs_allocated;\n");
760 printf (" CLEAR_HARD_REG_SET (_regs_allocated);\n");
762 for (i
= 0; i
< XVECLEN (split
, 0); i
++)
764 rtx elt
= XVECEXP (split
, 0, i
);
765 if (GET_CODE (elt
) == MATCH_SCRATCH
)
767 int last_insn_nr
= insn_nr
;
768 int cur_insn_nr
= insn_nr
;
770 for (j
= i
+ 1; j
< XVECLEN (split
, 0); j
++)
771 if (GET_CODE (XVECEXP (split
, 0, j
)) == MATCH_DUP
)
773 if (XINT (XVECEXP (split
, 0, j
), 0) == XINT (elt
, 0))
774 last_insn_nr
= cur_insn_nr
;
776 else if (GET_CODE (XVECEXP (split
, 0, j
)) != MATCH_SCRATCH
)
779 printf (" if ((operands[%d] = peep2_find_free_register (%d, %d, \"%s\", %smode, &_regs_allocated)) == NULL_RTX)\n\
782 insn_nr
, last_insn_nr
,
784 GET_MODE_NAME (GET_MODE (elt
)));
787 else if (GET_CODE (elt
) != MATCH_DUP
)
792 extern int main
PARAMS ((int, char **));
801 progname
= "genemit";
804 fatal ("no input file name");
806 if (init_md_reader_args (argc
, argv
) != SUCCESS_EXIT_CODE
)
807 return (FATAL_EXIT_CODE
);
809 /* Assign sequential codes to all entries in the machine description
810 in parallel with the tables in insn-output.c. */
812 insn_code_number
= 0;
813 insn_index_number
= 0;
815 printf ("/* Generated automatically by the program `genemit'\n\
816 from the machine description file `md'. */\n\n");
818 printf ("#include \"config.h\"\n");
819 printf ("#include \"system.h\"\n");
820 printf ("#include \"rtl.h\"\n");
821 printf ("#include \"tm_p.h\"\n");
822 printf ("#include \"function.h\"\n");
823 printf ("#include \"expr.h\"\n");
824 printf ("#include \"optabs.h\"\n");
825 printf ("#include \"real.h\"\n");
826 printf ("#include \"flags.h\"\n");
827 printf ("#include \"output.h\"\n");
828 printf ("#include \"insn-config.h\"\n");
829 printf ("#include \"hard-reg-set.h\"\n");
830 printf ("#include \"recog.h\"\n");
831 printf ("#include \"resource.h\"\n");
832 printf ("#include \"reload.h\"\n");
833 printf ("#include \"toplev.h\"\n");
834 printf ("#include \"ggc.h\"\n\n");
835 printf ("#define FAIL return (end_sequence (), _val)\n");
836 printf ("#define DONE return (_val = gen_sequence (), end_sequence (), _val)\n");
838 /* Read the machine description. */
844 desc
= read_md_rtx (&line_no
, &insn_code_number
);
848 switch (GET_CODE (desc
))
862 case DEFINE_PEEPHOLE2
:
872 /* Write out the routines to add CLOBBERs to a pattern and say whether they
873 clobber a hard reg. */
874 output_add_clobbers ();
875 output_added_clobbers_hard_reg_p ();
878 return (ferror (stdout
) != 0 ? FATAL_EXIT_CODE
: SUCCESS_EXIT_CODE
);
881 /* Define this so we can link with print-rtl.o to get debug_rtx function. */
884 int code ATTRIBUTE_UNUSED
;