public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH][MSP430][0/4] Reduce code size when performing bit shifts
@ 2019-06-04 13:03 Jozef Lawrynowicz
  2019-06-04 13:07 ` [PATCH][MSP430][1/4] Put libgcc shift functions in their own sections Jozef Lawrynowicz
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Jozef Lawrynowicz @ 2019-06-04 13:03 UTC (permalink / raw)
  To: gcc-patches; +Cc: nickc

The following series of patches reduces the code size of MSP430 programs that
make use of bit shifts.
The MSP430 does not have a native instruction for shifting integers, but in
some cases the native rotate instruction can be substituted. In other cases,
assembly code in libgcc is used to emulate the shift.

Successfully regtested the changes with the GCC and G++ testsuites for
msp430-elf, in both the small and large memory models.
I've included some details about the achieved code size reduction in the
individual patch submissions.

Ok for trunk?

jozefl (4):
  Put libgcc shift functions in their own sections
  Emulate 16-bit shifts with rotate insn when src operand is originally in
    memory
  Disable performance optimal library code shifts when optimizing for size
  Implement 64-bit shifts in assembly code

 gcc/config/msp430/msp430.c                         | 13 ++++-
 gcc/config/msp430/msp430.md                        | 66 ++++++++++++++++++----
 gcc/testsuite/gcc.target/msp430/emulate-slli.c     | 15 +++++
 gcc/testsuite/gcc.target/msp430/emulate-srai.c     | 15 +++++
 gcc/testsuite/gcc.target/msp430/emulate-srli.c     | 15 +++++
 gcc/testsuite/gcc.target/msp430/mspabi_sllll.c     | 10 ++++
 gcc/testsuite/gcc.target/msp430/mspabi_srall.c     | 10 ++++
 gcc/testsuite/gcc.target/msp430/mspabi_srlll.c     | 10 ++++
 .../gcc.target/msp430/size-optimized-shifts.c      | 26 +++++++++
 libgcc/config/msp430/slli.S                        | 41 +++++++++++++-
 libgcc/config/msp430/srai.S                        | 42 +++++++++++++-
 libgcc/config/msp430/srli.S                        | 43 +++++++++++++-
 12 files changed, 286 insertions(+), 20 deletions(-)

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

end of thread, other threads:[~2019-06-16 21:42 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-04 13:03 [PATCH][MSP430][0/4] Reduce code size when performing bit shifts Jozef Lawrynowicz
2019-06-04 13:07 ` [PATCH][MSP430][1/4] Put libgcc shift functions in their own sections Jozef Lawrynowicz
2019-06-05 22:20   ` Jeff Law
2019-06-04 13:11 ` [PATCH][MSP430][2/4] Emulate 16-bit shifts with rotate insn when src operand is originally in memory Jozef Lawrynowicz
2019-06-05 22:21   ` Jeff Law
2019-06-04 13:14 ` [PATCH][MSP430][3/4] Disable performance optimal library code shifts when optimizing for size Jozef Lawrynowicz
2019-06-05 22:22   ` Jeff Law
2019-06-04 13:17 ` [PATCH][MSP430][4/4] Implement 64-bit shifts in assembly code Jozef Lawrynowicz
2019-06-05 22:35   ` Jeff Law
2019-06-06 12:42     ` Jozef Lawrynowicz
2019-06-06 17:33       ` Jeff Law
2019-06-16 21:42         ` Jozef Lawrynowicz

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