On 6/4/19 7:14 AM, Jozef Lawrynowicz wrote:
> This patch reduces code size by disabling the performance optimized,
> "const_variant" of shift library functions when optimization for size is
> enabled.
>
> For the following program, the below code size reduction is observed:
> long a;
>
> int
> main (void)
> {
> a = a >> 4;
> return 0;
> }
>
> With shift patch 2:
> text data bss dec hex filename
> 522 12 22 556 22c a.out
> New patch:
> text data bss dec hex filename
> 474 12 22 508 1fc a.out
>
> Ok for trunk?
>
>
> 0003-MSP430-Do-not-use-the-performance-optimized-variant-.patch
>
> From 894b6809822ba3a3a1bab3750abe29e03f2a3ad6 Mon Sep 17 00:00:00 2001
> From: Jozef Lawrynowicz <joze...@mittosystems.com>
> Date: Mon, 13 May 2019 17:52:19 +0100
> Subject: [PATCH 3/4] MSP430: Do not use the performance optimized variant of a
> shift by constant amount when optimizing for size
>
> gcc/ChangeLog
>
> 2019-06-04 Jozef Lawrynowicz <joze...@mittosystems.com>
>
> * config/msp430/msp430.md (ashlhi3): Use the const_variant of shift
> library functions only when not optimizing for size.
> (ashlsi3): Likewise.
> (ashrhi3): Likewise.
> (ashrsi3): Likewise.
> (lshrhi3): Likewise.
> (lshrsi3): Likewise.
>
> gcc/testsuite/ChangeLog
>
> 2019-06-04 Jozef Lawrynowicz <joze...@mittosystems.com>
>
> * gcc.target/msp430/size-optimized-shifts.c: New test.
OK
jeff