diff mbox

[5/9] Optimise __aeabi_ldivmod (stack manipulation)

Message ID 1402481995-12749-5-git-send-email-charles.baylis@linaro.org
State New
Headers show

Commit Message

Charles Baylis June 11, 2014, 10:19 a.m. UTC
2014-05-22  Charles Baylis  <charles.baylis@linaro.org>

	* config/arm/bpabi.S (__aeabi_ldivmod): Optimise stack manipulation.
---
 libgcc/config/arm/bpabi.S | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

Comments

Richard Earnshaw June 18, 2014, 1:53 p.m. UTC | #1
On 11/06/14 11:19, Charles Baylis wrote:
> 2014-05-22  Charles Baylis  <charles.baylis@linaro.org>
> 
> 	* config/arm/bpabi.S (__aeabi_ldivmod): Optimise stack manipulation.

OK.

R.

> ---
>  libgcc/config/arm/bpabi.S | 14 +++-----------
>  1 file changed, 3 insertions(+), 11 deletions(-)
> 
> diff --git a/libgcc/config/arm/bpabi.S b/libgcc/config/arm/bpabi.S
> index 927e37f..3f9ece5 100644
> --- a/libgcc/config/arm/bpabi.S
> +++ b/libgcc/config/arm/bpabi.S
> @@ -174,18 +174,10 @@ ARM_FUNC_START aeabi_ldivmod
>  	cfi_start	__aeabi_ldivmod, LSYM(Lend_aeabi_ldivmod)
>  	test_div_by_zero	signed
>  
> -	sub	sp, sp, #8
> -#if defined(__thumb2__)
> -	mov	ip, sp
> -	push	{ip, lr}
> -#else
> -	do_push	{sp, lr}
> -#endif
> -98:	cfi_push 98b - __aeabi_ldivmod, 0xe, -0xc, 0x10
> +	push_for_divide	__aeabi_ldivmod
> +	/* arguments in (r0:r1), (r2:r3) and *sp */
>  	bl	SYM(__gnu_ldivmod_helper) __PLT__
> -	ldr	lr, [sp, #4]
> -	add	sp, sp, #8
> -	do_pop	{r2, r3}
> +	pop_for_divide
>  	RET
>  	cfi_end	LSYM(Lend_aeabi_ldivmod)
>  	
>
diff mbox

Patch

diff --git a/libgcc/config/arm/bpabi.S b/libgcc/config/arm/bpabi.S
index 927e37f..3f9ece5 100644
--- a/libgcc/config/arm/bpabi.S
+++ b/libgcc/config/arm/bpabi.S
@@ -174,18 +174,10 @@  ARM_FUNC_START aeabi_ldivmod
 	cfi_start	__aeabi_ldivmod, LSYM(Lend_aeabi_ldivmod)
 	test_div_by_zero	signed
 
-	sub	sp, sp, #8
-#if defined(__thumb2__)
-	mov	ip, sp
-	push	{ip, lr}
-#else
-	do_push	{sp, lr}
-#endif
-98:	cfi_push 98b - __aeabi_ldivmod, 0xe, -0xc, 0x10
+	push_for_divide	__aeabi_ldivmod
+	/* arguments in (r0:r1), (r2:r3) and *sp */
 	bl	SYM(__gnu_ldivmod_helper) __PLT__
-	ldr	lr, [sp, #4]
-	add	sp, sp, #8
-	do_pop	{r2, r3}
+	pop_for_divide
 	RET
 	cfi_end	LSYM(Lend_aeabi_ldivmod)