public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: William Tambe <tambewilliam@gmail.com>
To: Stefan Franke <stefan@franke.ms>
Cc: gcc-help <gcc-help@gcc.gnu.org>
Subject: Re: Make GCC move instructions between a multi-cycle instruction and the next instruction that depends on its result.
Date: Wed, 23 Feb 2022 09:07:14 -0600	[thread overview]
Message-ID: <CAF8i9mOWEQXnJsex+vBGphi-seJroOJi2p+oUjfYgJtth9Y7Xg@mail.gmail.com> (raw)
In-Reply-To: <00a001d82886$7f477db0$7dd67910$@franke.ms>

On Wed, Feb 23, 2022 at 1:26 AM <stefan@franke.ms> wrote:
>
> > -----Ursprüngliche Nachricht-----
> > Von: Gcc-help <gcc-help-bounces+bebbo=bejy.net@gcc.gnu.org> Im
> > Auftrag von Segher Boessenkool
> > Gesendet: Mittwoch, 23. Februar 2022 01:23
> > An: William Tambe <tambewilliam@gmail.com>
> > Cc: gcc-help <gcc-help@gcc.gnu.org>
> > Betreff: Re: Make GCC move instructions between a multi-cycle instruction
> > and the next instruction that depends on its result.
> >
> > On Tue, Feb 22, 2022 at 03:15:55PM -0600, William Tambe via Gcc-help
> > wrote:
> > [snip]
> > > > Without above transformation, `add %4 %7` would cause the cpu to
> > > > wait on `div %4 %5` when it could have executed instructions that do
> > > > not depend on the result of "div".
> > >
> > > How to implement above transformation such that GCC moves instructions
> > > between a multi-cycle instruction and the next instruction that
> > > depends on its result ?
> >
> > GCC has a pretty advanced instruction scheduler.  You can start looking at
> > <https://gcc.gnu.org/onlinedocs/gccint/Scheduling.html> for example?
> >
>
> You should also look at the md files defining an automaton -->
> "define_automaton".
>
> There you model the pipelines, latency etc.p.p. for the cpu.
> Then annotate the insns in the cpu md file with the types from the
> automaton.
> That information can be used by the scheduler and you may still need to
> implement some of the scheduler hooks.
>
> Start looking at a simple cpu.
>

Would it be possible and safe to accomplish above transformation using
TARGET_MACHINE_DEPENDENT_REORG ? If yes, what functions can be used to
move an instruction ?

> Stefan
>

      reply	other threads:[~2022-02-23 15:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-22 19:00 William Tambe
2022-02-22 21:15 ` William Tambe
2022-02-23  0:22   ` Segher Boessenkool
2022-02-23  0:51     ` William Tambe
2022-02-23  7:25     ` AW: " stefan
2022-02-23 15:07       ` William Tambe [this message]

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=CAF8i9mOWEQXnJsex+vBGphi-seJroOJi2p+oUjfYgJtth9Y7Xg@mail.gmail.com \
    --to=tambewilliam@gmail.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=stefan@franke.ms \
    /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).