public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/108009] New: GCC does not produce Pack Halfword instructions
@ 2022-12-07 14:32 chris.sidebottom at arm dot com
  0 siblings, 0 replies; only message in thread
From: chris.sidebottom at arm dot com @ 2022-12-07 14:32 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108009

            Bug ID: 108009
           Summary: GCC does not produce Pack Halfword instructions
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: chris.sidebottom at arm dot com
  Target Milestone: ---

I've been trying to remove a dependency on CMSIS intrinsics
(https://github.com/ARM-software/CMSIS_5/blob/develop/CMSIS/Core/Include/cmsis_gcc.h),
following https://arm-software.github.io/acle/main/acle.html, I should be able
to generate a halfword packing instructions
(https://developer.arm.com/documentation/dui0489/h/arm-and-thumb-instructions/pkhbt-and-pkhtb)
using C, such as:

  int pack(int x, int y) {
      return ((x & 0xFFFFu) << 16) | (y & 0xffffu);
  }

However, `gcc -mcpu=cortex-m4 -O3` results in two instructions rather than the
single halfword packing instruction.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-12-07 14:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-07 14:32 [Bug target/108009] New: GCC does not produce Pack Halfword instructions chris.sidebottom at arm dot com

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