02111-1307, USA. */
-#include "hconfig.h"
+#include "bconfig.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "errors.h"
#include "insn-config.h"
gen_insn (insn)
rtx insn;
{
- register int i;
- register struct extraction *p;
- register struct code_ptr *link;
+ int i;
+ struct extraction *p;
+ struct code_ptr *link;
op_count = 0;
dup_count = 0;
rtx x;
const char *path;
{
- register RTX_CODE code;
- register int i;
- register int len;
- register const char *fmt;
+ RTX_CODE code;
+ int i;
+ int len;
+ const char *fmt;
int depth = strlen (path);
char *newpath;
break;
case MATCH_DUP:
- case MATCH_PAR_DUP:
duplocs[dup_count] = xstrdup (path);
dupnums[dup_count] = XINT (x, 0);
dup_count++;
break;
+ case MATCH_PAR_DUP:
case MATCH_OP_DUP:
duplocs[dup_count] = xstrdup (path);
dupnums[dup_count] = XINT (x, 0);
for (i = XVECLEN (x, 1) - 1; i >= 0; i--)
{
- newpath[depth] = '0' + i;
+ newpath[depth] = (code == MATCH_OP_DUP ? '0' : 'a') + i;
walk_rtx (XVECEXP (x, 1, i), newpath);
}
free (newpath);
print_path (path)
const char *path;
{
- register int len = strlen (path);
- register int i;
+ int len = strlen (path);
+ int i;
if (len == 0)
{
/* We first write out the operations (XEXP or XVECEXP) in reverse
order, then write "insn", then the indices in forward order. */
- for (i = len - 1; i >=0 ; i--)
+ for (i = len - 1; i >= 0 ; i--)
{
if (ISLOWER(path[i]))
printf ("XVECEXP (");
progname = "genextract";
if (argc <= 1)
- fatal ("No input file name.");
+ fatal ("no input file name");
- if (init_md_reader (argv[1]) != SUCCESS_EXIT_CODE)
+ if (init_md_reader_args (argc, argv) != SUCCESS_EXIT_CODE)
return (FATAL_EXIT_CODE);
/* Assign sequential codes to all entries in the machine description
printf ("#include \"config.h\"\n");
printf ("#include \"system.h\"\n");
+ printf ("#include \"coretypes.h\"\n");
+ printf ("#include \"tm.h\"\n");
printf ("#include \"rtl.h\"\n");
printf ("#include \"insn-config.h\"\n");
printf ("#include \"recog.h\"\n");
printf ("void\ninsn_extract (insn)\n");
printf (" rtx insn;\n");
printf ("{\n");
- printf (" register rtx *ro = recog_data.operand;\n");
- printf (" register rtx **ro_loc = recog_data.operand_loc;\n");
+ printf (" rtx *ro = recog_data.operand;\n");
+ printf (" rtx **ro_loc = recog_data.operand_loc;\n");
printf (" rtx pat = PATTERN (insn);\n");
printf (" int i ATTRIBUTE_UNUSED;\n\n");
printf (" memset (ro, 0, sizeof (*ro) * MAX_RECOG_OPERANDS);\n");
/* The vector in the insn says how many operands it has.
And all it contains are operands. In fact, the vector was
- created just for the sake of this function. */
+ created just for the sake of this function. We need to set the
+ location of the operands for sake of simplifications after
+ extraction, like eliminating subregs. */
printf (" for (i = XVECLEN (pat, 0) - 1; i >= 0; i--)\n");
- printf (" ro[i] = XVECEXP (pat, 0, i);\n");
+ printf (" ro[i] = *(ro_loc[i] = &XVECEXP (pat, 0, i));\n");
printf (" break;\n\n");
}