diff options
Diffstat (limited to 'sysdeps/mips')
135 files changed, 962 insertions, 1177 deletions
diff --git a/sysdeps/mips/Makefile b/sysdeps/mips/Makefile index 3d3552322b..7ac6fa5031 100644 --- a/sysdeps/mips/Makefile +++ b/sysdeps/mips/Makefile @@ -9,10 +9,7 @@ endif ifeq ($(subdir),rt) librt-sysdep_routines += rt-sysdep -endif - -ifeq ($(subdir),debug) -CFLAGS-backtrace.c += -funwind-tables +librt-shared-only-routines += rt-sysdep endif ifeq ($(subdir),csu) @@ -26,6 +23,9 @@ CPPFLAGS-crtn.S += $(pic-ccflag) endif ASFLAGS-.os += $(pic-ccflag) +# libc.a and libc_p.a must be compiled with -fPIE/-fpie for static PIE. +ASFLAGS-.o += $(pie-default) +ASFLAGS-.op += $(pie-default) ifeq ($(subdir),elf) ifneq ($(o32-fpabi),) diff --git a/sysdeps/mips/__longjmp.c b/sysdeps/mips/__longjmp.c index 9aed9fa517..56bb73f1bc 100644 --- a/sysdeps/mips/__longjmp.c +++ b/sysdeps/mips/__longjmp.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1992-2016 Free Software Foundation, Inc. +/* Copyright (C) 1992-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Brendan Kehoe (brendan@zen.org). diff --git a/sysdeps/mips/add_n.S b/sysdeps/mips/add_n.S index 6450bd93cc..b0a8fd13b9 100644 --- a/sysdeps/mips/add_n.S +++ b/sysdeps/mips/add_n.S @@ -1,7 +1,7 @@ /* MIPS2 __mpn_add_n -- Add two limb vectors of the same length > 0 and store sum in a third limb vector. -Copyright (C) 1995-2016 Free Software Foundation, Inc. +Copyright (C) 1995-2018 Free Software Foundation, Inc. This file is part of the GNU MP Library. diff --git a/sysdeps/mips/addmul_1.S b/sysdeps/mips/addmul_1.S index cf09942254..0b182084d7 100644 --- a/sysdeps/mips/addmul_1.S +++ b/sysdeps/mips/addmul_1.S @@ -1,7 +1,7 @@ /* MIPS __mpn_addmul_1 -- Multiply a limb vector with a single limb and add the product to a second limb vector. -Copyright (C) 1995-2016 Free Software Foundation, Inc. +Copyright (C) 1995-2018 Free Software Foundation, Inc. This file is part of the GNU MP Library. diff --git a/sysdeps/mips/atomic-machine.h b/sysdeps/mips/atomic-machine.h index a60e4fbac8..5acf9487c1 100644 --- a/sysdeps/mips/atomic-machine.h +++ b/sysdeps/mips/atomic-machine.h @@ -1,5 +1,5 @@ /* Low-level functions for atomic operations. Mips version. - Copyright (C) 2005-2016 Free Software Foundation, Inc. + Copyright (C) 2005-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -55,68 +55,43 @@ typedef uintmax_t uatomic_max_t; # define MIPS_SYNC sync #endif -/* Certain revisions of the R10000 Processor need an LL/SC Workaround - enabled. Revisions before 3.0 misbehave on atomic operations, and - Revs 2.6 and lower deadlock after several seconds due to other errata. - - To quote the R10K Errata: - Workaround: The basic idea is to inhibit the four instructions - from simultaneously becoming active in R10000. Padding all - ll/sc sequences with nops or changing the looping branch in the - routines to a branch likely (which is always predicted taken - by R10000) will work. The nops should go after the loop, and the - number of them should be 28. This number could be decremented for - each additional instruction in the ll/sc loop such as the lock - modifier(s) between the ll and sc, the looping branch and its - delay slot. For typical short routines with one ll/sc loop, any - instructions after the loop could also count as a decrement. The - nop workaround pollutes the cache more but would be a few cycles - faster if all the code is in the cache and the looping branch - is predicted not taken. */ - - -#ifdef _MIPS_ARCH_R10000 -#define R10K_BEQZ_INSN "beqzl" -#else -#define R10K_BEQZ_INSN "beqz" -#endif - #define MIPS_SYNC_STR_2(X) #X #define MIPS_SYNC_STR_1(X) MIPS_SYNC_STR_2(X) #define MIPS_SYNC_STR MIPS_SYNC_STR_1(MIPS_SYNC) -#if __GNUC_PREREQ (4, 8) || defined __mips16 -/* The __atomic_* builtins are available in GCC 4.7 and later, but MIPS - support for their efficient implementation was added only in GCC 4.8. - We still want to use them even with GCC 4.7 for MIPS16 code where we - have no assembly alternative available and want to avoid the __sync_* - builtins if at all possible. */ - #define USE_ATOMIC_COMPILER_BUILTINS 1 +/* MIPS is an LL/SC machine. However, XLP has a direct atomic exchange + instruction which will be used by __atomic_exchange_n. */ +#ifdef _MIPS_ARCH_XLP +# define ATOMIC_EXCHANGE_USES_CAS 0 +#else +# define ATOMIC_EXCHANGE_USES_CAS 1 +#endif + /* Compare and exchange. For all "bool" routines, we return FALSE if exchange succesful. */ -# define __arch_compare_and_exchange_bool_8_int(mem, newval, oldval, model) \ +#define __arch_compare_and_exchange_bool_8_int(mem, newval, oldval, model) \ (abort (), 0) -# define __arch_compare_and_exchange_bool_16_int(mem, newval, oldval, model) \ +#define __arch_compare_and_exchange_bool_16_int(mem, newval, oldval, model) \ (abort (), 0) -# define __arch_compare_and_exchange_bool_32_int(mem, newval, oldval, model) \ +#define __arch_compare_and_exchange_bool_32_int(mem, newval, oldval, model) \ ({ \ typeof (*mem) __oldval = (oldval); \ !__atomic_compare_exchange_n (mem, (void *) &__oldval, newval, 0, \ model, __ATOMIC_RELAXED); \ }) -# define __arch_compare_and_exchange_val_8_int(mem, newval, oldval, model) \ +#define __arch_compare_and_exchange_val_8_int(mem, newval, oldval, model) \ (abort (), (typeof(*mem)) 0) -# define __arch_compare_and_exchange_val_16_int(mem, newval, oldval, model) \ +#define __arch_compare_and_exchange_val_16_int(mem, newval, oldval, model) \ (abort (), (typeof(*mem)) 0) -# define __arch_compare_and_exchange_val_32_int(mem, newval, oldval, model) \ +#define __arch_compare_and_exchange_val_32_int(mem, newval, oldval, model) \ ({ \ typeof (*mem) __oldval = (oldval); \ __atomic_compare_exchange_n (mem, (void *) &__oldval, newval, 0, \ @@ -124,343 +99,91 @@ typedef uintmax_t uatomic_max_t; __oldval; \ }) -# if _MIPS_SIM == _ABIO32 +#if _MIPS_SIM == _ABIO32 /* We can't do an atomic 64-bit operation in O32. */ -# define __arch_compare_and_exchange_bool_64_int(mem, newval, oldval, model) \ +# define __arch_compare_and_exchange_bool_64_int(mem, newval, oldval, model) \ (abort (), 0) -# define __arch_compare_and_exchange_val_64_int(mem, newval, oldval, model) \ +# define __arch_compare_and_exchange_val_64_int(mem, newval, oldval, model) \ (abort (), (typeof(*mem)) 0) -# else -# define __arch_compare_and_exchange_bool_64_int(mem, newval, oldval, model) \ +#else +# define __arch_compare_and_exchange_bool_64_int(mem, newval, oldval, model) \ __arch_compare_and_exchange_bool_32_int (mem, newval, oldval, model) -# define __arch_compare_and_exchange_val_64_int(mem, newval, oldval, model) \ +# define __arch_compare_and_exchange_val_64_int(mem, newval, oldval, model) \ __arch_compare_and_exchange_val_32_int (mem, newval, oldval, model) -# endif +#endif /* Compare and exchange with "acquire" semantics, ie barrier after. */ -# define atomic_compare_and_exchange_bool_acq(mem, new, old) \ +#define atomic_compare_and_exchange_bool_acq(mem, new, old) \ __atomic_bool_bysize (__arch_compare_and_exchange_bool, int, \ mem, new, old, __ATOMIC_ACQUIRE) -# define atomic_compare_and_exchange_val_acq(mem, new, old) \ +#define atomic_compare_and_exchange_val_acq(mem, new, old) \ __atomic_val_bysize (__arch_compare_and_exchange_val, int, \ mem, new, old, __ATOMIC_ACQUIRE) /* Compare and exchange with "release" semantics, ie barrier before. */ -# define atomic_compare_and_exchange_bool_rel(mem, new, old) \ - __atomic_bool_bysize (__arch_compare_and_exchange_bool, int, \ - mem, new, old, __ATOMIC_RELEASE) - -# define atomic_compare_and_exchange_val_rel(mem, new, old) \ +#define atomic_compare_and_exchange_val_rel(mem, new, old) \ __atomic_val_bysize (__arch_compare_and_exchange_val, int, \ mem, new, old, __ATOMIC_RELEASE) /* Atomic exchange (without compare). */ -# define __arch_exchange_8_int(mem, newval, model) \ +#define __arch_exchange_8_int(mem, newval, model) \ (abort (), (typeof(*mem)) 0) -# define __arch_exchange_16_int(mem, newval, model) \ +#define __arch_exchange_16_int(mem, newval, model) \ (abort (), (typeof(*mem)) 0) -# define __arch_exchange_32_int(mem, newval, model) \ +#define __arch_exchange_32_int(mem, newval, model) \ __atomic_exchange_n (mem, newval, model) -# if _MIPS_SIM == _ABIO32 +#if _MIPS_SIM == _ABIO32 /* We can't do an atomic 64-bit operation in O32. */ -# define __arch_exchange_64_int(mem, newval, model) \ +# define __arch_exchange_64_int(mem, newval, model) \ (abort (), (typeof(*mem)) 0) -# else -# define __arch_exchange_64_int(mem, newval, model) \ +#else +# define __arch_exchange_64_int(mem, newval, model) \ __atomic_exchange_n (mem, newval, model) -# endif +#endif -# define atomic_exchange_acq(mem, value) \ +#define atomic_exchange_acq(mem, value) \ __atomic_val_bysize (__arch_exchange, int, mem, value, __ATOMIC_ACQUIRE) -# define atomic_exchange_rel(mem, value) \ +#define atomic_exchange_rel(mem, value) \ __atomic_val_bysize (__arch_exchange, int, mem, value, __ATOMIC_RELEASE) /* Atomically add value and return the previous (unincremented) value. */ -# define __arch_exchange_and_add_8_int(mem, value, model) \ +#define __arch_exchange_and_add_8_int(mem, value, model) \ (abort (), (typeof(*mem)) 0) -# define __arch_exchange_and_add_16_int(mem, value, model) \ +#define __arch_exchange_and_add_16_int(mem, value, model) \ (abort (), (typeof(*mem)) 0) -# define __arch_exchange_and_add_32_int(mem, value, model) \ +#define __arch_exchange_and_add_32_int(mem, value, model) \ __atomic_fetch_add (mem, value, model) -# if _MIPS_SIM == _ABIO32 +#if _MIPS_SIM == _ABIO32 /* We can't do an atomic 64-bit operation in O32. */ -# define __arch_exchange_and_add_64_int(mem, value, model) \ +# define __arch_exchange_and_add_64_int(mem, value, model) \ (abort (), (typeof(*mem)) 0) -# else -# define __arch_exchange_and_add_64_int(mem, value, model) \ +#else +# define __arch_exchange_and_add_64_int(mem, value, model) \ __atomic_fetch_add (mem, value, model) -# endif +#endif -# define atomic_exchange_and_add_acq(mem, value) \ +#define atomic_exchange_and_add_acq(mem, value) \ __atomic_val_bysize (__arch_exchange_and_add, int, mem, value, \ __ATOMIC_ACQUIRE) -# define atomic_exchange_and_add_rel(mem, value) \ +#define atomic_exchange_and_add_rel(mem, value) \ __atomic_val_bysize (__arch_exchange_and_add, int, mem, value, \ __ATOMIC_RELEASE) -#else /* !__mips16 && !__GNUC_PREREQ (4, 8) */ -/* This implementation using inline assembly will be removed once glibc - requires GCC 4.8 or later to build. */ - -#define USE_ATOMIC_COMPILER_BUILTINS 0 - -/* Compare and exchange. For all of the "xxx" routines, we expect a - "__prev" and a "__cmp" variable to be provided by the enclosing scope, - in which values are returned. */ - -# define __arch_compare_and_exchange_xxx_8_int(mem, newval, oldval, rel, acq) \ - (abort (), __prev = 0, __cmp = 0, (void) __cmp) - -# define __arch_compare_and_exchange_xxx_16_int(mem, newval, oldval, rel, acq) \ - (abort (), __prev = 0, __cmp = 0, (void) __cmp) - -# define __arch_compare_and_exchange_xxx_32_int(mem, newval, oldval, rel, acq) \ - __asm__ __volatile__ ( \ - ".set push\n\t" \ - MIPS_PUSH_MIPS2 \ - rel "\n" \ - "1:\t" \ - "ll %0,%5\n\t" \ - "move %1,$0\n\t" \ - "bne %0,%3,2f\n\t" \ - "move %1,%4\n\t" \ - "sc %1,%2\n\t" \ - R10K_BEQZ_INSN" %1,1b\n" \ - acq "\n\t" \ - ".set pop\n" \ - "2:\n\t" \ - : "=&r" (__prev), "=&r" (__cmp), "=m" (*mem) \ - : "r" (oldval), "r" (newval), "m" (*mem) \ - : "memory") - -# if _MIPS_SIM == _ABIO32 -/* We can't do an atomic 64-bit operation in O32. */ -# define __arch_compare_and_exchange_xxx_64_int(mem, newval, oldval, rel, acq) \ - (abort (), __prev = 0, __cmp = 0, (void) __cmp) -# else -# define __arch_compare_and_exchange_xxx_64_int(mem, newval, oldval, rel, acq) \ - __asm__ __volatile__ ("\n" \ - ".set push\n\t" \ - MIPS_PUSH_MIPS2 \ - rel "\n" \ - "1:\t" \ - "lld %0,%5\n\t" \ - "move %1,$0\n\t" \ - "bne %0,%3,2f\n\t" \ - "move %1,%4\n\t" \ - "scd %1,%2\n\t" \ - R10K_BEQZ_INSN" %1,1b\n" \ - acq "\n\t" \ - ".set pop\n" \ - "2:\n\t" \ - : "=&r" (__prev), "=&r" (__cmp), "=m" (*mem) \ - : "r" (oldval), "r" (newval), "m" (*mem) \ - : "memory") -# endif - -/* For all "bool" routines, we return FALSE if exchange succesful. */ - -# define __arch_compare_and_exchange_bool_8_int(mem, new, old, rel, acq) \ -({ typeof (*mem) __prev __attribute__ ((unused)); int __cmp; \ - __arch_compare_and_exchange_xxx_8_int(mem, new, old, rel, acq); \ - !__cmp; }) - -# define __arch_compare_and_exchange_bool_16_int(mem, new, old, rel, acq) \ -({ typeof (*mem) __prev __attribute__ ((unused)); int __cmp; \ - __arch_compare_and_exchange_xxx_16_int(mem, new, old, rel, acq); \ - !__cmp; }) - -# define __arch_compare_and_exchange_bool_32_int(mem, new, old, rel, acq) \ -({ typeof (*mem) __prev __attribute__ ((unused)); int __cmp; \ - __arch_compare_and_exchange_xxx_32_int(mem, new, old, rel, acq); \ - !__cmp; }) - -# define __arch_compare_and_exchange_bool_64_int(mem, new, old, rel, acq) \ -({ typeof (*mem) __prev __attribute__ ((unused)); int __cmp; \ - __arch_compare_and_exchange_xxx_64_int(mem, new, old, rel, acq); \ - !__cmp; }) - -/* For all "val" routines, return the old value whether exchange - successful or not. */ - -# define __arch_compare_and_exchange_val_8_int(mem, new, old, rel, acq) \ -({ typeof (*mem) __prev; int __cmp; \ - __arch_compare_and_exchange_xxx_8_int(mem, new, old, rel, acq); \ - (typeof (*mem))__prev; }) - -# define __arch_compare_and_exchange_val_16_int(mem, new, old, rel, acq) \ -({ typeof (*mem) __prev; int __cmp; \ - __arch_compare_and_exchange_xxx_16_int(mem, new, old, rel, acq); \ - (typeof (*mem))__prev; }) - -# define __arch_compare_and_exchange_val_32_int(mem, new, old, rel, acq) \ -({ typeof (*mem) __prev; int __cmp; \ - __arch_compare_and_exchange_xxx_32_int(mem, new, old, rel, acq); \ - (typeof (*mem))__prev; }) - -# define __arch_compare_and_exchange_val_64_int(mem, new, old, rel, acq) \ -({ typeof (*mem) __prev; int __cmp; \ - __arch_compare_and_exchange_xxx_64_int(mem, new, old, rel, acq); \ - (typeof (*mem))__prev; }) - -/* Compare and exchange with "acquire" semantics, ie barrier after. */ - -# define atomic_compare_and_exchange_bool_acq(mem, new, old) \ - __atomic_bool_bysize (__arch_compare_and_exchange_bool, int, \ - mem, new, old, "", MIPS_SYNC_STR) - -# define atomic_compare_and_exchange_val_acq(mem, new, old) \ - __atomic_val_bysize (__arch_compare_and_exchange_val, int, \ - mem, new, old, "", MIPS_SYNC_STR) - -/* Compare and exchange with "release" semantics, ie barrier before. */ - -# define atomic_compare_and_exchange_bool_rel(mem, new, old) \ - __atomic_bool_bysize (__arch_compare_and_exchange_bool, int, \ - mem, new, old, MIPS_SYNC_STR, "") - -# define atomic_compare_and_exchange_val_rel(mem, new, old) \ - __atomic_val_bysize (__arch_compare_and_exchange_val, int, \ - mem, new, old, MIPS_SYNC_STR, "") - - - -/* Atomic exchange (without compare). */ - -# define __arch_exchange_xxx_8_int(mem, newval, rel, acq) \ - (abort (), (typeof(*mem)) 0) - -# define __arch_exchange_xxx_16_int(mem, newval, rel, acq) \ - (abort (), (typeof(*mem)) 0) - -# define __arch_exchange_xxx_32_int(mem, newval, rel, acq) \ -({ typeof (*mem) __prev; int __cmp; \ - __asm__ __volatile__ ("\n" \ - ".set push\n\t" \ - MIPS_PUSH_MIPS2 \ - rel "\n" \ - "1:\t" \ - "ll %0,%4\n\t" \ - "move %1,%3\n\t" \ - "sc %1,%2\n\t" \ - R10K_BEQZ_INSN" %1,1b\n" \ - acq "\n\t" \ - ".set pop\n" \ - "2:\n\t" \ - : "=&r" (__prev), "=&r" (__cmp), "=m" (*mem) \ - : "r" (newval), "m" (*mem) \ - : "memory"); \ - __prev; }) - -# if _MIPS_SIM == _ABIO32 -/* We can't do an atomic 64-bit operation in O32. */ -# define __arch_exchange_xxx_64_int(mem, newval, rel, acq) \ - (abort (), (typeof(*mem)) 0) -# else -# define __arch_exchange_xxx_64_int(mem, newval, rel, acq) \ -({ typeof (*mem) __prev; int __cmp; \ - __asm__ __volatile__ ("\n" \ - ".set push\n\t" \ - MIPS_PUSH_MIPS2 \ - rel "\n" \ - "1:\n" \ - "lld %0,%4\n\t" \ - "move %1,%3\n\t" \ - "scd %1,%2\n\t" \ - R10K_BEQZ_INSN" %1,1b\n" \ - acq "\n\t" \ - ".set pop\n" \ - "2:\n\t" \ - : "=&r" (__prev), "=&r" (__cmp), "=m" (*mem) \ - : "r" (newval), "m" (*mem) \ - : "memory"); \ - __prev; }) -# endif - -# define atomic_exchange_acq(mem, value) \ - __atomic_val_bysize (__arch_exchange_xxx, int, mem, value, "", MIPS_SYNC_STR) - -# define atomic_exchange_rel(mem, value) \ - __atomic_val_bysize (__arch_exchange_xxx, int, mem, value, MIPS_SYNC_STR, "") - - -/* Atomically add value and return the previous (unincremented) value. */ - -# define __arch_exchange_and_add_8_int(mem, newval, rel, acq) \ - (abort (), (typeof(*mem)) 0) - -# define __arch_exchange_and_add_16_int(mem, newval, rel, acq) \ - (abort (), (typeof(*mem)) 0) - -# define __arch_exchange_and_add_32_int(mem, value, rel, acq) \ -({ typeof (*mem) __prev; int __cmp; \ - __asm__ __volatile__ ("\n" \ - ".set push\n\t" \ - MIPS_PUSH_MIPS2 \ - rel "\n" \ - "1:\t" \ - "ll %0,%4\n\t" \ - "addu %1,%0,%3\n\t" \ - "sc %1,%2\n\t" \ - R10K_BEQZ_INSN" %1,1b\n" \ - acq "\n\t" \ - ".set pop\n" \ - "2:\n\t" \ - : "=&r" (__prev), "=&r" (__cmp), "=m" (*mem) \ - : "r" (value), "m" (*mem) \ - : "memory"); \ - __prev; }) - -# if _MIPS_SIM == _ABIO32 -/* We can't do an atomic 64-bit operation in O32. */ -# define __arch_exchange_and_add_64_int(mem, value, rel, acq) \ - (abort (), (typeof(*mem)) 0) -# else -# define __arch_exchange_and_add_64_int(mem, value, rel, acq) \ -({ typeof (*mem) __prev; int __cmp; \ - __asm__ __volatile__ ( \ - ".set push\n\t" \ - MIPS_PUSH_MIPS2 \ - rel "\n" \ - "1:\t" \ - "lld %0,%4\n\t" \ - "daddu %1,%0,%3\n\t" \ - "scd %1,%2\n\t" \ - R10K_BEQZ_INSN" %1,1b\n" \ - acq "\n\t" \ - ".set pop\n" \ - "2:\n\t" \ - : "=&r" (__prev), "=&r" (__cmp), "=m" (*mem) \ - : "r" (value), "m" (*mem) \ - : "memory"); \ - __prev; }) -# endif - -# define atomic_exchange_and_add_acq(mem, value) \ - __atomic_val_bysize (__arch_exchange_and_add, int, mem, value, \ - "", MIPS_SYNC_STR) - -# define atomic_exchange_and_add_rel(mem, value) \ - __atomic_val_bysize (__arch_exchange_and_add, int, mem, value, \ - MIPS_SYNC_STR, "") - -#endif /* !__mips16 && !__GNUC_PREREQ (4, 8) */ - /* TODO: More atomic operations could be implemented efficiently; only the basic requirements are done. */ diff --git a/sysdeps/mips/backtrace.c b/sysdeps/mips/backtrace.c deleted file mode 100644 index 27ce597b39..0000000000 --- a/sysdeps/mips/backtrace.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/x86_64/backtrace.c> diff --git a/sysdeps/mips/bits/dlfcn.h b/sysdeps/mips/bits/dlfcn.h index caf7ea72ea..471ab4fdda 100644 --- a/sysdeps/mips/bits/dlfcn.h +++ b/sysdeps/mips/bits/dlfcn.h @@ -1,5 +1,5 @@ /* System dependent definitions for run-time dynamic loading. - Copyright (C) 1996-2016 Free Software Foundation, Inc. + Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/sysdeps/mips/bits/fenv.h b/sysdeps/mips/bits/fenv.h index f829bd3807..37d0a9e64d 100644 --- a/sysdeps/mips/bits/fenv.h +++ b/sysdeps/mips/bits/fenv.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1998-2016 Free Software Foundation, Inc. +/* Copyright (C) 1998-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -83,3 +83,11 @@ fenv_t; /* Floating-point environment where none of the exception is masked. */ # define FE_NOMASK_ENV ((const fenv_t *) -2) #endif + +#if __GLIBC_USE (IEC_60559_BFP_EXT) +/* Type representing floating-point control modes. */ +typedef unsigned int femode_t; + +/* Default floating-point control modes. */ +# define FE_DFL_MODE ((const femode_t *) -1L) +#endif diff --git a/sysdeps/mips/bits/ipctypes.h b/sysdeps/mips/bits/ipctypes.h index d09136b805..57b4aa5997 100644 --- a/sysdeps/mips/bits/ipctypes.h +++ b/sysdeps/mips/bits/ipctypes.h @@ -1,5 +1,5 @@ /* bits/ipctypes.h -- Define some types used by SysV IPC/MSG/SHM. MIPS version - Copyright (C) 2002-2016 Free Software Foundation, Inc. + Copyright (C) 2002-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/sysdeps/mips/bits/link.h b/sysdeps/mips/bits/link.h index 0bb6a61b10..207171c512 100644 --- a/sysdeps/mips/bits/link.h +++ b/sysdeps/mips/bits/link.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2005-2016 Free Software Foundation, Inc. +/* Copyright (C) 2005-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/sysdeps/mips/bits/mathdef.h b/sysdeps/mips/bits/mathdef.h deleted file mode 100644 index 3a1162776f..0000000000 --- a/sysdeps/mips/bits/mathdef.h +++ /dev/null @@ -1,43 +0,0 @@ -/* Copyright (C) 1997-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - <http://www.gnu.org/licenses/>. */ - -#if !defined _MATH_H && !defined _COMPLEX_H -# error "Never use <bits/mathdef.h> directly; include <math.h> instead" -#endif - -#include <sgidefs.h> - -#if defined __USE_ISOC99 && defined _MATH_H && !defined _MATH_H_MATHDEF -# define _MATH_H_MATHDEF 1 - -/* MIPS has `float' and `double' operations. */ -typedef float float_t; /* `float' expressions are evaluated as - `float'. */ -typedef double double_t; /* `double' expressions are evaluated as - `double'. */ - -/* The values returned by `ilogb' for 0 and NaN respectively. */ -# define FP_ILOGB0 (-2147483647) -# define FP_ILOGBNAN 2147483647 - -#endif /* ISO C99 */ - -#if ! defined __NO_LONG_DOUBLE_MATH && _MIPS_SIM == _ABIO32 -/* Signal that we do not really have a `long double'. This disables the - declaration of all the `long double' function variants. */ -# define __NO_LONG_DOUBLE_MATH 1 -#endif diff --git a/sysdeps/mips/bits/nan.h b/sysdeps/mips/bits/nan.h deleted file mode 100644 index feecd2704a..0000000000 --- a/sysdeps/mips/bits/nan.h +++ /dev/null @@ -1,67 +0,0 @@ -/* `NAN' constant for IEEE 754 machines. MIPS version. - Copyright (C) 1992-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - -#ifndef _MATH_H -# error "Never use <bits/nan.h> directly; include <math.h> instead." -#endif - - -/* IEEE Not A Number. */ -/* In legacy-NaN mode MIPS has the qNaN and sNaN patterns reversed - compared to most other architectures. IEEE 754-1985 left the - definition of this open to implementations, and for MIPS the top bit - of the mantissa must be SET to indicate a sNaN. In 2008-NaN mode - MIPS aligned to IEEE 754-2008. */ - -#if __GNUC_PREREQ(3,3) - -# define NAN (__builtin_nanf ("")) - -#elif defined __GNUC__ - -/* No 2008-NaN mode support in any GCC version before 4.9. */ - -# define NAN \ - (__extension__ \ - ((union { unsigned __l __attribute__ ((__mode__ (__SI__))); float __d; }) \ - { __l: 0x7fbfffffUL }).__d) - -#else - -# include <endian.h> - -# if __BYTE_ORDER == __BIG_ENDIAN -# ifdef __mips_nan2008 -# define __qnan_bytes { 0x7f, 0xc0, 0, 0 } -# else -# define __qnan_bytes { 0x7f, 0xbf, 0xff, 0xff } -# endif -# endif -# if __BYTE_ORDER == __LITTLE_ENDIAN -# ifdef __mips_nan2008 -# define __qnan_bytes { 0, 0, 0xc0, 0x7f } -# else -# define __qnan_bytes { 0xff, 0xff, 0xbf, 0x7f } -# endif -# endif - -static union { unsigned char __c[4]; float __d; } __qnan_union - __attribute__ ((__unused__)) = { __qnan_bytes }; -# define NAN (__qnan_union.__d) - -#endif /* GCC. */ diff --git a/sysdeps/mips/bits/setjmp.h b/sysdeps/mips/bits/setjmp.h index 9ba70beda3..e859101b00 100644 --- a/sysdeps/mips/bits/setjmp.h +++ b/sysdeps/mips/bits/setjmp.h @@ -1,5 +1,5 @@ /* Define the machine-dependent type `jmp_buf'. MIPS version. - Copyright (C) 1992-2016 Free Software Foundation, Inc. + Copyright (C) 1992-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -29,19 +29,19 @@ typedef struct __jmp_buf_internal_tag { #if _MIPS_SIM == _ABIO32 /* Program counter. */ - __ptr_t __pc; + void *__pc; /* Stack pointer. */ - __ptr_t __sp; + void *__sp; /* Callee-saved registers s0 through s7. */ int __regs[8]; /* The frame pointer. */ - __ptr_t __fp; + void *__fp; /* The global pointer. */ - __ptr_t __gp; + void *__gp; #else /* Program counter. */ __extension__ long long __pc; diff --git a/sysdeps/mips/bits/wordsize.h b/sysdeps/mips/bits/wordsize.h index bc90435442..4dcc655eb9 100644 --- a/sysdeps/mips/bits/wordsize.h +++ b/sysdeps/mips/bits/wordsize.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2016 Free Software Foundation, Inc. +/* Copyright (C) 2002-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -17,7 +17,15 @@ #include <sgidefs.h> -#define __WORDSIZE _MIPS_SZPTR +#define __WORDSIZE _MIPS_SZPTR + #if _MIPS_SIM == _ABI64 # define __WORDSIZE_TIME64_COMPAT32 1 +#else +# define __WORDSIZE_TIME64_COMPAT32 0 +#endif + +#if __WORDSIZE == 32 +#define __WORDSIZE32_SIZE_ULONG 0 +#define __WORDSIZE32_PTRDIFF_LONG 0 #endif diff --git a/sysdeps/mips/bsd-_setjmp.S b/sysdeps/mips/bsd-_setjmp.S index b75e091f16..8e041d0893 100644 --- a/sysdeps/mips/bsd-_setjmp.S +++ b/sysdeps/mips/bsd-_setjmp.S @@ -1,5 +1,5 @@ /* BSD `_setjmp' entry point to `sigsetjmp (..., 0)'. MIPS version. - Copyright (C) 1996-2016 Free Software Foundation, Inc. + Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/sysdeps/mips/bsd-setjmp.S b/sysdeps/mips/bsd-setjmp.S index 2ec4fe8263..6ea08661f2 100644 --- a/sysdeps/mips/bsd-setjmp.S +++ b/sysdeps/mips/bsd-setjmp.S @@ -1,5 +1,5 @@ /* BSD `setjmp' entry point to `sigsetjmp (..., 1)'. MIPS version. - Copyright (C) 1996-2016 Free Software Foundation, Inc. + Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/sysdeps/mips/dl-dtprocnum.h b/sysdeps/mips/dl-dtprocnum.h index ee72ebe81e..14aaebec8e 100644 --- a/sysdeps/mips/dl-dtprocnum.h +++ b/sysdeps/mips/dl-dtprocnum.h @@ -1,5 +1,5 @@ /* Configuration of lookup functions. MIPS version. - Copyright (C) 2000-2016 Free Software Foundation, Inc. + Copyright (C) 2000-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/sysdeps/mips/dl-machine-reject-phdr.h b/sysdeps/mips/dl-machine-reject-phdr.h index 6fe8287356..afa3d41b0a 100644 --- a/sysdeps/mips/dl-machine-reject-phdr.h +++ b/sysdeps/mips/dl-machine-reject-phdr.h @@ -1,5 +1,5 @@ /* Machine-dependent program header inspection for the ELF loader. - Copyright (C) 2014-2016 Free Software Foundation, Inc. + Copyright (C) 2014-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/sysdeps/mips/dl-machine.h b/sysdeps/mips/dl-machine.h index 8c0b40e8de..91fc640388 100644 --- a/sysdeps/mips/dl-machine.h +++ b/sysdeps/mips/dl-machine.h @@ -1,5 +1,5 @@ /* Machine-dependent ELF dynamic relocation inline functions. MIPS version. - Copyright (C) 1996-2016 Free Software Foundation, Inc. + Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Kazumoto Kojima <kkojima@info.kanagawa-u.ac.jp>. @@ -190,7 +190,7 @@ elf_machine_load_address (void) fiddles with global data. */ #define ELF_MACHINE_BEFORE_RTLD_RELOC(dynamic_info) \ do { \ - struct link_map *map = &bootstrap_map; \ + struct link_map *map = BOOTSTRAP_MAP; \ ElfW(Sym) *sym; \ ElfW(Addr) *got; \ int i, n; \ @@ -220,7 +220,7 @@ do { \ while (i--) \ { \ if (sym->st_shndx == SHN_UNDEF || sym->st_shndx == SHN_COMMON) \ - *got = map->l_addr + sym->st_value; \ + *got = SYMBOL_ADDRESS (map, sym, true); \ else if (ELFW(ST_TYPE) (sym->st_info) == STT_FUNC \ && *got != sym->st_value) \ *got += map->l_addr; \ @@ -230,7 +230,7 @@ do { \ *got += map->l_addr; \ } \ else \ - *got = map->l_addr + sym->st_value; \ + *got = SYMBOL_ADDRESS (map, sym, true); \ \ got++; \ sym++; \ @@ -453,6 +453,7 @@ dl_platform_init (void) the corresponding PLT entry instead. */ static inline ElfW(Addr) elf_machine_fixup_plt (struct link_map *map, lookup_t t, + const ElfW(Sym) *refsym, const ElfW(Sym) *sym, const ElfW(Rel) *reloc, ElfW(Addr) *reloc_addr, ElfW(Addr) value) { @@ -597,7 +598,7 @@ elf_machine_reloc (struct link_map *map, ElfW(Addr) r_info, #ifndef RTLD_BOOTSTRAP if (map != &GL(dl_rtld_map)) #endif - reloc_value += sym->st_value + map->l_addr; + reloc_value += SYMBOL_ADDRESS (map, sym, true); } else { @@ -662,7 +663,7 @@ elf_machine_reloc (struct link_map *map, ElfW(Addr) r_info, "found jump slot relocation with non-zero addend"); sym_map = RESOLVE_MAP (&sym, version, r_type); - value = sym_map == NULL ? 0 : sym_map->l_addr + sym->st_value; + value = SYMBOL_ADDRESS (sym_map, sym, true); *addr_field = value; break; @@ -676,7 +677,7 @@ elf_machine_reloc (struct link_map *map, ElfW(Addr) r_info, /* Calculate the address of the symbol. */ sym_map = RESOLVE_MAP (&sym, version, r_type); - value = sym_map == NULL ? 0 : sym_map->l_addr + sym->st_value; + value = SYMBOL_ADDRESS (sym_map, sym, true); if (__builtin_expect (sym == NULL, 0)) /* This can happen in trace mode if an object could not be @@ -694,7 +695,8 @@ elf_machine_reloc (struct link_map *map, ElfW(Addr) r_info, RTLD_PROGNAME, strtab + refsym->st_name); } memcpy (reloc_addr, (void *) value, - MIN (sym->st_size, refsym->st_size)); + sym->st_size < refsym->st_size + ? sym->st_size : refsym->st_size); break; } @@ -796,7 +798,7 @@ elf_machine_got_rel (struct link_map *map, int lazy) = vernum ? &map->l_versions[vernum[sym_index] & 0x7fff] : NULL; \ struct link_map *sym_map; \ sym_map = RESOLVE_MAP (&ref, version, reloc); \ - ref ? sym_map->l_addr + ref->st_value : 0; \ + SYMBOL_ADDRESS (sym_map, ref, true); \ }) if (map->l_info[VERSYMIDX (DT_VERSYM)] != NULL) @@ -840,7 +842,7 @@ elf_machine_got_rel (struct link_map *map, int lazy) && !(sym->st_other & STO_MIPS_PLT)) { if (lazy) - *got = sym->st_value + map->l_addr; + *got = SYMBOL_ADDRESS (map, sym, true); else /* This is a lazy-binding stub, so we don't need the canonical address. */ diff --git a/sysdeps/mips/dl-procinfo.c b/sysdeps/mips/dl-procinfo.c index 9158d32d3d..008d52d33e 100644 --- a/sysdeps/mips/dl-procinfo.c +++ b/sysdeps/mips/dl-procinfo.c @@ -1,5 +1,5 @@ /* Data for Mips version of processor capability information. - Copyright (C) 2007-2016 Free Software Foundation, Inc. + Copyright (C) 2007-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Robert Millan <rmh@gnu.org>. diff --git a/sysdeps/mips/dl-procinfo.h b/sysdeps/mips/dl-procinfo.h index d031b0c46f..68235c48f8 100644 --- a/sysdeps/mips/dl-procinfo.h +++ b/sysdeps/mips/dl-procinfo.h @@ -1,5 +1,5 @@ /* Mips version of processor capability information handling macros. - Copyright (C) 2007-2016 Free Software Foundation, Inc. + Copyright (C) 2007-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Robert Millan <rmh@gnu.org>. @@ -28,13 +28,6 @@ #define _DL_PLATFORMS_COUNT 4 -static inline const char * -__attribute__ ((unused)) -_dl_platform_string (int idx) -{ - return GLRO(dl_mips_platforms)[idx]; -}; - static inline int __attribute__ ((unused, always_inline)) _dl_string_platform (const char *str) @@ -44,7 +37,7 @@ _dl_string_platform (const char *str) if (str != NULL) for (i = 0; i < _DL_PLATFORMS_COUNT; ++i) { - if (strcmp (str, _dl_platform_string (i)) == 0) + if (strcmp (str, GLRO(dl_mips_platforms)[i]) == 0) return i; } return -1; diff --git a/sysdeps/mips/dl-tls.h b/sysdeps/mips/dl-tls.h index 4d084d6191..7f9ce2a9e8 100644 --- a/sysdeps/mips/dl-tls.h +++ b/sysdeps/mips/dl-tls.h @@ -1,5 +1,5 @@ /* Thread-local storage handling in the ELF dynamic linker. MIPS version. - Copyright (C) 2005-2016 Free Software Foundation, Inc. + Copyright (C) 2005-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -43,6 +43,3 @@ extern void *__tls_get_addr (tls_index *ti); # define GET_ADDR_OFFSET (ti->ti_offset + TLS_DTV_OFFSET) # define __TLS_GET_ADDR(__ti) (__tls_get_addr (__ti) - TLS_DTV_OFFSET) - -/* Value used for dtv entries for which the allocation is delayed. */ -#define TLS_DTV_UNALLOCATED ((void *) -1l) diff --git a/sysdeps/mips/dl-trampoline.c b/sysdeps/mips/dl-trampoline.c index fbb1ded65f..35b6b93a89 100644 --- a/sysdeps/mips/dl-trampoline.c +++ b/sysdeps/mips/dl-trampoline.c @@ -1,5 +1,5 @@ /* PLT trampoline. MIPS version. - Copyright (C) 1996-2016 Free Software Foundation, Inc. + Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Kazumoto Kojima <kkojima@info.kanagawa-u.ac.jp>. @@ -192,12 +192,12 @@ __dl_runtime_resolve (ElfW(Word) sym_index, /* Currently value contains the base load address of the object that defines sym. Now add in the symbol offset. */ - value = (sym ? sym_map->l_addr + sym->st_value : 0); + value = SYMBOL_ADDRESS (sym_map, sym, true); } else /* We already found the symbol. The module (and therefore its load address) is also known. */ - value = l->l_addr + sym->st_value; + value = SYMBOL_ADDRESS (l, sym, true); /* Apply the relocation with that value. */ *(got + local_gotno + sym_index - gotsym) = value; diff --git a/sysdeps/mips/fpregdef.h b/sysdeps/mips/fpregdef.h index d00f7115cb..6b7e7b1333 100644 --- a/sysdeps/mips/fpregdef.h +++ b/sysdeps/mips/fpregdef.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-2016 Free Software Foundation, Inc. +/* Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/sysdeps/mips/fpu/e_sqrt.c b/sysdeps/mips/fpu/e_sqrt.c index 9c48fef125..3a18711951 100644 --- a/sysdeps/mips/fpu/e_sqrt.c +++ b/sysdeps/mips/fpu/e_sqrt.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2016 Free Software Foundation, Inc. +/* Copyright (C) 2002-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Hartvig Ekner <hartvige@mips.com>, 2002. diff --git a/sysdeps/mips/fpu/e_sqrtf.c b/sysdeps/mips/fpu/e_sqrtf.c index b3a31550dd..ed858ab04a 100644 --- a/sysdeps/mips/fpu/e_sqrtf.c +++ b/sysdeps/mips/fpu/e_sqrtf.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2016 Free Software Foundation, Inc. +/* Copyright (C) 2002-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Hartvig Ekner <hartvige@mips.com>, 2002. diff --git a/sysdeps/mips/fpu/fclrexcpt.c b/sysdeps/mips/fpu/fclrexcpt.c index 6b044ab05f..51310d931f 100644 --- a/sysdeps/mips/fpu/fclrexcpt.c +++ b/sysdeps/mips/fpu/fclrexcpt.c @@ -1,5 +1,5 @@ /* Clear given exceptions in current floating-point environment. - Copyright (C) 1998-2016 Free Software Foundation, Inc. + Copyright (C) 1998-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Andreas Jaeger <aj@suse.de>, 1998. diff --git a/sysdeps/mips/fpu/fedisblxcpt.c b/sysdeps/mips/fpu/fedisblxcpt.c index 87287cbcb0..37a6a6e358 100644 --- a/sysdeps/mips/fpu/fedisblxcpt.c +++ b/sysdeps/mips/fpu/fedisblxcpt.c @@ -1,5 +1,5 @@ /* Disable floating-point exceptions. - Copyright (C) 2000-2016 Free Software Foundation, Inc. + Copyright (C) 2000-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Andreas Jaeger <aj@suse.de>, 2000. diff --git a/sysdeps/mips/fpu/feenablxcpt.c b/sysdeps/mips/fpu/feenablxcpt.c index 0a6dffc37c..81f73ab6bd 100644 --- a/sysdeps/mips/fpu/feenablxcpt.c +++ b/sysdeps/mips/fpu/feenablxcpt.c @@ -1,5 +1,5 @@ /* Enable floating-point exceptions. - Copyright (C) 2000-2016 Free Software Foundation, Inc. + Copyright (C) 2000-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Andreas Jaeger <aj@suse.de>, 2000. diff --git a/sysdeps/mips/fpu/fegetenv.c b/sysdeps/mips/fpu/fegetenv.c index fd9dcb8a4b..8e8fa2c576 100644 --- a/sysdeps/mips/fpu/fegetenv.c +++ b/sysdeps/mips/fpu/fegetenv.c @@ -1,5 +1,5 @@ /* Store current floating-point environment. - Copyright (C) 1998-2016 Free Software Foundation, Inc. + Copyright (C) 1998-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Andreas Jaeger <aj@suse.de>, 1998. diff --git a/sysdeps/mips/fpu/fegetexcept.c b/sysdeps/mips/fpu/fegetexcept.c index d02089c261..da7e56f1d6 100644 --- a/sysdeps/mips/fpu/fegetexcept.c +++ b/sysdeps/mips/fpu/fegetexcept.c @@ -1,5 +1,5 @@ /* Get enabled floating-point exceptions. - Copyright (C) 2000-2016 Free Software Foundation, Inc. + Copyright (C) 2000-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Andreas Jaeger <aj@suse.de>, 2000. diff --git a/sysdeps/mips/nptl/pthread_spin_lock.c b/sysdeps/mips/fpu/fegetmode.c index e681f5b193..e0a5180f7b 100644 --- a/sysdeps/mips/nptl/pthread_spin_lock.c +++ b/sysdeps/mips/fpu/fegetmode.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2012-2016 Free Software Foundation, Inc. +/* Store current floating-point control modes. MIPS version. + Copyright (C) 2016-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -12,12 +13,15 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see + License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ -#define SPIN_LOCK_READS_BETWEEN_CMPXCHG 1000 +#include <fenv.h> +#include <fpu_control.h> -/* We can't use the normal "#include <nptl/pthread_spin_lock.c>" because - it will resolve to this very file. Using "sysdeps/.." as reference to the - top level directory does the job. */ -#include <sysdeps/../nptl/pthread_spin_lock.c> +int +fegetmode (femode_t *modep) +{ + _FPU_GETCW (*modep); + return 0; +} diff --git a/sysdeps/mips/fpu/fegetround.c b/sysdeps/mips/fpu/fegetround.c index 72b414e71e..a7ac444aea 100644 --- a/sysdeps/mips/fpu/fegetround.c +++ b/sysdeps/mips/fpu/fegetround.c @@ -1,5 +1,5 @@ /* Return current rounding direction. - Copyright (C) 1998-2016 Free Software Foundation, Inc. + Copyright (C) 1998-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Andreas Jaeger <aj@arthur.rhein-neckar.de>, 1998. diff --git a/sysdeps/mips/fpu/feholdexcpt.c b/sysdeps/mips/fpu/feholdexcpt.c index 4e48bc055a..eb9d476498 100644 --- a/sysdeps/mips/fpu/feholdexcpt.c +++ b/sysdeps/mips/fpu/feholdexcpt.c @@ -1,5 +1,5 @@ /* Store current floating-point environment and clear exceptions. - Copyright (C) 2000-2016 Free Software Foundation, Inc. + Copyright (C) 2000-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Andreas Jaeger <aj@suse.de>, 2000. diff --git a/sysdeps/mips/fpu/fenv_libc.h b/sysdeps/mips/fpu/fenv_libc.h index bb28d8fded..4f32cddbca 100644 --- a/sysdeps/mips/fpu/fenv_libc.h +++ b/sysdeps/mips/fpu/fenv_libc.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2016 Free Software Foundation, Inc. +/* Copyright (C) 2000-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Andreas Jaeger <aj@suse.de>. diff --git a/sysdeps/mips/fpu/fesetenv.c b/sysdeps/mips/fpu/fesetenv.c index a99810eee5..8dee8782c3 100644 --- a/sysdeps/mips/fpu/fesetenv.c +++ b/sysdeps/mips/fpu/fesetenv.c @@ -1,5 +1,5 @@ /* Install given floating-point environment. - Copyright (C) 1998-2016 Free Software Foundation, Inc. + Copyright (C) 1998-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Andreas Jaeger <aj@suse.de>, 1998. diff --git a/sysdeps/mips/fpu/fesetexcept.c b/sysdeps/mips/fpu/fesetexcept.c new file mode 100644 index 0000000000..d14febca6b --- /dev/null +++ b/sysdeps/mips/fpu/fesetexcept.c @@ -0,0 +1,32 @@ +/* Set given exception flags. MIPS version. + Copyright (C) 2016-2018 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#include <fenv.h> +#include <fpu_control.h> + +int +fesetexcept (int excepts) +{ + fpu_control_t temp; + + _FPU_GETCW (temp); + temp |= excepts & FE_ALL_EXCEPT; + _FPU_SETCW (temp); + + return 0; +} diff --git a/sysdeps/mips/fpu/fesetmode.c b/sysdeps/mips/fpu/fesetmode.c new file mode 100644 index 0000000000..68541735b4 --- /dev/null +++ b/sysdeps/mips/fpu/fesetmode.c @@ -0,0 +1,38 @@ +/* Install given floating-point control modes. MIPS version. + Copyright (C) 2016-2018 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#include <fenv.h> +#include <fpu_control.h> + +#define FCSR_STATUS 0xfe83f07c + +int +fesetmode (const femode_t *modep) +{ + fpu_control_t cw; + + _FPU_GETCW (cw); + cw &= FCSR_STATUS; + if (modep == FE_DFL_MODE) + cw |= _FPU_DEFAULT; + else + cw |= *modep & ~FCSR_STATUS; + _FPU_SETCW (cw); + + return 0; +} diff --git a/sysdeps/mips/fpu/fesetround.c b/sysdeps/mips/fpu/fesetround.c index 0e0b2f2293..31fdeab368 100644 --- a/sysdeps/mips/fpu/fesetround.c +++ b/sysdeps/mips/fpu/fesetround.c @@ -1,5 +1,5 @@ /* Set current rounding direction. - Copyright (C) 1998-2016 Free Software Foundation, Inc. + Copyright (C) 1998-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Andreas Jaeger <aj@arthur.rhein-neckar.de>, 1998. diff --git a/sysdeps/mips/fpu/feupdateenv.c b/sysdeps/mips/fpu/feupdateenv.c index 2f9e4a3cf2..669bfc3c9e 100644 --- a/sysdeps/mips/fpu/feupdateenv.c +++ b/sysdeps/mips/fpu/feupdateenv.c @@ -1,5 +1,5 @@ /* Install given floating-point environment and raise exceptions. - Copyright (C) 1998-2016 Free Software Foundation, Inc. + Copyright (C) 1998-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Andreas Jaeger <aj@suse.de>, 1998. diff --git a/sysdeps/mips/fpu/fgetexcptflg.c b/sysdeps/mips/fpu/fgetexcptflg.c index 04fe583db5..1e594e1470 100644 --- a/sysdeps/mips/fpu/fgetexcptflg.c +++ b/sysdeps/mips/fpu/fgetexcptflg.c @@ -1,5 +1,5 @@ /* Store current representation for exceptions. - Copyright (C) 1998-2016 Free Software Foundation, Inc. + Copyright (C) 1998-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Andreas Jaeger <aj@suse.de>, 1998. diff --git a/sysdeps/mips/fpu/fraiseexcpt.c b/sysdeps/mips/fpu/fraiseexcpt.c index 9d71e2051b..56ad431662 100644 --- a/sysdeps/mips/fpu/fraiseexcpt.c +++ b/sysdeps/mips/fpu/fraiseexcpt.c @@ -1,5 +1,5 @@ /* Raise given exceptions. - Copyright (C) 2000-2016 Free Software Foundation, Inc. + Copyright (C) 2000-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Andreas Jaeger <aj@suse.de>, 2000. diff --git a/sysdeps/mips/fpu/fsetexcptflg.c b/sysdeps/mips/fpu/fsetexcptflg.c index 43a2037da6..dc447a7775 100644 --- a/sysdeps/mips/fpu/fsetexcptflg.c +++ b/sysdeps/mips/fpu/fsetexcptflg.c @@ -1,5 +1,5 @@ /* Set floating-point environment exception handling. - Copyright (C) 1998-2016 Free Software Foundation, Inc. + Copyright (C) 1998-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Hartvig Ekner <hartvige@mips.com>, 2002. diff --git a/sysdeps/mips/fpu/ftestexcept.c b/sysdeps/mips/fpu/ftestexcept.c index 41b2f73da8..fa645b2675 100644 --- a/sysdeps/mips/fpu/ftestexcept.c +++ b/sysdeps/mips/fpu/ftestexcept.c @@ -1,5 +1,5 @@ /* Test exception in current environment. - Copyright (C) 1998-2016 Free Software Foundation, Inc. + Copyright (C) 1998-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Andreas Jaeger <aj@arthur.rhein-neckar.de>, 1998. diff --git a/sysdeps/mips/fpu_control.h b/sysdeps/mips/fpu_control.h index ca077bf9aa..a1d88fea06 100644 --- a/sysdeps/mips/fpu_control.h +++ b/sysdeps/mips/fpu_control.h @@ -1,5 +1,5 @@ /* FPU control word bits. Mips version. - Copyright (C) 1996-2016 Free Software Foundation, Inc. + Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Olaf Flebbe and Ralf Baechle. diff --git a/sysdeps/mips/gccframe.h b/sysdeps/mips/gccframe.h index eaa7bfb44e..af6a17f17f 100644 --- a/sysdeps/mips/gccframe.h +++ b/sysdeps/mips/gccframe.h @@ -1,5 +1,5 @@ /* Definition of object in frame unwind info. mips version. - Copyright (C) 2001-2016 Free Software Foundation, Inc. + Copyright (C) 2001-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/sysdeps/mips/ieee754/bits/floatn.h b/sysdeps/mips/ieee754/bits/floatn.h new file mode 100644 index 0000000000..917fe4bc3c --- /dev/null +++ b/sysdeps/mips/ieee754/bits/floatn.h @@ -0,0 +1,97 @@ +/* Macros to control TS 18661-3 glibc features on MIPS platforms. + Copyright (C) 2017-2018 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _BITS_FLOATN_H +#define _BITS_FLOATN_H + +#include <features.h> +#include <bits/long-double.h> + +/* Defined to 1 if the current compiler invocation provides a + floating-point type with the IEEE 754 binary128 format, and this + glibc includes corresponding *f128 interfaces for it. */ +#ifndef __NO_LONG_DOUBLE_MATH +# define __HAVE_FLOAT128 1 +#else +/* glibc does not support _Float128 for platforms where long double is + normally binary128 when building with long double as binary64. + GCC's default for supported scalar modes does not support it either + in that case. */ +# define __HAVE_FLOAT128 0 +#endif + +/* Defined to 1 if __HAVE_FLOAT128 is 1 and the type is ABI-distinct + from the default float, double and long double types in this glibc. */ +#define __HAVE_DISTINCT_FLOAT128 0 + +/* Defined to 1 if the current compiler invocation provides a + floating-point type with the right format for _Float64x, and this + glibc includes corresponding *f64x interfaces for it. */ +#define __HAVE_FLOAT64X __HAVE_FLOAT128 + +/* Defined to 1 if __HAVE_FLOAT64X is 1 and _Float64x has the format + of long double. Otherwise, if __HAVE_FLOAT64X is 1, _Float64x has + the format of _Float128, which must be different from that of long + double. */ +#define __HAVE_FLOAT64X_LONG_DOUBLE __HAVE_FLOAT128 + +#ifndef __ASSEMBLER__ + +/* Defined to concatenate the literal suffix to be used with _Float128 + types, if __HAVE_FLOAT128 is 1. */ +# if __HAVE_FLOAT128 +# if !__GNUC_PREREQ (7, 0) || defined __cplusplus +/* The literal suffix f128 exists only since GCC 7.0. */ +# define __f128(x) x##l +# else +# define __f128(x) x##f128 +# endif +# endif + +/* Defined to a complex binary128 type if __HAVE_FLOAT128 is 1. */ +# if __HAVE_FLOAT128 +# if !__GNUC_PREREQ (7, 0) || defined __cplusplus +# define __CFLOAT128 _Complex long double +# else +# define __CFLOAT128 _Complex _Float128 +# endif +# endif + +/* The remaining of this file provides support for older compilers. */ +# if __HAVE_FLOAT128 + +/* The type _Float128 exists only since GCC 7.0. */ +# if !__GNUC_PREREQ (7, 0) || defined __cplusplus +typedef long double _Float128; +# endif + +/* Various built-in functions do not exist before GCC 7.0. */ +# if !__GNUC_PREREQ (7, 0) +# define __builtin_huge_valf128() (__builtin_huge_vall ()) +# define __builtin_inff128() (__builtin_infl ()) +# define __builtin_nanf128(x) (__builtin_nanl (x)) +# define __builtin_nansf128(x) (__builtin_nansl (x)) +# endif + +# endif + +#endif /* !__ASSEMBLER__. */ + +#include <bits/floatn-common.h> + +#endif /* _BITS_FLOATN_H */ diff --git a/sysdeps/mips/ieee754/bits/long-double.h b/sysdeps/mips/ieee754/bits/long-double.h new file mode 100644 index 0000000000..a1e41d28df --- /dev/null +++ b/sysdeps/mips/ieee754/bits/long-double.h @@ -0,0 +1,23 @@ +/* Properties of long double type. MIPS version. + Copyright (C) 2016-2018 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#include <sgidefs.h> + +#if !defined __NO_LONG_DOUBLE_MATH && _MIPS_SIM == _ABIO32 +# define __NO_LONG_DOUBLE_MATH 1 +#endif diff --git a/sysdeps/mips/ieee754/ieee754.h b/sysdeps/mips/ieee754/ieee754.h index f34a2fa2d0..9b94ecb280 100644 --- a/sysdeps/mips/ieee754/ieee754.h +++ b/sysdeps/mips/ieee754/ieee754.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1992-2016 Free Software Foundation, Inc. +/* Copyright (C) 1992-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/sysdeps/mips/ieee754/s_fma.c b/sysdeps/mips/ieee754/s_fma.c deleted file mode 100644 index 574141416b..0000000000 --- a/sysdeps/mips/ieee754/s_fma.c +++ /dev/null @@ -1,5 +0,0 @@ -#ifdef __mips_hard_float -# include <sysdeps/ieee754/dbl-64/s_fma.c> -#else -# include <soft-fp/fmadf4.c> -#endif diff --git a/sysdeps/mips/ieee754/s_fmaf.c b/sysdeps/mips/ieee754/s_fmaf.c deleted file mode 100644 index 30bcdae620..0000000000 --- a/sysdeps/mips/ieee754/s_fmaf.c +++ /dev/null @@ -1,5 +0,0 @@ -#ifdef __mips_hard_float -# include <sysdeps/ieee754/dbl-64/s_fmaf.c> -#else -# include <soft-fp/fmasf4.c> -#endif diff --git a/sysdeps/mips/ieee754/s_fmal.c b/sysdeps/mips/ieee754/s_fmal.c index 6b83e914fe..c52331967d 100644 --- a/sysdeps/mips/ieee754/s_fmal.c +++ b/sysdeps/mips/ieee754/s_fmal.c @@ -4,4 +4,4 @@ # error "long double fma being compiled for o32 ABI" #endif -#include <soft-fp/fmatf4.c> +#include <sysdeps/ieee754/soft-fp/s_fmal.c> diff --git a/sysdeps/mips/include/sys/asm.h b/sysdeps/mips/include/sys/asm.h index 7e288df117..e44df8fe0b 100644 --- a/sysdeps/mips/include/sys/asm.h +++ b/sysdeps/mips/include/sys/asm.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2013-2016 Free Software Foundation, Inc. +/* Copyright (C) 2013-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,8 +16,9 @@ <http://www.gnu.org/licenses/>. */ #ifndef _SYS_ASM_H +#include_next <sys/asm.h> -# include_next <sys/asm.h> +# ifndef _ISOMAC # undef __mips_cfi_startproc # define __mips_cfi_startproc cfi_startproc @@ -50,4 +51,5 @@ cfi_restore (gp) # endif -#endif +# endif /* _ISOMAC */ +#endif /* sys/asm.h */ diff --git a/sysdeps/mips/jmpbuf-unwind.h b/sysdeps/mips/jmpbuf-unwind.h index 55a9b09056..8318c4669e 100644 --- a/sysdeps/mips/jmpbuf-unwind.h +++ b/sysdeps/mips/jmpbuf-unwind.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2016 Free Software Foundation, Inc. +/* Copyright (C) 2003-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/sysdeps/mips/ldbl-classify-compat.h b/sysdeps/mips/ldbl-classify-compat.h new file mode 100644 index 0000000000..547ac7b53a --- /dev/null +++ b/sysdeps/mips/ldbl-classify-compat.h @@ -0,0 +1,8 @@ +#ifndef MIPS_LDBL_CLASSIFY_COMPAT_H +#define MIPS_LDBL_CLASSIFY_COMPAT_H 1 + +/* Enable __finitel, __isinfl, and __isnanl for binary compatibility + when built without long double support. */ +#define LDBL_CLASSIFY_COMPAT 1 + +#endif diff --git a/sysdeps/mips/ldsodefs.h b/sysdeps/mips/ldsodefs.h index 7399eff32d..c6e5ce7e66 100644 --- a/sysdeps/mips/ldsodefs.h +++ b/sysdeps/mips/ldsodefs.h @@ -1,5 +1,5 @@ /* Run-time dynamic linker data structures for loaded ELF shared objects. - Copyright (C) 2000-2016 Free Software Foundation, Inc. + Copyright (C) 2000-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/sysdeps/mips/libc-tls.c b/sysdeps/mips/libc-tls.c index b4c91fb84b..a3d6165241 100644 --- a/sysdeps/mips/libc-tls.c +++ b/sysdeps/mips/libc-tls.c @@ -1,5 +1,5 @@ /* Thread-local storage handling in the ELF dynamic linker. MIPS version. - Copyright (C) 2005-2016 Free Software Foundation, Inc. + Copyright (C) 2005-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/sysdeps/mips/localplt.data b/sysdeps/mips/localplt.data new file mode 100644 index 0000000000..f0c5970c08 --- /dev/null +++ b/sysdeps/mips/localplt.data @@ -0,0 +1,3 @@ +# MIPS does not use PLTs in shared libraries, and implicit GOT +# relocation means this test cannot check for GOT relocations as an +# alternative. diff --git a/sysdeps/mips/lshift.S b/sysdeps/mips/lshift.S index 8bca5466b2..5a2d19bc8f 100644 --- a/sysdeps/mips/lshift.S +++ b/sysdeps/mips/lshift.S @@ -1,6 +1,6 @@ /* MIPS2 __mpn_lshift -- -Copyright (C) 1995-2016 Free Software Foundation, Inc. +Copyright (C) 1995-2018 Free Software Foundation, Inc. This file is part of the GNU MP Library. diff --git a/sysdeps/mips/machine-gmon.h b/sysdeps/mips/machine-gmon.h index 8e8efd2ebe..afc3ae5022 100644 --- a/sysdeps/mips/machine-gmon.h +++ b/sysdeps/mips/machine-gmon.h @@ -1,5 +1,5 @@ /* Machine-specific calling sequence for `mcount' profiling function. MIPS - Copyright (C) 1996-2016 Free Software Foundation, Inc. + Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/sysdeps/mips/math-tests.h b/sysdeps/mips/math-tests.h index f41c1616b0..941d38bdf0 100644 --- a/sysdeps/mips/math-tests.h +++ b/sysdeps/mips/math-tests.h @@ -1,5 +1,5 @@ /* Configuration for math tests. MIPS version. - Copyright (C) 2013-2016 Free Software Foundation, Inc. + Copyright (C) 2013-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -19,10 +19,7 @@ #include <features.h> #include <sgidefs.h> -/* MIPS soft float does not support exceptions and rounding modes, and - before GCC 4.9 long double when wider than double is implemented - using fp-bit which does not integrate with hardware exceptions and - rounding modes. */ +/* MIPS soft float does not support exceptions and rounding modes. */ #ifdef __mips_soft_float # define ROUNDING_TESTS_float(MODE) ((MODE) == FE_TONEAREST) # define ROUNDING_TESTS_double(MODE) ((MODE) == FE_TONEAREST) @@ -30,9 +27,12 @@ # define EXCEPTION_TESTS_float 0 # define EXCEPTION_TESTS_double 0 # define EXCEPTION_TESTS_long_double 0 -#elif _MIPS_SIM != _ABIO32 && !__GNUC_PREREQ (4, 9) -# define ROUNDING_TESTS_long_double(MODE) ((MODE) == FE_TONEAREST) -# define EXCEPTION_TESTS_long_double 0 +#endif + +/* NaN payload preservation when converting a signaling NaN to quiet + is only required in NAN2008 mode. */ +#ifndef __mips_nan2008 +# define SNAN_TESTS_PRESERVE_PAYLOAD 0 #endif #include_next <math-tests.h> diff --git a/sysdeps/mips/math_private.h b/sysdeps/mips/math_private.h index 2ea3c5708a..01ae8b18fd 100644 --- a/sysdeps/mips/math_private.h +++ b/sysdeps/mips/math_private.h @@ -1,5 +1,5 @@ /* Internal math stuff. MIPS version. - Copyright (C) 2013-2016 Free Software Foundation, Inc. + Copyright (C) 2013-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -19,14 +19,6 @@ #ifndef MIPS_MATH_PRIVATE_H #define MIPS_MATH_PRIVATE_H 1 -#ifdef __mips_nan2008 -/* MIPS aligned to IEEE 754-2008. */ -#else -/* One of the few architectures where the meaning of the quiet/signaling bit is - inverse to IEEE 754-2008 (as well as common practice for IEEE 754-1985). */ -# define HIGH_ORDER_BIT_IS_SET_FOR_SNAN -#endif - /* Inline functions to speed up the math library implementation. The default versions of these routines are in generic/math_private.h and call fesetround, feholdexcept, etc. These routines use inlined @@ -248,10 +240,6 @@ libc_feholdsetround_mips_ctx (struct rm_ctx *ctx, int round) #endif -/* Enable __finitel, __isinfl, and __isnanl for binary compatibility - when built without long double support. */ -#define LDBL_CLASSIFY_COMPAT 1 - #include_next <math_private.h> #endif diff --git a/sysdeps/mips/memcpy.S b/sysdeps/mips/memcpy.S index 9b072d7420..3e9bd1d61b 100644 --- a/sysdeps/mips/memcpy.S +++ b/sysdeps/mips/memcpy.S @@ -1,4 +1,4 @@ -/* Copyright (C) 2012-2016 Free Software Foundation, Inc. +/* Copyright (C) 2012-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -507,7 +507,7 @@ L(skip_pref): move a2,t8 /* Here we have src and dest word-aligned but less than 64-bytes or - * 128 bytes to go. Check for a 32(64) byte chunk and copy if if there + * 128 bytes to go. Check for a 32(64) byte chunk and copy if there * is one. Otherwise jump down to L(chk1w) to handle the tail end of * the copy. */ @@ -736,7 +736,7 @@ L(ua_skip_pref): move a2,t8 /* Here we have src and dest word-aligned but less than 64-bytes or - * 128 bytes to go. Check for a 32(64) byte chunk and copy if if there + * 128 bytes to go. Check for a 32(64) byte chunk and copy if there * is one. Otherwise jump down to L(ua_chk1w) to handle the tail end of * the copy. */ diff --git a/sysdeps/mips/memset.S b/sysdeps/mips/memset.S index 9035b3d2f6..4145b00be0 100644 --- a/sysdeps/mips/memset.S +++ b/sysdeps/mips/memset.S @@ -1,4 +1,4 @@ -/* Copyright (C) 2013-2016 Free Software Foundation, Inc. +/* Copyright (C) 2013-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -370,7 +370,7 @@ L(skip_pref): move a2,t8 /* Here we have dest word-aligned but less than 64-bytes or 128 bytes to go. - Check for a 32(64) byte chunk and copy if if there is one. Otherwise + Check for a 32(64) byte chunk and copy if there is one. Otherwise jump down to L(chk1w) to handle the tail end of the copy. */ L(chkw): andi t8,a2,NSIZEMASK /* is there a 32-byte/64-byte chunk. */ diff --git a/sysdeps/mips/memusage.h b/sysdeps/mips/memusage.h index dd1692f961..597a31e0a9 100644 --- a/sysdeps/mips/memusage.h +++ b/sysdeps/mips/memusage.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2016 Free Software Foundation, Inc. +/* Copyright (C) 2000-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/sysdeps/mips/mips32/crti.S b/sysdeps/mips/mips32/crti.S index 5c0ad7328a..b3e1c4e0d5 100644 --- a/sysdeps/mips/mips32/crti.S +++ b/sysdeps/mips/mips32/crti.S @@ -1,5 +1,5 @@ /* Special .init and .fini section support for MIPS (o32). - Copyright (C) 1995-2016 Free Software Foundation, Inc. + Copyright (C) 1995-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -40,6 +40,12 @@ #include <libc-symbols.h> +#ifdef __mips_micromips +# define JALR_RELOC R_MICROMIPS_JALR +#else +# define JALR_RELOC R_MIPS_JALR +#endif + #ifndef PREINIT_FUNCTION # define PREINIT_FUNCTION __gmon_start__ #endif @@ -59,6 +65,7 @@ .section .init,"ax",@progbits .p2align 2 .globl _init + .hidden _init .type _init, @function _init: .set noreorder @@ -71,18 +78,20 @@ _init: lw $2,%got(PREINIT_FUNCTION)($28) beq $2,$0,.Lno_weak_fn lw $25,%call16(PREINIT_FUNCTION)($28) - .reloc 1f,R_MIPS_JALR,PREINIT_FUNCTION + .reloc 1f,JALR_RELOC,PREINIT_FUNCTION 1: jalr $25 .Lno_weak_fn: + .insn #else lw $25,%got(PREINIT_FUNCTION)($28) - .reloc 1f,R_MIPS_JALR,PREINIT_FUNCTION + .reloc 1f,JALR_RELOC,PREINIT_FUNCTION 1: jalr $25 #endif .section .fini,"ax",@progbits .p2align 2 .globl _fini + .hidden _fini .type _fini, @function _fini: .set noreorder diff --git a/sysdeps/mips/mips32/crtn.S b/sysdeps/mips/mips32/crtn.S index a2f97c85e1..84efcb1938 100644 --- a/sysdeps/mips/mips32/crtn.S +++ b/sysdeps/mips/mips32/crtn.S @@ -1,5 +1,5 @@ /* Special .init and .fini section support for MIPS (o32). - Copyright (C) 1995-2016 Free Software Foundation, Inc. + Copyright (C) 1995-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/sysdeps/mips/mips32/fpu/fix-fp-int-convert-overflow.h b/sysdeps/mips/mips32/fpu/fix-fp-int-convert-overflow.h index b9f4aea488..1afc7f65a6 100644 --- a/sysdeps/mips/mips32/fpu/fix-fp-int-convert-overflow.h +++ b/sysdeps/mips/mips32/fpu/fix-fp-int-convert-overflow.h @@ -1,5 +1,5 @@ /* Fix for conversion of floating point to integer overflow. MIPS version. - Copyright (C) 2015-2016 Free Software Foundation, Inc. + Copyright (C) 2015-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/sysdeps/mips/mips32/fpu/fpucw-helpers.c b/sysdeps/mips/mips32/fpu/fpucw-helpers.c index 2af39e969e..c52d55460e 100644 --- a/sysdeps/mips/mips32/fpu/fpucw-helpers.c +++ b/sysdeps/mips/mips32/fpu/fpucw-helpers.c @@ -1,5 +1,5 @@ /* FPU control word handling, MIPS version, needed by MIPS16 callers. - Copyright (C) 1996-2016 Free Software Foundation, Inc. + Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/sysdeps/mips/mips32/libm-test-ulps b/sysdeps/mips/mips32/libm-test-ulps index aa3d696863..e62cca3e03 100644 --- a/sysdeps/mips/mips32/libm-test-ulps +++ b/sysdeps/mips/mips32/libm-test-ulps @@ -184,15 +184,15 @@ idouble: 1 ifloat: 2 Function: Imaginary part of "cacos": -double: 1 +double: 2 float: 2 -idouble: 1 +idouble: 2 ifloat: 2 Function: Real part of "cacos_downward": -double: 2 +double: 3 float: 2 -idouble: 2 +idouble: 3 ifloat: 2 Function: Imaginary part of "cacos_downward": @@ -202,9 +202,9 @@ idouble: 5 ifloat: 3 Function: Real part of "cacos_towardzero": -double: 2 +double: 3 float: 2 -idouble: 2 +idouble: 3 ifloat: 2 Function: Imaginary part of "cacos_towardzero": @@ -220,15 +220,15 @@ idouble: 2 ifloat: 2 Function: Imaginary part of "cacos_upward": -double: 4 -float: 4 -idouble: 4 -ifloat: 4 +double: 5 +float: 7 +idouble: 5 +ifloat: 7 Function: Real part of "cacosh": -double: 1 +double: 2 float: 2 -idouble: 1 +idouble: 2 ifloat: 2 Function: Imaginary part of "cacosh": @@ -244,10 +244,10 @@ idouble: 5 ifloat: 3 Function: Imaginary part of "cacosh_downward": -double: 2 -float: 2 -idouble: 2 -ifloat: 2 +double: 3 +float: 3 +idouble: 3 +ifloat: 3 Function: Real part of "cacosh_towardzero": double: 5 @@ -256,9 +256,9 @@ idouble: 5 ifloat: 3 Function: Imaginary part of "cacosh_towardzero": -double: 2 +double: 3 float: 2 -idouble: 2 +idouble: 3 ifloat: 2 Function: Real part of "cacosh_upward": @@ -268,9 +268,9 @@ idouble: 4 ifloat: 4 Function: Imaginary part of "cacosh_upward": -double: 2 +double: 3 float: 2 -idouble: 2 +idouble: 3 ifloat: 2 Function: "carg": @@ -302,16 +302,16 @@ idouble: 1 ifloat: 1 Function: Imaginary part of "casin": -double: 1 +double: 2 float: 2 -idouble: 1 +idouble: 2 ifloat: 2 Function: Real part of "casin_downward": double: 3 -float: 1 +float: 2 idouble: 3 -ifloat: 1 +ifloat: 2 Function: Imaginary part of "casin_downward": double: 5 @@ -332,21 +332,21 @@ idouble: 5 ifloat: 3 Function: Real part of "casin_upward": -double: 2 -float: 1 -idouble: 2 -ifloat: 1 +double: 3 +float: 2 +idouble: 3 +ifloat: 2 Function: Imaginary part of "casin_upward": -double: 4 -float: 4 -idouble: 4 -ifloat: 4 +double: 5 +float: 7 +idouble: 5 +ifloat: 7 Function: Real part of "casinh": -double: 1 +double: 2 float: 2 -idouble: 1 +idouble: 2 ifloat: 2 Function: Imaginary part of "casinh": @@ -363,9 +363,9 @@ ifloat: 3 Function: Imaginary part of "casinh_downward": double: 3 -float: 1 +float: 2 idouble: 3 -ifloat: 1 +ifloat: 2 Function: Real part of "casinh_towardzero": double: 5 @@ -380,19 +380,21 @@ idouble: 3 ifloat: 1 Function: Real part of "casinh_upward": -double: 4 -float: 4 -idouble: 4 -ifloat: 4 +double: 5 +float: 7 +idouble: 5 +ifloat: 7 Function: Imaginary part of "casinh_upward": -double: 2 +double: 3 float: 2 -idouble: 2 +idouble: 3 ifloat: 2 Function: Real part of "catan": +double: 1 float: 1 +idouble: 1 ifloat: 1 Function: Imaginary part of "catan": @@ -403,9 +405,9 @@ ifloat: 1 Function: Real part of "catan_downward": double: 1 -float: 1 +float: 2 idouble: 1 -ifloat: 1 +ifloat: 2 Function: Imaginary part of "catan_downward": double: 2 @@ -415,18 +417,20 @@ ifloat: 2 Function: Real part of "catan_towardzero": double: 1 -float: 1 +float: 2 idouble: 1 -ifloat: 1 +ifloat: 2 Function: Imaginary part of "catan_towardzero": double: 2 -float: 1 +float: 2 idouble: 2 -ifloat: 1 +ifloat: 2 Function: Real part of "catan_upward": +double: 1 float: 1 +idouble: 1 ifloat: 1 Function: Imaginary part of "catan_upward": @@ -442,7 +446,9 @@ idouble: 1 ifloat: 1 Function: Imaginary part of "catanh": +double: 1 float: 1 +idouble: 1 ifloat: 1 Function: Real part of "catanh_downward": @@ -459,9 +465,9 @@ ifloat: 2 Function: Real part of "catanh_towardzero": double: 2 -float: 1 +float: 2 idouble: 2 -ifloat: 1 +ifloat: 2 Function: Imaginary part of "catanh_towardzero": double: 1 @@ -471,12 +477,14 @@ ifloat: 2 Function: Real part of "catanh_upward": double: 4 -float: 3 +float: 4 idouble: 4 -ifloat: 3 +ifloat: 4 Function: Imaginary part of "catanh_upward": +double: 1 float: 1 +idouble: 1 ifloat: 1 Function: "cbrt": @@ -671,9 +679,9 @@ ifloat: 2 Function: Real part of "clog10_downward": double: 5 -float: 4 +float: 5 idouble: 5 -ifloat: 4 +ifloat: 5 Function: Imaginary part of "clog10_downward": double: 2 @@ -742,7 +750,9 @@ idouble: 1 ifloat: 2 Function: "cos": +double: 1 float: 1 +idouble: 1 ifloat: 1 Function: "cos_downward": @@ -789,9 +799,9 @@ ifloat: 2 Function: Real part of "cpow": double: 2 -float: 4 +float: 5 idouble: 2 -ifloat: 4 +ifloat: 5 Function: Imaginary part of "cpow": float: 2 @@ -977,9 +987,9 @@ ifloat: 1 Function: Imaginary part of "ctan": double: 2 -float: 1 +float: 2 idouble: 2 -ifloat: 1 +ifloat: 2 Function: Real part of "ctan_downward": double: 6 @@ -989,9 +999,9 @@ ifloat: 5 Function: Imaginary part of "ctan_downward": double: 2 -float: 1 +float: 2 idouble: 2 -ifloat: 1 +ifloat: 2 Function: Real part of "ctan_towardzero": double: 5 @@ -1007,9 +1017,9 @@ ifloat: 2 Function: Real part of "ctan_upward": double: 2 -float: 3 +float: 4 idouble: 2 -ifloat: 3 +ifloat: 4 Function: Imaginary part of "ctan_upward": double: 2 @@ -1019,9 +1029,9 @@ ifloat: 3 Function: Real part of "ctanh": double: 2 -float: 1 +float: 2 idouble: 2 -ifloat: 1 +ifloat: 2 Function: Imaginary part of "ctanh": double: 2 @@ -1031,9 +1041,9 @@ ifloat: 2 Function: Real part of "ctanh_downward": double: 4 -float: 1 +float: 2 idouble: 4 -ifloat: 1 +ifloat: 2 Function: Imaginary part of "ctanh_downward": double: 6 @@ -1165,15 +1175,21 @@ ifloat: 1 Function: "exp_downward": double: 1 +float: 1 idouble: 1 +ifloat: 1 Function: "exp_towardzero": double: 1 +float: 1 idouble: 1 +ifloat: 1 Function: "exp_upward": double: 1 +float: 1 idouble: 1 +ifloat: 1 Function: "expm1": double: 1 @@ -1247,9 +1263,9 @@ ifloat: 2 Function: "j0_downward": double: 2 -float: 3 +float: 4 idouble: 2 -ifloat: 3 +ifloat: 4 Function: "j0_towardzero": double: 3 @@ -1271,9 +1287,9 @@ ifloat: 2 Function: "j1_downward": double: 3 -float: 2 +float: 3 idouble: 3 -ifloat: 2 +ifloat: 3 Function: "j1_towardzero": double: 3 @@ -1426,29 +1442,9 @@ idouble: 1 ifloat: 2 Function: "pow": +double: 1 float: 1 -ifloat: 1 - -Function: "pow10": -double: 2 -idouble: 2 - -Function: "pow10_downward": -double: 2 -float: 1 -idouble: 2 -ifloat: 1 - -Function: "pow10_towardzero": -double: 2 -float: 1 -idouble: 2 -ifloat: 1 - -Function: "pow10_upward": -double: 2 -float: 1 -idouble: 2 +idouble: 1 ifloat: 1 Function: "pow_downward": @@ -1470,7 +1466,9 @@ idouble: 1 ifloat: 1 Function: "sin": +double: 1 float: 1 +idouble: 1 ifloat: 1 Function: "sin_downward": @@ -1492,7 +1490,9 @@ idouble: 1 ifloat: 2 Function: "sincos": +double: 1 float: 1 +idouble: 1 ifloat: 1 Function: "sincos_downward": @@ -1615,9 +1615,9 @@ ifloat: 1 Function: "y0_downward": double: 3 -float: 2 +float: 4 idouble: 3 -ifloat: 2 +ifloat: 4 Function: "y0_towardzero": double: 3 @@ -1627,9 +1627,9 @@ ifloat: 3 Function: "y0_upward": double: 3 -float: 4 +float: 5 idouble: 3 -ifloat: 4 +ifloat: 5 Function: "y1": double: 3 @@ -1657,15 +1657,15 @@ ifloat: 2 Function: "yn": double: 3 -float: 2 +float: 3 idouble: 3 -ifloat: 2 +ifloat: 3 Function: "yn_downward": double: 3 -float: 2 +float: 4 idouble: 3 -ifloat: 2 +ifloat: 4 Function: "yn_towardzero": double: 3 @@ -1675,8 +1675,8 @@ ifloat: 3 Function: "yn_upward": double: 4 -float: 4 +float: 5 idouble: 4 -ifloat: 4 +ifloat: 5 # end of automatic generation diff --git a/sysdeps/mips/mips32/libm-test-ulps-name b/sysdeps/mips/mips32/libm-test-ulps-name new file mode 100644 index 0000000000..d0622692ce --- /dev/null +++ b/sysdeps/mips/mips32/libm-test-ulps-name @@ -0,0 +1 @@ +MIPS 32-bit diff --git a/sysdeps/mips/mips32/nofpu/Implies b/sysdeps/mips/mips32/nofpu/Implies new file mode 100644 index 0000000000..abcbadb25f --- /dev/null +++ b/sysdeps/mips/mips32/nofpu/Implies @@ -0,0 +1 @@ +ieee754/soft-fp diff --git a/sysdeps/mips/mips32/sfp-machine.h b/sysdeps/mips/mips32/sfp-machine.h index 4e23aa8b26..5215655029 100644 --- a/sysdeps/mips/mips32/sfp-machine.h +++ b/sysdeps/mips/mips32/sfp-machine.h @@ -41,9 +41,20 @@ # define _FP_QNANNEGATEDP 1 #endif +#ifdef __mips_nan2008 +/* NaN payloads should be preserved for NAN2008. */ +# define _FP_CHOOSENAN(fs, wc, R, X, Y, OP) \ + do \ + { \ + R##_s = X##_s; \ + _FP_FRAC_COPY_##wc (R, X); \ + R##_c = FP_CLS_NAN; \ + } \ + while (0) +#else /* From my experiments it seems X is chosen unless one of the NaNs is sNaN, in which case the result is NANSIGN/NANFRAC. */ -#define _FP_CHOOSENAN(fs, wc, R, X, Y, OP) \ +# define _FP_CHOOSENAN(fs, wc, R, X, Y, OP) \ do { \ if ((_FP_FRAC_HIGH_RAW_##fs(X) | \ _FP_FRAC_HIGH_RAW_##fs(Y)) & _FP_QNANBIT_##fs) \ @@ -58,6 +69,7 @@ } \ R##_c = FP_CLS_NAN; \ } while (0) +#endif #define FP_EX_INVALID (1 << 4) #define FP_EX_DIVZERO (1 << 3) diff --git a/sysdeps/mips/mips64/__longjmp.c b/sysdeps/mips/mips64/__longjmp.c index 147e979232..e5d413280c 100644 --- a/sysdeps/mips/mips64/__longjmp.c +++ b/sysdeps/mips/mips64/__longjmp.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1992-2016 Free Software Foundation, Inc. +/* Copyright (C) 1992-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Brendan Kehoe (brendan@zen.org). diff --git a/sysdeps/mips/mips64/add_n.S b/sysdeps/mips/mips64/add_n.S index 056aee7e76..46d6f77162 100644 --- a/sysdeps/mips/mips64/add_n.S +++ b/sysdeps/mips/mips64/add_n.S @@ -1,7 +1,7 @@ /* MIPS3 __mpn_add_n -- Add two limb vectors of the same length > 0 and * store sum in a third limb vector. * - * Copyright (C) 1995-2016 Free Software Foundation, Inc. + * Copyright (C) 1995-2018 Free Software Foundation, Inc. * * This file is part of the GNU MP Library. * diff --git a/sysdeps/mips/mips64/addmul_1.S b/sysdeps/mips/mips64/addmul_1.S index d7fe56bcde..dae3a74438 100644 --- a/sysdeps/mips/mips64/addmul_1.S +++ b/sysdeps/mips/mips64/addmul_1.S @@ -1,7 +1,7 @@ /* MIPS3 __mpn_addmul_1 -- Multiply a limb vector with a single limb and * add the product to a second limb vector. * - * Copyright (C) 1992-2016 Free Software Foundation, Inc. + * Copyright (C) 1992-2018 Free Software Foundation, Inc. * * This file is part of the GNU MP Library. * diff --git a/sysdeps/mips/mips64/bsd-_setjmp.S b/sysdeps/mips/mips64/bsd-_setjmp.S index cd2ae472eb..f58ee38d1f 100644 --- a/sysdeps/mips/mips64/bsd-_setjmp.S +++ b/sysdeps/mips/mips64/bsd-_setjmp.S @@ -1,5 +1,5 @@ /* BSD `_setjmp' entry point to `sigsetjmp (..., 0)'. MIPS64 version. - Copyright (C) 1996-2016 Free Software Foundation, Inc. + Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/sysdeps/mips/mips64/bsd-setjmp.S b/sysdeps/mips/mips64/bsd-setjmp.S index 8b094a30ea..1f084daf3c 100644 --- a/sysdeps/mips/mips64/bsd-setjmp.S +++ b/sysdeps/mips/mips64/bsd-setjmp.S @@ -1,5 +1,5 @@ /* BSD `setjmp' entry point to `sigsetjmp (..., 1)'. MIPS64 version. - Copyright (C) 1996-2016 Free Software Foundation, Inc. + Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/sysdeps/mips/mips64/e_sqrtl.c b/sysdeps/mips/mips64/e_sqrtl.c index 4453ac8ee0..6e3352962f 100644 --- a/sysdeps/mips/mips64/e_sqrtl.c +++ b/sysdeps/mips/mips64/e_sqrtl.c @@ -1,5 +1,5 @@ /* long double square root in software floating-point emulation. - Copyright (C) 1997-2016 Free Software Foundation, Inc. + Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/sysdeps/mips/mips64/gmp-mparam.h b/sysdeps/mips/mips64/gmp-mparam.h index 1e76391a60..9874aaefe3 100644 --- a/sysdeps/mips/mips64/gmp-mparam.h +++ b/sysdeps/mips/mips64/gmp-mparam.h @@ -1,6 +1,6 @@ /* gmp-mparam.h -- Compiler/machine parameter header file. -Copyright (C) 1991-2016 Free Software Foundation, Inc. +Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU MP Library. diff --git a/sysdeps/mips/mips64/libm-test-ulps b/sysdeps/mips/mips64/libm-test-ulps index 5bf6f3e65b..82b15be5af 100644 --- a/sysdeps/mips/mips64/libm-test-ulps +++ b/sysdeps/mips/mips64/libm-test-ulps @@ -250,36 +250,36 @@ ildouble: 2 ldouble: 2 Function: Imaginary part of "cacos": -double: 1 +double: 2 float: 2 -idouble: 1 +idouble: 2 ifloat: 2 ildouble: 2 ldouble: 2 Function: Real part of "cacos_downward": -double: 2 +double: 3 float: 2 -idouble: 2 +idouble: 3 ifloat: 2 -ildouble: 2 -ldouble: 2 +ildouble: 3 +ldouble: 3 Function: Imaginary part of "cacos_downward": double: 5 float: 3 idouble: 5 ifloat: 3 -ildouble: 5 -ldouble: 5 +ildouble: 6 +ldouble: 6 Function: Real part of "cacos_towardzero": -double: 2 +double: 3 float: 2 -idouble: 2 +idouble: 3 ifloat: 2 -ildouble: 2 -ldouble: 2 +ildouble: 3 +ldouble: 3 Function: Imaginary part of "cacos_towardzero": double: 5 @@ -298,17 +298,17 @@ ildouble: 3 ldouble: 3 Function: Imaginary part of "cacos_upward": -double: 4 -float: 4 -idouble: 4 -ifloat: 4 -ildouble: 5 -ldouble: 5 +double: 5 +float: 7 +idouble: 5 +ifloat: 7 +ildouble: 7 +ldouble: 7 Function: Real part of "cacosh": -double: 1 +double: 2 float: 2 -idouble: 1 +idouble: 2 ifloat: 2 ildouble: 2 ldouble: 2 @@ -330,12 +330,12 @@ ildouble: 5 ldouble: 5 Function: Imaginary part of "cacosh_downward": -double: 2 -float: 2 -idouble: 2 -ifloat: 2 -ildouble: 2 -ldouble: 2 +double: 3 +float: 3 +idouble: 3 +ifloat: 3 +ildouble: 4 +ldouble: 4 Function: Real part of "cacosh_towardzero": double: 5 @@ -346,28 +346,28 @@ ildouble: 5 ldouble: 5 Function: Imaginary part of "cacosh_towardzero": -double: 2 +double: 3 float: 2 -idouble: 2 +idouble: 3 ifloat: 2 -ildouble: 2 -ldouble: 2 +ildouble: 3 +ldouble: 3 Function: Real part of "cacosh_upward": double: 4 float: 4 idouble: 4 ifloat: 4 -ildouble: 5 -ldouble: 5 +ildouble: 6 +ldouble: 6 Function: Imaginary part of "cacosh_upward": -double: 2 +double: 3 float: 2 -idouble: 2 +idouble: 3 ifloat: 2 -ildouble: 3 -ldouble: 3 +ildouble: 4 +ldouble: 4 Function: "carg": float: 1 @@ -408,18 +408,18 @@ ildouble: 2 ldouble: 2 Function: Imaginary part of "casin": -double: 1 +double: 2 float: 2 -idouble: 1 +idouble: 2 ifloat: 2 ildouble: 2 ldouble: 2 Function: Real part of "casin_downward": double: 3 -float: 1 +float: 2 idouble: 3 -ifloat: 1 +ifloat: 2 ildouble: 3 ldouble: 3 @@ -428,8 +428,8 @@ double: 5 float: 3 idouble: 5 ifloat: 3 -ildouble: 5 -ldouble: 5 +ildouble: 6 +ldouble: 6 Function: Real part of "casin_towardzero": double: 3 @@ -448,25 +448,25 @@ ildouble: 5 ldouble: 5 Function: Real part of "casin_upward": -double: 2 -float: 1 -idouble: 2 -ifloat: 1 +double: 3 +float: 2 +idouble: 3 +ifloat: 2 ildouble: 3 ldouble: 3 Function: Imaginary part of "casin_upward": -double: 4 -float: 4 -idouble: 4 -ifloat: 4 -ildouble: 5 -ldouble: 5 +double: 5 +float: 7 +idouble: 5 +ifloat: 7 +ildouble: 7 +ldouble: 7 Function: Real part of "casinh": -double: 1 +double: 2 float: 2 -idouble: 1 +idouble: 2 ifloat: 2 ildouble: 2 ldouble: 2 @@ -484,14 +484,14 @@ double: 5 float: 3 idouble: 5 ifloat: 3 -ildouble: 5 -ldouble: 5 +ildouble: 6 +ldouble: 6 Function: Imaginary part of "casinh_downward": double: 3 -float: 1 +float: 2 idouble: 3 -ifloat: 1 +ifloat: 2 ildouble: 3 ldouble: 3 @@ -512,23 +512,25 @@ ildouble: 3 ldouble: 3 Function: Real part of "casinh_upward": -double: 4 -float: 4 -idouble: 4 -ifloat: 4 -ildouble: 5 -ldouble: 5 +double: 5 +float: 7 +idouble: 5 +ifloat: 7 +ildouble: 7 +ldouble: 7 Function: Imaginary part of "casinh_upward": -double: 2 +double: 3 float: 2 -idouble: 2 +idouble: 3 ifloat: 2 ildouble: 3 ldouble: 3 Function: Real part of "catan": +double: 1 float: 1 +idouble: 1 ifloat: 1 ildouble: 1 ldouble: 1 @@ -543,9 +545,9 @@ ldouble: 1 Function: Real part of "catan_downward": double: 1 -float: 1 +float: 2 idouble: 1 -ifloat: 1 +ifloat: 2 ildouble: 2 ldouble: 2 @@ -554,30 +556,32 @@ double: 2 float: 2 idouble: 2 ifloat: 2 -ildouble: 3 -ldouble: 3 +ildouble: 2 +ldouble: 2 Function: Real part of "catan_towardzero": double: 1 -float: 1 +float: 2 idouble: 1 -ifloat: 1 +ifloat: 2 ildouble: 2 ldouble: 2 Function: Imaginary part of "catan_towardzero": double: 2 -float: 1 +float: 2 idouble: 2 -ifloat: 1 -ildouble: 3 -ldouble: 3 +ifloat: 2 +ildouble: 2 +ldouble: 2 Function: Real part of "catan_upward": +double: 1 float: 1 +idouble: 1 ifloat: 1 -ildouble: 1 -ldouble: 1 +ildouble: 2 +ldouble: 2 Function: Imaginary part of "catan_upward": double: 3 @@ -596,7 +600,9 @@ ildouble: 1 ldouble: 1 Function: Imaginary part of "catanh": +double: 1 float: 1 +idouble: 1 ifloat: 1 ildouble: 1 ldouble: 1 @@ -606,8 +612,8 @@ double: 2 float: 2 idouble: 2 ifloat: 2 -ildouble: 3 -ldouble: 3 +ildouble: 2 +ldouble: 2 Function: Imaginary part of "catanh_downward": double: 1 @@ -619,11 +625,11 @@ ldouble: 2 Function: Real part of "catanh_towardzero": double: 2 -float: 1 +float: 2 idouble: 2 -ifloat: 1 -ildouble: 3 -ldouble: 3 +ifloat: 2 +ildouble: 2 +ldouble: 2 Function: Imaginary part of "catanh_towardzero": double: 1 @@ -635,17 +641,19 @@ ldouble: 2 Function: Real part of "catanh_upward": double: 4 -float: 3 +float: 4 idouble: 4 -ifloat: 3 +ifloat: 4 ildouble: 4 ldouble: 4 Function: Imaginary part of "catanh_upward": +double: 1 float: 1 +idouble: 1 ifloat: 1 -ildouble: 1 -ldouble: 1 +ildouble: 2 +ldouble: 2 Function: "cbrt": double: 3 @@ -903,9 +911,9 @@ ldouble: 2 Function: Real part of "clog10_downward": double: 5 -float: 4 +float: 5 idouble: 5 -ifloat: 4 +ifloat: 5 ildouble: 3 ldouble: 3 @@ -998,7 +1006,9 @@ ildouble: 2 ldouble: 2 Function: "cos": +double: 1 float: 1 +idouble: 1 ifloat: 1 ildouble: 1 ldouble: 1 @@ -1061,9 +1071,9 @@ ldouble: 3 Function: Real part of "cpow": double: 2 -float: 4 +float: 5 idouble: 2 -ifloat: 4 +ifloat: 5 ildouble: 4 ldouble: 4 @@ -1317,9 +1327,9 @@ ldouble: 3 Function: Imaginary part of "ctan": double: 2 -float: 1 +float: 2 idouble: 2 -ifloat: 1 +ifloat: 2 ildouble: 3 ldouble: 3 @@ -1333,9 +1343,9 @@ ldouble: 4 Function: Imaginary part of "ctan_downward": double: 2 -float: 1 +float: 2 idouble: 2 -ifloat: 1 +ifloat: 2 ildouble: 5 ldouble: 5 @@ -1357,9 +1367,9 @@ ldouble: 5 Function: Real part of "ctan_upward": double: 2 -float: 3 +float: 4 idouble: 2 -ifloat: 3 +ifloat: 4 ildouble: 5 ldouble: 5 @@ -1373,9 +1383,9 @@ ldouble: 5 Function: Real part of "ctanh": double: 2 -float: 1 +float: 2 idouble: 2 -ifloat: 1 +ifloat: 2 ildouble: 3 ldouble: 3 @@ -1389,9 +1399,9 @@ ldouble: 3 Function: Real part of "ctanh_downward": double: 4 -float: 1 +float: 2 idouble: 4 -ifloat: 1 +ifloat: 2 ildouble: 5 ldouble: 5 @@ -1569,15 +1579,21 @@ ldouble: 2 Function: "exp_downward": double: 1 +float: 1 idouble: 1 +ifloat: 1 Function: "exp_towardzero": double: 1 +float: 1 idouble: 1 +ifloat: 1 Function: "exp_upward": double: 1 +float: 1 idouble: 1 +ifloat: 1 Function: "expm1": double: 1 @@ -1677,9 +1693,9 @@ ldouble: 2 Function: "j0_downward": double: 2 -float: 3 +float: 4 idouble: 2 -ifloat: 3 +ifloat: 4 ildouble: 4 ldouble: 4 @@ -1709,9 +1725,9 @@ ldouble: 4 Function: "j1_downward": double: 3 -float: 2 +float: 3 idouble: 3 -ifloat: 2 +ifloat: 3 ildouble: 4 ldouble: 4 @@ -1918,41 +1934,13 @@ ildouble: 1 ldouble: 1 Function: "pow": +double: 1 float: 1 +idouble: 1 ifloat: 1 ildouble: 2 ldouble: 2 -Function: "pow10": -double: 2 -idouble: 2 -ildouble: 2 -ldouble: 2 - -Function: "pow10_downward": -double: 2 -float: 1 -idouble: 2 -ifloat: 1 -ildouble: 3 -ldouble: 3 - -Function: "pow10_towardzero": -double: 2 -float: 1 -idouble: 2 -ifloat: 1 -ildouble: 3 -ldouble: 3 - -Function: "pow10_upward": -double: 2 -float: 1 -idouble: 2 -ifloat: 1 -ildouble: 3 -ldouble: 3 - Function: "pow_downward": double: 1 float: 1 @@ -1978,7 +1966,9 @@ ildouble: 2 ldouble: 2 Function: "sin": +double: 1 float: 1 +idouble: 1 ifloat: 1 ildouble: 1 ldouble: 1 @@ -2008,7 +1998,9 @@ ildouble: 3 ldouble: 3 Function: "sincos": +double: 1 float: 1 +idouble: 1 ifloat: 1 ildouble: 1 ldouble: 1 @@ -2173,9 +2165,9 @@ ldouble: 3 Function: "y0_downward": double: 3 -float: 2 +float: 4 idouble: 3 -ifloat: 2 +ifloat: 4 ildouble: 4 ldouble: 4 @@ -2189,9 +2181,9 @@ ldouble: 3 Function: "y0_upward": double: 3 -float: 4 +float: 5 idouble: 3 -ifloat: 4 +ifloat: 5 ildouble: 3 ldouble: 3 @@ -2229,17 +2221,17 @@ ldouble: 5 Function: "yn": double: 3 -float: 2 +float: 3 idouble: 3 -ifloat: 2 +ifloat: 3 ildouble: 5 ldouble: 5 Function: "yn_downward": double: 3 -float: 2 +float: 4 idouble: 3 -ifloat: 2 +ifloat: 4 ildouble: 5 ldouble: 5 @@ -2253,9 +2245,9 @@ ldouble: 5 Function: "yn_upward": double: 4 -float: 4 +float: 5 idouble: 4 -ifloat: 4 +ifloat: 5 ildouble: 5 ldouble: 5 diff --git a/sysdeps/mips/mips64/libm-test-ulps-name b/sysdeps/mips/mips64/libm-test-ulps-name new file mode 100644 index 0000000000..916e314f86 --- /dev/null +++ b/sysdeps/mips/mips64/libm-test-ulps-name @@ -0,0 +1 @@ +MIPS 64-bit diff --git a/sysdeps/mips/mips64/lshift.S b/sysdeps/mips/mips64/lshift.S index fdd5b31fe7..73b1cfb8e7 100644 --- a/sysdeps/mips/mips64/lshift.S +++ b/sysdeps/mips/mips64/lshift.S @@ -1,6 +1,6 @@ /* MIPS3 __mpn_lshift -- * - * Copyright (C) 1995-2016 Free Software Foundation, Inc. + * Copyright (C) 1995-2018 Free Software Foundation, Inc. * * This file is part of the GNU MP Library. * diff --git a/sysdeps/mips/mips64/mul_1.S b/sysdeps/mips/mips64/mul_1.S index eccd146033..8707257a68 100644 --- a/sysdeps/mips/mips64/mul_1.S +++ b/sysdeps/mips/mips64/mul_1.S @@ -1,7 +1,7 @@ /* MIPS3 __mpn_mul_1 -- Multiply a limb vector with a single limb and * store the product in a second limb vector. * - * Copyright (C) 1992-2016 Free Software Foundation, Inc. + * Copyright (C) 1992-2018 Free Software Foundation, Inc. * * This file is part of the GNU MP Library. * diff --git a/sysdeps/mips/mips64/n32/crti.S b/sysdeps/mips/mips64/n32/crti.S index 00b89f3894..59a09d5763 100644 --- a/sysdeps/mips/mips64/n32/crti.S +++ b/sysdeps/mips/mips64/n32/crti.S @@ -1,5 +1,5 @@ /* Special .init and .fini section support for MIPS (n32). - Copyright (C) 1995-2016 Free Software Foundation, Inc. + Copyright (C) 1995-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -40,6 +40,12 @@ #include <libc-symbols.h> +#ifdef __mips_micromips +# define JALR_RELOC R_MICROMIPS_JALR +#else +# define JALR_RELOC R_MIPS_JALR +#endif + #ifndef PREINIT_FUNCTION # define PREINIT_FUNCTION __gmon_start__ #endif @@ -59,6 +65,7 @@ .section .init,"ax",@progbits .p2align 2 .globl _init + .hidden _init .type _init, @function _init: addiu $sp,$sp,-16 @@ -71,18 +78,20 @@ _init: lw $2,%got_disp(PREINIT_FUNCTION)($28) beq $2,$0,.Lno_weak_fn lw $25,%call16(PREINIT_FUNCTION)($28) - .reloc 1f,R_MIPS_JALR,PREINIT_FUNCTION + .reloc 1f,JALR_RELOC,PREINIT_FUNCTION 1: jalr $25 .Lno_weak_fn: + .insn #else lw $25,%got_disp(PREINIT_FUNCTION)($28) - .reloc 1f,R_MIPS_JALR,PREINIT_FUNCTION + .reloc 1f,JALR_RELOC,PREINIT_FUNCTION 1: jalr $25 #endif .section .fini,"ax",@progbits .p2align 2 .globl _fini + .hidden _fini .type _fini, @function _fini: addiu $sp,$sp,-16 diff --git a/sysdeps/mips/mips64/n32/crtn.S b/sysdeps/mips/mips64/n32/crtn.S index d4e6b685dd..6fa7630d0c 100644 --- a/sysdeps/mips/mips64/n32/crtn.S +++ b/sysdeps/mips/mips64/n32/crtn.S @@ -1,5 +1,5 @@ /* Special .init and .fini section support for MIPS (n32). - Copyright (C) 1995-2016 Free Software Foundation, Inc. + Copyright (C) 1995-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/sysdeps/mips/mips64/n32/fpu/s_fma.c b/sysdeps/mips/mips64/n32/fpu/s_fma.c new file mode 100644 index 0000000000..b61fa643de --- /dev/null +++ b/sysdeps/mips/mips64/n32/fpu/s_fma.c @@ -0,0 +1 @@ +#include <sysdeps/ieee754/dbl-64/s_fma.c> diff --git a/sysdeps/mips/mips64/n32/nofpu/Implies b/sysdeps/mips/mips64/n32/nofpu/Implies new file mode 100644 index 0000000000..abcbadb25f --- /dev/null +++ b/sysdeps/mips/mips64/n32/nofpu/Implies @@ -0,0 +1 @@ +ieee754/soft-fp diff --git a/sysdeps/mips/mips64/n64/crti.S b/sysdeps/mips/mips64/n64/crti.S index f59b20c631..fd468f0467 100644 --- a/sysdeps/mips/mips64/n64/crti.S +++ b/sysdeps/mips/mips64/n64/crti.S @@ -1,5 +1,5 @@ /* Special .init and .fini section support for MIPS (n64). - Copyright (C) 1995-2016 Free Software Foundation, Inc. + Copyright (C) 1995-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -40,6 +40,12 @@ #include <libc-symbols.h> +#ifdef __mips_micromips +# define JALR_RELOC R_MICROMIPS_JALR +#else +# define JALR_RELOC R_MIPS_JALR +#endif + #ifndef PREINIT_FUNCTION # define PREINIT_FUNCTION __gmon_start__ #endif @@ -59,6 +65,7 @@ .section .init,"ax",@progbits .p2align 2 .globl _init + .hidden _init .type _init, @function _init: daddiu $sp,$sp,-16 @@ -71,18 +78,20 @@ _init: ld $2,%got_disp(PREINIT_FUNCTION)($28) beq $2,$0,.Lno_weak_fn ld $25,%call16(PREINIT_FUNCTION)($28) - .reloc 1f,R_MIPS_JALR,PREINIT_FUNCTION + .reloc 1f,JALR_RELOC,PREINIT_FUNCTION 1: jalr $25 .Lno_weak_fn: + .insn #else ld $25,%got_disp(PREINIT_FUNCTION)($28) - .reloc 1f,R_MIPS_JALR,PREINIT_FUNCTION + .reloc 1f,JALR_RELOC,PREINIT_FUNCTION 1: jalr $25 #endif .section .fini,"ax",@progbits .p2align 2 .globl _fini + .hidden _fini .type _fini, @function _fini: daddiu $sp,$sp,-16 diff --git a/sysdeps/mips/mips64/n64/crtn.S b/sysdeps/mips/mips64/n64/crtn.S index 98649008a3..13f72c754c 100644 --- a/sysdeps/mips/mips64/n64/crtn.S +++ b/sysdeps/mips/mips64/n64/crtn.S @@ -1,5 +1,5 @@ /* Special .init and .fini section support for MIPS (n64). - Copyright (C) 1995-2016 Free Software Foundation, Inc. + Copyright (C) 1995-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/sysdeps/mips/mips64/n64/fpu/s_fma.c b/sysdeps/mips/mips64/n64/fpu/s_fma.c new file mode 100644 index 0000000000..b61fa643de --- /dev/null +++ b/sysdeps/mips/mips64/n64/fpu/s_fma.c @@ -0,0 +1 @@ +#include <sysdeps/ieee754/dbl-64/s_fma.c> diff --git a/sysdeps/mips/mips64/n64/nofpu/Implies b/sysdeps/mips/mips64/n64/nofpu/Implies new file mode 100644 index 0000000000..abcbadb25f --- /dev/null +++ b/sysdeps/mips/mips64/n64/nofpu/Implies @@ -0,0 +1 @@ +ieee754/soft-fp diff --git a/sysdeps/mips/mips64/rshift.S b/sysdeps/mips/mips64/rshift.S index ade44fec65..22eede3b78 100644 --- a/sysdeps/mips/mips64/rshift.S +++ b/sysdeps/mips/mips64/rshift.S @@ -1,6 +1,6 @@ /* MIPS3 __mpn_rshift -- * - * Copyright (C) 1995-2016 Free Software Foundation, Inc. + * Copyright (C) 1995-2018 Free Software Foundation, Inc. * * This file is part of the GNU MP Library. * diff --git a/sysdeps/mips/mips64/setjmp.S b/sysdeps/mips/mips64/setjmp.S index e72eaa71fd..ea30bd8efa 100644 --- a/sysdeps/mips/mips64/setjmp.S +++ b/sysdeps/mips/mips64/setjmp.S @@ -1,4 +1,4 @@ -/* Copyright (C) 1996-2016 Free Software Foundation, Inc. +/* Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -42,3 +42,4 @@ ENTRY (__sigsetjmp) #endif jr t9 END (__sigsetjmp) +hidden_def (__sigsetjmp) diff --git a/sysdeps/mips/mips64/setjmp_aux.c b/sysdeps/mips/mips64/setjmp_aux.c index d924c97ce3..5354d40f38 100644 --- a/sysdeps/mips/mips64/setjmp_aux.c +++ b/sysdeps/mips/mips64/setjmp_aux.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1996-2016 Free Software Foundation, Inc. +/* Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Brendan Kehoe (brendan@zen.org). @@ -24,7 +24,12 @@ pointer. We do things this way because it's difficult to reliably access them in C. */ +/* Stack protection is disabled to avoid changing s0 (or any other + caller-save register) before storing it to environment. + See BZ #22624. */ + int +inhibit_stack_protector __sigsetjmp_aux (jmp_buf env, int savemask, long long sp, long long fp, long long gp) { diff --git a/sysdeps/mips/mips64/sfp-machine.h b/sysdeps/mips/mips64/sfp-machine.h index 708afc783e..35cc4ddeb1 100644 --- a/sysdeps/mips/mips64/sfp-machine.h +++ b/sysdeps/mips/mips64/sfp-machine.h @@ -44,9 +44,20 @@ # define _FP_QNANNEGATEDP 1 #endif +#ifdef __mips_nan2008 +/* NaN payloads should be preserved for NAN2008. */ +# define _FP_CHOOSENAN(fs, wc, R, X, Y, OP) \ + do \ + { \ + R##_s = X##_s; \ + _FP_FRAC_COPY_##wc (R, X); \ + R##_c = FP_CLS_NAN; \ + } \ + while (0) +#else /* From my experiments it seems X is chosen unless one of the NaNs is sNaN, in which case the result is NANSIGN/NANFRAC. */ -#define _FP_CHOOSENAN(fs, wc, R, X, Y, OP) \ +# define _FP_CHOOSENAN(fs, wc, R, X, Y, OP) \ do { \ if ((_FP_FRAC_HIGH_RAW_##fs(X) | \ _FP_FRAC_HIGH_RAW_##fs(Y)) & _FP_QNANBIT_##fs) \ @@ -61,6 +72,7 @@ } \ R##_c = FP_CLS_NAN; \ } while (0) +#endif #define _FP_DECL_EX fpu_control_t _fcw diff --git a/sysdeps/mips/mips64/sub_n.S b/sysdeps/mips/mips64/sub_n.S index 4b3cce4037..6cc09a7771 100644 --- a/sysdeps/mips/mips64/sub_n.S +++ b/sysdeps/mips/mips64/sub_n.S @@ -1,7 +1,7 @@ /* MIPS3 __mpn_sub_n -- Subtract two limb vectors of the same length > 0 and * store difference in a third limb vector. * - * Copyright (C) 1995-2016 Free Software Foundation, Inc. + * Copyright (C) 1995-2018 Free Software Foundation, Inc. * * This file is part of the GNU MP Library. * diff --git a/sysdeps/mips/mips64/submul_1.S b/sysdeps/mips/mips64/submul_1.S index 40cf6fb482..fb9a1c2375 100644 --- a/sysdeps/mips/mips64/submul_1.S +++ b/sysdeps/mips/mips64/submul_1.S @@ -1,7 +1,7 @@ /* MIPS3 __mpn_submul_1 -- Multiply a limb vector with a single limb and * subtract the product from a second limb vector. * - * Copyright (C) 1992-2016 Free Software Foundation, Inc. + * Copyright (C) 1992-2018 Free Software Foundation, Inc. * * This file is part of the GNU MP Library. * diff --git a/sysdeps/mips/mul_1.S b/sysdeps/mips/mul_1.S index 770f7786d1..02d9d5152f 100644 --- a/sysdeps/mips/mul_1.S +++ b/sysdeps/mips/mul_1.S @@ -1,7 +1,7 @@ /* MIPS __mpn_mul_1 -- Multiply a limb vector with a single limb and store the product in a second limb vector. -Copyright (C) 1995-2016 Free Software Foundation, Inc. +Copyright (C) 1995-2018 Free Software Foundation, Inc. This file is part of the GNU MP Library. diff --git a/sysdeps/mips/nan-high-order-bit.h b/sysdeps/mips/nan-high-order-bit.h new file mode 100644 index 0000000000..0500605d01 --- /dev/null +++ b/sysdeps/mips/nan-high-order-bit.h @@ -0,0 +1,32 @@ +/* Specify NaN high-order bit conventions. MIPS version. + Copyright (C) 2016-2018 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef NAN_HIGH_ORDER_BIT_H +#define NAN_HIGH_ORDER_BIT_H 1 + +#ifdef __mips_nan2008 +/* MIPS aligned to IEEE 754-2008. */ +# define HIGH_ORDER_BIT_IS_SET_FOR_SNAN 0 +#else +/* One of the few architectures where the meaning of the + quiet/signaling bit is inverse to IEEE 754-2008 (as well as common + practice for IEEE 754-1985). */ +# define HIGH_ORDER_BIT_IS_SET_FOR_SNAN 1 +#endif + +#endif /* nan-high-order-bit.h */ diff --git a/sysdeps/mips/nptl/Makefile b/sysdeps/mips/nptl/Makefile index 117744ffe2..280fc5691d 100644 --- a/sysdeps/mips/nptl/Makefile +++ b/sysdeps/mips/nptl/Makefile @@ -1,4 +1,4 @@ -# Copyright (C) 2005-2016 Free Software Foundation, Inc. +# Copyright (C) 2005-2018 Free Software Foundation, Inc. # This file is part of the GNU C Library. # # The GNU C Library is free software; you can redistribute it and/or @@ -21,4 +21,5 @@ endif ifeq ($(subdir),nptl) libpthread-sysdep_routines += nptl-sysdep +libpthread-shared-only-routines += nptl-sysdep endif diff --git a/sysdeps/mips/nptl/bits/pthreadtypes-arch.h b/sysdeps/mips/nptl/bits/pthreadtypes-arch.h new file mode 100644 index 0000000000..f9e7d18a8b --- /dev/null +++ b/sysdeps/mips/nptl/bits/pthreadtypes-arch.h @@ -0,0 +1,89 @@ +/* Machine-specific pthread type layouts. MIPS version. + Copyright (C) 2005-2018 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _BITS_PTHREADTYPES_ARCH_H +#define _BITS_PTHREADTYPES_ARCH_H 1 + +#include <endian.h> + +#if _MIPS_SIM == _ABI64 +# define __SIZEOF_PTHREAD_ATTR_T 56 +# define __SIZEOF_PTHREAD_MUTEX_T 40 +# define __SIZEOF_PTHREAD_RWLOCK_T 56 +# define __SIZEOF_PTHREAD_BARRIER_T 32 +#else +# define __SIZEOF_PTHREAD_ATTR_T 36 +# define __SIZEOF_PTHREAD_MUTEX_T 24 +# define __SIZEOF_PTHREAD_RWLOCK_T 32 +# define __SIZEOF_PTHREAD_BARRIER_T 20 +#endif +#define __SIZEOF_PTHREAD_MUTEXATTR_T 4 +#define __SIZEOF_PTHREAD_COND_T 48 +#define __SIZEOF_PTHREAD_CONDATTR_T 4 +#define __SIZEOF_PTHREAD_RWLOCKATTR_T 8 +#define __SIZEOF_PTHREAD_BARRIERATTR_T 4 + +/* Data structure for mutex handling. */ +#define __PTHREAD_COMPAT_PADDING_MID +#define __PTHREAD_COMPAT_PADDING_END +#define __PTHREAD_MUTEX_LOCK_ELISION 0 +#define __PTHREAD_MUTEX_NUSERS_AFTER_KIND (_MIPS_SIM != _ABI64) +#define __PTHREAD_MUTEX_USE_UNION (_MIPS_SIM != _ABI64) + +#define __LOCK_ALIGNMENT +#define __ONCE_ALIGNMENT + +struct __pthread_rwlock_arch_t +{ + unsigned int __readers; + unsigned int __writers; + unsigned int __wrphase_futex; + unsigned int __writers_futex; + unsigned int __pad3; + unsigned int __pad4; +#if _MIPS_SIM == _ABI64 + int __cur_writer; + int __shared; + unsigned long int __pad1; + unsigned long int __pad2; + /* FLAGS must stay at this position in the structure to maintain + binary compatibility. */ + unsigned int __flags; +# else +# if __BYTE_ORDER == __BIG_ENDIAN + unsigned char __pad1; + unsigned char __pad2; + unsigned char __shared; + /* FLAGS must stay at this position in the structure to maintain + binary compatibility. */ + unsigned char __flags; +# else + /* FLAGS must stay at this position in the structure to maintain + binary compatibility. */ + unsigned char __flags; + unsigned char __shared; + unsigned char __pad1; + unsigned char __pad2; +# endif + int __cur_writer; +#endif +}; + +#define __PTHREAD_RWLOCK_ELISION_EXTRA 0 + +#endif /* bits/pthreadtypes.h */ diff --git a/sysdeps/mips/nptl/bits/pthreadtypes.h b/sysdeps/mips/nptl/bits/pthreadtypes.h deleted file mode 100644 index 68ed94b145..0000000000 --- a/sysdeps/mips/nptl/bits/pthreadtypes.h +++ /dev/null @@ -1,237 +0,0 @@ -/* Machine-specific pthread type layouts. MIPS version. - Copyright (C) 2005-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - <http://www.gnu.org/licenses/>. */ - -#ifndef _BITS_PTHREADTYPES_H -#define _BITS_PTHREADTYPES_H 1 - -#include <endian.h> - -#if _MIPS_SIM == _ABI64 -# define __SIZEOF_PTHREAD_ATTR_T 56 -# define __SIZEOF_PTHREAD_MUTEX_T 40 -# define __SIZEOF_PTHREAD_MUTEXATTR_T 4 -# define __SIZEOF_PTHREAD_COND_T 48 -# define __SIZEOF_PTHREAD_CONDATTR_T 4 -# define __SIZEOF_PTHREAD_RWLOCK_T 56 -# define __SIZEOF_PTHREAD_RWLOCKATTR_T 8 -# define __SIZEOF_PTHREAD_BARRIER_T 32 -# define __SIZEOF_PTHREAD_BARRIERATTR_T 4 -#else -# define __SIZEOF_PTHREAD_ATTR_T 36 -# define __SIZEOF_PTHREAD_MUTEX_T 24 -# define __SIZEOF_PTHREAD_MUTEXATTR_T 4 -# define __SIZEOF_PTHREAD_COND_T 48 -# define __SIZEOF_PTHREAD_CONDATTR_T 4 -# define __SIZEOF_PTHREAD_RWLOCK_T 32 -# define __SIZEOF_PTHREAD_RWLOCKATTR_T 8 -# define __SIZEOF_PTHREAD_BARRIER_T 20 -# define __SIZEOF_PTHREAD_BARRIERATTR_T 4 -#endif - - -/* Thread identifiers. The structure of the attribute type is - deliberately not exposed. */ -typedef unsigned long int pthread_t; - - -union pthread_attr_t -{ - char __size[__SIZEOF_PTHREAD_ATTR_T]; - long int __align; -}; -#ifndef __have_pthread_attr_t -typedef union pthread_attr_t pthread_attr_t; -# define __have_pthread_attr_t 1 -#endif - - -#if _MIPS_SIM == _ABI64 -typedef struct __pthread_internal_list -{ - struct __pthread_internal_list *__prev; - struct __pthread_internal_list *__next; -} __pthread_list_t; -#else -typedef struct __pthread_internal_slist -{ - struct __pthread_internal_slist *__next; -} __pthread_slist_t; -#endif - - -/* Data structures for mutex handling. The structure of the attribute - type is deliberately not exposed. */ -typedef union -{ - struct __pthread_mutex_s - { - int __lock; - unsigned int __count; - int __owner; -#if _MIPS_SIM == _ABI64 - unsigned int __nusers; -#endif - /* KIND must stay at this position in the structure to maintain - binary compatibility. */ - int __kind; -#if _MIPS_SIM == _ABI64 - int __spins; - __pthread_list_t __list; -# define __PTHREAD_MUTEX_HAVE_PREV 1 -#else - unsigned int __nusers; - __extension__ union - { - int __spins; - __pthread_slist_t __list; - }; -#endif - } __data; - char __size[__SIZEOF_PTHREAD_MUTEX_T]; - long int __align; -} pthread_mutex_t; - -/* Mutex __spins initializer used by PTHREAD_MUTEX_INITIALIZER. */ -#define __PTHREAD_SPINS 0 - -typedef union -{ - char __size[__SIZEOF_PTHREAD_MUTEXATTR_T]; - int __align; -} pthread_mutexattr_t; - - -/* Data structure for conditional variable handling. The structure of - the attribute type is deliberately not exposed. */ -typedef union -{ - struct - { - int __lock; - unsigned int __futex; - __extension__ unsigned long long int __total_seq; - __extension__ unsigned long long int __wakeup_seq; - __extension__ unsigned long long int __woken_seq; - void *__mutex; - unsigned int __nwaiters; - unsigned int __broadcast_seq; - } __data; - char __size[__SIZEOF_PTHREAD_COND_T]; - __extension__ long long int __align; -} pthread_cond_t; - -typedef union -{ - char __size[__SIZEOF_PTHREAD_CONDATTR_T]; - int __align; -} pthread_condattr_t; - - -/* Keys for thread-specific data */ -typedef unsigned int pthread_key_t; - - -/* Once-only execution */ -typedef int pthread_once_t; - - -#if defined __USE_UNIX98 || defined __USE_XOPEN2K -/* Data structure for read-write lock variable handling. The - structure of the attribute type is deliberately not exposed. */ -typedef union -{ -# if _MIPS_SIM == _ABI64 - struct - { - int __lock; - unsigned int __nr_readers; - unsigned int __readers_wakeup; - unsigned int __writer_wakeup; - unsigned int __nr_readers_queued; - unsigned int __nr_writers_queued; - int __writer; - int __shared; - unsigned long int __pad1; - unsigned long int __pad2; - /* FLAGS must stay at this position in the structure to maintain - binary compatibility. */ - unsigned int __flags; - } __data; -# else - struct - { - int __lock; - unsigned int __nr_readers; - unsigned int __readers_wakeup; - unsigned int __writer_wakeup; - unsigned int __nr_readers_queued; - unsigned int __nr_writers_queued; -#if __BYTE_ORDER == __BIG_ENDIAN - unsigned char __pad1; - unsigned char __pad2; - unsigned char __shared; - /* FLAGS must stay at this position in the structure to maintain - binary compatibility. */ - unsigned char __flags; -#else - /* FLAGS must stay at this position in the structure to maintain - binary compatibility. */ - unsigned char __flags; - unsigned char __shared; - unsigned char __pad1; - unsigned char __pad2; -#endif - int __writer; - } __data; -# endif - char __size[__SIZEOF_PTHREAD_RWLOCK_T]; - long int __align; -} pthread_rwlock_t; - -#define __PTHREAD_RWLOCK_ELISION_EXTRA 0 - -typedef union -{ - char __size[__SIZEOF_PTHREAD_RWLOCKATTR_T]; - long int __align; -} pthread_rwlockattr_t; -#endif - - -#ifdef __USE_XOPEN2K -/* POSIX spinlock data type. */ -typedef volatile int pthread_spinlock_t; - - -/* POSIX barriers data type. The structure of the type is - deliberately not exposed. */ -typedef union -{ - char __size[__SIZEOF_PTHREAD_BARRIER_T]; - long int __align; -} pthread_barrier_t; - -typedef union -{ - char __size[__SIZEOF_PTHREAD_BARRIERATTR_T]; - int __align; -} pthread_barrierattr_t; -#endif - - -#endif /* bits/pthreadtypes.h */ diff --git a/sysdeps/mips/nptl/bits/semaphore.h b/sysdeps/mips/nptl/bits/semaphore.h index 93c61cccdc..e78d075e5a 100644 --- a/sysdeps/mips/nptl/bits/semaphore.h +++ b/sysdeps/mips/nptl/bits/semaphore.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2016 Free Software Foundation, Inc. +/* Copyright (C) 2002-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/sysdeps/mips/nptl/pthread-offsets.h b/sysdeps/mips/nptl/pthread-offsets.h new file mode 100644 index 0000000000..0ac3eda3fb --- /dev/null +++ b/sysdeps/mips/nptl/pthread-offsets.h @@ -0,0 +1,13 @@ +#if _MIPS_SIM == _ABI64 +# define __PTHREAD_MUTEX_NUSERS_OFFSET 12 +# define __PTHREAD_MUTEX_KIND_OFFSET 16 +# define __PTHREAD_MUTEX_SPINS_OFFSET 20 +# define __PTHREAD_MUTEX_ELISION_OFFSET 22 +# define __PTHREAD_MUTEX_LIST_OFFSET 24 +#else +# define __PTHREAD_MUTEX_NUSERS_OFFSET 16 +# define __PTHREAD_MUTEX_KIND_OFFSET 12 +# define __PTHREAD_MUTEX_SPINS_OFFSET 20 +# define __PTHREAD_MUTEX_ELISION_OFFSET 22 +# define __PTHREAD_MUTEX_LIST_OFFSET 20 +#endif diff --git a/sysdeps/mips/nptl/pthreaddef.h b/sysdeps/mips/nptl/pthreaddef.h index 271155f810..7b1283ae64 100644 --- a/sysdeps/mips/nptl/pthreaddef.h +++ b/sysdeps/mips/nptl/pthreaddef.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2016 Free Software Foundation, Inc. +/* Copyright (C) 2002-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/sysdeps/mips/nptl/tcb-offsets.sym b/sysdeps/mips/nptl/tcb-offsets.sym index e0e71dc430..9ea25b94a8 100644 --- a/sysdeps/mips/nptl/tcb-offsets.sym +++ b/sysdeps/mips/nptl/tcb-offsets.sym @@ -7,5 +7,4 @@ #define thread_offsetof(mem) (long)(offsetof(struct pthread, mem) - TLS_TCB_OFFSET - TLS_PRE_TCB_SIZE) MULTIPLE_THREADS_OFFSET thread_offsetof (header.multiple_threads) -PID_OFFSET thread_offsetof (pid) TID_OFFSET thread_offsetof (tid) diff --git a/sysdeps/mips/nptl/tls.h b/sysdeps/mips/nptl/tls.h index 10ca878292..777432fe1a 100644 --- a/sysdeps/mips/nptl/tls.h +++ b/sysdeps/mips/nptl/tls.h @@ -1,5 +1,5 @@ /* Definition for thread-local data handling. NPTL/MIPS version. - Copyright (C) 2005-2016 Free Software Foundation, Inc. + Copyright (C) 2005-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -25,20 +25,11 @@ # include <stdbool.h> # include <stddef.h> # include <stdint.h> +# include <dl-dtv.h> + /* Get system call information. */ # include <sysdep.h> -/* Type for the dtv. */ -typedef union dtv -{ - size_t counter; - struct - { - void *val; - bool is_static; - } pointer; -} dtv_t; - #ifdef __mips16 /* MIPS16 uses GCC builtin to access the TP. */ # define READ_THREAD_POINTER() (__builtin_thread_pointer ()) @@ -168,6 +159,7 @@ typedef struct # define NO_TLS_OFFSET -1 /* Get and set the global scope generation counter in struct pthread. */ +#define THREAD_GSCOPE_IN_TCB 1 #define THREAD_GSCOPE_FLAG_UNUSED 0 #define THREAD_GSCOPE_FLAG_USED 1 #define THREAD_GSCOPE_FLAG_WAIT 2 diff --git a/sysdeps/mips/preconfigure b/sysdeps/mips/preconfigure index c118592b27..48fc32ed5b 100644 --- a/sysdeps/mips/preconfigure +++ b/sysdeps/mips/preconfigure @@ -25,5 +25,7 @@ mips*) if test "$abiflag" != "_ABIO32" -a "$mips16flag" = "1"; then as_fn_error $? "MIPS16 is only supported with the o32 ABI." "$LINENO" 5 fi + + with_fp_cond="defined __mips_hard_float" ;; esac diff --git a/sysdeps/mips/regdef.h b/sysdeps/mips/regdef.h index 64cffbf5b2..d55b623759 100644 --- a/sysdeps/mips/regdef.h +++ b/sysdeps/mips/regdef.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1994-2016 Free Software Foundation, Inc. +/* Copyright (C) 1994-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ralf Baechle <ralf@gnu.org>. diff --git a/sysdeps/mips/rshift.S b/sysdeps/mips/rshift.S index 450c2f51d6..a80b902a7d 100644 --- a/sysdeps/mips/rshift.S +++ b/sysdeps/mips/rshift.S @@ -1,6 +1,6 @@ /* MIPS2 __mpn_rshift -- -Copyright (C) 1995-2016 Free Software Foundation, Inc. +Copyright (C) 1995-2018 Free Software Foundation, Inc. This file is part of the GNU MP Library. diff --git a/sysdeps/mips/setjmp.S b/sysdeps/mips/setjmp.S index 8ddbf19085..5863ffafbc 100644 --- a/sysdeps/mips/setjmp.S +++ b/sysdeps/mips/setjmp.S @@ -1,4 +1,4 @@ -/* Copyright (C) 1996-2016 Free Software Foundation, Inc. +/* Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -44,3 +44,4 @@ ENTRY (__sigsetjmp) j __sigsetjmp_aux #endif END (__sigsetjmp) +hidden_def (__sigsetjmp) diff --git a/sysdeps/mips/setjmp_aux.c b/sysdeps/mips/setjmp_aux.c index 2539ee00af..ee3e63f0ad 100644 --- a/sysdeps/mips/setjmp_aux.c +++ b/sysdeps/mips/setjmp_aux.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1996-2016 Free Software Foundation, Inc. +/* Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Brendan Kehoe (brendan@zen.org). @@ -23,7 +23,12 @@ pointer. We do things this way because it's difficult to reliably access them in C. */ +/* Stack protection is disabled to avoid changing s0 (or any other + caller-save register) before storing it to environment. + See BZ #22624. */ + int __attribute__ ((nomips16)) +inhibit_stack_protector __sigsetjmp_aux (jmp_buf env, int savemask, int sp, int fp) { #ifdef __mips_hard_float diff --git a/sysdeps/mips/sgidefs.h b/sysdeps/mips/sgidefs.h index ea9e497e32..e3721feeec 100644 --- a/sysdeps/mips/sgidefs.h +++ b/sysdeps/mips/sgidefs.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1996-2016 Free Software Foundation, Inc. +/* Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ralf Baechle <ralf@gnu.org>. diff --git a/sysdeps/mips/sotruss-lib.c b/sysdeps/mips/sotruss-lib.c index ea28ec7b5b..74d01bd1fc 100644 --- a/sysdeps/mips/sotruss-lib.c +++ b/sysdeps/mips/sotruss-lib.c @@ -1,5 +1,5 @@ /* Override generic sotruss-lib.c to define actual functions for MIPS. - Copyright (C) 2012-2016 Free Software Foundation, Inc. + Copyright (C) 2012-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/sysdeps/mips/stackinfo.h b/sysdeps/mips/stackinfo.h index 882d3ad3d4..ff3b6f594c 100644 --- a/sysdeps/mips/stackinfo.h +++ b/sysdeps/mips/stackinfo.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2016 Free Software Foundation, Inc. +/* Copyright (C) 2000-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/sysdeps/mips/start.S b/sysdeps/mips/start.S index cfbc297957..a4c4ef0fae 100644 --- a/sysdeps/mips/start.S +++ b/sysdeps/mips/start.S @@ -1,5 +1,5 @@ /* Startup code compliant to the ELF Mips ABI. - Copyright (C) 1995-2016 Free Software Foundation, Inc. + Copyright (C) 1995-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/sysdeps/mips/strcmp.S b/sysdeps/mips/strcmp.S index f1278d267f..1afeda3c5f 100644 --- a/sysdeps/mips/strcmp.S +++ b/sysdeps/mips/strcmp.S @@ -1,4 +1,4 @@ -/* Copyright (C) 2014-2016 Free Software Foundation, Inc. +/* Copyright (C) 2014-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/sysdeps/mips/sub_n.S b/sysdeps/mips/sub_n.S index 2d6bad1f90..3202016c71 100644 --- a/sysdeps/mips/sub_n.S +++ b/sysdeps/mips/sub_n.S @@ -1,7 +1,7 @@ /* MIPS2 __mpn_sub_n -- Subtract two limb vectors of the same length > 0 and store difference in a third limb vector. -Copyright (C) 1995-2016 Free Software Foundation, Inc. +Copyright (C) 1995-2018 Free Software Foundation, Inc. This file is part of the GNU MP Library. diff --git a/sysdeps/mips/submul_1.S b/sysdeps/mips/submul_1.S index 6acbb475fb..641cdb2df9 100644 --- a/sysdeps/mips/submul_1.S +++ b/sysdeps/mips/submul_1.S @@ -1,7 +1,7 @@ /* MIPS __mpn_submul_1 -- Multiply a limb vector with a single limb and subtract the product from a second limb vector. -Copyright (C) 1995-2016 Free Software Foundation, Inc. +Copyright (C) 1995-2018 Free Software Foundation, Inc. This file is part of the GNU MP Library. diff --git a/sysdeps/mips/sys/asm.h b/sysdeps/mips/sys/asm.h index 3373b850a1..9fabc79472 100644 --- a/sysdeps/mips/sys/asm.h +++ b/sysdeps/mips/sys/asm.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1997-2016 Free Software Foundation, Inc. +/* Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ralf Baechle <ralf@gnu.org>. diff --git a/sysdeps/mips/sys/fpregdef.h b/sysdeps/mips/sys/fpregdef.h index aa32f733ff..be79d9e2e6 100644 --- a/sysdeps/mips/sys/fpregdef.h +++ b/sysdeps/mips/sys/fpregdef.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-2016 Free Software Foundation, Inc. +/* Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/sysdeps/mips/sys/regdef.h b/sysdeps/mips/sys/regdef.h index 8416d97115..35a7c7ffaf 100644 --- a/sysdeps/mips/sys/regdef.h +++ b/sysdeps/mips/sys/regdef.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1997-2016 Free Software Foundation, Inc. +/* Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ralf Baechle <ralf@gnu.org>. diff --git a/sysdeps/mips/sys/tas.h b/sysdeps/mips/sys/tas.h index 22907ab86f..d5ed013e28 100644 --- a/sysdeps/mips/sys/tas.h +++ b/sysdeps/mips/sys/tas.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2016 Free Software Foundation, Inc. +/* Copyright (C) 2000-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Maciej W. Rozycki <macro@ds2.pg.gda.pl>, 2000. diff --git a/sysdeps/mips/sys/ucontext.h b/sysdeps/mips/sys/ucontext.h index b3d752bc46..aaa08fdea9 100644 --- a/sysdeps/mips/sys/ucontext.h +++ b/sysdeps/mips/sys/ucontext.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1998-2016 Free Software Foundation, Inc. +/* Copyright (C) 1998-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -21,8 +21,13 @@ #define _SYS_UCONTEXT_H 1 #include <features.h> + +#include <bits/types.h> +#include <bits/types/sigset_t.h> +#include <bits/types/stack_t.h> + #include <sgidefs.h> -#include <signal.h> + /* Type for general register. */ #if _MIPS_SIM == _ABIO32 @@ -32,127 +37,140 @@ typedef __uint64_t greg_t; #endif /* Number of general registers. */ -#define NGREG 36 +#define __NGREG 36 +#ifdef __USE_MISC +# define NGREG __NGREG +#endif /* Container for all general registers. */ -typedef greg_t gregset_t[NGREG]; +typedef greg_t gregset_t[__NGREG]; +#ifdef __USE_MISC /* Number of each register is the `gregset_t' array. */ enum { CTX_R0 = 0, -#define CTX_R0 CTX_R0 +# define CTX_R0 CTX_R0 CTX_AT = 1, -#define CTX_AT CTX_AT +# define CTX_AT CTX_AT CTX_V0 = 2, -#define CTX_V0 CTX_V0 +# define CTX_V0 CTX_V0 CTX_V1 = 3, -#define CTX_V1 CTX_V1 +# define CTX_V1 CTX_V1 CTX_A0 = 4, -#define CTX_A0 CTX_A0 +# define CTX_A0 CTX_A0 CTX_A1 = 5, -#define CTX_A1 CTX_A1 +# define CTX_A1 CTX_A1 CTX_A2 = 6, -#define CTX_A2 CTX_A2 +# define CTX_A2 CTX_A2 CTX_A3 = 7, -#define CTX_A3 CTX_A3 +# define CTX_A3 CTX_A3 CTX_T0 = 8, -#define CTX_T0 CTX_T0 +# define CTX_T0 CTX_T0 CTX_T1 = 9, -#define CTX_T1 CTX_T1 +# define CTX_T1 CTX_T1 CTX_T2 = 10, -#define CTX_T2 CTX_T2 +# define CTX_T2 CTX_T2 CTX_T3 = 11, -#define CTX_T3 CTX_T3 +# define CTX_T3 CTX_T3 CTX_T4 = 12, -#define CTX_T4 CTX_T4 +# define CTX_T4 CTX_T4 CTX_T5 = 13, -#define CTX_T5 CTX_T5 +# define CTX_T5 CTX_T5 CTX_T6 = 14, -#define CTX_T6 CTX_T6 +# define CTX_T6 CTX_T6 CTX_T7 = 15, -#define CTX_T7 CTX_T7 +# define CTX_T7 CTX_T7 CTX_S0 = 16, -#define CTX_S0 CTX_S0 +# define CTX_S0 CTX_S0 CTX_S1 = 17, -#define CTX_S1 CTX_S1 +# define CTX_S1 CTX_S1 CTX_S2 = 18, -#define CTX_S2 CTX_S2 +# define CTX_S2 CTX_S2 CTX_S3 = 19, -#define CTX_S3 CTX_S3 +# define CTX_S3 CTX_S3 CTX_S4 = 20, -#define CTX_S4 CTX_S4 +# define CTX_S4 CTX_S4 CTX_S5 = 21, -#define CTX_S5 CTX_S5 +# define CTX_S5 CTX_S5 CTX_S6 = 22, -#define CTX_S6 CTX_S6 +# define CTX_S6 CTX_S6 CTX_S7 = 23, -#define CTX_S7 CTX_S7 +# define CTX_S7 CTX_S7 CTX_T8 = 24, -#define CTX_T8 CTX_T8 +# define CTX_T8 CTX_T8 CTX_T9 = 25, -#define CTX_T9 CTX_T9 +# define CTX_T9 CTX_T9 CTX_K0 = 26, -#define CTX_K0 CTX_K0 +# define CTX_K0 CTX_K0 CTX_K1 = 27, -#define CTX_K1 CTX_K1 +# define CTX_K1 CTX_K1 CTX_GP = 28, -#define CTX_GP CTX_GP +# define CTX_GP CTX_GP CTX_SP = 29, -#define CTX_SP CTX_SP +# define CTX_SP CTX_SP CTX_S8 = 30, -#define CTX_S8 CTX_S8 +# define CTX_S8 CTX_S8 CTX_RA = 31, -#define CTX_RA CTX_RA +# define CTX_RA CTX_RA CTX_MDLO = 32, -#define CTX_MDLO CTX_MDLO +# define CTX_MDLO CTX_MDLO CTX_MDHI = 33, -#define CTX_MDHI CTX_MDHI +# define CTX_MDHI CTX_MDHI CTX_CAUSE = 34, -#define CTX_CAUSE CTX_CAUSE +# define CTX_CAUSE CTX_CAUSE CTX_EPC = 35, -#define CTX_EPC CTX_EPC +# define CTX_EPC CTX_EPC }; +#endif + +#ifdef __USE_MISC +# define __ctx(fld) fld +#else +# define __ctx(fld) __ ## fld +#endif /* Structure to describe FPU registers. */ -typedef struct fpregset +typedef struct { union { #if _MIPS_SIM == _ABIO32 - double fp_dregs[16]; - float fp_fregs[32]; - unsigned int fp_regs[32]; + double __ctx(fp_dregs)[16]; + float __ctx(fp_fregs)[32]; + unsigned int __ctx(fp_regs)[32]; #else - double fp_dregs[32]; - /* float fp_fregs[32]; */ - __uint64_t fp_regs[32]; + double __ctx(fp_dregs)[32]; + /* float __ctx(fp_fregs)[32]; */ + __uint64_t __ctx(fp_regs)[32]; #endif - } fp_r; - unsigned int fp_csr; - unsigned int fp_pad; + } __ctx(fp_r); + unsigned int __ctx(fp_csr); + unsigned int __ctx(fp_pad); } fpregset_t; /* Context to describe whole processor state. */ typedef struct { - gregset_t gpregs; - fpregset_t fpregs; + gregset_t __ctx(gpregs); + fpregset_t __ctx(fpregs); } mcontext_t; /* Userlevel context. */ -typedef struct ucontext +typedef struct ucontext_t { #if _MIPS_SIM == _ABIO32 - unsigned long int uc_flags; + unsigned long int __ctx(uc_flags); #else - __uint64_t uc_flags; + __uint64_t __ctx(uc_flags); #endif - struct ucontext *uc_link; - __sigset_t uc_sigmask; + struct ucontext_t *uc_link; + sigset_t uc_sigmask; stack_t uc_stack; mcontext_t uc_mcontext; - int uc_filler[48]; + int __glibc_reserved1[48]; } ucontext_t; +#undef __ctx + #endif /* sys/ucontext.h */ diff --git a/sysdeps/mips/tst-abi-fp32mod.c b/sysdeps/mips/tst-abi-fp32mod.c index 860f7979b1..fe0d6503e2 100644 --- a/sysdeps/mips/tst-abi-fp32mod.c +++ b/sysdeps/mips/tst-abi-fp32mod.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2014-2016 Free Software Foundation, Inc. +/* Copyright (C) 2014-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/sysdeps/mips/tst-abi-fp64amod.c b/sysdeps/mips/tst-abi-fp64amod.c index 8b336cec5a..3f1e3827a5 100644 --- a/sysdeps/mips/tst-abi-fp64amod.c +++ b/sysdeps/mips/tst-abi-fp64amod.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2014-2016 Free Software Foundation, Inc. +/* Copyright (C) 2014-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/sysdeps/mips/tst-abi-fp64mod.c b/sysdeps/mips/tst-abi-fp64mod.c index 9ef89f2446..bdb46e4e7d 100644 --- a/sysdeps/mips/tst-abi-fp64mod.c +++ b/sysdeps/mips/tst-abi-fp64mod.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2014-2016 Free Software Foundation, Inc. +/* Copyright (C) 2014-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/sysdeps/mips/tst-abi-fpxxmod.c b/sysdeps/mips/tst-abi-fpxxmod.c index 1ecaa22da6..81b95da80e 100644 --- a/sysdeps/mips/tst-abi-fpxxmod.c +++ b/sysdeps/mips/tst-abi-fpxxmod.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2014-2016 Free Software Foundation, Inc. +/* Copyright (C) 2014-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/sysdeps/mips/tst-abi-fpxxomod.c b/sysdeps/mips/tst-abi-fpxxomod.c index 1fe40fa3b1..d26966095c 100644 --- a/sysdeps/mips/tst-abi-fpxxomod.c +++ b/sysdeps/mips/tst-abi-fpxxomod.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2014-2016 Free Software Foundation, Inc. +/* Copyright (C) 2014-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/sysdeps/mips/tst-abi-interlink.c b/sysdeps/mips/tst-abi-interlink.c index 125f98ffeb..7407e2564d 100644 --- a/sysdeps/mips/tst-abi-interlink.c +++ b/sysdeps/mips/tst-abi-interlink.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2014-2016 Free Software Foundation, Inc. +/* Copyright (C) 2014-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/sysdeps/mips/tst-audit.h b/sysdeps/mips/tst-audit.h index a24bf75f02..02adb0902c 100644 --- a/sysdeps/mips/tst-audit.h +++ b/sysdeps/mips/tst-audit.h @@ -1,6 +1,6 @@ /* Definitions for testing PLT entry/exit auditing. ARM version. - Copyright (C) 2005-2016 Free Software Foundation, Inc. + Copyright (C) 2005-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. diff --git a/sysdeps/mips/tst-mode-switch-1.c b/sysdeps/mips/tst-mode-switch-1.c index 1a26e4c7b5..aa73c82b22 100644 --- a/sysdeps/mips/tst-mode-switch-1.c +++ b/sysdeps/mips/tst-mode-switch-1.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2014-2016 Free Software Foundation, Inc. +/* Copyright (C) 2014-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -71,8 +71,8 @@ thread_function (void * arg __attribute__ ((unused))) return NULL; } -int -main (void) +static int +do_test (void) { int count = sysconf (_SC_NPROCESSORS_ONLN); if (count <= 0) @@ -121,3 +121,6 @@ main (void) return result; } + +#define TEST_FUNCTION do_test () +#include "../../test-skeleton.c" diff --git a/sysdeps/mips/tst-mode-switch-2.c b/sysdeps/mips/tst-mode-switch-2.c index b41acf45d3..2f63e7ff8e 100644 --- a/sysdeps/mips/tst-mode-switch-2.c +++ b/sysdeps/mips/tst-mode-switch-2.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2014-2016 Free Software Foundation, Inc. +/* Copyright (C) 2014-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -77,8 +77,8 @@ thread_function (void * arg __attribute__ ((unused))) return NULL; } -int -main (void) +static int +do_test (void) { int count = sysconf (_SC_NPROCESSORS_ONLN); if (count <= 0) @@ -161,3 +161,6 @@ main (void) return result; } + +#define TEST_FUNCTION do_test () +#include "../../test-skeleton.c" diff --git a/sysdeps/mips/tst-mode-switch-3.c b/sysdeps/mips/tst-mode-switch-3.c index 65e2b5eebd..f9ba8b2603 100644 --- a/sysdeps/mips/tst-mode-switch-3.c +++ b/sysdeps/mips/tst-mode-switch-3.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2014-2016 Free Software Foundation, Inc. +/* Copyright (C) 2014-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -43,8 +43,8 @@ static jmp_buf env; float check1 = 2.0; double check2 = 3.0; -int -main (void) +static int +do_test (void) { int i; int result = 0; @@ -88,3 +88,6 @@ main (void) return result; } + +#define TEST_FUNCTION do_test () +#include "../../test-skeleton.c" |