public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "segher at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug ada/64180] New: PowerPC carry bit improvements Date: Thu, 04 Dec 2014 02:23:00 -0000 [thread overview] Message-ID: <bug-64180-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64180 Bug ID: 64180 Summary: PowerPC carry bit improvements Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: ada Assignee: segher at gcc dot gnu.org Reporter: segher at gcc dot gnu.org Target: powerpc*-*-* In current mainline, every RTL instruction that uses XER[CA] (the carry bit) will have to set it in the same instruction, because other instructions clobber it at will. Those RTL insns then are output as multiple machine insns. This is bad for multiple reasons: 1) It leads to code explosion: we have patterns like and_neg_geu. None of those are necessary if we can just express the machine insns as separate RTL insns directly. 2) There are so many possible combinations that some are missed, or deemed not worth the effort (and cost) to implement as RTL insns. This is especially true of the multi-precision add/sub patterns. As a consequence we get not very well optimised code. 3) The resulting insns are not scheduled well. So, let's improve this. THE PLAN ======== First, we need to let GCC know about the CA bit. This is done. GCC thinks the register is SImode or DImode, which is a) fine, because it will never allocate anything to it itself, and we write only 0 or 1 to it; and b) handy, because we have to do arithmetic with it in those modes all the time. Secondly, we need to change all the patterns that clobber CA so that either: a) they don't clobber it anymore; or b) the clobber is explicit. This is partly done. Remaining are two classes of insns: 1) those that should be split into separate insns; and 2) those that slightly regress code quality if changed (mostly those use "addic" so they can use GPR0 as well as all other GPRs). The insns in 1) are the multi-precision add/sub/neg, and all the various eq/ne/ltu/gtu/leu/geu things. These all have to be done at the same time, using... Thirdly, we need to add patterns for the actual machine insns. For things like "addic" we need multiple patterns, one each per kind of immediate op (pos/neg/0/-1), since canonical RTL for those is different. We also should make all asm() clobber CA implicitly, because quite a lot of code in the field clobbers it without telling the compiler. Finally, as a further improvement, we should put some extra attributes on the "C" and "E" insns so that the scheduling descriptions can be made more accurate; and those scheduling descriptions then should be updated.
next reply other threads:[~2014-12-04 2:23 UTC|newest] Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top 2014-12-04 2:23 segher at gcc dot gnu.org [this message] 2014-12-04 18:38 ` [Bug target/64180] " dje at gcc dot gnu.org 2014-12-10 18:29 ` segher at gcc dot gnu.org 2014-12-10 18:31 ` segher at gcc dot gnu.org 2014-12-10 18:31 ` segher at gcc dot gnu.org 2014-12-10 18:32 ` segher at gcc dot gnu.org 2014-12-10 18:34 ` segher at gcc dot gnu.org 2014-12-10 18:36 ` segher at gcc dot gnu.org 2014-12-10 18:38 ` segher at gcc dot gnu.org 2014-12-12 21:20 ` pthaugen at gcc dot gnu.org 2015-01-02 2:16 ` segher at gcc dot gnu.org
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=bug-64180-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@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: linkBe 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).