mn10200/mn10300/AM33: minor space savings
J. Johnston
jjohnstn@cygnus.com
Wed Apr 26 09:18:00 GMT 2000
Alexandre Oliva wrote:
>
> This patch reduces the jmp_buf size to its minimum on mn10200 and
> mn10300, and uses post-increment addressing modes on AM33, when saving
> and restoring extended registers, which reduces the code size. Ok to
> install?
>
>
Yes.
-- Jeff J.
----------------------------------------------------------------------------------------------------
> Index: newlib/ChangeLog
> by Alexandre Oliva <aoliva@cygnus.com>
>
> * libc/include/machine/setjmp.h (_JBLEN, mn10200, mn10300):
> Set to 6.
> (_JBLEN, AM33): Reset to 10.
> * libc/machine/mn10300/setjmp.S (setjmp, longjmp): Use
> post-increment when it is worth it, spacewise.
>
> Index: newlib/libc/include/machine/setjmp.h
> ===================================================================
> RCS file: /cvs/cvsfiles/devo/newlib/libc/include/machine/setjmp.h,v
> retrieving revision 1.56
> diff -u -r1.56 setjmp.h
> --- newlib/libc/include/machine/setjmp.h 1999/11/18 22:34:25 1.56
> +++ newlib/libc/include/machine/setjmp.h 2000/04/26 05:38:28
> @@ -108,8 +108,11 @@
> #endif
>
> #if defined(__mn10300__) || defined(__mn10200__)
> -/* A guess */
> +#define _JBLEN 6
> +#ifdef __AM33__
> +#undef _JBLEN
> #define _JBLEN 10
> +#endif
> #endif
>
> #ifdef __v850
> Index: newlib/libc/machine/mn10300/setjmp.S
> ===================================================================
> RCS file: /cvs/cvsfiles/devo/newlib/libc/machine/mn10300/setjmp.S,v
> retrieving revision 1.5
> diff -u -r1.5 setjmp.S
> --- newlib/libc/machine/mn10300/setjmp.S 1999/12/02 00:41:13 1.5
> +++ newlib/libc/machine/mn10300/setjmp.S 2000/04/26 05:38:29
> @@ -17,10 +17,11 @@
> mov sp,a1
> mov a1,(20,a0)
> #ifdef __AM33__
> - mov r4,(24,a0)
> - mov r5,(28,a0)
> - mov r6,(32,a0)
> - mov r7,(36,a0)
> + add 24,a0
> + mov r4,(a0+)
> + mov r5,(a0+)
> + mov r6,(a0+)
> + mov r7,(a0+)
> #endif
> sub d0,d0
> rets
> @@ -37,10 +38,11 @@
> mov (20,a0),a1
> mov a1,sp
> #ifdef __AM33__
> - mov (24,a0),r4
> - mov (28,a0),r5
> - mov (32,a0),r6
> - mov (36,a0),r7
> + add 24,a0
> + mov (a0+),r4
> + mov (a0+),r5
> + mov (a0+),r6
> + mov (a0+),r7
> #endif
> cmp 0,d1
> bne L1
>
> ----------------------------------------------------------------------------------------------------
>
> --
> Alexandre Oliva Enjoy Guaraná, see http://www.ic.unicamp.br/~oliva/
> Cygnus Solutions, a Red Hat company aoliva@{redhat, cygnus}.com
> Free Software Developer and Evangelist CS PhD student at IC-Unicamp
> oliva@{lsd.ic.unicamp.br, gnu.org} Write to mailing lists, not to me
More information about the Newlib
mailing list