public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Dan Towner <dant@picochip.com>
To: gcc@gcc.gnu.org
Subject: DFA Scheduling Queries
Date: Mon, 21 Oct 2002 09:06:00 -0000	[thread overview]
Message-ID: <3DB40869.3080709@picochip.com> (raw)

Hi all,

I am working on a port of gcc targeting a 16-bit VLIW DSP. I am using 
DFA instruction scheduling, and I have a couple of queries with regard 
to the best way of using this.

The instructions can be divided into the basic classes: simpleAlu, 
complexAlu, loadStore, branch, and multiply. Each VLIW packet has 4 
sub-packets, which can hold:

    1) simpleAlu
    2) simpleAlu or complexAlu
    3) multiply or loadStore or branch
    4) immediate constant

I have created a cpu unit for each of these sub-packets:

   (define_query_cpu_unit "slot0,slot1,slot2,slotC")

I have created reservations for each instruction type, so that it uses 
the correct slots. For example, a simple instruction can go in either 
slot 0 or slot 1:

   (define_insn_reservation "simpleAluInsn" 1
     (and (eq_attr "type" "simpleAlu"))
      "(slot0|slot1)")

Similarly for all the other instructions - they are mapped to the 
appropriate slots.

My first question is how to represent the immediate constant slot. 
Currently, I have defined two forms for each instruction, one with the 
constant, and one without. For example, the above reservation could 
actually be:

  (define_insn_reservation "simpleAluInsn" 1
   (and (eq_attr "type" "simpleAlu") (eq_attr "hasConstant" "false"))
   "(slot0|slot1)")
  (define_insn_reservation "simpleAluInsnWithConst" 1
   (and (eq_attr "type" "simpleAlu") (eq_attr "hasConstant" "true"))
   "(slot0|slot1)+slotC")

Thus, every one of my reservations comes in one of two forms: with and 
without a constant. Is this the best way of representing this 
requirement, or can I do better?

My second question relates to scheduling instruction sequences which use 
status registers. For example, a 32-bit add can be handled as a 16-bit 
add (which generates a carry), followed by a 16-bit add-with-borrow 
(which pulls in and uses the previously generated carry flag). Once the 
first instruction has executed, the second instruction can execute in 
either slot0, or slot1, at any point, *provided no other instructions 
modifies the carry flag* (actually, to be precise, such modifying 
instructions can be executed in slot1, which can't modify the status 
flags). How can I describe such a situation using the DFA scheduler - is 
it even possible?

Thanks,

Dan.

=============================================================================
Daniel Towner
picoChip Designs Ltd., Riverside Buildings, 108, Walcot Street, BATH, 
BA1 5BG
dant@picochip.com
07786 702589


             reply	other threads:[~2002-10-21 13:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-21  9:06 Dan Towner [this message]
2002-10-21  9:37 ` Vladimir Makarov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3DB40869.3080709@picochip.com \
    --to=dant@picochip.com \
    --cc=gcc@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).