4
0
mirror of git://sourceware.org/git/newlib-cygwin.git synced 2025-01-19 12:59:21 +08:00
Jeff Johnston b8f7ea5ccb 2003-06-24 Kazu Hirata <kazu@cs.umass.edu>
* libc/machine/h8300/setarch.h: New.
        * libc/machine/h8300/memcpy.S: Use it.
        * libc/machine/h8300/memset.S: Likewise.
        * libc/machine/h8300/reg_memcpy.S: Likewise.
        * libc/machine/h8300/reg_memset.S: Likewise.
        * libc/machine/h8300/setjmp.S: Likewise.
        * libc/machine/h8300/strcmp.S: Likewise.
2003-06-24 19:43:58 +00:00

58 lines
830 B
ArmAsm

#include "setarch.h"
.file "setjmp.S"
.section .text
.align 2
.global _setjmp
_setjmp:
#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)
mov.w r5,@(4,r0)
mov.w r4,@(6,r0)
mov.w @sp,r1
mov.w r1,@(8,r0)
sub.w r0,r0
#endif
rts
.global _longjmp
_longjmp:
#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
mov.l er1,er0
#endif
bne .L1
sub er0,er0
adds #1,er0
#else
mov.w @r0+,r7
mov.w @r0+,r6
mov.w @r0+,r5
mov.w @r0+,r4
mov.w @r0,r2
mov.w r2,@sp
mov.w r1,r0
bne .L1
mov.w #1,r0
#endif
.L1:
rts