2013-11-26 Matheus Almeida <Matheus.Almeida@imgtec.com>

* libc/include/machine/setjmp.h: Add support for __mips_fpr being
        64 and treat it the same as if __mips64 is set.
        * libc/machine/mips/setjmp.S: Ditto, plus add checks for _MIPS_SIM
        being _ABIN32 and _ABI64.
This commit is contained in:
Jeff Johnston 2013-11-26 19:58:19 +00:00
parent a50f8f5973
commit a00d2722b6
3 changed files with 44 additions and 12 deletions

View File

@ -1,3 +1,10 @@
2013-11-26 Matheus Almeida <Matheus.Almeida@imgtec.com>
* libc/include/machine/setjmp.h: Add support for __mips_fpr being
64 and treat it the same as if __mips64 is set.
* libc/machine/mips/setjmp.S: Ditto, plus add checks for _MIPS_SIM
being _ABIN32 and _ABI64.
2013-11-26 Joel Sherrill <joel.sherrill@oarcorp.com>
* libc/machine/powerpc/vfscanf.c, libc/stdio/fgetpos.c,

View File

@ -106,14 +106,14 @@ _BEGIN_STD_C
#endif
#ifdef __mips__
#ifdef __mips64
#define _JBTYPE long long
#endif
#ifdef __mips_soft_float
#define _JBLEN 11
#else
#define _JBLEN 23
#endif
# if defined(__mips64) || (__mips_fpr == 64)
# define _JBTYPE long long
# endif
# ifdef __mips_soft_float
# define _JBLEN 11
# else
# define _JBLEN 23
# endif
#endif
#ifdef __m88000__

View File

@ -23,6 +23,24 @@
#define NUM_GPRS_SAVED 11
#ifdef __mips_hard_float
#if _MIPS_SIM == _ABIN32
FPR_OFFSET ($f20, 0); \
FPR_OFFSET ($f22, 1); \
FPR_OFFSET ($f24, 2); \
FPR_OFFSET ($f26, 3); \
FPR_OFFSET ($f28, 4); \
FPR_OFFSET ($f30, 5);
#elif _MIPS_SIM == _ABI64
#define FPR_LAYOUT \
FPR_OFFSET ($f24, 0); \
FPR_OFFSET ($f25, 1); \
FPR_OFFSET ($f26, 2); \
FPR_OFFSET ($f27, 3); \
FPR_OFFSET ($f28, 4); \
FPR_OFFSET ($f29, 5); \
FPR_OFFSET ($f30, 6); \
FPR_OFFSET ($f31, 7);
#else /* Assuming _MIPS_SIM == _ABIO32 */
#define FPR_LAYOUT \
FPR_OFFSET ($f20, 0); \
FPR_OFFSET ($f21, 1); \
@ -35,11 +53,12 @@
FPR_OFFSET ($f28, 8); \
FPR_OFFSET ($f29, 9); \
FPR_OFFSET ($f30, 10); \
FPR_OFFSET ($f31, 11)
FPR_OFFSET ($f31, 11);
#endif
#else
#define FPR_LAYOUT
#endif
#ifdef __mips64
#define BYTES_PER_WORD 8
#define LOAD_GPR ld
@ -47,12 +66,18 @@
#define STORE_GPR sd
#define STORE_FPR sdc1
#else
#define BYTES_PER_WORD 4
#define LOAD_GPR lw
#define LOAD_FPR lwc1
#define STORE_GPR sw
#if __mips_fpr == 64
#define BYTES_PER_WORD 8
#define LOAD_FPR l.d
#define STORE_FPR s.d
#else
#define BYTES_PER_WORD 4
#define LOAD_FPR lwc1
#define STORE_FPR swc1
#endif
#endif
#define GPOFF(INDEX) (INDEX * BYTES_PER_WORD)
#define FPOFF(INDEX) ((INDEX + NUM_GPRS_SAVED) * BYTES_PER_WORD)