[PATCH RL78] Update crt0.S
Kaushik Phatak
Kaushik.Phatak@kpit.com
Mon Oct 19 07:39:00 GMT 2015
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. */
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rl78_crt02.diff
Type: application/octet-stream
Size: 621 bytes
Desc: rl78_crt02.diff
URL: <http://sourceware.org/pipermail/newlib/attachments/20151019/fe7b1ccc/attachment.obj>
More information about the Newlib
mailing list