summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/sh/__longjmp.S
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2002-11-15 09:21:07 +0000
committerEric Andersen <andersen@codepoet.org>2002-11-15 09:21:07 +0000
commitbb9393fa99f96a086572d2332e6ac8283b8fe954 (patch)
treee0b2cd05f30a7be4b102d380bea8c9c2203e3582 /libc/sysdeps/linux/sh/__longjmp.S
parent339efdc629aa385769390f69d8bf079ab4e0d50c (diff)
Stefan Allius writes:
Hi Erik, I added the FPU support for the setjmp/longjmp stuff. This patch also moves the code from the bsd*.S files to the setjmp.S file, so we can use simple branch instructions instead of referencing over the .GOT/.PLT section. This makes the PIC code much easier, smaller and faster. (The idea comes from the SPARC target) Bye Stefan
Diffstat (limited to 'libc/sysdeps/linux/sh/__longjmp.S')
-rw-r--r--libc/sysdeps/linux/sh/__longjmp.S16
1 files changed, 16 insertions, 0 deletions
diff --git a/libc/sysdeps/linux/sh/__longjmp.S b/libc/sysdeps/linux/sh/__longjmp.S
index 163801969..7e2b0b16d 100644
--- a/libc/sysdeps/linux/sh/__longjmp.S
+++ b/libc/sysdeps/linux/sh/__longjmp.S
@@ -36,6 +36,21 @@ __longjmp:
mov.l @r4+, r13
mov.l @r4+, r14
mov.l @r4+, r15
+#if defined __UCLIBC_HAS_FLOATS__ && ! defined __UCLIBC_HAS_SOFT_FLOAT__
+ lds.l @r4+, pr
+ ldc.l @r4+, gbr
+ lds.l @r4+, fpscr
+ fmov.s @r4+, fr12
+ fmov.s @r4+, fr13
+ mov r5, r0 /* get the return value in place */
+ tst r0, r0
+ bf.s 1f
+ fmov.s @r4+, fr14
+ mov #1,r0 /* can't let setjmp() return zero! */
+1:
+ rts
+ fmov.s @r4+, fr15
+#else
mov r5, r0 /* get the return value in place */
tst r0, r0
bf.s 1f
@@ -44,5 +59,6 @@ __longjmp:
1:
rts
ldc.l @r4+, gbr
+#endif
.size __longjmp,.-__longjmp;