This is the mail archive of the gcc@gcc.gnu.org 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]

rtl to asm conversion in scheduler


Hello!

I have a question regarding the Haifa Scheduler in gcc-3.2.3 and your
help would be
very appreciated.

Goal: I would need to get the assembly representation for a single
instruction in haifa-sched.c. The reason for this is that it would be
important to get the opcode which will be produced by a single
instruction (ie ADDU or something) for chosing the right candidate in
the ready-list. For instructions that are represented by patterns
evaluating to more lines of asm-code it would be necessary to get at
least the very first and the last opcode. It would be best to have all
opcodes for sure.

In its final pass gcc-3.2.3 emits assembly code using functions in
final.c. As far as I have seen the work is always done for a single
function at once using the following calls

(main.c)    main -->
(toplev.c)    toplev_main -->
(toplev.c)    do_compile -->
(toplev.c)    compile-file -->
(c-parse.c)    yyparse -->
then ie:
(c-decl.c)    finish_function -->
(c-decl.c)    c_expand_body -->
(toplev.c)    rest_of_compilation -->
where there are several passes and in the end:
(final.c)    final -->
(final.c)    final_scan_insn

I would need something similar for outputting a single instruction such
that the internal representation of the program being parsed is not hurt.

It seems that I somehow need that functionality or some suitable macro
for use within the scheduler. Somehow I will have to invoke the output
part of the patterns assigned to an 'rtx insn', but I just can't figure
out how to do that.
A Macro returning some char* would be fine; or some function that writes
to Disk (not to asm_out_file but somewhere else) would still do the job.

Please feel free to correct mistakes I have made in the description
above; I did not find too much documentation regarding that problem.

Thanks a lot,
  Philipp Glatz.

--
Philipp Maria Glatz
student of telematics @ TUGraz
philippg@sbox.tugraz.at
glatz@student.tugraz.at


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