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 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 register_constraints
;
36 static int insn_code_number
;
37 static int insn_index_number
;
39 /* Data structure for recording the patterns of insns that have CLOBBERs.
40 We use this to output a function that adds these CLOBBERs to a
41 previously-allocated PARALLEL expression. */
45 struct clobber_ent
*insns
;
48 struct clobber_pat
*next
;
52 /* Records one insn that uses the clobber list. */
56 int code_number
; /* Counts only insns. */
57 struct clobber_ent
*next
;
60 static void max_operand_1 (rtx
);
61 static int max_operand_vec (rtx
, int);
62 static void print_code (RTX_CODE
);
63 static void gen_exp (rtx
, enum rtx_code
, char *);
64 static void gen_insn (rtx
, int);
65 static void gen_expand (rtx
);
66 static void gen_split (rtx
);
67 static void output_add_clobbers (void);
68 static void output_added_clobbers_hard_reg_p (void);
69 static void gen_rtx_scratch (rtx
, enum rtx_code
);
70 static void output_peephole2_scratches (rtx
);
86 if (code
== MATCH_OPERAND
&& XSTR (x
, 2) != 0 && *XSTR (x
, 2) != '\0')
87 register_constraints
= 1;
88 if (code
== MATCH_SCRATCH
&& XSTR (x
, 1) != 0 && *XSTR (x
, 1) != '\0')
89 register_constraints
= 1;
90 if (code
== MATCH_OPERAND
|| code
== MATCH_OPERATOR
91 || code
== MATCH_PARALLEL
)
92 max_opno
= MAX (max_opno
, XINT (x
, 0));
93 if (code
== MATCH_DUP
|| code
== MATCH_OP_DUP
|| code
== MATCH_PAR_DUP
)
94 max_dup_opno
= MAX (max_dup_opno
, XINT (x
, 0));
95 if (code
== MATCH_SCRATCH
)
96 max_scratch_opno
= MAX (max_scratch_opno
, XINT (x
, 0));
98 fmt
= GET_RTX_FORMAT (code
);
99 len
= GET_RTX_LENGTH (code
);
100 for (i
= 0; i
< len
; i
++)
102 if (fmt
[i
] == 'e' || fmt
[i
] == 'u')
103 max_operand_1 (XEXP (x
, i
));
104 else if (fmt
[i
] == 'E')
107 for (j
= 0; j
< XVECLEN (x
, i
); j
++)
108 max_operand_1 (XVECEXP (x
, i
, j
));
114 max_operand_vec (rtx insn
, int arg
)
116 int len
= XVECLEN (insn
, arg
);
121 max_scratch_opno
= -1;
123 for (i
= 0; i
< len
; i
++)
124 max_operand_1 (XVECEXP (insn
, arg
, i
));
130 print_code (RTX_CODE code
)
133 for (p1
= GET_RTX_NAME (code
); *p1
; p1
++)
134 putchar (TOUPPER(*p1
));
138 gen_rtx_scratch (rtx x
, enum rtx_code subroutine_type
)
140 if (subroutine_type
== DEFINE_PEEPHOLE2
)
142 printf ("operand%d", XINT (x
, 0));
146 printf ("gen_rtx_SCRATCH (%smode)", GET_MODE_NAME (GET_MODE (x
)));
150 /* Print a C expression to construct an RTX just like X,
151 substituting any operand references appearing within. */
154 gen_exp (rtx x
, enum rtx_code subroutine_type
, char *used
)
175 if (used
[XINT (x
, 0)])
177 printf ("copy_rtx (operand%d)", XINT (x
, 0));
180 used
[XINT (x
, 0)] = 1;
182 printf ("operand%d", XINT (x
, 0));
186 printf ("gen_rtx (GET_CODE (operand%d), ", XINT (x
, 0));
187 if (GET_MODE (x
) == VOIDmode
)
188 printf ("GET_MODE (operand%d)", XINT (x
, 0));
190 printf ("%smode", GET_MODE_NAME (GET_MODE (x
)));
191 for (i
= 0; i
< XVECLEN (x
, 1); i
++)
194 gen_exp (XVECEXP (x
, 1, i
), subroutine_type
, used
);
200 printf ("gen_rtx (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");
232 printf ("const0_rtx");
233 else if (INTVAL (x
) == 1)
234 printf ("const1_rtx");
235 else if (INTVAL (x
) == -1)
236 printf ("constm1_rtx");
237 else if (INTVAL (x
) == STORE_FLAG_VALUE
)
238 printf ("const_true_rtx");
241 printf ("GEN_INT (");
242 printf (HOST_WIDE_INT_PRINT_DEC_C
, INTVAL (x
));
248 /* These shouldn't be written in MD files. Instead, the appropriate
249 routines in varasm.c should be called. */
258 printf (" (%smode", GET_MODE_NAME (GET_MODE (x
)));
260 fmt
= GET_RTX_FORMAT (code
);
261 len
= GET_RTX_LENGTH (code
);
262 for (i
= 0; i
< len
; i
++)
267 if (fmt
[i
] == 'e' || fmt
[i
] == 'u')
268 gen_exp (XEXP (x
, i
), subroutine_type
, used
);
269 else if (fmt
[i
] == 'i')
270 printf ("%u", XINT (x
, i
));
271 else if (fmt
[i
] == 's')
272 printf ("\"%s\"", XSTR (x
, i
));
273 else if (fmt
[i
] == 'E')
276 printf ("gen_rtvec (%d", XVECLEN (x
, i
));
277 for (j
= 0; j
< XVECLEN (x
, i
); j
++)
280 gen_exp (XVECEXP (x
, i
, j
), subroutine_type
, used
);
290 /* Generate the `gen_...' function for a DEFINE_INSN. */
293 gen_insn (rtx insn
, int lineno
)
298 /* See if the pattern for this insn ends with a group of CLOBBERs of (hard)
299 registers or MATCH_SCRATCHes. If so, store away the information for
304 int has_hard_reg
= 0;
306 for (i
= XVECLEN (insn
, 1) - 1; i
> 0; i
--)
308 if (GET_CODE (XVECEXP (insn
, 1, i
)) != CLOBBER
)
311 if (GET_CODE (XEXP (XVECEXP (insn
, 1, i
), 0)) == REG
)
313 else if (GET_CODE (XEXP (XVECEXP (insn
, 1, i
), 0)) != MATCH_SCRATCH
)
317 if (i
!= XVECLEN (insn
, 1) - 1)
319 struct clobber_pat
*p
;
320 struct clobber_ent
*link
= xmalloc (sizeof (struct clobber_ent
));
323 link
->code_number
= insn_code_number
;
325 /* See if any previous CLOBBER_LIST entry is the same as this
328 for (p
= clobber_list
; p
; p
= p
->next
)
330 if (p
->first_clobber
!= i
+ 1
331 || XVECLEN (p
->pattern
, 1) != XVECLEN (insn
, 1))
334 for (j
= i
+ 1; j
< XVECLEN (insn
, 1); j
++)
336 rtx old
= XEXP (XVECEXP (p
->pattern
, 1, j
), 0);
337 rtx
new = XEXP (XVECEXP (insn
, 1, j
), 0);
339 /* OLD and NEW are the same if both are to be a SCRATCH
341 or if both are registers of the same mode and number. */
342 if (! (GET_MODE (old
) == GET_MODE (new)
343 && ((GET_CODE (old
) == MATCH_SCRATCH
344 && GET_CODE (new) == MATCH_SCRATCH
)
345 || (GET_CODE (old
) == REG
&& GET_CODE (new) == REG
346 && REGNO (old
) == REGNO (new)))))
350 if (j
== XVECLEN (insn
, 1))
356 p
= xmalloc (sizeof (struct clobber_pat
));
360 p
->first_clobber
= i
+ 1;
361 p
->next
= clobber_list
;
362 p
->has_hard_reg
= has_hard_reg
;
366 link
->next
= p
->insns
;
371 /* Don't mention instructions whose names are the null string
372 or begin with '*'. They are in the machine description just
374 if (XSTR (insn
, 0)[0] == 0 || XSTR (insn
, 0)[0] == '*')
377 printf ("/* %s:%d */\n", read_rtx_filename
, lineno
);
379 /* Find out how many operands this function has,
380 and also whether any of them have register constraints. */
381 register_constraints
= 0;
382 operands
= max_operand_vec (insn
, 1);
383 if (max_dup_opno
>= operands
)
384 fatal ("match_dup operand number has no match_operand");
386 /* Output the function name and argument declarations. */
387 printf ("rtx\ngen_%s (", XSTR (insn
, 0));
389 for (i
= 0; i
< operands
; i
++)
391 printf (",\n\trtx operand%d ATTRIBUTE_UNUSED", i
);
393 printf ("rtx operand%d ATTRIBUTE_UNUSED", i
);
399 /* Output code to construct and return the rtl for the instruction body */
401 if (XVECLEN (insn
, 1) == 1)
404 gen_exp (XVECEXP (insn
, 1, 0), DEFINE_INSN
, NULL
);
409 printf (" return gen_rtx_PARALLEL (VOIDmode, gen_rtvec (%d",
412 for (i
= 0; i
< XVECLEN (insn
, 1); i
++)
415 gen_exp (XVECEXP (insn
, 1, i
), DEFINE_INSN
, NULL
);
417 printf ("));\n}\n\n");
421 /* Generate the `gen_...' function for a DEFINE_EXPAND. */
424 gen_expand (rtx expand
)
429 if (strlen (XSTR (expand
, 0)) == 0)
430 fatal ("define_expand lacks a name");
431 if (XVEC (expand
, 1) == 0)
432 fatal ("define_expand for %s lacks a pattern", XSTR (expand
, 0));
434 /* Find out how many operands this function has,
435 and also whether any of them have register constraints. */
436 register_constraints
= 0;
438 operands
= max_operand_vec (expand
, 1);
440 /* Output the function name and argument declarations. */
441 printf ("rtx\ngen_%s (", XSTR (expand
, 0));
443 for (i
= 0; i
< operands
; i
++)
445 printf (",\n\trtx operand%d", i
);
447 printf ("rtx operand%d", i
);
453 /* If we don't have any C code to write, only one insn is being written,
454 and no MATCH_DUPs are present, we can just return the desired insn
455 like we do for a DEFINE_INSN. This saves memory. */
456 if ((XSTR (expand
, 3) == 0 || *XSTR (expand
, 3) == '\0')
457 && operands
> max_dup_opno
458 && XVECLEN (expand
, 1) == 1)
461 gen_exp (XVECEXP (expand
, 1, 0), DEFINE_EXPAND
, NULL
);
466 /* For each operand referred to only with MATCH_DUPs,
467 make a local variable. */
468 for (i
= operands
; i
<= max_dup_opno
; i
++)
469 printf (" rtx operand%d;\n", i
);
470 for (; i
<= max_scratch_opno
; i
++)
471 printf (" rtx operand%d ATTRIBUTE_UNUSED;\n", i
);
472 printf (" rtx _val = 0;\n");
473 printf (" start_sequence ();\n");
475 /* The fourth operand of DEFINE_EXPAND is some code to be executed
476 before the actual construction.
477 This code expects to refer to `operands'
478 just as the output-code in a DEFINE_INSN does,
479 but here `operands' is an automatic array.
480 So copy the operand values there before executing it. */
481 if (XSTR (expand
, 3) && *XSTR (expand
, 3))
484 if (operands
> 0 || max_dup_opno
>= 0 || max_scratch_opno
>= 0)
485 printf (" rtx operands[%d];\n",
486 MAX (operands
, MAX (max_scratch_opno
, max_dup_opno
) + 1));
487 /* Output code to copy the arguments into `operands'. */
488 for (i
= 0; i
< operands
; i
++)
489 printf (" operands[%d] = operand%d;\n", i
, i
);
491 /* Output the special code to be executed before the sequence
493 printf ("%s\n", XSTR (expand
, 3));
495 /* Output code to copy the arguments back out of `operands'
496 (unless we aren't going to use them at all). */
497 if (XVEC (expand
, 1) != 0)
499 for (i
= 0; i
< operands
; i
++)
500 printf (" operand%d = operands[%d];\n", i
, i
);
501 for (; i
<= max_dup_opno
; i
++)
502 printf (" operand%d = operands[%d];\n", i
, i
);
503 for (; i
<= max_scratch_opno
; i
++)
504 printf (" operand%d = operands[%d];\n", i
, i
);
509 /* Output code to construct the rtl for the instruction bodies.
510 Use emit_insn to add them to the sequence being accumulated.
511 But don't do this if the user's code has set `no_more' nonzero. */
513 for (i
= 0; i
< XVECLEN (expand
, 1); i
++)
515 rtx next
= XVECEXP (expand
, 1, i
);
516 if ((GET_CODE (next
) == SET
&& GET_CODE (SET_DEST (next
)) == PC
)
517 || (GET_CODE (next
) == PARALLEL
518 && ((GET_CODE (XVECEXP (next
, 0, 0)) == SET
519 && GET_CODE (SET_DEST (XVECEXP (next
, 0, 0))) == PC
)
520 || GET_CODE (XVECEXP (next
, 0, 0)) == RETURN
))
521 || GET_CODE (next
) == RETURN
)
522 printf (" emit_jump_insn (");
523 else if ((GET_CODE (next
) == SET
&& GET_CODE (SET_SRC (next
)) == CALL
)
524 || GET_CODE (next
) == CALL
525 || (GET_CODE (next
) == PARALLEL
526 && GET_CODE (XVECEXP (next
, 0, 0)) == SET
527 && GET_CODE (SET_SRC (XVECEXP (next
, 0, 0))) == CALL
)
528 || (GET_CODE (next
) == PARALLEL
529 && GET_CODE (XVECEXP (next
, 0, 0)) == CALL
))
530 printf (" emit_call_insn (");
531 else if (GET_CODE (next
) == CODE_LABEL
)
532 printf (" emit_label (");
533 else if (GET_CODE (next
) == MATCH_OPERAND
534 || GET_CODE (next
) == MATCH_DUP
535 || GET_CODE (next
) == MATCH_OPERATOR
536 || GET_CODE (next
) == MATCH_OP_DUP
537 || GET_CODE (next
) == MATCH_PARALLEL
538 || GET_CODE (next
) == MATCH_PAR_DUP
539 || GET_CODE (next
) == PARALLEL
)
542 printf (" emit_insn (");
543 gen_exp (next
, DEFINE_EXPAND
, NULL
);
545 if (GET_CODE (next
) == SET
&& GET_CODE (SET_DEST (next
)) == PC
546 && GET_CODE (SET_SRC (next
)) == LABEL_REF
)
547 printf (" emit_barrier ();");
550 /* Call `get_insns' to extract the list of all the
551 insns emitted within this gen_... function. */
553 printf (" _val = get_insns ();\n");
554 printf (" end_sequence ();\n");
555 printf (" return _val;\n}\n\n");
558 /* Like gen_expand, but generates insns resulting from splitting SPLIT. */
561 gen_split (rtx split
)
565 const char *const name
=
566 ((GET_CODE (split
) == DEFINE_PEEPHOLE2
) ? "peephole2" : "split");
570 if (XVEC (split
, 0) == 0)
571 fatal ("define_%s (definition %d) lacks a pattern", name
,
573 else if (XVEC (split
, 2) == 0)
574 fatal ("define_%s (definition %d) lacks a replacement pattern", name
,
577 /* Find out how many operands this function has. */
579 max_operand_vec (split
, 2);
580 operands
= MAX (max_opno
, MAX (max_dup_opno
, max_scratch_opno
)) + 1;
581 unused
= (operands
== 0 ? " ATTRIBUTE_UNUSED" : "");
582 used
= xcalloc (1, operands
);
584 /* Output the prototype, function name and argument declarations. */
585 if (GET_CODE (split
) == DEFINE_PEEPHOLE2
)
587 printf ("extern rtx gen_%s_%d (rtx, rtx *);\n",
588 name
, insn_code_number
);
589 printf ("rtx\ngen_%s_%d (rtx curr_insn ATTRIBUTE_UNUSED, rtx *operands%s)\n",
590 name
, insn_code_number
, unused
);
594 printf ("extern rtx gen_split_%d (rtx *);\n", insn_code_number
);
595 printf ("rtx\ngen_%s_%d (rtx *operands%s)\n", name
, insn_code_number
, unused
);
599 /* Declare all local variables. */
600 for (i
= 0; i
< operands
; i
++)
601 printf (" rtx operand%d;\n", i
);
602 printf (" rtx _val = 0;\n");
604 if (GET_CODE (split
) == DEFINE_PEEPHOLE2
)
605 output_peephole2_scratches (split
);
607 printf (" start_sequence ();\n");
609 /* The fourth operand of DEFINE_SPLIT is some code to be executed
610 before the actual construction. */
613 printf ("%s\n", XSTR (split
, 3));
615 /* Output code to copy the arguments back out of `operands' */
616 for (i
= 0; i
< operands
; i
++)
617 printf (" operand%d = operands[%d];\n", i
, i
);
619 /* Output code to construct the rtl for the instruction bodies.
620 Use emit_insn to add them to the sequence being accumulated.
621 But don't do this if the user's code has set `no_more' nonzero. */
623 for (i
= 0; i
< XVECLEN (split
, 2); i
++)
625 rtx next
= XVECEXP (split
, 2, i
);
626 if ((GET_CODE (next
) == SET
&& GET_CODE (SET_DEST (next
)) == PC
)
627 || (GET_CODE (next
) == PARALLEL
628 && GET_CODE (XVECEXP (next
, 0, 0)) == SET
629 && GET_CODE (SET_DEST (XVECEXP (next
, 0, 0))) == PC
)
630 || GET_CODE (next
) == RETURN
)
631 printf (" emit_jump_insn (");
632 else if ((GET_CODE (next
) == SET
&& GET_CODE (SET_SRC (next
)) == CALL
)
633 || GET_CODE (next
) == CALL
634 || (GET_CODE (next
) == PARALLEL
635 && GET_CODE (XVECEXP (next
, 0, 0)) == SET
636 && GET_CODE (SET_SRC (XVECEXP (next
, 0, 0))) == CALL
)
637 || (GET_CODE (next
) == PARALLEL
638 && GET_CODE (XVECEXP (next
, 0, 0)) == CALL
))
639 printf (" emit_call_insn (");
640 else if (GET_CODE (next
) == CODE_LABEL
)
641 printf (" emit_label (");
642 else if (GET_CODE (next
) == MATCH_OPERAND
643 || GET_CODE (next
) == MATCH_OPERATOR
644 || GET_CODE (next
) == MATCH_PARALLEL
645 || GET_CODE (next
) == MATCH_OP_DUP
646 || GET_CODE (next
) == MATCH_DUP
647 || GET_CODE (next
) == PARALLEL
)
650 printf (" emit_insn (");
651 gen_exp (next
, GET_CODE (split
), used
);
653 if (GET_CODE (next
) == SET
&& GET_CODE (SET_DEST (next
)) == PC
654 && GET_CODE (SET_SRC (next
)) == LABEL_REF
)
655 printf (" emit_barrier ();");
658 /* Call `get_insns' to make a list of all the
659 insns emitted within this gen_... function. */
661 printf (" _val = get_insns ();\n");
662 printf (" end_sequence ();\n");
663 printf (" return _val;\n}\n\n");
668 /* Write a function, `add_clobbers', that is given a PARALLEL of sufficient
669 size for the insn and an INSN_CODE, and inserts the required CLOBBERs at
670 the end of the vector. */
673 output_add_clobbers (void)
675 struct clobber_pat
*clobber
;
676 struct clobber_ent
*ent
;
679 printf ("\n\nvoid\nadd_clobbers (rtx pattern ATTRIBUTE_UNUSED, int insn_code_number)\n");
681 printf (" switch (insn_code_number)\n");
684 for (clobber
= clobber_list
; clobber
; clobber
= clobber
->next
)
686 for (ent
= clobber
->insns
; ent
; ent
= ent
->next
)
687 printf (" case %d:\n", ent
->code_number
);
689 for (i
= clobber
->first_clobber
; i
< XVECLEN (clobber
->pattern
, 1); i
++)
691 printf (" XVECEXP (pattern, 0, %d) = ", i
);
692 gen_exp (XVECEXP (clobber
->pattern
, 1, i
),
693 GET_CODE (clobber
->pattern
), NULL
);
697 printf (" break;\n\n");
700 printf (" default:\n");
701 printf (" abort ();\n");
706 /* Write a function, `added_clobbers_hard_reg_p' this is given an insn_code
707 number that needs clobbers and returns 1 if they include a clobber of a
708 hard reg and 0 if they just clobber SCRATCH. */
711 output_added_clobbers_hard_reg_p (void)
713 struct clobber_pat
*clobber
;
714 struct clobber_ent
*ent
;
717 printf ("\n\nint\nadded_clobbers_hard_reg_p (int insn_code_number)\n");
719 printf (" switch (insn_code_number)\n");
722 for (clobber_p
= 0; clobber_p
<= 1; clobber_p
++)
725 for (clobber
= clobber_list
; clobber
; clobber
= clobber
->next
)
726 if (clobber
->has_hard_reg
== clobber_p
)
727 for (ent
= clobber
->insns
; ent
; ent
= ent
->next
)
729 printf (" case %d:\n", ent
->code_number
);
734 printf (" return %d;\n\n", clobber_p
);
737 printf (" default:\n");
738 printf (" abort ();\n");
743 /* Generate code to invoke find_free_register () as needed for the
744 scratch registers used by the peephole2 pattern in SPLIT. */
747 output_peephole2_scratches (rtx split
)
752 printf (" HARD_REG_SET _regs_allocated;\n");
753 printf (" CLEAR_HARD_REG_SET (_regs_allocated);\n");
755 for (i
= 0; i
< XVECLEN (split
, 0); i
++)
757 rtx elt
= XVECEXP (split
, 0, i
);
758 if (GET_CODE (elt
) == MATCH_SCRATCH
)
760 int last_insn_nr
= insn_nr
;
761 int cur_insn_nr
= insn_nr
;
763 for (j
= i
+ 1; j
< XVECLEN (split
, 0); j
++)
764 if (GET_CODE (XVECEXP (split
, 0, j
)) == MATCH_DUP
)
766 if (XINT (XVECEXP (split
, 0, j
), 0) == XINT (elt
, 0))
767 last_insn_nr
= cur_insn_nr
;
769 else if (GET_CODE (XVECEXP (split
, 0, j
)) != MATCH_SCRATCH
)
772 printf (" if ((operands[%d] = peep2_find_free_register (%d, %d, \"%s\", %smode, &_regs_allocated)) == NULL_RTX)\n\
775 insn_nr
, last_insn_nr
,
777 GET_MODE_NAME (GET_MODE (elt
)));
780 else if (GET_CODE (elt
) != MATCH_DUP
)
786 main (int argc
, char **argv
)
790 progname
= "genemit";
793 fatal ("no input file name");
795 if (init_md_reader_args (argc
, argv
) != SUCCESS_EXIT_CODE
)
796 return (FATAL_EXIT_CODE
);
798 /* Assign sequential codes to all entries in the machine description
799 in parallel with the tables in insn-output.c. */
801 insn_code_number
= 0;
802 insn_index_number
= 0;
804 printf ("/* Generated automatically by the program `genemit'\n\
805 from the machine description file `md'. */\n\n");
807 printf ("#include \"config.h\"\n");
808 printf ("#include \"system.h\"\n");
809 printf ("#include \"coretypes.h\"\n");
810 printf ("#include \"tm.h\"\n");
811 printf ("#include \"rtl.h\"\n");
812 printf ("#include \"tm_p.h\"\n");
813 printf ("#include \"function.h\"\n");
814 printf ("#include \"expr.h\"\n");
815 printf ("#include \"optabs.h\"\n");
816 printf ("#include \"real.h\"\n");
817 printf ("#include \"flags.h\"\n");
818 printf ("#include \"output.h\"\n");
819 printf ("#include \"insn-config.h\"\n");
820 printf ("#include \"hard-reg-set.h\"\n");
821 printf ("#include \"recog.h\"\n");
822 printf ("#include \"resource.h\"\n");
823 printf ("#include \"reload.h\"\n");
824 printf ("#include \"toplev.h\"\n");
825 printf ("#include \"ggc.h\"\n\n");
826 printf ("#define FAIL return (end_sequence (), _val)\n");
827 printf ("#define DONE return (_val = get_insns (), end_sequence (), _val)\n\n");
829 /* Read the machine description. */
835 desc
= read_md_rtx (&line_no
, &insn_code_number
);
839 switch (GET_CODE (desc
))
842 gen_insn (desc
, line_no
);
846 printf ("/* %s:%d */\n", read_rtx_filename
, line_no
);
851 printf ("/* %s:%d */\n", read_rtx_filename
, line_no
);
855 case DEFINE_PEEPHOLE2
:
856 printf ("/* %s:%d */\n", read_rtx_filename
, line_no
);
866 /* Write out the routines to add CLOBBERs to a pattern and say whether they
867 clobber a hard reg. */
868 output_add_clobbers ();
869 output_added_clobbers_hard_reg_p ();
872 return (ferror (stdout
) != 0 ? FATAL_EXIT_CODE
: SUCCESS_EXIT_CODE
);
875 /* Define this so we can link with print-rtl.o to get debug_rtx function. */
877 get_insn_name (int code ATTRIBUTE_UNUSED
)