diff options
author | Jeff Johnston <jjohnstn@redhat.com> | 2002-11-20 20:24:57 +0300 |
---|---|---|
committer | Jeff Johnston <jjohnstn@redhat.com> | 2002-11-20 20:24:57 +0300 |
commit | 505746ad22f5f15466be71fafb03952587165461 (patch) | |
tree | 9048be90ad74f20070e1243a62616c77692ef3b7 /newlib/libc/machine | |
parent | 647b92a7d420bee9244054947379f026d105def8 (diff) |
2002-11-20 Ryo Tsuruta <ryo@kitanet.ne.jp>
* libc/machine/h8300/setjmp.S (setjmp, longjmp): Combine common
code for __H8300H__ and __H8300S__. Also return 32-bit return code
when -mint32 is used.
Diffstat (limited to 'newlib/libc/machine')
-rw-r--r-- | newlib/libc/machine/h8300/setjmp.S | 33 |
1 files changed, 12 insertions, 21 deletions
diff --git a/newlib/libc/machine/h8300/setjmp.S b/newlib/libc/machine/h8300/setjmp.S index 9e7164095..5c44973c0 100644 --- a/newlib/libc/machine/h8300/setjmp.S +++ b/newlib/libc/machine/h8300/setjmp.S @@ -12,21 +12,14 @@ .align 2 .global _setjmp _setjmp: -#ifdef __H8300H__ - mov.l er7,@er0 - mov.l er6,@(4,er0) - mov.l er5,@(8,er0) - mov.l er4,@(12,er0) - mov.l @sp,er1 - mov.l er1,@(16,er0) -#else -#ifdef __H8300S__ +#if defined(__H8300H__) || defined(__H8300S__) mov.l er7,@er0 mov.l er6,@(4,er0) mov.l er5,@(8,er0) mov.l er4,@(12,er0) mov.l @sp,er1 mov.l er1,@(16,er0) + sub.l er0,er0 #else mov.w r7,@r0 mov.w r6,@(2,r0) @@ -34,28 +27,27 @@ _setjmp: mov.w r4,@(6,r0) mov.w @sp,r1 mov.w r1,@(8,r0) -#endif -#endif sub.w r0,r0 +#endif rts .global _longjmp _longjmp: -#ifdef __H8300H__ +#if defined(__H8300H__) || defined (__H8300S__) mov.l @er0+,er7 mov.l @er0+,er6 mov.l @er0+,er5 mov.l @er0+,er4 mov.l @er0,er2 mov.l er2,@sp +#if (__INT_MAX__ <= 32767) + mov.w r1,r0 #else -#ifdef __H8300S__ - mov.l @er0+,er7 - mov.l @er0+,er6 - mov.l @er0+,er5 - mov.l @er0+,er4 - mov.l @er0,er2 - mov.l er2,@sp + mov.l er1,er0 +#endif + bne .L1 + sub er0,er0 + adds #1,er0 #else mov.w @r0+,r7 mov.w @r0+,r6 @@ -63,10 +55,9 @@ _longjmp: mov.w @r0+,r4 mov.w @r0,r2 mov.w r2,@sp -#endif -#endif mov.w r1,r0 bne .L1 mov.w #1,r0 +#endif .L1: rts |