public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "tilman@code-monkey.de" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug target/56110] New: Sub-optimal code: unnecessary CMP after AND Date: Fri, 25 Jan 2013 17:12:00 -0000 [thread overview] Message-ID: <bug-56110-4@http.gcc.gnu.org/bugzilla/> (raw) http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56110 Bug #: 56110 Summary: Sub-optimal code: unnecessary CMP after AND Classification: Unclassified Product: gcc Version: 4.7.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target AssignedTo: unassigned@gcc.gnu.org ReportedBy: tilman@code-monkey.de Target: arm Compiling this code unsigned f1 (unsigned x, unsigned m) { if (m & 0x008080) x >>= 8; return x; } with gcc 4.7.2 gives this code for ARMv5: $ armv5tel-softfloat-linux-gnueabi-gcc -O2 -S -o- f1.c [...] ldr r3, .L6 and r3, r1, r3 @ XXX cmp r3, #0 @ XXX movne r0, r0, lsr #8 bx lr [...] AFAICS we could get rid of the CMP if we used ANDS instead of AND: ldr r3, .L6 ands r3, r1, r3 movne r0, r0, lsr #8 bx lr
next reply other threads:[~2013-01-25 17:12 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top 2013-01-25 17:12 tilman@code-monkey.de [this message] 2013-02-16 16:49 ` [Bug target/56110] " tilman@code-monkey.de 2013-03-16 9:01 ` tilman@code-monkey.de 2013-08-05 19:36 ` ramana 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-56110-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).