This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: VLIW scheduling and delayed branch

> When do you un-parallel those instructions? And, how?

I don't; I use a C function to output such an insn group.

In that C function, I basically save the global state of final, and use
functions of final.c to output constitutent insns.

The insn group output function basically looks like this:

first prepare:
  static char buf[256];
  FILE *old_out_file;
  /* open memory file */
  old_out_file = asm_out_file;
  asm_out_file = fmemopen (buf, sizeof(buf), "w");
  gcc_assert (asm_out_file);

then loop over all constitutent insns:
      cleanup_subreg_operands (insn);
      if (! constrain_operands_cached (1))
        fatal_insn_not_found (insn);
      current_output_insn = insn;
      /* Find the proper template for this insn.  */
      template = get_insn_template (insn_code_number, insn);
      gcc_assert (template);
      gcc_assert (!(template[0] == '#' && template[1] == '\0'));
      fprintf (asm_out_file, "\t||");
      output_asm_insn (template, recog_data.operand);
      fseek (asm_out_file, ftell (asm_out_file) - 1, SEEK_SET);

finally cleanup:
  fclose (asm_out_file);
  asm_out_file = old_out_file;
  return &buf[4];

That's why I wrote it's kind of hackish :-)  fmemopen also isn't
necessarily very portable, but is needed since all the final output
routines directly output to a FILE *, and I need to intercept that


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]