This is the mail archive of the
mailing list for the GCC project.
Help modifying an existing port.
- From: kernel_learner <kernel_learner at yahoo dot com>
- To: gcc at gcc dot gnu dot org
- Date: Tue, 20 Apr 2004 20:13:28 -0700 (PDT)
- Subject: Help modifying an existing port.
How's it going? I am using an existing GCC Port to an
embedded opensource architecture called OpenRISC
(www.opencores.org/or1k). It's a simple RISC
architecture and the compiler + binutils have already
been ported over to this new architecture.
For a certain project I want to modify the compiler
for this architecture so that it generates code which
always contains two independent instructions next to
each other. If the compiler does not find independent
instructions it should insert a no-op instead.
One of the modifications I made was to assign the
variable "issue_rate" a value of 2", this ensures that
in the scheduler pass in haifa-sched.c in the function
schedule_block() the compiler always "tries" to
schedule two instructions together..the loop that does
/* Issue insns from ready list. */
while (ready.n_ready != 0
&& (*current_sched_info->schedule_more_p) ())
where can_issue_more is initalized to "issue_rate"
When it breaks out of the this loop a non-zero value
in can_issue_more indicates that two independent
instructions were not found and it is at this point
that I need to insert no-op.
I really need help with this part as there are a
couple of things I am not really able to figure out:
1. Creating a new rtx for a NOP instruction
2. How do I add this new NOP instruction into the
existing RTX list.
Any help would be really appreciated.. I would also
like comments on whether my approach of modifying the
function schedule_block() is right or not..at this
point I don't want to do code motion across
basic-blocks to find independent instructions..so my
region is a basic-block
Do you Yahoo!?
Yahoo! Photos: High-quality 4x6 digital prints for 25¢