public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "mike.robins at talktalk dot net" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c/99937] New: Optimization needed for ARM with single cycle multiplier Date: Tue, 06 Apr 2021 14:02:36 +0000 [thread overview] Message-ID: <bug-99937-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99937 Bug ID: 99937 Summary: Optimization needed for ARM with single cycle multiplier Product: gcc Version: 10.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: mike.robins at talktalk dot net Target Milestone: --- Created attachment 50512 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50512&action=edit Source file(s) I am cross-compiling using "arm-none-eabi-gcc -mcpu=cortex-m0plus -Wall -Wextra -fno-strict-aliasing -fwrapv -O3 -S foobar.c" for a target architecture that performs a multiply in a single cycle, using gcc version 10.2.0 on a PC running Fedora Linux. Is there an option to persuade the compiler to use the multiply instruction automatically instead of shifts and adds when multiplying by a constant? In the example code attached, gcc uses the trick of multiplying by a big number instead of dividing by a small one (12 in this case). For my target, the code from "-O3" is both longer and slower then that for "-Os".
next reply other threads:[~2021-04-06 14:02 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-04-06 14:02 mike.robins at talktalk dot net [this message] 2021-04-06 14:20 ` [Bug target/99937] " rguenth at gcc dot gnu.org 2021-04-06 14:41 ` mike.robins at talktalk dot net 2021-04-07 7:11 ` rguenth at gcc dot gnu.org 2021-04-07 16:16 ` mike.robins at talktalk dot net 2021-04-07 16:23 ` clyon 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-99937-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).