public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: <stefan@franke.ms>
To: "'gcc-help'" <gcc-help@gcc.gnu.org>
Subject: AW: Make GCC move instructions between a multi-cycle instruction and the next instruction that depends on its result.
Date: Wed, 23 Feb 2022 08:25:13 +0100	[thread overview]
Message-ID: <00a001d82886$7f477db0$7dd67910$@franke.ms> (raw)
In-Reply-To: <20220223002253.GB614@gate.crashing.org>

> -----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.

Stefan


  parent reply	other threads:[~2022-02-23  7:25 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     ` stefan [this message]
2022-02-23 15:07       ` William Tambe

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='00a001d82886$7f477db0$7dd67910$@franke.ms' \
    --to=stefan@franke.ms \
    --cc=gcc-help@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).