[PATCH][MSP430][4/4] Implement 64-bit shifts in assembly code
Jeff Law
law@redhat.com
Wed Jun 5 22:35:00 GMT 2019
On 6/4/19 7:17 AM, Jozef Lawrynowicz wrote:
> This patch implements 64-bit shifts in assembly code. Previously, generic C
> library code from libgcc would be used to perform the shifts, which was much
> more costly in terms of code size.
>
> I observed 700 PASS->FAIL regressions from the GCC testsuite alone when these
> 64-bit shifts were implemented incorrectly, hence I've assumed there is
> already adequate test coverage that shifts operate correctly, and I have not
> added new tests to verify their correct execution.
>
> For the following program, the below code size reduction is observed:
> long long a;
>
> int
> main (void)
> {
> a = a >> 4;
> return 0;
> }
>
> With shift patch 3:
> text data bss dec hex filename
> 670 12 26 708 2c4 a.out
> With new patch:
> text data bss dec hex filename
> 512 12 26 550 226 a.out
>
> Ok for trunk?
>
>
> 0004-MSP430-Implement-64-bit-shifts-in-assembly-code.patch
>
> From 3b34b3d005ea63b37cf6a277395a048e55d854b2 Mon Sep 17 00:00:00 2001
> From: Jozef Lawrynowicz <jozef.l@mittosystems.com>
> Date: Mon, 13 May 2019 17:55:27 +0100
> Subject: [PATCH 4/4] MSP430: Implement 64-bit shifts in assembly code
>
> gcc/ChangeLog
>
> 2019-06-04 Jozef Lawrynowicz <jozef.l@mittosystems.com>
>
> * config/msp430/msp430.c (msp430_expand_helper): Setup arguments which
> describe how to perform MSPABI compliant 64-bit shift.
> * config/msp430/msp430.md (ashldi3): New define_expand.
> (ashrdi3): New define_expand.
> (lshrdi3): New define_expand.
>
> libgcc/ChangeLog
>
> 2019-06-04 Jozef Lawrynowicz <jozef.l@mittosystems.com>
>
> * config/msp430/slli.S (__mspabi_sllll): New library function for
> performing a logical left shift of a 64-bit value.
> (__mspabi_srall): New library function for
> performing a arithmetic right shift of a 64-bit value.
> (__mspabi_srlll): New library function for
> performing a logical right shift of a 64-bit value.
>
> gcc/testsuite/ChangeLog
>
> 2019-06-04 Jozef Lawrynowicz <jozef.l@mittosystems.com>
>
> * gcc.target/msp430/mspabi_sllll.c: New test.
> * gcc.target/msp430/mspabi_srall.c: New test.
> * gcc.target/msp430/mspabi_srlll.c: New test.
Going to assume your assembly routines are correct :-)
OK
jeff
More information about the Gcc-patches
mailing list