From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from franke.ms (serveronline.org [78.46.86.77]) by sourceware.org (Postfix) with ESMTPS id B8C1C394742F for ; Wed, 23 Feb 2022 07:25:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B8C1C394742F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=franke.ms Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=franke.ms Received: from HP (pd9e54f07.dip0.t-ipconnect.de [217.229.79.7]) by serveronline.org (BEJY V1.6.12-SNAPSHOT (c) 2000-2021 by BebboSoft, Stefan "Bebbo" Franke, all rights reserved) with SMTP id 17f25784ebab9f424cfa84bd012 from stefan@franke.ms for gcc-help@gcc.gnu.org; Wed, 23 Feb 2022 08:25:15 +0100 From: To: "'gcc-help'" References: <20220223002253.GB614@gate.crashing.org> In-Reply-To: <20220223002253.GB614@gate.crashing.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 Message-ID: <00a001d82886$7f477db0$7dd67910$@franke.ms> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQGb+wSbS8BWCwg/SoP7B8yTVp7rcQHQyCQKAg5LdvGs+hpIoA== Content-Language: de X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, KAM_SHORT, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-help@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-help mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Feb 2022 07:25:19 -0000 > -----Urspr=FCngliche Nachricht----- > Von: Gcc-help Im > Auftrag von Segher Boessenkool > Gesendet: Mittwoch, 23. Februar 2022 01:23 > An: William Tambe > Cc: gcc-help > Betreff: Re: Make GCC move instructions between a multi-cycle = instruction > and the next instruction that depends on its result. >=20 > 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 ? >=20 > GCC has a pretty advanced instruction scheduler. You can start = looking at > for example? >=20 You should also look at the md files defining an automaton --> "define_automaton".=20 There you model the pipelines, latency etc.p.p. for the cpu.=20 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