public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/99937] New: Optimization needed for ARM with single cycle multiplier
@ 2021-04-06 14:02 mike.robins at talktalk dot net
  2021-04-06 14:20 ` [Bug target/99937] " rguenth at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: mike.robins at talktalk dot net @ 2021-04-06 14:02 UTC (permalink / raw)
  To: gcc-bugs

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".

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-04-07 16:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-06 14:02 [Bug c/99937] New: Optimization needed for ARM with single cycle multiplier mike.robins at talktalk dot net
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

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).