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"
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);
/* 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_args (argc, argv) != SUCCESS_EXIT_CODE)
return (FATAL_EXIT_CODE);
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");
/* 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");
}