[PATCH RL78] Update crt0.S

Corinna Vinschen vinschen@redhat.com
Tue Oct 20 13:53:00 GMT 2015


Is the patch ok then, DJ?

On Oct 15 10:35, Kaushik Phatak wrote:
> Hi DJ,
> Thanks for your prompt review.
> 
> >> +        bz      $_bss_zero_done
> >> +        br      $1b
> >> 
> >> +_bss_zero_done:
> 
> >Any reason to not do this?
> >
> >	bnz $1b
> >_bss_zero_done:
> 
> Yes, that should make it more compact, I should have thought of that earlier.
> Please find below an updated patch. This is regression tested and will also reduce code size
> by 2 bytes as compared to the earlier version.
> 
> Best Regards,
> Kaushik
> p.s. Kindly ignore any disclaimers at end of this e-mail as they are auto-inserted.
> 
> 2015-10-15  Kaushik Phatak <kaushik.phatak@kpit.com>
> 
>         * rl78/crt0.S (_start): Fixed code that clears .bss
> 
> ===================================================================
> --- libgloss/rl78/crt0.S	(revision 2805)
> +++ libgloss/rl78/crt0.S	(working copy)
> @@ -176,17 +176,19 @@
>  
>  ;; block fill to .bss
>  
> -	movw	bc, #__bsssize
> -	movw	ax, #0
> -1:	
> -	cmpw	ax, bc
> -	bz	$1f
> -	movw	__bssstart[bc], ax
> -	decw	bc
> -	decw	bc
> -	br	$1b
> -1:	
> +	movw    bc, #__bsssize
> +	movw    ax, #0
> +	cmpw    ax, bc
> +	bz      $_bss_zero_done
> +1:
> +	decw    bc
> +	decw    bc
> +	movw    __bssstart[bc], ax
> +	cmpw    ax, bc
> +	bnz      $1b
>  
> +_bss_zero_done:
> +
>  	call	!!__rl78_init
>  
>  #ifdef PROFILE_SUPPORT	/* Defined in gcrt0.S.  */


Thanks,
Corinna

-- 
Corinna Vinschen
Cygwin Maintainer
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/newlib/attachments/20151020/845c9844/attachment.sig>


More information about the Newlib mailing list