public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "olegendo at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug target/66235] New: [SH] Optimize tst reg,const movrt sequence Date: Thu, 21 May 2015 08:46:00 -0000 [thread overview] Message-ID: <bug-66235-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66235 Bug ID: 66235 Summary: [SH] Optimize tst reg,const movrt sequence Product: gcc Version: 6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: olegendo at gcc dot gnu.org Target Milestone: --- Target: sh*-*-* The following example: bool test_00 (unsigned int x) { return (x & 0x1042A) != 0; } compiled with -O2 -m4: mov.l .L3,r1 tst r1,r4 mov #-1,r1 rts negc r1,r0 .L4: .align 2 .L3: .long 0x1042A On non-SH2A there is no movrt insn and a !T -> reg move is done via negc. If the preceeding tst insn uses a constant, the constant can be complemented to avoid the negc and #-1 constant load: mov.l .L3,r1 tst r1,r4 rts movt r0 .L4: .align 2 .L3: .long 0xFFFEFBD5 The tstsi_t splitter could be extended to look for a following movrt insn and optimize it accordingly. The downside of doing this is an increased constant pool size, if the original (non-complemented) constant is used for something else. Moreover, it is only beneficial to do this if there are no other negc #-1 movrt insns which share the #-1 constant. On the other hand, sharing the #-1 constant increases the life time of regs and thus increases reg pressure.
next reply other threads:[~2015-05-21 8:46 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2015-05-21 8:46 olegendo at gcc dot gnu.org [this message] 2015-05-21 9:30 ` [Bug target/66235] " olegendo 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-66235-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).