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 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 (GET_CODE (operand%d), ", XINT (x
, 0));
182 if (GET_MODE (x
) == VOIDmode
)
183 printf ("GET_MODE (operand%d)", XINT (x
, 0));
185 printf ("%smode", GET_MODE_NAME (GET_MODE (x
)));
186 for (i
= 0; i
< XVECLEN (x
, 1); i
++)
189 gen_exp (XVECEXP (x
, 1, i
), subroutine_type
, used
);
195 printf ("gen_rtx (GET_CODE (operand%d)", XINT (x
, 0));
196 printf (", %smode", GET_MODE_NAME (GET_MODE (x
)));
197 for (i
= 0; i
< XVECLEN (x
, 2); i
++)
200 gen_exp (XVECEXP (x
, 2, i
), subroutine_type
, used
);
207 printf ("operand%d", XINT (x
, 0));
211 gen_rtx_scratch (x
, subroutine_type
);
215 fatal ("ADDRESS expression code used in named instruction pattern");
227 printf ("const0_rtx");
228 else if (INTVAL (x
) == 1)
229 printf ("const1_rtx");
230 else if (INTVAL (x
) == -1)
231 printf ("constm1_rtx");
232 else if (INTVAL (x
) == STORE_FLAG_VALUE
)
233 printf ("const_true_rtx");
236 printf ("GEN_INT (");
237 printf (HOST_WIDE_INT_PRINT_DEC_C
, INTVAL (x
));
243 /* These shouldn't be written in MD files. Instead, the appropriate
244 routines in varasm.c should be called. */
253 printf (" (%smode", GET_MODE_NAME (GET_MODE (x
)));
255 fmt
= GET_RTX_FORMAT (code
);
256 len
= GET_RTX_LENGTH (code
);
257 for (i
= 0; i
< len
; i
++)
262 if (fmt
[i
] == 'e' || fmt
[i
] == 'u')
263 gen_exp (XEXP (x
, i
), subroutine_type
, used
);
264 else if (fmt
[i
] == 'i')
265 printf ("%u", XINT (x
, i
));
266 else if (fmt
[i
] == 's')
267 printf ("\"%s\"", XSTR (x
, i
));
268 else if (fmt
[i
] == 'E')
271 printf ("gen_rtvec (%d", XVECLEN (x
, i
));
272 for (j
= 0; j
< XVECLEN (x
, i
); j
++)
275 gen_exp (XVECEXP (x
, i
, j
), subroutine_type
, used
);
285 /* Generate the `gen_...' function for a DEFINE_INSN. */
288 gen_insn (rtx insn
, int lineno
)
293 /* See if the pattern for this insn ends with a group of CLOBBERs of (hard)
294 registers or MATCH_SCRATCHes. If so, store away the information for
299 int has_hard_reg
= 0;
301 for (i
= XVECLEN (insn
, 1) - 1; i
> 0; i
--)
303 if (GET_CODE (XVECEXP (insn
, 1, i
)) != CLOBBER
)
306 if (GET_CODE (XEXP (XVECEXP (insn
, 1, i
), 0)) == REG
)
308 else if (GET_CODE (XEXP (XVECEXP (insn
, 1, i
), 0)) != MATCH_SCRATCH
)
312 if (i
!= XVECLEN (insn
, 1) - 1)
314 struct clobber_pat
*p
;
315 struct clobber_ent
*link
= xmalloc (sizeof (struct clobber_ent
));
318 link
->code_number
= insn_code_number
;
320 /* See if any previous CLOBBER_LIST entry is the same as this
323 for (p
= clobber_list
; p
; p
= p
->next
)
325 if (p
->first_clobber
!= i
+ 1
326 || XVECLEN (p
->pattern
, 1) != XVECLEN (insn
, 1))
329 for (j
= i
+ 1; j
< XVECLEN (insn
, 1); j
++)
331 rtx old
= XEXP (XVECEXP (p
->pattern
, 1, j
), 0);
332 rtx
new = XEXP (XVECEXP (insn
, 1, j
), 0);
334 /* OLD and NEW are the same if both are to be a SCRATCH
336 or if both are registers of the same mode and number. */
337 if (! (GET_MODE (old
) == GET_MODE (new)
338 && ((GET_CODE (old
) == MATCH_SCRATCH
339 && GET_CODE (new) == MATCH_SCRATCH
)
340 || (GET_CODE (old
) == REG
&& GET_CODE (new) == REG
341 && REGNO (old
) == REGNO (new)))))
345 if (j
== XVECLEN (insn
, 1))
351 p
= xmalloc (sizeof (struct clobber_pat
));
355 p
->first_clobber
= i
+ 1;
356 p
->next
= clobber_list
;
357 p
->has_hard_reg
= has_hard_reg
;
361 link
->next
= p
->insns
;
366 /* Don't mention instructions whose names are the null string
367 or begin with '*'. They are in the machine description just
369 if (XSTR (insn
, 0)[0] == 0 || XSTR (insn
, 0)[0] == '*')
372 printf ("/* %s:%d */\n", read_rtx_filename
, lineno
);
374 /* Find out how many operands this function has. */
375 operands
= max_operand_vec (insn
, 1);
376 if (max_dup_opno
>= operands
)
377 fatal ("match_dup operand number has no match_operand");
379 /* Output the function name and argument declarations. */
380 printf ("rtx\ngen_%s (", XSTR (insn
, 0));
382 for (i
= 0; i
< operands
; i
++)
384 printf (",\n\trtx operand%d ATTRIBUTE_UNUSED", i
);
386 printf ("rtx operand%d ATTRIBUTE_UNUSED", i
);
392 /* Output code to construct and return the rtl for the instruction body */
394 if (XVECLEN (insn
, 1) == 1)
397 gen_exp (XVECEXP (insn
, 1, 0), DEFINE_INSN
, NULL
);
402 printf (" return gen_rtx_PARALLEL (VOIDmode, gen_rtvec (%d",
405 for (i
= 0; i
< XVECLEN (insn
, 1); i
++)
408 gen_exp (XVECEXP (insn
, 1, i
), DEFINE_INSN
, NULL
);
410 printf ("));\n}\n\n");
414 /* Generate the `gen_...' function for a DEFINE_EXPAND. */
417 gen_expand (rtx expand
)
422 if (strlen (XSTR (expand
, 0)) == 0)
423 fatal ("define_expand lacks a name");
424 if (XVEC (expand
, 1) == 0)
425 fatal ("define_expand for %s lacks a pattern", XSTR (expand
, 0));
427 /* Find out how many operands this function has. */
428 operands
= max_operand_vec (expand
, 1);
430 /* Output the function name and argument declarations. */
431 printf ("rtx\ngen_%s (", XSTR (expand
, 0));
433 for (i
= 0; i
< operands
; i
++)
435 printf (",\n\trtx operand%d", i
);
437 printf ("rtx operand%d", i
);
443 /* If we don't have any C code to write, only one insn is being written,
444 and no MATCH_DUPs are present, we can just return the desired insn
445 like we do for a DEFINE_INSN. This saves memory. */
446 if ((XSTR (expand
, 3) == 0 || *XSTR (expand
, 3) == '\0')
447 && operands
> max_dup_opno
448 && XVECLEN (expand
, 1) == 1)
451 gen_exp (XVECEXP (expand
, 1, 0), DEFINE_EXPAND
, NULL
);
456 /* For each operand referred to only with MATCH_DUPs,
457 make a local variable. */
458 for (i
= operands
; i
<= max_dup_opno
; i
++)
459 printf (" rtx operand%d;\n", i
);
460 for (; i
<= max_scratch_opno
; i
++)
461 printf (" rtx operand%d ATTRIBUTE_UNUSED;\n", i
);
462 printf (" rtx _val = 0;\n");
463 printf (" start_sequence ();\n");
465 /* The fourth operand of DEFINE_EXPAND is some code to be executed
466 before the actual construction.
467 This code expects to refer to `operands'
468 just as the output-code in a DEFINE_INSN does,
469 but here `operands' is an automatic array.
470 So copy the operand values there before executing it. */
471 if (XSTR (expand
, 3) && *XSTR (expand
, 3))
474 if (operands
> 0 || max_dup_opno
>= 0 || max_scratch_opno
>= 0)
475 printf (" rtx operands[%d];\n",
476 MAX (operands
, MAX (max_scratch_opno
, max_dup_opno
) + 1));
477 /* Output code to copy the arguments into `operands'. */
478 for (i
= 0; i
< operands
; i
++)
479 printf (" operands[%d] = operand%d;\n", i
, i
);
481 /* Output the special code to be executed before the sequence
483 printf ("%s\n", XSTR (expand
, 3));
485 /* Output code to copy the arguments back out of `operands'
486 (unless we aren't going to use them at all). */
487 if (XVEC (expand
, 1) != 0)
489 for (i
= 0; i
< operands
; i
++)
490 printf (" operand%d = operands[%d];\n", i
, i
);
491 for (; i
<= max_dup_opno
; i
++)
492 printf (" operand%d = operands[%d];\n", i
, i
);
493 for (; i
<= max_scratch_opno
; i
++)
494 printf (" operand%d = operands[%d];\n", i
, i
);
499 /* Output code to construct the rtl for the instruction bodies.
500 Use emit_insn to add them to the sequence being accumulated.
501 But don't do this if the user's code has set `no_more' nonzero. */
503 for (i
= 0; i
< XVECLEN (expand
, 1); i
++)
505 rtx next
= XVECEXP (expand
, 1, i
);
506 if ((GET_CODE (next
) == SET
&& GET_CODE (SET_DEST (next
)) == PC
)
507 || (GET_CODE (next
) == PARALLEL
508 && ((GET_CODE (XVECEXP (next
, 0, 0)) == SET
509 && GET_CODE (SET_DEST (XVECEXP (next
, 0, 0))) == PC
)
510 || GET_CODE (XVECEXP (next
, 0, 0)) == RETURN
))
511 || GET_CODE (next
) == RETURN
)
512 printf (" emit_jump_insn (");
513 else if ((GET_CODE (next
) == SET
&& GET_CODE (SET_SRC (next
)) == CALL
)
514 || GET_CODE (next
) == CALL
515 || (GET_CODE (next
) == PARALLEL
516 && GET_CODE (XVECEXP (next
, 0, 0)) == SET
517 && GET_CODE (SET_SRC (XVECEXP (next
, 0, 0))) == CALL
)
518 || (GET_CODE (next
) == PARALLEL
519 && GET_CODE (XVECEXP (next
, 0, 0)) == CALL
))
520 printf (" emit_call_insn (");
521 else if (GET_CODE (next
) == CODE_LABEL
)
522 printf (" emit_label (");
523 else if (GET_CODE (next
) == MATCH_OPERAND
524 || GET_CODE (next
) == MATCH_DUP
525 || GET_CODE (next
) == MATCH_OPERATOR
526 || GET_CODE (next
) == MATCH_OP_DUP
527 || GET_CODE (next
) == MATCH_PARALLEL
528 || GET_CODE (next
) == MATCH_PAR_DUP
529 || GET_CODE (next
) == PARALLEL
)
532 printf (" emit_insn (");
533 gen_exp (next
, DEFINE_EXPAND
, NULL
);
535 if (GET_CODE (next
) == SET
&& GET_CODE (SET_DEST (next
)) == PC
536 && GET_CODE (SET_SRC (next
)) == LABEL_REF
)
537 printf (" emit_barrier ();");
540 /* Call `get_insns' to extract the list of all the
541 insns emitted within this gen_... function. */
543 printf (" _val = get_insns ();\n");
544 printf (" end_sequence ();\n");
545 printf (" return _val;\n}\n\n");
548 /* Like gen_expand, but generates insns resulting from splitting SPLIT. */
551 gen_split (rtx split
)
555 const char *const name
=
556 ((GET_CODE (split
) == DEFINE_PEEPHOLE2
) ? "peephole2" : "split");
560 if (XVEC (split
, 0) == 0)
561 fatal ("define_%s (definition %d) lacks a pattern", name
,
563 else if (XVEC (split
, 2) == 0)
564 fatal ("define_%s (definition %d) lacks a replacement pattern", name
,
567 /* Find out how many operands this function has. */
569 max_operand_vec (split
, 2);
570 operands
= MAX (max_opno
, MAX (max_dup_opno
, max_scratch_opno
)) + 1;
571 unused
= (operands
== 0 ? " ATTRIBUTE_UNUSED" : "");
572 used
= xcalloc (1, operands
);
574 /* Output the prototype, function name and argument declarations. */
575 if (GET_CODE (split
) == DEFINE_PEEPHOLE2
)
577 printf ("extern rtx gen_%s_%d (rtx, rtx *);\n",
578 name
, insn_code_number
);
579 printf ("rtx\ngen_%s_%d (rtx curr_insn ATTRIBUTE_UNUSED, rtx *operands%s)\n",
580 name
, insn_code_number
, unused
);
584 printf ("extern rtx gen_split_%d (rtx *);\n", insn_code_number
);
585 printf ("rtx\ngen_%s_%d (rtx *operands%s)\n", name
, insn_code_number
, unused
);
589 /* Declare all local variables. */
590 for (i
= 0; i
< operands
; i
++)
591 printf (" rtx operand%d;\n", i
);
592 printf (" rtx _val = 0;\n");
594 if (GET_CODE (split
) == DEFINE_PEEPHOLE2
)
595 output_peephole2_scratches (split
);
597 printf (" start_sequence ();\n");
599 /* The fourth operand of DEFINE_SPLIT is some code to be executed
600 before the actual construction. */
603 printf ("%s\n", XSTR (split
, 3));
605 /* Output code to copy the arguments back out of `operands' */
606 for (i
= 0; i
< operands
; i
++)
607 printf (" operand%d = operands[%d];\n", i
, i
);
609 /* Output code to construct the rtl for the instruction bodies.
610 Use emit_insn to add them to the sequence being accumulated.
611 But don't do this if the user's code has set `no_more' nonzero. */
613 for (i
= 0; i
< XVECLEN (split
, 2); i
++)
615 rtx next
= XVECEXP (split
, 2, i
);
616 if ((GET_CODE (next
) == SET
&& GET_CODE (SET_DEST (next
)) == PC
)
617 || (GET_CODE (next
) == PARALLEL
618 && GET_CODE (XVECEXP (next
, 0, 0)) == SET
619 && GET_CODE (SET_DEST (XVECEXP (next
, 0, 0))) == PC
)
620 || GET_CODE (next
) == RETURN
)
621 printf (" emit_jump_insn (");
622 else if ((GET_CODE (next
) == SET
&& GET_CODE (SET_SRC (next
)) == CALL
)
623 || GET_CODE (next
) == CALL
624 || (GET_CODE (next
) == PARALLEL
625 && GET_CODE (XVECEXP (next
, 0, 0)) == SET
626 && GET_CODE (SET_SRC (XVECEXP (next
, 0, 0))) == CALL
)
627 || (GET_CODE (next
) == PARALLEL
628 && GET_CODE (XVECEXP (next
, 0, 0)) == CALL
))
629 printf (" emit_call_insn (");
630 else if (GET_CODE (next
) == CODE_LABEL
)
631 printf (" emit_label (");
632 else if (GET_CODE (next
) == MATCH_OPERAND
633 || GET_CODE (next
) == MATCH_OPERATOR
634 || GET_CODE (next
) == MATCH_PARALLEL
635 || GET_CODE (next
) == MATCH_OP_DUP
636 || GET_CODE (next
) == MATCH_DUP
637 || GET_CODE (next
) == PARALLEL
)
640 printf (" emit_insn (");
641 gen_exp (next
, GET_CODE (split
), used
);
643 if (GET_CODE (next
) == SET
&& GET_CODE (SET_DEST (next
)) == PC
644 && GET_CODE (SET_SRC (next
)) == LABEL_REF
)
645 printf (" emit_barrier ();");
648 /* Call `get_insns' to make a list of all the
649 insns emitted within this gen_... function. */
651 printf (" _val = get_insns ();\n");
652 printf (" end_sequence ();\n");
653 printf (" return _val;\n}\n\n");
658 /* Write a function, `add_clobbers', that is given a PARALLEL of sufficient
659 size for the insn and an INSN_CODE, and inserts the required CLOBBERs at
660 the end of the vector. */
663 output_add_clobbers (void)
665 struct clobber_pat
*clobber
;
666 struct clobber_ent
*ent
;
669 printf ("\n\nvoid\nadd_clobbers (rtx pattern ATTRIBUTE_UNUSED, int insn_code_number)\n");
671 printf (" switch (insn_code_number)\n");
674 for (clobber
= clobber_list
; clobber
; clobber
= clobber
->next
)
676 for (ent
= clobber
->insns
; ent
; ent
= ent
->next
)
677 printf (" case %d:\n", ent
->code_number
);
679 for (i
= clobber
->first_clobber
; i
< XVECLEN (clobber
->pattern
, 1); i
++)
681 printf (" XVECEXP (pattern, 0, %d) = ", i
);
682 gen_exp (XVECEXP (clobber
->pattern
, 1, i
),
683 GET_CODE (clobber
->pattern
), NULL
);
687 printf (" break;\n\n");
690 printf (" default:\n");
691 printf (" abort ();\n");
696 /* Write a function, `added_clobbers_hard_reg_p' this is given an insn_code
697 number that needs clobbers and returns 1 if they include a clobber of a
698 hard reg and 0 if they just clobber SCRATCH. */
701 output_added_clobbers_hard_reg_p (void)
703 struct clobber_pat
*clobber
;
704 struct clobber_ent
*ent
;
707 printf ("\n\nint\nadded_clobbers_hard_reg_p (int insn_code_number)\n");
709 printf (" switch (insn_code_number)\n");
712 for (clobber_p
= 0; clobber_p
<= 1; clobber_p
++)
715 for (clobber
= clobber_list
; clobber
; clobber
= clobber
->next
)
716 if (clobber
->has_hard_reg
== clobber_p
)
717 for (ent
= clobber
->insns
; ent
; ent
= ent
->next
)
719 printf (" case %d:\n", ent
->code_number
);
724 printf (" return %d;\n\n", clobber_p
);
727 printf (" default:\n");
728 printf (" abort ();\n");
733 /* Generate code to invoke find_free_register () as needed for the
734 scratch registers used by the peephole2 pattern in SPLIT. */
737 output_peephole2_scratches (rtx split
)
742 printf (" HARD_REG_SET _regs_allocated;\n");
743 printf (" CLEAR_HARD_REG_SET (_regs_allocated);\n");
745 for (i
= 0; i
< XVECLEN (split
, 0); i
++)
747 rtx elt
= XVECEXP (split
, 0, i
);
748 if (GET_CODE (elt
) == MATCH_SCRATCH
)
750 int last_insn_nr
= insn_nr
;
751 int cur_insn_nr
= insn_nr
;
753 for (j
= i
+ 1; j
< XVECLEN (split
, 0); j
++)
754 if (GET_CODE (XVECEXP (split
, 0, j
)) == MATCH_DUP
)
756 if (XINT (XVECEXP (split
, 0, j
), 0) == XINT (elt
, 0))
757 last_insn_nr
= cur_insn_nr
;
759 else if (GET_CODE (XVECEXP (split
, 0, j
)) != MATCH_SCRATCH
)
762 printf (" if ((operands[%d] = peep2_find_free_register (%d, %d, \"%s\", %smode, &_regs_allocated)) == NULL_RTX)\n\
765 insn_nr
, last_insn_nr
,
767 GET_MODE_NAME (GET_MODE (elt
)));
770 else if (GET_CODE (elt
) != MATCH_DUP
)
776 main (int argc
, char **argv
)
780 progname
= "genemit";
783 fatal ("no input file name");
785 if (init_md_reader_args (argc
, argv
) != SUCCESS_EXIT_CODE
)
786 return (FATAL_EXIT_CODE
);
788 /* Assign sequential codes to all entries in the machine description
789 in parallel with the tables in insn-output.c. */
791 insn_code_number
= 0;
792 insn_index_number
= 0;
794 printf ("/* Generated automatically by the program `genemit'\n\
795 from the machine description file `md'. */\n\n");
797 printf ("#include \"config.h\"\n");
798 printf ("#include \"system.h\"\n");
799 printf ("#include \"coretypes.h\"\n");
800 printf ("#include \"tm.h\"\n");
801 printf ("#include \"rtl.h\"\n");
802 printf ("#include \"tm_p.h\"\n");
803 printf ("#include \"function.h\"\n");
804 printf ("#include \"expr.h\"\n");
805 printf ("#include \"optabs.h\"\n");
806 printf ("#include \"real.h\"\n");
807 printf ("#include \"flags.h\"\n");
808 printf ("#include \"output.h\"\n");
809 printf ("#include \"insn-config.h\"\n");
810 printf ("#include \"hard-reg-set.h\"\n");
811 printf ("#include \"recog.h\"\n");
812 printf ("#include \"resource.h\"\n");
813 printf ("#include \"reload.h\"\n");
814 printf ("#include \"toplev.h\"\n");
815 printf ("#include \"ggc.h\"\n\n");
816 printf ("#define FAIL return (end_sequence (), _val)\n");
817 printf ("#define DONE return (_val = get_insns (), end_sequence (), _val)\n\n");
819 /* Read the machine description. */
825 desc
= read_md_rtx (&line_no
, &insn_code_number
);
829 switch (GET_CODE (desc
))
832 gen_insn (desc
, line_no
);
836 printf ("/* %s:%d */\n", read_rtx_filename
, line_no
);
841 printf ("/* %s:%d */\n", read_rtx_filename
, line_no
);
845 case DEFINE_PEEPHOLE2
:
846 printf ("/* %s:%d */\n", read_rtx_filename
, line_no
);
856 /* Write out the routines to add CLOBBERs to a pattern and say whether they
857 clobber a hard reg. */
858 output_add_clobbers ();
859 output_added_clobbers_hard_reg_p ();
862 return (ferror (stdout
) != 0 ? FATAL_EXIT_CODE
: SUCCESS_EXIT_CODE
);
865 /* Define this so we can link with print-rtl.o to get debug_rtx function. */
867 get_insn_name (int code ATTRIBUTE_UNUSED
)