From ba7f440e196c36a3a7b0a36893b1c0465b1ec94d Mon Sep 17 00:00:00 2001 From: "\"Steven J. Hill\"" Date: Tue, 10 Sep 2002 19:50:47 +0000 Subject: Don't unconditionally save/restore FP registers, we might be doing soft floating point. Thanks to Jay Carlson. --- libc/sysdeps/linux/mips/__longjmp.c | 2 ++ libc/sysdeps/linux/mips/setjmp_aux.c | 2 ++ 2 files changed, 4 insertions(+) (limited to 'libc') diff --git a/libc/sysdeps/linux/mips/__longjmp.c b/libc/sysdeps/linux/mips/__longjmp.c index 750a71fd1..ba0498480 100644 --- a/libc/sysdeps/linux/mips/__longjmp.c +++ b/libc/sysdeps/linux/mips/__longjmp.c @@ -38,6 +38,7 @@ __longjmp (env, val_arg) register int val asm ("a1"); /* Pull back the floating point callee-saved registers. */ +#ifndef __mips_soft_float asm volatile ("l.d $f20, %0" : : "m" (env[0].__fpregs[0])); asm volatile ("l.d $f22, %0" : : "m" (env[0].__fpregs[1])); asm volatile ("l.d $f24, %0" : : "m" (env[0].__fpregs[2])); @@ -48,6 +49,7 @@ __longjmp (env, val_arg) /* Get and reconstruct the floating point csr. */ asm volatile ("lw $2, %0" : : "m" (env[0].__fpc_csr)); asm volatile ("ctc1 $2, $31"); +#endif /* Get the GP. */ asm volatile ("lw $gp, %0" : : "m" (env[0].__gp)); diff --git a/libc/sysdeps/linux/mips/setjmp_aux.c b/libc/sysdeps/linux/mips/setjmp_aux.c index b957cea33..21164dbc8 100644 --- a/libc/sysdeps/linux/mips/setjmp_aux.c +++ b/libc/sysdeps/linux/mips/setjmp_aux.c @@ -29,6 +29,7 @@ extern int __sigjmp_save (sigjmp_buf, int); int __sigsetjmp_aux (jmp_buf env, int savemask, int sp, int fp) { +#ifndef __mips_soft_float /* Store the floating point callee-saved registers... */ asm volatile ("s.d $f20, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[0])); asm volatile ("s.d $f22, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[1])); @@ -36,6 +37,7 @@ __sigsetjmp_aux (jmp_buf env, int savemask, int sp, int fp) asm volatile ("s.d $f26, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[3])); asm volatile ("s.d $f28, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[4])); asm volatile ("s.d $f30, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[5])); +#endif /* .. and the PC; */ asm volatile ("sw $31, %0" : : "m" (env[0].__jmpbuf[0].__pc)); -- cgit v1.2.3