diff options
Diffstat (limited to 'sysdeps/sparc/sparc64')
259 files changed, 3059 insertions, 2694 deletions
diff --git a/sysdeps/sparc/sparc64/Implies b/sysdeps/sparc/sparc64/Implies index 7abc50efcc..fe5eccd855 100644 --- a/sysdeps/sparc/sparc64/Implies +++ b/sysdeps/sparc/sparc64/Implies @@ -4,4 +4,3 @@ ieee754/ldbl-128 ieee754/dbl-64/wordsize-64 ieee754/dbl-64 ieee754/flt-32 -sparc/sparc64/soft-fp diff --git a/sysdeps/sparc/sparc64/Makefile b/sysdeps/sparc/sparc64/Makefile index 3a12510307..16b760539e 100644 --- a/sysdeps/sparc/sparc64/Makefile +++ b/sysdeps/sparc/sparc64/Makefile @@ -1,14 +1,33 @@ +# Makefile for SPARC 64-bit. +# Copyright (C) 1997-2018 Free Software Foundation, Inc. +# This file is part of the GNU C Library. +# Contributed by Jakub Jelinek (jj@ultra.linux.cz). +# + +# 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/>. + +sysdep-CFLAGS += -Wa,-Av9a -mvis + ifeq ($(subdir),string) sysdep_routines += align-cpy endif -ifeq ($(have-as-vis3),yes) ASFLAGS-.o += -Wa,-Av9d ASFLAGS-.os += -Wa,-Av9d ASFLAGS-.op += -Wa,-Av9d -ASFLAGS-.og += -Wa,-Av9d ASFLAGS-.oS += -Wa,-Av9d -endif # nscd uses atomic_spin_nop which in turn requires cpu_relax ifeq ($(subdir),nscd) @@ -18,3 +37,15 @@ endif ifeq ($(subdir),nptl) libpthread-routines += cpu_relax endif + +ifeq ($(subdir),soft-fp) +sparc64-quad-routines := qp_add qp_cmp qp_cmpe qp_div qp_dtoq qp_feq qp_fge \ + qp_fgt qp_fle qp_flt qp_fne qp_itoq qp_mul qp_neg qp_qtod qp_qtoi \ + qp_qtos qp_qtoui qp_qtoux qp_qtox qp_sqrt qp_stoq qp_sub qp_uitoq \ + qp_uxtoq qp_xtoq qp_util +sysdep_routines += $(sparc64-quad-routines) +endif + +ifeq ($(subdir),math) +CPPFLAGS += -I../soft-fp/ +endif diff --git a/sysdeps/sparc/sparc64/Versions b/sysdeps/sparc/sparc64/Versions index 4cef7bcc71..b2661ede85 100644 --- a/sysdeps/sparc/sparc64/Versions +++ b/sysdeps/sparc/sparc64/Versions @@ -4,6 +4,12 @@ libc { __align_cpy_1; __align_cpy_2; __align_cpy_4; __align_cpy_8; __align_cpy_16; } + GLIBC_2.2 { + _Qp_add; _Qp_cmp; _Qp_cmpe; _Qp_div; _Qp_dtoq; _Qp_feq; _Qp_fge; _Qp_fgt; + _Qp_fle; _Qp_flt; _Qp_fne; _Qp_itoq; _Qp_mul; _Qp_neg; _Qp_qtod; _Qp_qtoi; + _Qp_qtos; _Qp_qtoui; _Qp_qtoux; _Qp_qtox; _Qp_sqrt; _Qp_stoq; _Qp_sub; + _Qp_uitoq; _Qp_uxtoq; _Qp_xtoq; + } } libm { GLIBC_2.1 { diff --git a/sysdeps/sparc/sparc64/add_n.S b/sysdeps/sparc/sparc64/add_n.S index f208965d20..f804090c0d 100644 --- a/sysdeps/sparc/sparc64/add_n.S +++ b/sysdeps/sparc/sparc64/add_n.S @@ -1,7 +1,7 @@ /* SPARC v9 __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/sparc/sparc64/addmul_1.S b/sysdeps/sparc/sparc64/addmul_1.S index 4a0b39b86d..b36ce03764 100644 --- a/sysdeps/sparc/sparc64/addmul_1.S +++ b/sysdeps/sparc/sparc64/addmul_1.S @@ -1,7 +1,7 @@ /* SPARC v9 __mpn_addmul_1 -- Multiply a limb vector with a single limb and add the product to a second limb vector. - Copyright (C) 1996-2016 Free Software Foundation, Inc. + Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU MP Library. diff --git a/sysdeps/sparc/sparc64/align-cpy.S b/sysdeps/sparc/sparc64/align-cpy.S index 55ac0ed6c1..945a81a9e2 100644 --- a/sysdeps/sparc/sparc64/align-cpy.S +++ b/sysdeps/sparc/sparc64/align-cpy.S @@ -1,6 +1,6 @@ /* Aligned copy routines specified by Sparc V9 ABI. For 64-bit sparc. - Copyright (C) 2010-2016 Free Software Foundation, Inc. + Copyright (C) 2010-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by David S. Miller (davem@davemloft.net) diff --git a/sysdeps/sparc/sparc64/atomic-machine.h b/sysdeps/sparc/sparc64/atomic-machine.h index c1777fa950..a737dda2c4 100644 --- a/sysdeps/sparc/sparc64/atomic-machine.h +++ b/sysdeps/sparc/sparc64/atomic-machine.h @@ -1,5 +1,5 @@ /* Atomic operations. sparc64 version. - 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. Contributed by Jakub Jelinek <jakub@redhat.com>, 2003. @@ -47,6 +47,9 @@ typedef uintmax_t uatomic_max_t; #define __HAVE_64B_ATOMICS 1 #define USE_ATOMIC_COMPILER_BUILTINS 0 +/* XXX Is this actually correct? */ +#define ATOMIC_EXCHANGE_USES_CAS 1 + #define __arch_compare_and_exchange_val_8_acq(mem, newval, oldval) \ (abort (), (__typeof (*mem)) 0) diff --git a/sysdeps/sparc/sparc64/bits/wordsize.h b/sysdeps/sparc/sparc64/bits/wordsize.h index d8fd1a513d..2f66f10d72 100644 --- a/sysdeps/sparc/sparc64/bits/wordsize.h +++ b/sysdeps/sparc/sparc64/bits/wordsize.h @@ -5,4 +5,7 @@ # define __WORDSIZE_TIME64_COMPAT32 1 #else # define __WORDSIZE 32 +# define __WORDSIZE_TIME64_COMPAT32 0 +# define __WORDSIZE32_SIZE_ULONG 0 +# define __WORDSIZE32_PTRDIFF_LONG 0 #endif diff --git a/sysdeps/sparc/sparc64/cpu_relax.S b/sysdeps/sparc/sparc64/cpu_relax.S deleted file mode 100644 index e527589d19..0000000000 --- a/sysdeps/sparc/sparc64/cpu_relax.S +++ /dev/null @@ -1,67 +0,0 @@ -/* CPU strand yielding for busy loops. - Copyright (C) 2012-2016 Free Software Foundation, Inc. - Contributed by David S. Miller (davem@davemloft.net) - 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 <sysdep.h> - - .text -__cpu_relax_generic: - rd %ccr, %g0 - rd %ccr, %g0 - rd %ccr, %g0 - retl - nop - .size __cpu_relax_generic,.-__cpu_relax_generic - -__cpu_relax_pause: - wr %g0, 128, %asr27 - retl - nop - .size __cpu_relax_pause,.-__cpu_relax_pause - -ENTRY(__cpu_relax) - .type __cpu_relax, @gnu_indirect_function -# ifdef SHARED - SETUP_PIC_REG_LEAF(o3, o5) -# endif - set HWCAP_SPARC_PAUSE, %o1 - andcc %o0, %o1, %g0 - be 1f - nop -# ifdef SHARED - sethi %gdop_hix22(__cpu_relax_pause), %o1 - xor %o1, %gdop_lox10(__cpu_relax_pause), %o1 -# else - set __cpu_relax_pause, %o1 -# endif - ba 10f - nop -1: -# ifdef SHARED - sethi %gdop_hix22(__cpu_relax_generic), %o1 - xor %o1, %gdop_lox10(__cpu_relax_generic), %o1 -# else - set __cpu_relax_generic, %o1 -# endif -10: -# ifdef SHARED - add %o3, %o1, %o1 -# endif - retl - mov %o1, %o0 -END(__cpu_relax) diff --git a/sysdeps/sparc/sparc64/cpu_relax.c b/sysdeps/sparc/sparc64/cpu_relax.c new file mode 100644 index 0000000000..c485777f8f --- /dev/null +++ b/sysdeps/sparc/sparc64/cpu_relax.c @@ -0,0 +1,38 @@ +/* CPU strand yielding for busy loops. Linux/sparc64 version. + 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/>. */ + +#include <sparc-ifunc.h> + +static void +__cpu_relax_generic (void) +{ + asm volatile ("rd %ccr, %g0;" + "rd %ccr, %g0;" + "rd %ccr, %g0"); +} + +static void +__cpu_relax_pause (void) +{ + asm volatile ("wr %g0, 128, %asr27"); +} + +sparc_libc_ifunc (__cpu_relax, + hwcap & HWCAP_SPARC_PAUSE + ? __cpu_relax_pause + : __cpu_relax_generic) diff --git a/sysdeps/sparc/sparc64/dl-irel.h b/sysdeps/sparc/sparc64/dl-irel.h index cbb519187a..c5cd3057ac 100644 --- a/sysdeps/sparc/sparc64/dl-irel.h +++ b/sysdeps/sparc/sparc64/dl-irel.h @@ -1,6 +1,6 @@ /* Machine-dependent ELF indirect relocation inline functions. SPARC 64-bit version. - Copyright (C) 2010-2016 Free Software Foundation, Inc. + Copyright (C) 2010-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/sparc/sparc64/dl-machine.h b/sysdeps/sparc/sparc64/dl-machine.h index 713aeb7734..cd6a6996cb 100644 --- a/sysdeps/sparc/sparc64/dl-machine.h +++ b/sysdeps/sparc/sparc64/dl-machine.h @@ -1,5 +1,5 @@ /* Machine-dependent ELF dynamic relocation inline functions. Sparc64 version. - 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. The GNU C Library is free software; you can redistribute it and/or @@ -85,6 +85,7 @@ elf_machine_load_address (void) static inline Elf64_Addr __attribute__ ((always_inline)) elf_machine_fixup_plt (struct link_map *map, lookup_t t, + const ElfW(Sym) *refsym, const ElfW(Sym) *sym, const Elf64_Rela *reloc, Elf64_Addr *reloc_addr, Elf64_Addr value) { @@ -402,12 +403,13 @@ elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc, if (__builtin_expect (ELF64_ST_BIND (sym->st_info) == STB_LOCAL, 0) && sym->st_shndx != SHN_UNDEF) { + sym_map = map; value = map->l_addr; } else { 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); } #else value = 0; @@ -537,6 +539,12 @@ elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc, case R_SPARC_DISP32: *(unsigned int *) reloc_addr = (value - (Elf64_Addr) reloc_addr); break; + case R_SPARC_DISP64: + *reloc_addr = (value - (Elf64_Addr) reloc_addr); + break; + case R_SPARC_REGISTER: + *reloc_addr = value; + break; case R_SPARC_WDISP30: *(unsigned int *) reloc_addr = ((*(unsigned int *)reloc_addr & 0xc0000000) | diff --git a/sysdeps/sparc/sparc64/dl-plt.h b/sysdeps/sparc/sparc64/dl-plt.h index b8c3f9474e..46b690c1ad 100644 --- a/sysdeps/sparc/sparc64/dl-plt.h +++ b/sysdeps/sparc/sparc64/dl-plt.h @@ -1,5 +1,5 @@ /* PLT fixups. Sparc 64-bit version. - 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. The GNU C Library is free software; you can redistribute it and/or diff --git a/sysdeps/sparc/sparc64/dl-trampoline.S b/sysdeps/sparc/sparc64/dl-trampoline.S index 65eb8e1a75..4948b88b96 100644 --- a/sysdeps/sparc/sparc64/dl-trampoline.S +++ b/sysdeps/sparc/sparc64/dl-trampoline.S @@ -1,5 +1,5 @@ /* PLT trampolines. Sparc 64-bit 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/sparc/sparc64/fpu/e_sqrtl.c b/sysdeps/sparc/sparc64/fpu/e_sqrtl.c index 3a09383daa..68bd584e35 100644 --- a/sysdeps/sparc/sparc64/fpu/e_sqrtl.c +++ b/sysdeps/sparc/sparc64/fpu/e_sqrtl.c @@ -1,5 +1,5 @@ /* Long double square root, sparc64 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. Contributed by Jakub Jelinek <jakub@redhat.com>, 2000. diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/Makefile b/sysdeps/sparc/sparc64/fpu/multiarch/Makefile index 6a9274b4fa..3321e1d916 100644 --- a/sysdeps/sparc/sparc64/fpu/multiarch/Makefile +++ b/sysdeps/sparc/sparc64/fpu/multiarch/Makefile @@ -1,18 +1,30 @@ ifeq ($(subdir),math) -libm-sysdep_routines += s_ceil-vis2 s_ceilf-vis2 \ - s_floor-vis2 s_floorf-vis2 -ifeq ($(have-as-vis3),yes) -libm-sysdep_routines += m_signbitf-vis3 m_signbit-vis3 s_ceilf-vis3 \ - s_ceil-vis3 m_finitef-vis3 m_finite-vis3 \ - s_floorf-vis3 s_floor-vis3 m_isinff-vis3 \ - m_isinf-vis3 m_isnanf-vis3 m_isnan-vis3 \ - s_lrintf-vis3 s_lrint-vis3 s_rintf-vis3 \ - s_rint-vis3 s_fminf-vis3 s_fmin-vis3 \ - s_fmaxf-vis3 s_fmax-vis3 s_fmaf-vis3 \ - s_fma-vis3 s_nearbyint-vis3 s_nearbyintf-vis3 \ - s_truncf-vis3 s_trunc-vis3 -sysdep_routines += s_signbitf-vis3 s_signbit-vis3 s_finitef-vis3 \ - s_finite-vis3 s_isinff-vis3 s_isinf-vis3 \ - s_isnanf-vis3 s_isnan-vis3 -endif +# These functions are built both for libc and libm because they're required +# by printf. While the libc objects have the prefix s_, the libm ones are +# prefixed with m_. +sysdep_calls := s_signbitf-vis3 s_signbit-vis3 s_signbitf-generic \ + s_signbit-generic s_finitef-vis3 s_finite-vis3 \ + s_finitef-generic s_finite-generic \ + s_isinff-vis3 s_isinf-vis3 s_isinff-generic s_isinf-generic \ + s_isnanf-vis3 s_isnan-vis3 s_isnanf-generic s_isnan-generic + +sysdep_routines += $(sysdep_calls) +libm-sysdep_routines += s_lrintf-vis3 s_lrint-vis3 s_lrintf-generic \ + s_lrint-generic s_rintf-vis3 s_rint-vis3 \ + s_rintf-generic s_rint-generic \ + s_fmaf-vis3 s_fma-vis3 s_fmaf-generic s_fma-generic \ + s_nearbyint-vis3 s_nearbyintf-vis3 \ + s_nearbyint-generic s_nearbyintf-generic \ + s_ceilf-vis3 s_ceil-vis3 s_ceilf-generic \ + s_ceil-generic s_floorf-vis3 s_floor-vis3 \ + s_floorf-generic s_floor-generic s_truncf-vis3 \ + s_trunc-vis3 s_truncf-generic s_trunc-generic \ + $(sysdep_calls:s_%=m_%) + +CFLAGS-s_ceilf-vis3.c += -Wa,-Av9d -mvis3 +CFLAGS-s_ceil-vis3.c += -Wa,-Av9d -mvis3 +CFLAGS-s_floorf-vis3.c += -Wa,-Av9d -mvis3 +CFLAGS-s_floor-vis3.c += -Wa,-Av9d -mvis3 +CFLAGS-s_truncf-vis3.c += -Wa,-Av9d -mvis3 +CFLAGS-s_trunc-vis3.c += -Wa,-Av9d -mvis3 endif diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-generic.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-generic.c new file mode 100644 index 0000000000..febea745e1 --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-generic.c @@ -0,0 +1,2 @@ +#define __ceil __ceil_generic +#include <sysdeps/ieee754/dbl-64/wordsize-64/s_ceil.c> diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-vis2.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-vis2.S deleted file mode 100644 index fd1bf38662..0000000000 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-vis2.S +++ /dev/null @@ -1,57 +0,0 @@ -/* ceil function, sparc64 vis2 version. - Copyright (C) 2012-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David S. Miller <davem@davemloft.net>, 2012. - - 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 <sysdep.h> - - /* 'siam' (Set Interval Arithmetic Mode) is used to quickly override - the rounding mode during this routine. - - We add then subtract (or subtract than add if the initial - value was negative) 2**23 to the value, then subtract it - back out. - - This will clear out the fractional portion of the value and, - with suitable 'siam' initiated rouding mode settings, round - the final result in the proper direction. */ - -#define TWO_FIFTYTWO 0x43300000 /* 2**52 */ - -#define ZERO %f10 /* 0.0 */ -#define SIGN_BIT %f12 /* -0.0 */ - -ENTRY (__ceil_vis2) - sethi %hi(TWO_FIFTYTWO), %o2 - fzero ZERO - sllx %o2, 32, %o2 - fnegd ZERO, SIGN_BIT - stx %o2, [%sp + STACK_BIAS + 128] - fabsd %f0, %f14 - ldd [%sp + STACK_BIAS + 128], %f16 - fcmpd %fcc3, %f14, %f16 - fmovduge %fcc3, ZERO, %f16 - fand %f0, SIGN_BIT, SIGN_BIT - for %f16, SIGN_BIT, %f16 - siam (1 << 2) | 2 - faddd %f0, %f16, %f18 - siam (1 << 2) | 0 - fsubd %f18, %f16, %f18 - siam (0 << 2) - retl - for %f18, SIGN_BIT, %f0 -END (__ceil_vis2) diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-vis3.S deleted file mode 100644 index e6fa3f53d2..0000000000 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-vis3.S +++ /dev/null @@ -1,59 +0,0 @@ -/* ceil function, sparc64 vis3 version. - Copyright (C) 2012-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David S. Miller <davem@davemloft.net>, 2012. - - 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 <sysdep.h> - - /* 'siam' (Set Interval Arithmetic Mode) is used to quickly override - the rounding mode during this routine. - - We add then subtract (or subtract than add if the initial - value was negative) 2**23 to the value, then subtract it - back out. - - This will clear out the fractional portion of the value and, - with suitable 'siam' initiated rouding mode settings, round - the final result in the proper direction. - - We also use VIS3 moves to avoid using the stack to transfer - values between float and integer registers. */ - -#define TWO_FIFTYTWO 0x43300000 /* 2**52 */ - -#define ZERO %f10 /* 0.0 */ -#define SIGN_BIT %f12 /* -0.0 */ - -ENTRY (__ceil_vis3) - sethi %hi(TWO_FIFTYTWO), %o2 - fzero ZERO - sllx %o2, 32, %o2 - fnegd ZERO, SIGN_BIT - movxtod %o2, %f16 - fabsd %f0, %f14 - fcmpd %fcc3, %f14, %f16 - fmovduge %fcc3, ZERO, %f16 - fand %f0, SIGN_BIT, SIGN_BIT - for %f16, SIGN_BIT, %f16 - siam (1 << 2) | 2 - faddd %f0, %f16, %f18 - siam (1 << 2) | 0 - fsubd %f18, %f16, %f18 - siam (0 << 2) - retl - for %f18, SIGN_BIT, %f0 -END (__ceil_vis3) diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_fmax-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-vis3.c index 9a5c075375..a03a0090f0 100644 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_fmax-vis3.S +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-vis3.c @@ -1,7 +1,6 @@ -/* fmax function, sparc64 vis3 version. - Copyright (C) 2012-2016 Free Software Foundation, Inc. +/* ceil function, sparc64 vis3 version. + Copyright (C) 2016-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by David S. Miller <davem@davemloft.net>, 2012. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -17,10 +16,8 @@ License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ -#include <sysdep.h> +#include <math.h> -ENTRY (__fmax_vis3) - flcmpd %fcc1, %f0, %f2 - retl - fmovdlg %fcc1, %f2, %f0 -END (__fmax_vis3) +#define __ceil __ceil_vis3 + +#include <sysdeps/ieee754/dbl-64/wordsize-64/s_ceil.c> diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil.S deleted file mode 100644 index e7822bc307..0000000000 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil.S +++ /dev/null @@ -1,12 +0,0 @@ -#include <sparc-ifunc.h> - -SPARC_ASM_VIS3_VIS2_IFUNC(ceil) - -weak_alias (__ceil, ceil) - -# undef weak_alias -# define weak_alias(a, b) - -#define __ceil __ceil_generic - -#include "../s_ceil.S" diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil.c new file mode 100644 index 0000000000..3d34622d43 --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil.c @@ -0,0 +1,30 @@ +/* ceil function, sparc64 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 <sparc-ifunc.h> +#include <math.h> +#include <libm-alias-double.h> + +extern __typeof (ceil) __ceil_vis3 attribute_hidden; +extern __typeof (ceil) __ceil_generic attribute_hidden; + +sparc_libm_ifunc (__ceil, + hwcap & HWCAP_SPARC_VIS3 + ? __ceil_vis3 + : __ceil_generic) +libm_alias_double (__ceil, ceil) diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-generic.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-generic.c new file mode 100644 index 0000000000..ce75035954 --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-generic.c @@ -0,0 +1,2 @@ +#define __ceilf __ceilf_generic +#include <sysdeps/ieee754/flt-32/s_ceilf.c> diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-vis2.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-vis2.S deleted file mode 100644 index fe57a52a4a..0000000000 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-vis2.S +++ /dev/null @@ -1,56 +0,0 @@ -/* Float ceil function, sparc64 vis2 version. - Copyright (C) 2012-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David S. Miller <davem@davemloft.net>, 2012. - - 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 <sysdep.h> - - /* 'siam' (Set Interval Arithmetic Mode) is used to quickly override - the rounding mode during this routine. - - We add then subtract (or subtract than add if the initial - value was negative) 2**23 to the value, then subtract it - back out. - - This will clear out the fractional portion of the value and, - with suitable 'siam' initiated rouding mode settings, round - the final result in the proper direction. */ - -#define TWO_TWENTYTHREE 0x4b000000 /* 2**23 */ - -#define ZERO %f10 /* 0.0 */ -#define SIGN_BIT %f12 /* -0.0 */ - -ENTRY (__ceilf_vis2) - sethi %hi(TWO_TWENTYTHREE), %o2 - fzeros ZERO - fnegs ZERO, SIGN_BIT - st %o2, [%sp + STACK_BIAS + 128] - fabss %f1, %f14 - ld [%sp + STACK_BIAS + 128], %f16 - fcmps %fcc3, %f14, %f16 - fmovsuge %fcc3, ZERO, %f16 - fands %f1, SIGN_BIT, SIGN_BIT - fors %f16, SIGN_BIT, %f16 - siam (1 << 2) | 2 - fadds %f1, %f16, %f5 - siam (1 << 2) | 0 - fsubs %f5, %f16, %f5 - siam (0 << 2) - retl - fors %f5, SIGN_BIT, %f0 -END (__ceilf_vis2) diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-vis3.S deleted file mode 100644 index 9a0f9c567e..0000000000 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-vis3.S +++ /dev/null @@ -1,58 +0,0 @@ -/* Float ceil function, sparc64 vis3 version. - Copyright (C) 2012-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David S. Miller <davem@davemloft.net>, 2012. - - 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 <sysdep.h> - - /* 'siam' (Set Interval Arithmetic Mode) is used to quickly override - the rounding mode during this routine. - - We add then subtract (or subtract than add if the initial - value was negative) 2**23 to the value, then subtract it - back out. - - This will clear out the fractional portion of the value and, - with suitable 'siam' initiated rouding mode settings, round - the final result in the proper direction. - - We also use VIS3 moves to avoid using the stack to transfer - values between float and integer registers. */ - -#define TWO_TWENTYTHREE 0x4b000000 /* 2**23 */ - -#define ZERO %f10 /* 0.0 */ -#define SIGN_BIT %f12 /* -0.0 */ - -ENTRY (__ceilf_vis3) - sethi %hi(TWO_TWENTYTHREE), %o2 - fzeros ZERO - fnegs ZERO, SIGN_BIT - movwtos %o2, %f16 - fabss %f1, %f14 - fcmps %fcc3, %f14, %f16 - fmovsuge %fcc3, ZERO, %f16 - fands %f1, SIGN_BIT, SIGN_BIT - fors %f16, SIGN_BIT, %f16 - siam (1 << 2) | 2 - fadds %f1, %f16, %f5 - siam (1 << 2) | 0 - fsubs %f5, %f16, %f5 - siam (0 << 2) - retl - fors %f5, SIGN_BIT, %f0 -END (__ceilf_vis3) diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_fmin-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-vis3.c index b8c3fe0357..eb9ed6f7de 100644 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_fmin-vis3.S +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-vis3.c @@ -1,7 +1,6 @@ -/* fmin function, sparc64 vis3 version. - Copyright (C) 2012-2016 Free Software Foundation, Inc. +/* Float ceil function, sparc64 vis3 version. + Copyright (C) 2016-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by David S. Miller <davem@davemloft.net>, 2012. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -17,10 +16,8 @@ License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ -#include <sysdep.h> +#include <math.h> -ENTRY (__fmin_vis3) - flcmpd %fcc1, %f0, %f2 - retl - fmovdge %fcc1, %f2, %f0 -END (__fmin_vis3) +#define __ceilf __ceilf_vis3 + +#include <sysdeps/ieee754/flt-32/s_ceilf.c> diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf.S deleted file mode 100644 index 1c72a5728e..0000000000 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf.S +++ /dev/null @@ -1,12 +0,0 @@ -#include <sparc-ifunc.h> - -SPARC_ASM_VIS3_VIS2_IFUNC(ceilf) - -weak_alias (__ceilf, ceilf) - -# undef weak_alias -# define weak_alias(a, b) - -#define __ceilf __ceilf_generic - -#include "../s_ceilf.S" diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf.c new file mode 100644 index 0000000000..18d2eb565d --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf.c @@ -0,0 +1,30 @@ +/* Float ceil function, sparc64 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 <sparc-ifunc.h> +#include <math.h> +#include <libm-alias-float.h> + +extern __typeof (ceilf) __ceilf_vis3 attribute_hidden; +extern __typeof (ceilf) __ceilf_generic attribute_hidden; + +sparc_libm_ifunc (__ceilf, + hwcap & HWCAP_SPARC_VIS3 + ? __ceilf_vis3 + : __ceilf_generic); +libm_alias_float (__ceil, ceil) diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_finite-generic.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_finite-generic.S new file mode 100644 index 0000000000..dfbf32fc3f --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_finite-generic.S @@ -0,0 +1,6 @@ +#define __finite __finite_generic +#undef hidden_def +#define hidden_def(a) +#undef weak_alias +#define weak_alias(a,b) +#include <sysdeps/sparc/sparc64/fpu/s_finite.S> diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_finite-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_finite-vis3.S index 6d4297b9ed..0cd3fd50c9 100644 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_finite-vis3.S +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_finite-vis3.S @@ -1,5 +1,5 @@ /* finite(). sparc64 vis3 version. - 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/sparc/sparc64/fpu/multiarch/s_finite.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_finite.S deleted file mode 100644 index 78406a62b1..0000000000 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_finite.S +++ /dev/null @@ -1,15 +0,0 @@ -#include <sparc-ifunc.h> - -SPARC_ASM_VIS3_IFUNC(finite) - -hidden_def (__finite) -weak_alias (__finite, finite) - -# undef weak_alias -# define weak_alias(a, b) -# undef hidden_def -# define hidden_def(a) - -#define __finite __finite_generic - -#include "../s_finite.S" diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_finite.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_finite.c new file mode 100644 index 0000000000..b51ed19438 --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_finite.c @@ -0,0 +1,37 @@ +/* finite ifunc resolver, Linux/sparc64 version. + 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/>. */ + +#define __finite __redirect___finite +#define __finitef __redirect___finitef +#define __finitel __redirect___finitel +#include <math.h> +#undef __finite +#undef __finitef +#undef __finitel +#include <sparc-ifunc.h> + +extern __typeof (finite) __finite_vis3 attribute_hidden; +extern __typeof (finite) __finite_generic attribute_hidden; + +sparc_libm_ifunc_redirected (__redirect___finite, __finite, + hwcap & HWCAP_SPARC_VIS3 + ? __finite_vis3 + : __finite_generic); + +sparc_ifunc_redirected_hidden_def (__redirect___finite, __finite) +weak_alias (__finite, finite) diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_finitef-generic.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_finitef-generic.S new file mode 100644 index 0000000000..38880765fe --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_finitef-generic.S @@ -0,0 +1,6 @@ +#define __finitef __finitef_generic +#undef hidden_def +#define hidden_def(a) +#undef weak_alias +#define weak_alias(a,b) +#include <sysdeps/sparc/sparc64/fpu/s_finitef.S> diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_finitef-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_finitef-vis3.S index 8cc6149063..d0391f6dbf 100644 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_finitef-vis3.S +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_finitef-vis3.S @@ -1,5 +1,5 @@ /* finitef(). sparc64 vis3 version. - 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/sparc/sparc64/fpu/multiarch/s_finitef.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_finitef.S deleted file mode 100644 index cafd41fd92..0000000000 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_finitef.S +++ /dev/null @@ -1,15 +0,0 @@ -#include <sparc-ifunc.h> - -SPARC_ASM_VIS3_IFUNC(finitef) - -hidden_def (__finitef) -weak_alias (__finitef, finitef) - -# undef weak_alias -# define weak_alias(a, b) -# undef hidden_def -# define hidden_def(a) - -#define __finitef __finitef_generic - -#include "../s_finitef.S" diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_finitef.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_finitef.c new file mode 100644 index 0000000000..92cc5ef075 --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_finitef.c @@ -0,0 +1,33 @@ +/* finitef ifunc resolver, Linux/sparc64 version. + 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/>. */ + +#define __finitef __redirect___finitef +#include <math.h> +#undef __finitef +#include <sparc-ifunc.h> + +extern __typeof (finitef) __finitef_vis3 attribute_hidden; +extern __typeof (finitef) __finitef_generic attribute_hidden; + +sparc_libm_ifunc_redirected (__redirect___finitef, __finitef, + hwcap & HWCAP_SPARC_VIS3 + ? __finitef_vis3 + : __finitef_generic); + +sparc_ifunc_redirected_hidden_def (__redirect___finitef, __finitef) +weak_alias (__finitef, finitef) diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_floor-generic.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_floor-generic.c new file mode 100644 index 0000000000..0f3361a9fb --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_floor-generic.c @@ -0,0 +1,2 @@ +#define __floor __floor_generic +#include <sysdeps/ieee754/dbl-64/wordsize-64/s_floor.c> diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_floor-vis2.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_floor-vis2.S deleted file mode 100644 index 84fda73d95..0000000000 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_floor-vis2.S +++ /dev/null @@ -1,57 +0,0 @@ -/* floor function, sparc64 vis2 version. - Copyright (C) 2012-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David S. Miller <davem@davemloft.net>, 2012. - - 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 <sysdep.h> - - /* 'siam' (Set Interval Arithmetic Mode) is used to quickly override - the rounding mode during this routine. - - We add then subtract (or subtract than add if the initial - value was negative) 2**23 to the value, then subtract it - back out. - - This will clear out the fractional portion of the value and, - with suitable 'siam' initiated rouding mode settings, round - the final result in the proper direction. */ - -#define TWO_FIFTYTWO 0x43300000 /* 2**52 */ - -#define ZERO %f10 /* 0.0 */ -#define SIGN_BIT %f12 /* -0.0 */ - -ENTRY (__floor_vis2) - sethi %hi(TWO_FIFTYTWO), %o2 - fzero ZERO - sllx %o2, 32, %o2 - fnegd ZERO, SIGN_BIT - stx %o2, [%sp + STACK_BIAS + 128] - fabsd %f0, %f14 - ldd [%sp + STACK_BIAS + 128], %f16 - fcmpd %fcc3, %f14, %f16 - fmovduge %fcc3, ZERO, %f16 - fand %f0, SIGN_BIT, SIGN_BIT - for %f16, SIGN_BIT, %f16 - siam (1 << 2) | 3 - faddd %f0, %f16, %f18 - siam (1 << 2) | 0 - fsubd %f18, %f16, %f18 - siam (0 << 2) - retl - for %f18, SIGN_BIT, %f0 -END (__floor_vis2) diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_floor-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_floor-vis3.S deleted file mode 100644 index 1b275c2c63..0000000000 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_floor-vis3.S +++ /dev/null @@ -1,59 +0,0 @@ -/* floor function, sparc64 vis3 version. - Copyright (C) 2012-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David S. Miller <davem@davemloft.net>, 2012. - - 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 <sysdep.h> - - /* 'siam' (Set Interval Arithmetic Mode) is used to quickly override - the rounding mode during this routine. - - We add then subtract (or subtract than add if the initial - value was negative) 2**23 to the value, then subtract it - back out. - - This will clear out the fractional portion of the value and, - with suitable 'siam' initiated rouding mode settings, round - the final result in the proper direction. - - We also use VIS3 moves to avoid using the stack to transfer - values between float and integer registers. */ - -#define TWO_FIFTYTWO 0x43300000 /* 2**52 */ - -#define ZERO %f10 /* 0.0 */ -#define SIGN_BIT %f12 /* -0.0 */ - -ENTRY (__floor_vis3) - sethi %hi(TWO_FIFTYTWO), %o2 - fzero ZERO - sllx %o2, 32, %o2 - fnegd ZERO, SIGN_BIT - movxtod %o2, %f16 - fabsd %f0, %f14 - fcmpd %fcc3, %f14, %f16 - fmovduge %fcc3, ZERO, %f16 - fand %f0, SIGN_BIT, SIGN_BIT - for %f16, SIGN_BIT, %f16 - siam (1 << 2) | 3 - faddd %f0, %f16, %f18 - siam (1 << 2) | 0 - fsubd %f18, %f16, %f18 - siam (0 << 2) - retl - for %f18, SIGN_BIT, %f0 -END (__floor_vis3) diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_fminf-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_floor-vis3.c index e716f4ac02..d9974161b0 100644 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_fminf-vis3.S +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_floor-vis3.c @@ -1,7 +1,6 @@ -/* fminf function, sparc64 vis3 version. - Copyright (C) 2012-2016 Free Software Foundation, Inc. +/* floor function, sparc64 vis3 version. + Copyright (C) 2016-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by David S. Miller <davem@davemloft.net>, 2012. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -17,11 +16,8 @@ License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ -#include <sysdep.h> +#include <math.h> -ENTRY (__fminf_vis3) - flcmps %fcc1, %f1, %f3 - fmovs %f1, %f0 - retl - fmovsge %fcc1, %f3, %f0 -END (__fminf_vis3) +#define __floor __floor_vis3 + +#include <sysdeps/ieee754/dbl-64/wordsize-64/s_floor.c> diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_floor.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_floor.S deleted file mode 100644 index 989ccab56d..0000000000 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_floor.S +++ /dev/null @@ -1,12 +0,0 @@ -#include <sparc-ifunc.h> - -SPARC_ASM_VIS3_VIS2_IFUNC(floor) - -weak_alias (__floor, floor) - -# undef weak_alias -# define weak_alias(a, b) - -#define __floor __floor_generic - -#include "../s_floor.S" diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_floor.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_floor.c new file mode 100644 index 0000000000..6e5ecd2b5d --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_floor.c @@ -0,0 +1,30 @@ +/* floor function, sparc64 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 <sparc-ifunc.h> +#include <math.h> +#include <libm-alias-double.h> + +extern __typeof (floor) __floor_vis3 attribute_hidden; +extern __typeof (floor) __floor_generic attribute_hidden; + +sparc_libm_ifunc (__floor, + hwcap & HWCAP_SPARC_VIS3 + ? __floor_vis3 + : __floor_generic); +libm_alias_double (__floor, floor) diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-generic.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-generic.c new file mode 100644 index 0000000000..28c377b787 --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-generic.c @@ -0,0 +1,2 @@ +#define __floorf __floorf_generic +#include <sysdeps/ieee754/flt-32/s_floorf.c> diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-vis2.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-vis2.S deleted file mode 100644 index ab7e110ee9..0000000000 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-vis2.S +++ /dev/null @@ -1,56 +0,0 @@ -/* Float floor function, sparc64 vis2 version. - Copyright (C) 2012-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David S. Miller <davem@davemloft.net>, 2012. - - 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 <sysdep.h> - - /* 'siam' (Set Interval Arithmetic Mode) is used to quickly override - the rounding mode during this routine. - - We add then subtract (or subtract than add if the initial - value was negative) 2**23 to the value, then subtract it - back out. - - This will clear out the fractional portion of the value and, - with suitable 'siam' initiated rouding mode settings, round - the final result in the proper direction. */ - -#define TWO_TWENTYTHREE 0x4b000000 /* 2**23 */ - -#define ZERO %f10 /* 0.0 */ -#define SIGN_BIT %f12 /* -0.0 */ - -ENTRY (__floorf_vis2) - sethi %hi(TWO_TWENTYTHREE), %o2 - fzeros ZERO - fnegs ZERO, SIGN_BIT - st %o2, [%sp + STACK_BIAS + 128] - fabss %f1, %f14 - ld [%sp + STACK_BIAS + 128], %f16 - fcmps %fcc3, %f14, %f16 - fmovsuge %fcc3, ZERO, %f16 - fands %f1, SIGN_BIT, SIGN_BIT - fors %f16, SIGN_BIT, %f16 - siam (1 << 2) | 3 - fadds %f1, %f16, %f5 - siam (1 << 2) | 0 - fsubs %f5, %f16, %f5 - siam (0 << 2) - retl - fors %f5, SIGN_BIT, %f0 -END (__floorf_vis2) diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-vis3.S deleted file mode 100644 index b71e1cc2dc..0000000000 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-vis3.S +++ /dev/null @@ -1,58 +0,0 @@ -/* Float floor function, sparc64 vis3 version. - Copyright (C) 2012-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David S. Miller <davem@davemloft.net>, 2012. - - 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 <sysdep.h> - - /* 'siam' (Set Interval Arithmetic Mode) is used to quickly override - the rounding mode during this routine. - - We add then subtract (or subtract than add if the initial - value was negative) 2**23 to the value, then subtract it - back out. - - This will clear out the fractional portion of the value and, - with suitable 'siam' initiated rouding mode settings, round - the final result in the proper direction. - - We also use VIS3 moves to avoid using the stack to transfer - values between float and integer registers. */ - -#define TWO_TWENTYTHREE 0x4b000000 /* 2**23 */ - -#define ZERO %f10 /* 0.0 */ -#define SIGN_BIT %f12 /* -0.0 */ - -ENTRY (__floorf_vis3) - sethi %hi(TWO_TWENTYTHREE), %o2 - fzeros ZERO - fnegs ZERO, SIGN_BIT - movwtos %o2, %f16 - fabss %f1, %f14 - fcmps %fcc3, %f14, %f16 - fmovsuge %fcc3, ZERO, %f16 - fands %f1, SIGN_BIT, SIGN_BIT - fors %f16, SIGN_BIT, %f16 - siam (1 << 2) | 3 - fadds %f1, %f16, %f5 - siam (1 << 2) | 0 - fsubs %f5, %f16, %f5 - siam (0 << 2) - retl - fors %f5, SIGN_BIT, %f0 -END (__floorf_vis3) diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaxf-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-vis3.c index 50ee6fe101..d970da3752 100644 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaxf-vis3.S +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-vis3.c @@ -1,7 +1,6 @@ -/* fmaxf function, sparc64 vis3 version. - Copyright (C) 2012-2016 Free Software Foundation, Inc. +/* Float floor function, sparc64 vis3 version. + Copyright (C) 2016-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by David S. Miller <davem@davemloft.net>, 2012. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -17,11 +16,8 @@ License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ -#include <sysdep.h> +#include <math.h> -ENTRY (__fmaxf_vis3) - flcmps %fcc1, %f1, %f3 - fmovs %f1, %f0 - retl - fmovslg %fcc1, %f3, %f0 -END (__fmaxf_vis3) +#define __floorf __floorf_vis3 + +#include <sysdeps/ieee754/flt-32/s_floorf.c> diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf.S deleted file mode 100644 index d2a83cb9b8..0000000000 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf.S +++ /dev/null @@ -1,12 +0,0 @@ -#include <sparc-ifunc.h> - -SPARC_ASM_VIS3_VIS2_IFUNC(floorf) - -weak_alias (__floorf, floorf) - -# undef weak_alias -# define weak_alias(a, b) - -#define __floorf __floorf_generic - -#include "../s_floorf.S" diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf.c new file mode 100644 index 0000000000..b79fd83fa4 --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf.c @@ -0,0 +1,30 @@ +/* Float floor function, sparc64 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 <sparc-ifunc.h> +#include <math.h> +#include <libm-alias-float.h> + +extern __typeof (floorf) __floorf_vis3 attribute_hidden; +extern __typeof (floorf) __floorf_generic attribute_hidden; + +sparc_libm_ifunc (__floorf, + hwcap & HWCAP_SPARC_VIS3 + ? __floorf_vis3 + : __floorf_generic); +libm_alias_float (__floor, floor) diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_fma-generic.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_fma-generic.c new file mode 100644 index 0000000000..e40816facb --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_fma-generic.c @@ -0,0 +1,2 @@ +#define __fma __fma_generic +#include <sysdeps/ieee754/dbl-64/s_fma.c> diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_fma-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_fma-vis3.S index d43002caa5..ba50b3a657 100644 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_fma-vis3.S +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_fma-vis3.S @@ -1,5 +1,5 @@ /* fma function, sparc64 vis3 version. - 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. Contributed by David S. Miller <davem@davemloft.net>, 2012. diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_fma.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_fma.c index 3f2f1622c8..34b4f45150 100644 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_fma.c +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_fma.c @@ -1,14 +1,12 @@ -#ifdef HAVE_AS_VIS3_SUPPORT -# include <sparc-ifunc.h> -# include <math.h> - -extern double __fma_vis3 (double, double, double); -extern double __fma_generic (double, double, double); - -sparc_libm_ifunc(__fma, hwcap & HWCAP_SPARC_FMAF ? __fma_vis3 : __fma_generic); -weak_alias (__fma, fma) - -# define __fma __fma_generic -#endif - -#include <sysdeps/ieee754/dbl-64/s_fma.c> +#include <sparc-ifunc.h> +#include <math.h> +#include <libm-alias-double.h> + +extern __typeof (fma) __fma_vis3 attribute_hidden; +extern __typeof (fma) __fma_generic attribute_hidden; + +sparc_libm_ifunc (__fma, + hwcap & HWCAP_SPARC_FMAF + ? __fma_vis3 + : __fma_generic); +libm_alias_double (__fma, fma) diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf-generic.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf-generic.c new file mode 100644 index 0000000000..218eeb3115 --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf-generic.c @@ -0,0 +1,2 @@ +#define __fmaf __fmaf_generic +#include <sysdeps/ieee754/dbl-64/s_fmaf.c> diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf-vis3.S index 4ee6ee407c..fbfa5fd869 100644 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf-vis3.S +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf-vis3.S @@ -1,5 +1,5 @@ /* fmaf function, sparc64 vis3 version. - 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. Contributed by David S. Miller <davem@davemloft.net>, 2012. diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf.c index 7a273a3b13..08f71c8bba 100644 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf.c +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf.c @@ -1,14 +1,12 @@ -#ifdef HAVE_AS_VIS3_SUPPORT -# include <sparc-ifunc.h> -# include <math.h> - -extern float __fmaf_vis3 (float, float, float); -extern float __fmaf_generic (float, float, float); - -sparc_libm_ifunc(__fmaf, hwcap & HWCAP_SPARC_FMAF ? __fmaf_vis3 : __fmaf_generic); -weak_alias (__fmaf, fmaf) - -# define __fmaf __fmaf_generic -#endif - -#include <sysdeps/ieee754/dbl-64/s_fmaf.c> +#include <sparc-ifunc.h> +#include <math.h> +#include <libm-alias-float.h> + +extern __typeof (fmaf) __fmaf_vis3 attribute_hidden; +extern __typeof (fmaf) __fmaf_generic attribute_hidden; + +sparc_libm_ifunc (__fmaf, + hwcap & HWCAP_SPARC_FMAF + ? __fmaf_vis3 + : __fmaf_generic) +libm_alias_float (__fma, fma) diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_fmax.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_fmax.S deleted file mode 100644 index d5e59d8d1e..0000000000 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_fmax.S +++ /dev/null @@ -1,12 +0,0 @@ -#include <sparc-ifunc.h> - -SPARC_ASM_VIS3_IFUNC(fmax) - -weak_alias (__fmax, fmax) - -# undef weak_alias -# define weak_alias(a, b) - -#define __fmax __fmax_generic - -#include "../s_fmax.S" diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaxf.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaxf.S deleted file mode 100644 index daa91579c4..0000000000 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaxf.S +++ /dev/null @@ -1,12 +0,0 @@ -#include <sparc-ifunc.h> - -SPARC_ASM_VIS3_IFUNC(fmaxf) - -weak_alias (__fmaxf, fmaxf) - -# undef weak_alias -# define weak_alias(a, b) - -#define __fmaxf __fmaxf_generic - -#include "../s_fmaxf.S" diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_fmin.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_fmin.S deleted file mode 100644 index b2aec1bbc0..0000000000 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_fmin.S +++ /dev/null @@ -1,12 +0,0 @@ -#include <sparc-ifunc.h> - -SPARC_ASM_VIS3_IFUNC(fmin) - -weak_alias (__fmin, fmin) - -# undef weak_alias -# define weak_alias(a, b) - -#define __fmin __fmin_generic - -#include "../s_fmin.S" diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_fminf.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_fminf.S deleted file mode 100644 index c4690e1df9..0000000000 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_fminf.S +++ /dev/null @@ -1,12 +0,0 @@ -#include <sparc-ifunc.h> - -SPARC_ASM_VIS3_IFUNC(fminf) - -weak_alias (__fminf, fminf) - -# undef weak_alias -# define weak_alias(a, b) - -#define __fminf __fminf_generic - -#include "../s_fminf.S" diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_isinf-generic.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_isinf-generic.S new file mode 100644 index 0000000000..ebaf054025 --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_isinf-generic.S @@ -0,0 +1,6 @@ +#define __isinf __isinf_generic +#undef hidden_def +#define hidden_def(a) +#undef weak_alias +#define weak_alias(a,b) +#include <./sysdeps/sparc/sparc64/fpu/s_isinf.S> diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_isinf-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_isinf-vis3.S index 702de3e938..bb5e6a0772 100644 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_isinf-vis3.S +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_isinf-vis3.S @@ -1,5 +1,5 @@ /* isinf(). sparc64 vis3 version. - 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/sparc/sparc64/fpu/multiarch/s_isinf.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_isinf.S deleted file mode 100644 index ed9b62640d..0000000000 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_isinf.S +++ /dev/null @@ -1,15 +0,0 @@ -#include <sparc-ifunc.h> - -SPARC_ASM_VIS3_IFUNC(isinf) - -hidden_def (__isinf) -weak_alias (__isinf, isinf) - -# undef weak_alias -# define weak_alias(a, b) -# undef hidden_def -# define hidden_def(a) - -#define __isinf __isinf_generic - -#include "../s_isinf.S" diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_isinf.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_isinf.c new file mode 100644 index 0000000000..2eea299486 --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_isinf.c @@ -0,0 +1,37 @@ +/* isinf ifunc resolver, Linux/sparc64 version. + 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/>. */ + +#define __isinf __redirect___isinf +#define __isinff __redirect___isinff +#define __isinfl __redirect___isinfl +#include <math.h> +#undef __isinf +#undef __isinff +#undef __isinfl +#include <sparc-ifunc.h> + +extern __typeof (isinf) __isinf_vis3 attribute_hidden; +extern __typeof (isinf) __isinf_generic attribute_hidden; + +sparc_libm_ifunc_redirected (__redirect___isinf, __isinf, + hwcap & HWCAP_SPARC_VIS3 + ? __isinf_vis3 + : __isinf_generic) + +sparc_ifunc_redirected_hidden_def (__redirect___isinf, __isinf) +weak_alias (__isinf, isinf) diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_isinff-generic.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_isinff-generic.S new file mode 100644 index 0000000000..d37243f216 --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_isinff-generic.S @@ -0,0 +1,6 @@ +#define __isinff __isinff_generic +#undef hidden_def +#define hidden_def(a) +#undef weak_alias +#define weak_alias(a,b) +#include <sysdeps/sparc/sparc64/fpu/s_isinff.S> diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_isinff-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_isinff-vis3.S index 92e6e5c7ae..a80c22905f 100644 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_isinff-vis3.S +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_isinff-vis3.S @@ -1,5 +1,5 @@ /* isinff(). sparc64 vis3 version. - 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/sparc/sparc64/fpu/multiarch/s_isinff.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_isinff.S deleted file mode 100644 index 04517398f8..0000000000 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_isinff.S +++ /dev/null @@ -1,15 +0,0 @@ -#include <sparc-ifunc.h> - -SPARC_ASM_VIS3_IFUNC(isinff) - -hidden_def (__isinff) -weak_alias (__isinff, isinff) - -# undef weak_alias -# define weak_alias(a, b) -# undef hidden_def -# define hidden_def(a) - -#define __isinff __isinff_generic - -#include "../s_isinff.S" diff --git a/sysdeps/sparc/sparc64/fpu/s_fminf.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_isinff.c index bfa2e5b7e6..3b814c89fd 100644 --- a/sysdeps/sparc/sparc64/fpu/s_fminf.S +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_isinff.c @@ -1,7 +1,6 @@ -/* fminf function, sparc64 version. - Copyright (C) 2012-2016 Free Software Foundation, Inc. +/* isinff ifunc resolver, Linux/sparc64 version. + Copyright (C) 2017-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by David S. Miller <davem@davemloft.net>, 2012. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -17,20 +16,18 @@ License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ -#include <sysdep.h> +#define __isinff __redirect___isinff +#include <math.h> +#undef __isinff +#include <sparc-ifunc.h> -#define SIGN_BIT %f12 /* -0.0 */ +extern __typeof (isinff) __isinff_vis3 attribute_hidden; +extern __typeof (isinff) __isinff_generic attribute_hidden; -ENTRY (__fminf) - fcmps %fcc1, %f3, %f3 - fzeros SIGN_BIT - fmovsu %fcc1, %f1, %f3 - fnegs SIGN_BIT, SIGN_BIT - fcmps %fcc2, %f1, %f3 - fmovsug %fcc2, %f3, %f1 - fors %f1, %f3, %f4 - fands %f4, SIGN_BIT, %f4 - retl - fors %f1, %f4, %f0 -END (__fminf) -weak_alias (__fminf, fminf) +sparc_libm_ifunc_redirected (__redirect___isinff, __isinff, + hwcap & HWCAP_SPARC_VIS3 + ? __isinff_vis3 + : __isinff_generic); + +sparc_ifunc_redirected_hidden_def (__redirect___isinff, __isinff) +weak_alias (__isinff, isinff) diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_isnan-generic.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_isnan-generic.S new file mode 100644 index 0000000000..64d4430d82 --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_isnan-generic.S @@ -0,0 +1,6 @@ +#define __isnan __isnan_generic +#undef hidden_def +#define hidden_def(a) +#undef weak_alias +#define weak_alias(a,b) +#include <sysdeps/sparc/sparc64/fpu/s_isnan.S> diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_isnan-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_isnan-vis3.S index a891e6be3c..aefb2c77c7 100644 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_isnan-vis3.S +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_isnan-vis3.S @@ -1,5 +1,5 @@ /* isnan(). sparc64 vis3 version. - 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/sparc/sparc64/fpu/multiarch/s_isnan.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_isnan.S deleted file mode 100644 index 40e985a5d4..0000000000 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_isnan.S +++ /dev/null @@ -1,15 +0,0 @@ -#include <sparc-ifunc.h> - -SPARC_ASM_VIS3_IFUNC(isnan) - -hidden_def (__isnan) -weak_alias (__isnan, isnan) - -# undef weak_alias -# define weak_alias(a, b) -# undef hidden_def -# define hidden_def(a) - -#define __isnan __isnan_generic - -#include "../s_isnan.S" diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_isnan.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_isnan.c new file mode 100644 index 0000000000..ccf6fbe93a --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_isnan.c @@ -0,0 +1,37 @@ +/* isnan ifunc resolver, Linux/sparc64 version. + 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/>. */ + +#define __isnan __redirect___isnan +#define __isnanf __redirect___isnanf +#define __isnanl __redirect___isnanl +#include <math.h> +#undef __isnan +#undef __isnanf +#undef __isnanl +#include <sparc-ifunc.h> + +extern __typeof (isnan) __isnan_vis3 attribute_hidden; +extern __typeof (isnan) __isnan_generic attribute_hidden; + +sparc_libm_ifunc_redirected (__redirect___isnan, __isnan, + hwcap & HWCAP_SPARC_VIS3 + ? __isnan_vis3 + : __isnan_generic); + +sparc_ifunc_redirected_hidden_def (__redirect___isnan, __isnan) +weak_alias (__isnan, isnan) diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_isnanf-generic.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_isnanf-generic.S new file mode 100644 index 0000000000..5c82f7d101 --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_isnanf-generic.S @@ -0,0 +1,6 @@ +#define __isnanf __isnanf_generic +#undef hidden_def +#define hidden_def(a) +#undef weak_alias +#define weak_alias(a,b) +#include <sysdeps/sparc/sparc64/fpu/s_isnanf.S> diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_isnanf-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_isnanf-vis3.S index 0efaae016f..74c93aa228 100644 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_isnanf-vis3.S +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_isnanf-vis3.S @@ -1,5 +1,5 @@ /* isnanf(). sparc64 vis3 version. - 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/sparc/sparc64/fpu/multiarch/s_isnanf.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_isnanf.S deleted file mode 100644 index 6b53b69d2e..0000000000 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_isnanf.S +++ /dev/null @@ -1,15 +0,0 @@ -#include <sparc-ifunc.h> - -SPARC_ASM_VIS3_IFUNC(isnanf) - -hidden_def (__isnanf) -weak_alias (__isnanf, isnanf) - -# undef weak_alias -# define weak_alias(a, b) -# undef hidden_def -# define hidden_def(a) - -#define __isnanf __isnanf_generic - -#include "../s_isnanf.S" diff --git a/sysdeps/sparc/sparc64/fpu/s_fmaxf.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_isnanf.c index 1117d7a840..8ad3ccbc64 100644 --- a/sysdeps/sparc/sparc64/fpu/s_fmaxf.S +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_isnanf.c @@ -1,7 +1,6 @@ -/* fmaxf function, sparc64 version. - Copyright (C) 2012-2016 Free Software Foundation, Inc. +/* isnanf ifunc resolver, Linux/sparc64 version. + Copyright (C) 2017-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by David S. Miller <davem@davemloft.net>, 2012. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -17,20 +16,18 @@ License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ -#include <sysdep.h> +#define __isnanf __redirect___isnanf +#include <math.h> +#undef __isnanf +#include <sparc-ifunc.h> -#define SIGN_BIT %f12 /* -0.0 */ +extern __typeof (isnanf) __isnanf_vis3 attribute_hidden; +extern __typeof (isnanf) __isnanf_generic attribute_hidden; -ENTRY (__fmaxf) - fcmps %fcc1, %f3, %f3 - fzeros SIGN_BIT - fmovsu %fcc1, %f1, %f3 - fnegs SIGN_BIT, SIGN_BIT - fcmps %fcc2, %f1, %f3 - fmovsul %fcc2, %f3, %f1 - fands %f1, %f3, %f4 - fandnot2s SIGN_BIT, %f4, %f4 - retl - fandnot2s %f1, %f4, %f0 -END (__fmaxf) -weak_alias (__fmaxf, fmaxf) +sparc_libm_ifunc_redirected (__redirect___isnanf, __isnanf, + hwcap & HWCAP_SPARC_VIS3 + ? __isnanf_vis3 + : __isnanf_generic); + +sparc_ifunc_redirected_hidden_def (__redirect___isnanf,__isnanf) +weak_alias (__isnanf, isnanf) diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_lrint-generic.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_lrint-generic.S new file mode 100644 index 0000000000..e6ab999a66 --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_lrint-generic.S @@ -0,0 +1,6 @@ +#define __lrint __lrint_generic +#undef weak_alias +#define weak_alias(a,b) +#undef strong_alias +#define strong_alias(a,b) +#include <sysdeps/sparc/sparc64/fpu/s_lrint.S> diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_lrint-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_lrint-vis3.S index 8ec42ad576..865bc4b9d7 100644 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_lrint-vis3.S +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_lrint-vis3.S @@ -1,5 +1,5 @@ /* lrint(), sparc64 vis3 version. - 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. Contributed by David S. Miller <davem@davemloft.net>, 2012. diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_lrint.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_lrint.S deleted file mode 100644 index 94af8f028c..0000000000 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_lrint.S +++ /dev/null @@ -1,17 +0,0 @@ -#include <sparc-ifunc.h> - -SPARC_ASM_VIS3_IFUNC(lrint) - -weak_alias (__lrint, lrint) - -strong_alias (__lrint, __llrint) -weak_alias (__llrint, llrint) - -# undef weak_alias -# define weak_alias(a, b) -# undef strong_alias -# define strong_alias(a, b) - -#define __lrint __lrint_generic - -#include "../s_lrint.S" diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_lrint.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_lrint.c new file mode 100644 index 0000000000..159bcd9aa6 --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_lrint.c @@ -0,0 +1,40 @@ +/* lrint/llrint ifunc resolver, Linux/sparc64 version. + 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/>. */ + +#define lrint __redirect_lrint +#define llrint __redirect_llrint +#define __lrint __redirect___lrint +#define __llrint __redirect___llrint +#include <math.h> +#undef lrint +#undef llrint +#undef __lrint +#undef __llrint +#include <sparc-ifunc.h> +#include <libm-alias-double.h> + +extern __typeof (__redirect_lrint) __lrint_vis3 attribute_hidden; +extern __typeof (__redirect_lrint) __lrint_generic attribute_hidden; + +sparc_libm_ifunc_redirected (__redirect_lrint, __lrint, + hwcap & HWCAP_SPARC_VIS3 + ? __lrint_vis3 + : __lrint_generic); +libm_alias_double (__lrint, lrint) +strong_alias (__lrint, __llrint) +libm_alias_double (__llrint, llrint) diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf-generic.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf-generic.S new file mode 100644 index 0000000000..4cfbf4ae72 --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf-generic.S @@ -0,0 +1,6 @@ +#define __lrintf __lrintf_generic +#undef weak_alias +#define weak_alias(a,b) +#undef strong_alias +#define strong_alias(a,b) +#include <sysdeps/sparc/sparc64/fpu/s_lrintf.S> diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf-vis3.S index 943a2b14b2..229205e98a 100644 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf-vis3.S +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf-vis3.S @@ -1,5 +1,5 @@ /* lrintf(), sparc64 vis3 version. - 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. Contributed by David S. Miller <davem@davemloft.net>, 2012. diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf.S deleted file mode 100644 index e6ea4061c3..0000000000 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf.S +++ /dev/null @@ -1,17 +0,0 @@ -#include <sparc-ifunc.h> - -SPARC_ASM_VIS3_IFUNC(lrintf) - -weak_alias (__lrintf, lrintf) - -strong_alias (__lrintf, __llrintf) -weak_alias (__llrintf, llrintf) - -# undef weak_alias -# define weak_alias(a, b) -# undef strong_alias -# define strong_alias(a, b) - -#define __lrintf __lrintf_generic - -#include "../s_lrintf.S" diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf.c new file mode 100644 index 0000000000..ccb7cd9723 --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf.c @@ -0,0 +1,40 @@ +/* lrintf/llrintf ifunc resolver, Linux/sparc64 version. + 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/>. */ + +#define lrintf __redirect_lrintf +#define llrintf __redirect_llrintf +#define __lrintf __redirect_lrintf +#define __llrintf __redirect_llrintf +#include <math.h> +#undef lrintf +#undef llrintf +#undef __lrintf +#undef __llrintf +#include <sparc-ifunc.h> +#include <libm-alias-float.h> + +extern __typeof (__redirect_lrintf) __lrintf_vis3 attribute_hidden; +extern __typeof (__redirect_lrintf) __lrintf_generic attribute_hidden; + +sparc_libm_ifunc_redirected (__redirect_lrintf, __lrintf, + hwcap & HWCAP_SPARC_VIS3 + ? __lrintf_vis3 + : __lrintf_generic); +libm_alias_float (__lrint, lrint) +strong_alias (__lrintf, __llrintf) +libm_alias_float (__llrint, llrint) diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint-generic.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint-generic.S new file mode 100644 index 0000000000..efe238326d --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint-generic.S @@ -0,0 +1,4 @@ +#define __nearbyint __nearbyint_generic +#undef weak_alias +#define weak_alias(a,b) +#include <sysdeps/sparc/sparc64/fpu/s_nearbyint.S> diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint-vis3.S index fff277ae49..29b53e917c 100644 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint-vis3.S +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint-vis3.S @@ -1,7 +1,7 @@ /* Round float to int floating-point values without generating an inexact exception, sparc64 vis3 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. Contributed by David S. Miller <davem@davemloft.net>, 2013. @@ -35,6 +35,7 @@ #define SIGN_BIT %f12 /* -0.0 */ ENTRY (__nearbyint_vis3) + fcmpd %fcc3, %f0, %f0 /* Check for sNaN */ stx %fsr, [%sp + STACK_BIAS + 144] sethi %hi(TWO_FIFTYTWO), %o2 sllx %o2, 32, %o2 diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint.S deleted file mode 100644 index bb75ab3606..0000000000 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint.S +++ /dev/null @@ -1,12 +0,0 @@ -#include <sparc-ifunc.h> - -SPARC_ASM_VIS3_IFUNC(nearbyint) - -weak_alias (__nearbyint, nearbyint) - -# undef weak_alias -# define weak_alias(a, b) - -#define __nearbyint __nearbyint_generic - -#include "../s_nearbyint.S" diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint.c new file mode 100644 index 0000000000..b58cbdcc9b --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint.c @@ -0,0 +1,30 @@ +/* nearbyint ifunc resolver, Linux/sparc64 version. + 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/>. */ + +#include <math.h> +#include <sparc-ifunc.h> +#include <libm-alias-double.h> + +extern __typeof (nearbyint) __nearbyint_vis3 attribute_hidden; +extern __typeof (nearbyint) __nearbyint_generic attribute_hidden; + +sparc_libm_ifunc (__nearbyint, + hwcap & HWCAP_SPARC_VIS3 + ? __nearbyint_vis3 + : __nearbyint_generic); +libm_alias_double (__nearbyint, nearbyint) diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf-generic.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf-generic.S new file mode 100644 index 0000000000..a2e38e9983 --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf-generic.S @@ -0,0 +1,4 @@ +#define __nearbyintf __nearbyintf_generic +#undef weak_alias +#define weak_alias(a,b) +#include <sysdeps/sparc/sparc64/fpu/s_nearbyintf.S> diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf-vis3.S index c6e94ba73b..de2dbe9c93 100644 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf-vis3.S +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf-vis3.S @@ -1,7 +1,7 @@ /* Round float to int floating-point values without generating an inexact exception, sparc64 vis3 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. Contributed by David S. Miller <davem@davemloft.net>, 2013. @@ -35,6 +35,7 @@ #define SIGN_BIT %f12 /* -0.0 */ ENTRY (__nearbyintf_vis3) + fcmps %fcc3, %f1, %f1 /* Check for sNaN */ stx %fsr, [%sp + STACK_BIAS + 144] sethi %hi(0xf8003e0), %o5 sethi %hi(TWO_TWENTYTHREE), %o2 diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf.S deleted file mode 100644 index 95100c1bfc..0000000000 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf.S +++ /dev/null @@ -1,12 +0,0 @@ -#include <sparc-ifunc.h> - -SPARC_ASM_VIS3_IFUNC(nearbyintf) - -weak_alias (__nearbyintf, nearbyintf) - -# undef weak_alias -# define weak_alias(a, b) - -#define __nearbyintf __nearbyintf_generic - -#include "../s_nearbyintf.S" diff --git a/sysdeps/sparc/sparc64/fpu/s_fmin.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf.c index d93f76a38a..bd18ea2fcb 100644 --- a/sysdeps/sparc/sparc64/fpu/s_fmin.S +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf.c @@ -1,7 +1,6 @@ -/* fmin function, sparc64 version. - Copyright (C) 2012-2016 Free Software Foundation, Inc. +/* nearbyintf ifunc resolver, Linux/sparc64 version. + Copyright (C) 2017-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by David S. Miller <davem@davemloft.net>, 2012. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -17,20 +16,15 @@ License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ -#include <sysdep.h> +#include <math.h> +#include <sparc-ifunc.h> +#include <libm-alias-float.h> -#define SIGN_BIT %f12 /* -0.0 */ +extern __typeof (nearbyintf) __nearbyintf_vis3 attribute_hidden; +extern __typeof (nearbyintf) __nearbyintf_generic attribute_hidden; -ENTRY (__fmin) - fcmpd %fcc1, %f2, %f2 - fzero SIGN_BIT - fmovdu %fcc1, %f0, %f2 - fnegd SIGN_BIT, SIGN_BIT - fcmpd %fcc2, %f0, %f2 - fmovdug %fcc2, %f2, %f0 - for %f0, %f2, %f4 - fand %f4, SIGN_BIT, %f4 - retl - for %f0, %f4, %f0 -END (__fmin) -weak_alias (__fmin, fmin) +sparc_libm_ifunc (__nearbyintf, + hwcap & HWCAP_SPARC_VIS3 + ? __nearbyintf_vis3 + : __nearbyintf_generic); +libm_alias_float (__nearbyint, nearbyint) diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_rint-generic.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_rint-generic.S new file mode 100644 index 0000000000..d92743423e --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_rint-generic.S @@ -0,0 +1,4 @@ +#define __rint __rint_generic +#undef weak_alias +#define weak_alias(a, b) +#include <sysdeps/sparc/sparc64/fpu/s_rint.S> diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_rint-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_rint-vis3.S index c2a8e58cfe..19343c3de9 100644 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_rint-vis3.S +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_rint-vis3.S @@ -1,5 +1,5 @@ /* Round float to int floating-point values, sparc64 vis3 version. - 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. Contributed by David S. Miller <davem@davemloft.net>, 2012. diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_rint.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_rint.S deleted file mode 100644 index cc980eb8c7..0000000000 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_rint.S +++ /dev/null @@ -1,12 +0,0 @@ -#include <sparc-ifunc.h> - -SPARC_ASM_VIS3_IFUNC(rint) - -weak_alias (__rint, rint) - -# undef weak_alias -# define weak_alias(a, b) - -#define __rint __rint_generic - -#include "../s_rint.S" diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_rint.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_rint.c new file mode 100644 index 0000000000..ae782b0b60 --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_rint.c @@ -0,0 +1,30 @@ +/* rint ifunc resolver, Linux/sparc64 version. + 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/>. */ + +#include <math.h> +#include <sparc-ifunc.h> +#include <libm-alias-double.h> + +extern __typeof (rint) __rint_vis3 attribute_hidden; +extern __typeof (rint) __rint_generic attribute_hidden; + +sparc_libm_ifunc (__rint, + hwcap & HWCAP_SPARC_VIS3 + ? __rint_vis3 + : __rint_generic); +libm_alias_double (__rint, rint) diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_rintf-generic.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_rintf-generic.S new file mode 100644 index 0000000000..30da5f039d --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_rintf-generic.S @@ -0,0 +1,4 @@ +#define __rintf __rintf_generic +#undef weak_alias +#define weak_alias(a, b) +#include <sysdeps/sparc/sparc64/fpu/s_rintf.S> diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_rintf-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_rintf-vis3.S index 1dde1df91c..86a81c96d2 100644 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_rintf-vis3.S +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_rintf-vis3.S @@ -1,5 +1,5 @@ /* Round float to int floating-point values, sparc64 vis3 version. - 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. Contributed by David S. Miller <davem@davemloft.net>, 2012. diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_rintf.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_rintf.S deleted file mode 100644 index 38fd936086..0000000000 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_rintf.S +++ /dev/null @@ -1,12 +0,0 @@ -#include <sparc-ifunc.h> - -SPARC_ASM_VIS3_IFUNC(rintf) - -weak_alias (__rintf, rintf) - -# undef weak_alias -# define weak_alias(a, b) - -#define __rintf __rintf_generic - -#include "../s_rintf.S" diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_rintf.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_rintf.c new file mode 100644 index 0000000000..e0265c47aa --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_rintf.c @@ -0,0 +1,30 @@ +/* rintf ifunc resolver, Linux/sparc64 version. + 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/>. */ + +#include <math.h> +#include <sparc-ifunc.h> +#include <libm-alias-float.h> + +extern __typeof (rintf) __rintf_vis3 attribute_hidden; +extern __typeof (rintf) __rintf_generic attribute_hidden; + +sparc_libm_ifunc (__rintf, + hwcap & HWCAP_SPARC_VIS3 + ? __rintf_vis3 + : __rintf_generic); +libm_alias_float (__rint, rint) diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_signbit-generic.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_signbit-generic.S new file mode 100644 index 0000000000..dfa40aca8f --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_signbit-generic.S @@ -0,0 +1,6 @@ +#define __signbit __signbit_generic +#undef strong_alias +#define strong_alias(a, b) +#undef hidden_def +#define hidden_def(a) +#include <sysdeps/sparc/sparc64/fpu/s_signbit.S> diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_signbit-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_signbit-vis3.S index e2c9f7ddab..4bc1571ce7 100644 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_signbit-vis3.S +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_signbit-vis3.S @@ -1,5 +1,5 @@ /* signbit(). sparc64 vis3 version. - 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/sparc/sparc64/fpu/multiarch/s_signbit.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_signbit.S deleted file mode 100644 index e69550c474..0000000000 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_signbit.S +++ /dev/null @@ -1,23 +0,0 @@ -#include <sparc-ifunc.h> - -SPARC_ASM_VIS3_IFUNC(signbit) - -weak_alias (__signbit, signbit) - -/* On 64-bit the double version will also always work for - long-double-precision since in both cases the word with the - sign bit in it is passed always in register %f0. */ -strong_alias (__signbit, __signbitl) -hidden_def (__signbitl) -weak_alias (__signbitl, signbitl) - -# undef weak_alias -# define weak_alias(a, b) -# undef strong_alias -# define strong_alias(a, b) -# undef hidden_def -# define hidden_def(a) - -#define __signbit __signbit_generic - -#include "../s_signbit.S" diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_signbit.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_signbit.c new file mode 100644 index 0000000000..28d18b93af --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_signbit.c @@ -0,0 +1,37 @@ +/* signbit ifunc resolver, Linux/sparc64 version. + 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/>. */ + +#define __signbit __redirect_signbit +#include <math.h> +#undef __signbit + +#include <sparc-ifunc.h> + +extern __typeof (__redirect_signbit) __signbit_vis3 attribute_hidden; +extern __typeof (__redirect_signbit) __signbit_generic attribute_hidden; + +sparc_libm_ifunc_redirected (__redirect_signbit, __signbit, + hwcap & HWCAP_SPARC_VIS3 + ? __signbit_vis3 + : __signbit_generic); + +/* On 64-bit the double version will also always work for + long-double-precision since in both cases the word with the + sign bit in it is passed always in register %f0. */ +strong_alias (__signbit, __signbitl) +sparc_ifunc_redirected_hidden_def (__redirect_signbit, __signbitl) diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_signbitf-generic.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_signbitf-generic.S new file mode 100644 index 0000000000..851ff350d1 --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_signbitf-generic.S @@ -0,0 +1,2 @@ +#define __signbitf __signbitf_generic +#include <sysdeps/sparc/sparc64/fpu/s_signbitf.S> diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_signbitf-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_signbitf-vis3.S index 2dab5f9f31..bafa7d1c57 100644 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_signbitf-vis3.S +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_signbitf-vis3.S @@ -1,5 +1,5 @@ /* signbitf(). sparc64 vis3 version. - 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/sparc/sparc64/fpu/multiarch/s_signbitf.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_signbitf.S deleted file mode 100644 index c35c79f88a..0000000000 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_signbitf.S +++ /dev/null @@ -1,12 +0,0 @@ -#include <sparc-ifunc.h> - -SPARC_ASM_VIS3_IFUNC(signbitf) - -weak_alias (__signbitf, signbitf) - -# undef weak_alias -# define weak_alias(a, b) - -#define __signbitf __signbitf_generic - -#include "../s_signbitf.S" diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_signbitf.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_signbitf.c new file mode 100644 index 0000000000..b2648ee937 --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_signbitf.c @@ -0,0 +1,28 @@ +/* signbit ifunc resolver, Linux/sparc64 version. + 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/>. */ + +#include <math.h> +#include <sparc-ifunc.h> + +extern int __signbitf_vis3 (float) attribute_hidden; +extern int __signbitf_generic (float) attribute_hidden; + +sparc_libm_ifunc(__signbitf, + hwcap & HWCAP_SPARC_VIS3 + ? __signbitf_vis3 + : __signbitf_generic); diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc-generic.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc-generic.c new file mode 100644 index 0000000000..00abd2a643 --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc-generic.c @@ -0,0 +1,2 @@ +#define __trunc __trunc_generic +#include <sysdeps/ieee754/dbl-64/wordsize-64/s_trunc.c> diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc-vis3.S deleted file mode 100644 index 63d01485cb..0000000000 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc-vis3.S +++ /dev/null @@ -1,53 +0,0 @@ -/* Truncate argument to nearest integral value not larger than - the argument, sparc64 vis3 version. - - Copyright (C) 2013-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David S. Miller <davem@davemloft.net>, 2013. - - 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 <sysdep.h> - - /* We pop constants into the FPU registers using the incoming - argument stack slots, since this avoid having to use any PIC - references. We also thus avoid having to allocate a register - window. - - VIS instructions are used to facilitate the formation of - easier constants, and the propagation of the sign bit. */ - -#define TWO_FIFTYTWO 0x43300000 /* 2**52 */ - -#define ZERO %f10 /* 0.0 */ -#define SIGN_BIT %f12 /* -0.0 */ - -ENTRY (__trunc_vis3) - sethi %hi(TWO_FIFTYTWO), %o2 - sllx %o2, 32, %o2 - fzero ZERO - fnegd ZERO, SIGN_BIT - movxtod %o2, %f16 - fabsd %f0, %f14 - fcmpd %fcc3, %f14, %f16 - fmovduge %fcc3, ZERO, %f14 - fand %f0, SIGN_BIT, SIGN_BIT - fdtox %f14, %f14 - fxtod %f14, %f14 - faddd %f0, ZERO, %f18 - fmovduge %fcc3, %f18, %f14 - retl - for %f14, SIGN_BIT, %f0 -END (__trunc_vis3) diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc-vis3.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc-vis3.c new file mode 100644 index 0000000000..a89916ba89 --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc-vis3.c @@ -0,0 +1,23 @@ +/* trunc function, sparc64 vis3 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 <math.h> + +#define __trunc __trunc_vis3 + +#include <sysdeps/ieee754/dbl-64/wordsize-64/s_trunc.c> diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc.S deleted file mode 100644 index 0d6f43a189..0000000000 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc.S +++ /dev/null @@ -1,12 +0,0 @@ -#include <sparc-ifunc.h> - -SPARC_ASM_VIS3_IFUNC(trunc) - -weak_alias (__trunc, trunc) - -# undef weak_alias -# define weak_alias(a, b) - -#define __trunc __trunc_generic - -#include "../s_trunc.S" diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc.c new file mode 100644 index 0000000000..82ad6ffcca --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc.c @@ -0,0 +1,30 @@ +/* trunc function, sparc64 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 <sparc-ifunc.h> +#include <math.h> +#include <libm-alias-double.h> + +extern __typeof (trunc) __trunc_vis3 attribute_hidden; +extern __typeof (trunc) __trunc_generic attribute_hidden; + +sparc_libm_ifunc (__trunc, + hwcap & HWCAP_SPARC_VIS3 + ? __trunc_vis3 + : __trunc_generic); +libm_alias_double (__trunc, trunc) diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf-generic.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf-generic.c new file mode 100644 index 0000000000..7e5d91e742 --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf-generic.c @@ -0,0 +1,2 @@ +#define __truncf __truncf_generic +#include <sysdeps/ieee754/flt-32/s_truncf.c> diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf-vis3.S deleted file mode 100644 index 10b09c262c..0000000000 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf-vis3.S +++ /dev/null @@ -1,52 +0,0 @@ -/* Truncate argument to nearest integral value not larger than - the argument, sparc64 vis3 version. - - Copyright (C) 2013-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David S. Miller <davem@davemloft.net>, 2013. - - 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 <sysdep.h> - - /* We pop constants into the FPU registers using the incoming - argument stack slots, since this avoid having to use any PIC - references. We also thus avoid having to allocate a register - window. - - VIS instructions are used to facilitate the formation of - easier constants, and the propagation of the sign bit. */ - -#define TWO_TWENTYTHREE 0x4b000000 /* 2**23 */ - -#define ZERO %f10 /* 0.0 */ -#define SIGN_BIT %f12 /* -0.0 */ - -ENTRY (__truncf_vis3) - sethi %hi(TWO_TWENTYTHREE), %o2 - fzeros ZERO - fnegs ZERO, SIGN_BIT - movwtos %o2,%f16 - fabss %f1, %f14 - fcmps %fcc3, %f14, %f16 - fmovsuge %fcc3, ZERO, %f14 - fands %f1, SIGN_BIT, SIGN_BIT - fstoi %f14, %f14 - fitos %f14, %f14 - fadds %f1, ZERO, %f18 - fmovsuge %fcc3, %f18, %f14 - retl - fors %f14, SIGN_BIT, %f0 -END (__truncf_vis3) diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf-vis3.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf-vis3.c new file mode 100644 index 0000000000..676b1b47aa --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf-vis3.c @@ -0,0 +1,23 @@ +/* Float trunc function, sparc64 vis3 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 <math.h> + +#define __truncf __truncf_vis3 + +#include <sysdeps/ieee754/flt-32/s_truncf.c> diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf.S deleted file mode 100644 index 2ca2517334..0000000000 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf.S +++ /dev/null @@ -1,12 +0,0 @@ -#include <sparc-ifunc.h> - -SPARC_ASM_VIS3_IFUNC(truncf) - -weak_alias (__truncf, truncf) - -# undef weak_alias -# define weak_alias(a, b) - -#define __truncf __truncf_generic - -#include "../s_truncf.S" diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf.c new file mode 100644 index 0000000000..1c7a4a038f --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf.c @@ -0,0 +1,30 @@ +/* Float trunc function, sparc64 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 <sparc-ifunc.h> +#include <math.h> +#include <libm-alias-float.h> + +extern __typeof (truncf) __truncf_vis3 attribute_hidden; +extern __typeof (truncf) __truncf_generic attribute_hidden; + +sparc_libm_ifunc (__truncf, + hwcap & HWCAP_SPARC_VIS3 + ? __truncf_vis3 + : __truncf_generic) +libm_alias_float (__trunc, trunc) diff --git a/sysdeps/sparc/sparc64/fpu/s_ceil.S b/sysdeps/sparc/sparc64/fpu/s_ceil.S deleted file mode 100644 index 2c74438de4..0000000000 --- a/sysdeps/sparc/sparc64/fpu/s_ceil.S +++ /dev/null @@ -1,83 +0,0 @@ -/* ceil function, sparc64 version. - Copyright (C) 2012-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David S. Miller <davem@davemloft.net>, 2012. - - 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 <sysdep.h> - - /* Since changing the rounding mode is extremely expensive, we - try to round up using a method that is rounding mode - agnostic. - - We add then subtract (or subtract than add if the initial - value was negative) 2**23 to the value, then subtract it - back out. - - This will clear out the fractional portion of the value. - One of two things will happen for non-whole initial values. - Either the rounding mode will round it up, or it will be - rounded down. If the value started out whole, it will be - equal after the addition and subtraction. This means we - can accurately detect with one test whether we need to add - another 1.0 to round it up properly. - - We pop constants into the FPU registers using the incoming - argument stack slots, since this avoid having to use any - PIC references. We also thus avoid having to allocate a - register window. - - VIS instructions are used to facilitate the formation of - easier constants, and the propagation of the sign bit. */ - -#define TWO_FIFTYTWO 0x43300000 /* 2**52 */ -#define ONE_DOT_ZERO 0x3ff00000 /* 1.0 */ - -#define ZERO %f10 /* 0.0 */ -#define SIGN_BIT %f12 /* -0.0 */ - -ENTRY (__ceil) - sethi %hi(TWO_FIFTYTWO), %o2 - sethi %hi(ONE_DOT_ZERO), %o3 - fzero ZERO - - sllx %o2, 32, %o2 - fnegd ZERO, SIGN_BIT - - sllx %o3, 32, %o3 - stx %o2, [%sp + STACK_BIAS + 128] - fabsd %f0, %f14 - - ldd [%sp + STACK_BIAS + 128], %f16 - fcmpd %fcc3, %f14, %f16 - - fmovduge %fcc3, ZERO, %f16 - fand %f0, SIGN_BIT, SIGN_BIT - - for %f16, SIGN_BIT, %f16 - faddd %f0, %f16, %f18 - fsubd %f18, %f16, %f18 - fcmpd %fcc2, %f18, %f0 - stx %o3, [%sp + STACK_BIAS + 128] - - ldd [%sp + STACK_BIAS + 128], %f20 - fmovduge %fcc2, ZERO, %f20 - faddd %f18, %f20, %f0 - fabsd %f0, %f0 - retl - for %f0, SIGN_BIT, %f0 -END (__ceil) -weak_alias (__ceil, ceil) diff --git a/sysdeps/sparc/sparc64/fpu/s_ceilf.S b/sysdeps/sparc/sparc64/fpu/s_ceilf.S deleted file mode 100644 index 5542dc4818..0000000000 --- a/sysdeps/sparc/sparc64/fpu/s_ceilf.S +++ /dev/null @@ -1,81 +0,0 @@ -/* Float ceil function, sparc64 version. - Copyright (C) 2012-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David S. Miller <davem@davemloft.net>, 2012. - - 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 <sysdep.h> - - /* Since changing the rounding mode is extremely expensive, we - try to round up using a method that is rounding mode - agnostic. - - We add then subtract (or subtract than add if the initial - value was negative) 2**23 to the value, then subtract it - back out. - - This will clear out the fractional portion of the value. - One of two things will happen for non-whole initial values. - Either the rounding mode will round it up, or it will be - rounded down. If the value started out whole, it will be - equal after the addition and subtraction. This means we - can accurately detect with one test whether we need to add - another 1.0 to round it up properly. - - We pop constants into the FPU registers using the incoming - argument stack slots, since this avoid having to use any - PIC references. We also thus avoid having to allocate a - register window. - - VIS instructions are used to facilitate the formation of - easier constants, and the propagation of the sign bit. */ - -#define TWO_TWENTYTHREE 0x4b000000 /* 2**23 */ -#define ONE_DOT_ZERO 0x3f800000 /* 1.0 */ - -#define ZERO %f10 /* 0.0 */ -#define SIGN_BIT %f12 /* -0.0 */ - -ENTRY (__ceilf) - sethi %hi(TWO_TWENTYTHREE), %o2 - sethi %hi(ONE_DOT_ZERO), %o3 - fzeros ZERO - - fnegs ZERO, SIGN_BIT - - st %o2, [%sp + STACK_BIAS + 128] - fabss %f1, %f14 - - ld [%sp + STACK_BIAS + 128], %f16 - fcmps %fcc3, %f14, %f16 - - fmovsuge %fcc3, ZERO, %f16 - fands %f1, SIGN_BIT, SIGN_BIT - - fors %f16, SIGN_BIT, %f16 - fadds %f1, %f16, %f5 - fsubs %f5, %f16, %f5 - fcmps %fcc2, %f5, %f1 - st %o3, [%sp + STACK_BIAS + 128] - - ld [%sp + STACK_BIAS + 128], %f9 - fmovsuge %fcc2, ZERO, %f9 - fadds %f5, %f9, %f0 - fabss %f0, %f0 - retl - fors %f0, SIGN_BIT, %f0 -END (__ceilf) -weak_alias (__ceilf, ceilf) diff --git a/sysdeps/sparc/sparc64/fpu/s_copysign.S b/sysdeps/sparc/sparc64/fpu/s_copysign.S index 390b463525..f3f207dea0 100644 --- a/sysdeps/sparc/sparc64/fpu/s_copysign.S +++ b/sysdeps/sparc/sparc64/fpu/s_copysign.S @@ -1,5 +1,5 @@ /* copysign function, sparc64 version. - 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. Contributed by David S. Miller <davem@davemloft.net>, 2012. @@ -18,6 +18,7 @@ <http://www.gnu.org/licenses/>. */ #include <sysdep.h> +#include <libm-alias-double.h> ENTRY (__copysign) fzeros %f7 @@ -27,4 +28,4 @@ ENTRY (__copysign) retl fors %f0, %f9, %f0 END (__copysign) -weak_alias (__copysign, copysign)
\ No newline at end of file +libm_alias_double (__copysign, copysign) diff --git a/sysdeps/sparc/sparc64/fpu/s_copysignf.S b/sysdeps/sparc/sparc64/fpu/s_copysignf.S index def4b6bf97..6fb25c3322 100644 --- a/sysdeps/sparc/sparc64/fpu/s_copysignf.S +++ b/sysdeps/sparc/sparc64/fpu/s_copysignf.S @@ -1,5 +1,5 @@ /* float copysign function, sparc64 version. - 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. Contributed by David S. Miller <davem@davemloft.net>, 2012. @@ -18,6 +18,7 @@ <http://www.gnu.org/licenses/>. */ #include <sysdep.h> +#include <libm-alias-float.h> ENTRY (__copysignf) fzeros %f7 @@ -27,4 +28,4 @@ ENTRY (__copysignf) retl fors %f1, %f9, %f0 END (__copysignf) -weak_alias (__copysignf, copysignf)
\ No newline at end of file +libm_alias_float (__copysign, copysign) diff --git a/sysdeps/sparc/sparc64/fpu/s_fabs.c b/sysdeps/sparc/sparc64/fpu/s_fabs.c index db5ecf2162..7862290da3 100644 --- a/sysdeps/sparc/sparc64/fpu/s_fabs.c +++ b/sysdeps/sparc/sparc64/fpu/s_fabs.c @@ -1,5 +1,7 @@ +#include <libm-alias-double.h> + double __fabs (double x) { return __builtin_fabs (x); } -weak_alias (__fabs, fabs) +libm_alias_double (__fabs, fabs) diff --git a/sysdeps/sparc/sparc64/fpu/s_fabsf.c b/sysdeps/sparc/sparc64/fpu/s_fabsf.c index 8a218e4942..5f54f80bf5 100644 --- a/sysdeps/sparc/sparc64/fpu/s_fabsf.c +++ b/sysdeps/sparc/sparc64/fpu/s_fabsf.c @@ -1,5 +1,7 @@ +#include <libm-alias-float.h> + float __fabsf (float x) { return __builtin_fabsf (x); } -weak_alias (__fabsf, fabsf) +libm_alias_float (__fabs, fabs) diff --git a/sysdeps/sparc/sparc64/fpu/s_fabsl.c b/sysdeps/sparc/sparc64/fpu/s_fabsl.c index 67e9f47071..72e1c51340 100644 --- a/sysdeps/sparc/sparc64/fpu/s_fabsl.c +++ b/sysdeps/sparc/sparc64/fpu/s_fabsl.c @@ -1,5 +1,7 @@ +#include <libm-alias-ldouble.h> + long double __fabsl (long double x) { return __builtin_fabsl (x); } -weak_alias (__fabsl, fabsl) +libm_alias_ldouble (__fabs, fabs) diff --git a/sysdeps/sparc/sparc64/fpu/s_fdim.S b/sysdeps/sparc/sparc64/fpu/s_fdim.S deleted file mode 100644 index 7fae72a251..0000000000 --- a/sysdeps/sparc/sparc64/fpu/s_fdim.S +++ /dev/null @@ -1,32 +0,0 @@ -/* Compute positive difference, sparc 64-bit. - Copyright (C) 2013-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David S. Miller <davem@davemloft.net>. - - 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 <sysdep.h> -#include <math_ldbl_opt.h> - -ENTRY(__fdim) - fcmpd %f0, %f2 - fbug 1f - nop - fzero %f0 - fnegd %f0, %f2 -1: retl - fsubd %f0, %f2, %f0 -END(__fdim) -weak_alias (__fdim, fdim) diff --git a/sysdeps/sparc/sparc64/fpu/s_fdimf.S b/sysdeps/sparc/sparc64/fpu/s_fdimf.S deleted file mode 100644 index 356c23c4e3..0000000000 --- a/sysdeps/sparc/sparc64/fpu/s_fdimf.S +++ /dev/null @@ -1,31 +0,0 @@ -/* Compute positive difference, sparc 64-bit. - Copyright (C) 2013-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David S. Miller <davem@davemloft.net>. - - 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 <sysdep.h> - -ENTRY(__fdimf) - fcmps %f1, %f3 - fbug 1f - nop - fzeros %f1 - fnegs %f1, %f3 -1: retl - fsubs %f1, %f3, %f0 -END(__fdimf) -weak_alias (__fdimf, fdimf) diff --git a/sysdeps/sparc/sparc64/fpu/s_finite.S b/sysdeps/sparc/sparc64/fpu/s_finite.S index aa80fa0d83..b3018bbbcd 100644 --- a/sysdeps/sparc/sparc64/fpu/s_finite.S +++ b/sysdeps/sparc/sparc64/fpu/s_finite.S @@ -1,5 +1,5 @@ /* finite(). sparc64 version. - 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/sparc/sparc64/fpu/s_finitef.S b/sysdeps/sparc/sparc64/fpu/s_finitef.S index cdcdf34417..e82af81079 100644 --- a/sysdeps/sparc/sparc64/fpu/s_finitef.S +++ b/sysdeps/sparc/sparc64/fpu/s_finitef.S @@ -1,5 +1,5 @@ /* finitef(). sparc64 version. - 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/sparc/sparc64/fpu/s_floor.S b/sysdeps/sparc/sparc64/fpu/s_floor.S deleted file mode 100644 index aded393595..0000000000 --- a/sysdeps/sparc/sparc64/fpu/s_floor.S +++ /dev/null @@ -1,83 +0,0 @@ -/* floor function, sparc64 version. - Copyright (C) 2012-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David S. Miller <davem@davemloft.net>, 2012. - - 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 <sysdep.h> - - /* Since changing the rounding mode is extremely expensive, we - try to round up using a method that is rounding mode - agnostic. - - We add then subtract (or subtract than add if the initial - value was negative) 2**23 to the value, then subtract it - back out. - - This will clear out the fractional portion of the value. - One of two things will happen for non-whole initial values. - Either the rounding mode will round it up, or it will be - rounded down. If the value started out whole, it will be - equal after the addition and subtraction. This means we - can accurately detect with one test whether we need to add - another 1.0 to round it up properly. - - We pop constants into the FPU registers using the incoming - argument stack slots, since this avoid having to use any - PIC references. We also thus avoid having to allocate a - register window. - - VIS instructions are used to facilitate the formation of - easier constants, and the propagation of the sign bit. */ - -#define TWO_FIFTYTWO 0x43300000 /* 2**52 */ -#define ONE_DOT_ZERO 0x3ff00000 /* 1.0 */ - -#define ZERO %f10 /* 0.0 */ -#define SIGN_BIT %f12 /* -0.0 */ - -ENTRY (__floor) - sethi %hi(TWO_FIFTYTWO), %o2 - sethi %hi(ONE_DOT_ZERO), %o3 - fzero ZERO - - sllx %o2, 32, %o2 - fnegd ZERO, SIGN_BIT - - sllx %o3, 32, %o3 - stx %o2, [%sp + STACK_BIAS + 128] - fabsd %f0, %f14 - - ldd [%sp + STACK_BIAS + 128], %f16 - fcmpd %fcc3, %f14, %f16 - - fmovduge %fcc3, ZERO, %f16 - fand %f0, SIGN_BIT, SIGN_BIT - - for %f16, SIGN_BIT, %f16 - faddd %f0, %f16, %f18 - fsubd %f18, %f16, %f18 - fcmpd %fcc2, %f18, %f0 - stx %o3, [%sp + STACK_BIAS + 128] - - ldd [%sp + STACK_BIAS + 128], %f20 - fmovdule %fcc2, ZERO, %f20 - fsubd %f18, %f20, %f0 - fabsd %f0, %f0 - retl - for %f0, SIGN_BIT, %f0 -END (__floor) -weak_alias (__floor, floor) diff --git a/sysdeps/sparc/sparc64/fpu/s_floorf.S b/sysdeps/sparc/sparc64/fpu/s_floorf.S deleted file mode 100644 index 9f20549d8f..0000000000 --- a/sysdeps/sparc/sparc64/fpu/s_floorf.S +++ /dev/null @@ -1,81 +0,0 @@ -/* Float floor function, sparc64 version. - Copyright (C) 2012-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David S. Miller <davem@davemloft.net>, 2012. - - 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 <sysdep.h> - - /* Since changing the rounding mode is extremely expensive, we - try to round up using a method that is rounding mode - agnostic. - - We add then subtract (or subtract than add if the initial - value was negative) 2**23 to the value, then subtract it - back out. - - This will clear out the fractional portion of the value. - One of two things will happen for non-whole initial values. - Either the rounding mode will round it up, or it will be - rounded down. If the value started out whole, it will be - equal after the addition and subtraction. This means we - can accurately detect with one test whether we need to add - another 1.0 to round it up properly. - - We pop constants into the FPU registers using the incoming - argument stack slots, since this avoid having to use any - PIC references. We also thus avoid having to allocate a - register window. - - VIS instructions are used to facilitate the formation of - easier constants, and the propagation of the sign bit. */ - -#define TWO_TWENTYTHREE 0x4b000000 /* 2**23 */ -#define ONE_DOT_ZERO 0x3f800000 /* 1.0 */ - -#define ZERO %f10 /* 0.0 */ -#define SIGN_BIT %f12 /* -0.0 */ - -ENTRY (__floorf) - sethi %hi(TWO_TWENTYTHREE), %o2 - sethi %hi(ONE_DOT_ZERO), %o3 - fzeros ZERO - - fnegs ZERO, SIGN_BIT - - st %o2, [%sp + STACK_BIAS + 128] - fabss %f1, %f14 - - ld [%sp + STACK_BIAS + 128], %f16 - fcmps %fcc3, %f14, %f16 - - fmovsuge %fcc3, ZERO, %f16 - fands %f1, SIGN_BIT, SIGN_BIT - - fors %f16, SIGN_BIT, %f16 - fadds %f1, %f16, %f5 - fsubs %f5, %f16, %f5 - fcmps %fcc2, %f5, %f1 - st %o3, [%sp + STACK_BIAS + 128] - - ld [%sp + STACK_BIAS + 128], %f9 - fmovsule %fcc2, ZERO, %f9 - fsubs %f5, %f9, %f0 - fabss %f0, %f0 - retl - fors %f0, SIGN_BIT, %f0 -END (__floorf) -weak_alias (__floorf, floorf) diff --git a/sysdeps/sparc/sparc64/fpu/s_isinf.S b/sysdeps/sparc/sparc64/fpu/s_isinf.S index b9da758d71..6365bc438b 100644 --- a/sysdeps/sparc/sparc64/fpu/s_isinf.S +++ b/sysdeps/sparc/sparc64/fpu/s_isinf.S @@ -1,5 +1,5 @@ /* isinf(). sparc64 version. - 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/sparc/sparc64/fpu/s_isinff.S b/sysdeps/sparc/sparc64/fpu/s_isinff.S index a68845672f..9737d91102 100644 --- a/sysdeps/sparc/sparc64/fpu/s_isinff.S +++ b/sysdeps/sparc/sparc64/fpu/s_isinff.S @@ -1,5 +1,5 @@ /* isinff(). sparc64 version. - 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/sparc/sparc64/fpu/s_isnan.S b/sysdeps/sparc/sparc64/fpu/s_isnan.S index 342b987203..47ac0cf247 100644 --- a/sysdeps/sparc/sparc64/fpu/s_isnan.S +++ b/sysdeps/sparc/sparc64/fpu/s_isnan.S @@ -1,5 +1,5 @@ /* isnan(). sparc64 version. - 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/sparc/sparc64/fpu/s_isnanf.S b/sysdeps/sparc/sparc64/fpu/s_isnanf.S index 43e232260a..32e80219f7 100644 --- a/sysdeps/sparc/sparc64/fpu/s_isnanf.S +++ b/sysdeps/sparc/sparc64/fpu/s_isnanf.S @@ -1,5 +1,5 @@ /* isnanf(). sparc64 version. - 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/sparc/sparc64/fpu/s_lrint.S b/sysdeps/sparc/sparc64/fpu/s_lrint.S index 0e21aba06d..907a466be5 100644 --- a/sysdeps/sparc/sparc64/fpu/s_lrint.S +++ b/sysdeps/sparc/sparc64/fpu/s_lrint.S @@ -1,5 +1,5 @@ /* lrint(), sparc64 version. - 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. Contributed by David S. Miller <davem@davemloft.net>, 2012. @@ -18,6 +18,7 @@ <http://www.gnu.org/licenses/>. */ #include <sysdep.h> +#include <libm-alias-double.h> /* We pop constants into the FPU registers using the incoming argument stack slots, since this avoid having to use any PIC @@ -57,7 +58,7 @@ ENTRY (__lrint) retl ldx [%sp + STACK_BIAS + 128], %o0 END (__lrint) -weak_alias (__lrint, lrint) +libm_alias_double (__lrint, lrint) strong_alias (__lrint, __llrint) -weak_alias (__llrint, llrint) +libm_alias_double (__llrint, llrint) diff --git a/sysdeps/sparc/sparc64/fpu/s_lrintf.S b/sysdeps/sparc/sparc64/fpu/s_lrintf.S index 275222ff2d..7a341f6fc5 100644 --- a/sysdeps/sparc/sparc64/fpu/s_lrintf.S +++ b/sysdeps/sparc/sparc64/fpu/s_lrintf.S @@ -1,5 +1,5 @@ /* lrintf(), sparc64 version. - 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. Contributed by David S. Miller <davem@davemloft.net>, 2012. @@ -18,6 +18,7 @@ <http://www.gnu.org/licenses/>. */ #include <sysdep.h> +#include <libm-alias-float.h> /* We pop constants into the FPU registers using the incoming argument stack slots, since this avoid having to use any PIC @@ -56,7 +57,7 @@ ENTRY (__lrintf) retl ldx [%sp + STACK_BIAS + 128], %o0 END (__lrintf) -weak_alias (__lrintf, lrintf) +libm_alias_float (__lrint, lrint) strong_alias (__lrintf, __llrintf) -weak_alias (__llrintf, llrintf) +libm_alias_float (__llrint, llrint) diff --git a/sysdeps/sparc/sparc64/fpu/s_nearbyint.S b/sysdeps/sparc/sparc64/fpu/s_nearbyint.S index caf4d729e0..a8f099779f 100644 --- a/sysdeps/sparc/sparc64/fpu/s_nearbyint.S +++ b/sysdeps/sparc/sparc64/fpu/s_nearbyint.S @@ -1,7 +1,7 @@ /* Round float to int floating-point values without generating an inexact exception, sparc64 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. Contributed by David S. Miller <davem@davemloft.net>, 2013. @@ -20,6 +20,7 @@ <http://www.gnu.org/licenses/>. */ #include <sysdep.h> +#include <libm-alias-double.h> /* We pop constants into the FPU registers using the incoming argument stack slots, since this avoid having to use any PIC @@ -35,6 +36,7 @@ #define SIGN_BIT %f12 /* -0.0 */ ENTRY (__nearbyint) + fcmpd %fcc3, %f0, %f0 /* Check for sNaN */ stx %fsr, [%sp + STACK_BIAS + 144] sethi %hi(TWO_FIFTYTWO), %o2 sllx %o2, 32, %o2 @@ -60,4 +62,4 @@ ENTRY (__nearbyint) retl ldx [%sp + STACK_BIAS + 144], %fsr END (__nearbyint) -weak_alias (__nearbyint, nearbyint) +libm_alias_double (__nearbyint, nearbyint) diff --git a/sysdeps/sparc/sparc64/fpu/s_nearbyintf.S b/sysdeps/sparc/sparc64/fpu/s_nearbyintf.S index 4232eca9ad..361ea5800d 100644 --- a/sysdeps/sparc/sparc64/fpu/s_nearbyintf.S +++ b/sysdeps/sparc/sparc64/fpu/s_nearbyintf.S @@ -1,7 +1,7 @@ /* Round float to int floating-point values without generating an inexact exception, sparc64 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. Contributed by David S. Miller <davem@davemloft.net>, 2013. @@ -20,6 +20,7 @@ <http://www.gnu.org/licenses/>. */ #include <sysdep.h> +#include <libm-alias-float.h> /* We pop constants into the FPU registers using the incoming argument stack slots, since this avoid having to use any PIC @@ -35,6 +36,7 @@ #define SIGN_BIT %f12 /* -0.0 */ ENTRY (__nearbyintf) + fcmps %fcc3, %f1, %f1 /* Check for sNaN */ stx %fsr, [%sp + STACK_BIAS + 144] sethi %hi(0xf8003e0), %o5 sethi %hi(TWO_TWENTYTHREE), %o2 @@ -59,4 +61,4 @@ ENTRY (__nearbyintf) retl ldx [%sp + STACK_BIAS + 144], %fsr END (__nearbyintf) -weak_alias (__nearbyintf, nearbyintf) +libm_alias_float (__nearbyint, nearbyint) diff --git a/sysdeps/sparc/sparc64/fpu/s_rint.S b/sysdeps/sparc/sparc64/fpu/s_rint.S index afdb4329fb..23745fb7e5 100644 --- a/sysdeps/sparc/sparc64/fpu/s_rint.S +++ b/sysdeps/sparc/sparc64/fpu/s_rint.S @@ -1,5 +1,5 @@ /* Round float to int floating-point values, sparc64 version. - 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. Contributed by David S. Miller <davem@davemloft.net>, 2012. @@ -18,6 +18,7 @@ <http://www.gnu.org/licenses/>. */ #include <sysdep.h> +#include <libm-alias-double.h> /* We pop constants into the FPU registers using the incoming argument stack slots, since this avoid having to use any PIC @@ -54,4 +55,4 @@ ENTRY (__rint) retl for %f0, SIGN_BIT, %f0 END (__rint) -weak_alias (__rint, rint) +libm_alias_double (__rint, rint) diff --git a/sysdeps/sparc/sparc64/fpu/s_rintf.S b/sysdeps/sparc/sparc64/fpu/s_rintf.S index f9448957cf..7eeb175aa7 100644 --- a/sysdeps/sparc/sparc64/fpu/s_rintf.S +++ b/sysdeps/sparc/sparc64/fpu/s_rintf.S @@ -1,5 +1,5 @@ /* Round float to int floating-point values, sparc64 version. - 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. Contributed by David S. Miller <davem@davemloft.net>, 2012. @@ -18,6 +18,7 @@ <http://www.gnu.org/licenses/>. */ #include <sysdep.h> +#include <libm-alias-float.h> /* We pop constants into the FPU registers using the incoming argument stack slots, since this avoid having to use any PIC @@ -53,4 +54,4 @@ ENTRY (__rintf) retl fors %f0, SIGN_BIT, %f0 END (__rintf) -weak_alias (__rintf, rintf) +libm_alias_float (__rint, rint) diff --git a/sysdeps/sparc/sparc64/fpu/s_signbit.S b/sysdeps/sparc/sparc64/fpu/s_signbit.S index 1452c90f95..57fc717a48 100644 --- a/sysdeps/sparc/sparc64/fpu/s_signbit.S +++ b/sysdeps/sparc/sparc64/fpu/s_signbit.S @@ -1,5 +1,5 @@ /* signbit(). sparc64 version. - 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 @@ -24,11 +24,9 @@ ENTRY (__signbit) retl srl %o0, 31, %o0 END (__signbit) -weak_alias (__signbit, signbit) /* On 64-bit the double version will also always work for long-double-precision since in both cases the word with the sign bit in it is passed always in register %f0. */ strong_alias (__signbit, __signbitl) hidden_def (__signbitl) -weak_alias (__signbitl, signbitl) diff --git a/sysdeps/sparc/sparc64/fpu/s_signbitf.S b/sysdeps/sparc/sparc64/fpu/s_signbitf.S index 40d43d6c91..0b20f0189a 100644 --- a/sysdeps/sparc/sparc64/fpu/s_signbitf.S +++ b/sysdeps/sparc/sparc64/fpu/s_signbitf.S @@ -1,5 +1,5 @@ /* signbitf(). sparc64 version. - 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 @@ -24,4 +24,3 @@ ENTRY (__signbitf) retl srl %o0, 31, %o0 END (__signbitf) -weak_alias (__signbitf, signbitf) diff --git a/sysdeps/sparc/sparc64/fpu/s_trunc.S b/sysdeps/sparc/sparc64/fpu/s_trunc.S deleted file mode 100644 index 34ecb142d4..0000000000 --- a/sysdeps/sparc/sparc64/fpu/s_trunc.S +++ /dev/null @@ -1,55 +0,0 @@ -/* Truncate argument to nearest integral value not larger than - the argument, sparc64 version. - - Copyright (C) 2013-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David S. Miller <davem@davemloft.net>, 2013. - - 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 <sysdep.h> - - /* We pop constants into the FPU registers using the incoming - argument stack slots, since this avoid having to use any PIC - references. We also thus avoid having to allocate a register - window. - - VIS instructions are used to facilitate the formation of - easier constants, and the propagation of the sign bit. */ - -#define TWO_FIFTYTWO 0x43300000 /* 2**52 */ - -#define ZERO %f10 /* 0.0 */ -#define SIGN_BIT %f12 /* -0.0 */ - -ENTRY (__trunc) - sethi %hi(TWO_FIFTYTWO), %o2 - sllx %o2, 32, %o2 - fzero ZERO - fnegd ZERO, SIGN_BIT - stx %o2, [%sp + STACK_BIAS + 128] - fabsd %f0, %f14 - ldd [%sp + STACK_BIAS + 128], %f16 - fcmpd %fcc3, %f14, %f16 - fmovduge %fcc3, ZERO, %f14 - fand %f0, SIGN_BIT, SIGN_BIT - fdtox %f14, %f14 - fxtod %f14, %f14 - faddd %f0, ZERO, %f18 - fmovduge %fcc3, %f18, %f14 - retl - for %f14, SIGN_BIT, %f0 -END (__trunc) -weak_alias (__trunc, trunc) diff --git a/sysdeps/sparc/sparc64/fpu/s_truncf.S b/sysdeps/sparc/sparc64/fpu/s_truncf.S deleted file mode 100644 index 7bc7235bec..0000000000 --- a/sysdeps/sparc/sparc64/fpu/s_truncf.S +++ /dev/null @@ -1,54 +0,0 @@ -/* Truncate argument to nearest integral value not larger than - the argument, sparc64 version. - - Copyright (C) 2013-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David S. Miller <davem@davemloft.net>, 2013. - - 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 <sysdep.h> - - /* We pop constants into the FPU registers using the incoming - argument stack slots, since this avoid having to use any PIC - references. We also thus avoid having to allocate a register - window. - - VIS instructions are used to facilitate the formation of - easier constants, and the propagation of the sign bit. */ - -#define TWO_TWENTYTHREE 0x4b000000 /* 2**23 */ - -#define ZERO %f10 /* 0.0 */ -#define SIGN_BIT %f12 /* -0.0 */ - -ENTRY (__truncf) - sethi %hi(TWO_TWENTYTHREE), %o2 - fzeros ZERO - fnegs ZERO, SIGN_BIT - st %o2, [%sp + STACK_BIAS + 128] - fabss %f1, %f14 - ld [%sp + STACK_BIAS + 128], %f16 - fcmps %fcc3, %f14, %f16 - fmovsuge %fcc3, ZERO, %f14 - fands %f1, SIGN_BIT, SIGN_BIT - fstoi %f14, %f14 - fitos %f14, %f14 - fadds %f1, ZERO, %f18 - fmovsuge %fcc3, %f18, %f14 - retl - fors %f14, SIGN_BIT, %f0 -END (__truncf) -weak_alias (__truncf, truncf) diff --git a/sysdeps/sparc/sparc64/fpu/w_sqrtf.S b/sysdeps/sparc/sparc64/fpu/w_sqrtf.S deleted file mode 100644 index 4d1fedbd62..0000000000 --- a/sysdeps/sparc/sparc64/fpu/w_sqrtf.S +++ /dev/null @@ -1,48 +0,0 @@ -/* sqrtf function. sparc64 version. - Copyright (C) 2012-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/>. */ - -#include <sysdep.h> - -ENTRY (__sqrtf) - fzeros %f8 - fcmps %fcc2, %f1, %f8 - fbl,pn %fcc2, 1f - nop -8: retl - fsqrts %f1, %f0 -1: -#ifdef SHARED - SETUP_PIC_REG_LEAF(o5, g1) - sethi %gdop_hix22(_LIB_VERSION), %g1 - xor %g1, %gdop_lox10(_LIB_VERSION), %g1 - ldx [%o5 + %g1], %g1, %gdop(_LIB_VERSION) -#else - sethi %hi(_LIB_VERSION), %g1 - or %g1, %lo(_LIB_VERSION), %g1 -#endif - ld [%g1], %g1 - cmp %g1, -1 - be,pt %icc, 8b - fmovs %f1, %f3 - mov 126, %o2 - mov %o7, %g1 - call __kernel_standard_f - mov %g1, %o7 -END (__sqrtf) - -weak_alias (__sqrtf, sqrtf) diff --git a/sysdeps/sparc/sparc64/hp-timing.h b/sysdeps/sparc/sparc64/hp-timing.h index 14ad1a4bea..6632564106 100644 --- a/sysdeps/sparc/sparc64/hp-timing.h +++ b/sysdeps/sparc/sparc64/hp-timing.h @@ -1,5 +1,5 @@ /* High precision, low overhead timing functions. sparc64 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. Contributed by David S. Miller <davem@redhat.com>, 2001. diff --git a/sysdeps/sparc/sparc64/jmpbuf-unwind.h b/sysdeps/sparc/sparc64/jmpbuf-unwind.h index 11a8dd8221..c07688dd2b 100644 --- a/sysdeps/sparc/sparc64/jmpbuf-unwind.h +++ b/sysdeps/sparc/sparc64/jmpbuf-unwind.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. Contributed by David S. Miller <davem@davemloft.net>, 2005. @@ -22,15 +22,16 @@ /* Test if longjmp to JMPBUF would unwind the frame containing a local variable at ADDRESS. */ -#define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \ - ((unsigned long int) (address) < (jmpbuf)->uc_mcontext.mc_gregs[MC_O6] + 2047) +#define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \ + ((unsigned long int) (address) \ + < (jmpbuf)->__uc_mcontext.__mc_gregs[MC_O6] + 2047) #define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \ _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj) #define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \ ((uintptr_t) (_address) - (_adj) \ - < (uintptr_t) (_jmpbuf)[0].uc_mcontext.mc_gregs[MC_O6] + 2047 - (_adj)) + < (uintptr_t) (_jmpbuf)[0].__uc_mcontext.__mc_gregs[MC_O6] + 2047 - (_adj)) /* We use the normal lobngjmp for unwinding. */ #define __libc_unwind_longjmp(buf, val) __libc_longjmp (buf, val) diff --git a/sysdeps/sparc/sparc64/lshift.S b/sysdeps/sparc/sparc64/lshift.S index d67dc3ab02..9fa0f99aea 100644 --- a/sysdeps/sparc/sparc64/lshift.S +++ b/sysdeps/sparc/sparc64/lshift.S @@ -1,6 +1,6 @@ /* SPARC v9 __mpn_lshift -- - Copyright (C) 1996-2016 Free Software Foundation, Inc. + Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU MP Library. diff --git a/sysdeps/sparc/sparc64/memchr.S b/sysdeps/sparc/sparc64/memchr.S index d3e75f6647..1024cb0000 100644 --- a/sysdeps/sparc/sparc64/memchr.S +++ b/sysdeps/sparc/sparc64/memchr.S @@ -1,7 +1,7 @@ /* memchr (str, ch, n) -- Return pointer to first occurrence of CH in STR less than N. For SPARC v9. - 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 Jan Vondrak <jvon4518@ss1000.ms.mff.cuni.cz> and Jakub Jelinek <jj@ultra.linux.cz>. diff --git a/sysdeps/sparc/sparc64/memcmp.S b/sysdeps/sparc/sparc64/memcmp.S index 24d3a6d822..46ac800102 100644 --- a/sysdeps/sparc/sparc64/memcmp.S +++ b/sysdeps/sparc/sparc64/memcmp.S @@ -1,6 +1,6 @@ /* Compare two memory blocks for differences in the first COUNT bytes. For SPARC v9. - 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 Jan Vondrak <jvon4518@ss1000.ms.mff.cuni.cz> and Jakub Jelinek <jj@ultra.linux.cz>. diff --git a/sysdeps/sparc/sparc64/memcpy.S b/sysdeps/sparc/sparc64/memcpy.S index 3a286c4156..e1542d26bf 100644 --- a/sysdeps/sparc/sparc64/memcpy.S +++ b/sysdeps/sparc/sparc64/memcpy.S @@ -1,6 +1,6 @@ /* Copy SIZE bytes from SRC to DEST. For UltraSPARC. - 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 David S. Miller (davem@caip.rutgers.edu) and Jakub Jelinek (jakub@redhat.com). diff --git a/sysdeps/sparc/sparc64/memmove.S b/sysdeps/sparc/sparc64/memmove.S new file mode 100644 index 0000000000..117786bc1c --- /dev/null +++ b/sysdeps/sparc/sparc64/memmove.S @@ -0,0 +1,186 @@ +/* Copy memory to memory until the specified number of bytes + has been copied. Overlap is handled correctly. + For SPARC V9. + 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/>. */ + +#include <sysdep.h> + +#ifndef XCC +# define XCC xcc + .register %g2, #scratch +#endif + +ENTRY(memmove) + mov %o0, %g2 /* Save pointer to destination */ + cmp %o1, %o0 /* if from address is >= to use forward copy */ + bgeu,a %XCC, 2f /* else use backward if ... */ + cmp %o2, 17 /* delay slot, for small counts copy bytes */ + + sub %o0, %o1, %o4 /* get difference of two addresses */ + cmp %o2, %o4 /* compare size and difference of addresses */ + bgu %XCC, .Lovbc /* if size is bigger, have to do overlapped copy */ + cmp %o2, 17 /* delay slot, for small counts copy bytes */ +/* + * normal, copy forwards + */ +2: ble %XCC, .Ldbytecp + andcc %o1, 3, %o5 /* is src word aligned */ + bz,pn %icc, .Laldst + cmp %o5, 2 /* is src half-word aligned */ + be,pn %icc, .Ls2alg + cmp %o5, 3 /* src is byte aligned */ + ldub [%o1], %o3 /* move 1 or 3 bytes to align it */ + inc 1, %o1 + stb %o3, [%o0] /* move a byte to align src */ + inc 1, %o0 + bne,pn %icc, .Ls2alg + dec %o2 + b .Lald /* now go align dest */ + andcc %o0, 3, %o5 + +.Ls2alg: + lduh [%o1], %o3 /* know src is 2 byte aligned */ + inc 2, %o1 + srl %o3, 8, %o4 + stb %o4, [%o0] /* have to do bytes, */ + stb %o3, [%o0 + 1] /* don't know dst alingment */ + inc 2, %o0 + dec 2, %o2 + +.Laldst: + andcc %o0, 3, %o5 /* align the destination address */ +.Lald: bz,pn %icc, .Lw4cp + cmp %o5, 2 + bz,pn %icc, .Lw2cp + cmp %o5, 3 +.Lw3cp: + lduw [%o1], %o4 + inc 4, %o1 + srl %o4, 24, %o5 + stb %o5, [%o0] + bne,pt %icc, .Lw1cp + inc %o0 + dec 1, %o2 + andn %o2, 3, %o3 /* i3 is aligned word count */ + dec 4, %o3 /* avoid reading beyond tail of src */ + sub %o1, %o0, %o1 /* i1 gets the difference */ + +1: sll %o4, 8, %g1 /* save residual bytes */ + lduw [%o1+%o0], %o4 + deccc 4, %o3 + srl %o4, 24, %o5 /* merge with residual */ + or %o5, %g1, %g1 + st %g1, [%o0] + bnz,pt %XCC, 1b + inc 4, %o0 + sub %o1, 3, %o1 /* used one byte of last word read */ + and %o2, 3, %o2 + b 7f + inc 4, %o2 + +.Lw1cp: + srl %o4, 8, %o5 + sth %o5, [%o0] + inc 2, %o0 + dec 3, %o2 + andn %o2, 3, %o3 + dec 4, %o3 /* avoid reading beyond tail of src */ + sub %o1, %o0, %o1 /* i1 gets the difference */ + +2: sll %o4, 24, %g1 /* save residual bytes */ + lduw [%o1+%o0], %o4 + deccc 4, %o3 + srl %o4, 8, %o5 /* merge with residual */ + or %o5, %g1, %g1 + st %g1, [%o0] + bnz,pt %XCC, 2b + inc 4, %o0 + sub %o1, 1, %o1 /* used three bytes of last word read */ + and %o2, 3, %o2 + b 7f + inc 4, %o2 + +.Lw2cp: + lduw [%o1], %o4 + inc 4, %o1 + srl %o4, 16, %o5 + sth %o5, [%o0] + inc 2, %o0 + dec 2, %o2 + andn %o2, 3, %o3 /* i3 is aligned word count */ + dec 4, %o3 /* avoid reading beyond tail of src */ + sub %o1, %o0, %o1 /* i1 gets the difference */ + +3: sll %o4, 16, %g1 /* save residual bytes */ + lduw [%o1+%o0], %o4 + deccc 4, %o3 + srl %o4, 16, %o5 /* merge with residual */ + or %o5, %g1, %g1 + st %g1, [%o0] + bnz,pt %XCC, 3b + inc 4, %o0 + sub %o1, 2, %o1 /* used two bytes of last word read */ + and %o2, 3, %o2 + b 7f + inc 4, %o2 + +.Lw4cp: + andn %o2, 3, %o3 /* i3 is aligned word count */ + sub %o1, %o0, %o1 /* i1 gets the difference */ + +1: lduw [%o1+%o0], %o4 /* read from address */ + deccc 4, %o3 /* decrement count */ + st %o4, [%o0] /* write at destination address */ + bg,pt %XCC, 1b + inc 4, %o0 /* increment to address */ + b 7f + and %o2, 3, %o2 /* number of leftover bytes, if any */ + +/* + * differenced byte copy, works with any alignment + */ +.Ldbytecp: + b 7f + sub %o1, %o0, %o1 /* i1 gets the difference */ + +4: stb %o4, [%o0] /* write to address */ + inc %o0 /* inc to address */ +7: deccc %o2 /* decrement count */ + bge,a %XCC, 4b /* loop till done */ + ldub [%o1+%o0], %o4 /* read from address */ + retl + mov %g2, %o0 /* return pointer to destination */ + +/* + * an overlapped copy that must be done "backwards" + */ +.Lovbc: + add %o1, %o2, %o1 /* get to end of source space */ + add %o0, %o2, %o0 /* get to end of destination space */ + sub %o1, %o0, %o1 /* i1 gets the difference */ + +5: dec %o0 /* decrement to address */ + ldub [%o1+%o0], %o3 /* read a byte */ + deccc %o2 /* decrement count */ + bg,pt %XCC, 5b /* loop until done */ + stb %o3, [%o0] /* write byte */ + retl + mov %g2, %o0 /* return pointer to destination */ +END(memmove) + +libc_hidden_builtin_def (memmove) diff --git a/sysdeps/sparc/sparc64/memset.S b/sysdeps/sparc/sparc64/memset.S index 48002ebb58..72ae8e1ca1 100644 --- a/sysdeps/sparc/sparc64/memset.S +++ b/sysdeps/sparc/sparc64/memset.S @@ -1,6 +1,6 @@ /* Set a block of memory to some byte value. For UltraSPARC. - 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 David S. Miller (davem@caip.rutgers.edu) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/sysdeps/sparc/sparc64/mul_1.S b/sysdeps/sparc/sparc64/mul_1.S index 42b3b5c0de..4b7f4dbbeb 100644 --- a/sysdeps/sparc/sparc64/mul_1.S +++ b/sysdeps/sparc/sparc64/mul_1.S @@ -1,7 +1,7 @@ /* SPARC v9 __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/sparc/sparc64/multiarch/Makefile b/sysdeps/sparc/sparc64/multiarch/Makefile index 55b757f9ad..eaf758e7aa 100644 --- a/sysdeps/sparc/sparc64/multiarch/Makefile +++ b/sysdeps/sparc/sparc64/multiarch/Makefile @@ -8,11 +8,15 @@ endif ifeq ($(subdir),string) sysdep_routines += memcpy-ultra3 memcpy-niagara1 memcpy-niagara2 \ - memset-niagara1 memcpy-niagara4 memset-niagara4 + memset-niagara1 memcpy-niagara4 memset-niagara4 \ + memcpy-ultra1 memset-ultra1 memcpy-memmove-niagara7 \ + memmove-ultra1 memset-niagara7 endif ifeq ($(subdir),stdlib) -sysdep_routines += mul_1-vis3 addmul_1-vis3 submul_1-vis3 add_n-vis3 sub_n-vis3 +sysdep_routines += mul_1-vis3 mul_1-generic addmul_1-vis3 addmul_1-generic \ + submul_1-vis3 submul_1-generic add_n-vis3 add_n-generic \ + sub_n-vis3 sub_n-generic endif ifeq ($(subdir),math) diff --git a/sysdeps/sparc/sparc64/multiarch/add_n-generic.S b/sysdeps/sparc/sparc64/multiarch/add_n-generic.S new file mode 100644 index 0000000000..a16e7091b4 --- /dev/null +++ b/sysdeps/sparc/sparc64/multiarch/add_n-generic.S @@ -0,0 +1,2 @@ +#define __mpn_add_n __mpn_add_n_generic +#include <sysdeps/sparc/sparc64/add_n.S> diff --git a/sysdeps/sparc/sparc64/multiarch/add_n-vis3.S b/sysdeps/sparc/sparc64/multiarch/add_n-vis3.S index 0fda45a208..b4f1ef5181 100644 --- a/sysdeps/sparc/sparc64/multiarch/add_n-vis3.S +++ b/sysdeps/sparc/sparc64/multiarch/add_n-vis3.S @@ -1,7 +1,7 @@ ! SPARC v9 64-bit VIS3 __mpn_add_n -- Add two limb vectors of the same length > 0 and ! store sum in a third limb vector. ! -! 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. ! Contributed by David S. Miller <davem@davemloft.net> ! diff --git a/sysdeps/sparc/sparc64/multiarch/add_n.S b/sysdeps/sparc/sparc64/multiarch/add_n.S deleted file mode 100644 index 8e67d75921..0000000000 --- a/sysdeps/sparc/sparc64/multiarch/add_n.S +++ /dev/null @@ -1,56 +0,0 @@ -/* Multiple versions of add_n - - Copyright (C) 2013-2016 Free Software Foundation, Inc. - Contributed by David S. Miller (davem@davemloft.net) - 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 <sysdep.h> - -ENTRY(__mpn_add_n) - .type __mpn_add_n, @gnu_indirect_function -# ifdef SHARED - SETUP_PIC_REG_LEAF(o3, o5) -# endif - set HWCAP_SPARC_VIS3, %o1 - andcc %o0, %o1, %g0 - be 1f - nop -# ifdef SHARED - sethi %gdop_hix22(__mpn_add_n_vis3), %o1 - xor %o1, %gdop_lox10(__mpn_add_n_vis3), %o1 -# else - set __mpn_add_n_vis3, %o1 -# endif - ba 10f - nop -1: -# ifdef SHARED - sethi %gdop_hix22(__mpn_add_n_generic), %o1 - xor %o1, %gdop_lox10(__mpn_add_n_generic), %o1 -# else - set __mpn_add_n_generic, %o1 -# endif -10: -# ifdef SHARED - add %o3, %o1, %o1 -# endif - retl - mov %o1, %o0 -END(__mpn_add_n) - -#define __mpn_add_n __mpn_add_n_generic -#include "../add_n.S" diff --git a/sysdeps/sparc/sparc64/multiarch/add_n.c b/sysdeps/sparc/sparc64/multiarch/add_n.c new file mode 100644 index 0000000000..47b0d0e3bc --- /dev/null +++ b/sysdeps/sparc/sparc64/multiarch/add_n.c @@ -0,0 +1,28 @@ +/* __mpn_add_n ifunc resolver, Linux/sparc64 version. + 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/>. */ + +#include <gmp.h> +#include <sparc-ifunc.h> + +extern __typeof (mpn_add_n) __mpn_add_n_vis3 attribute_hidden; +extern __typeof (mpn_add_n) __mpn_add_n_generic attribute_hidden; + +sparc_libm_ifunc (__mpn_add_n, + hwcap & HWCAP_SPARC_VIS3 + ? __mpn_add_n_vis3 + : __mpn_add_n_generic) diff --git a/sysdeps/sparc/sparc64/multiarch/addmul_1-generic.S b/sysdeps/sparc/sparc64/multiarch/addmul_1-generic.S new file mode 100644 index 0000000000..5bf1da7fde --- /dev/null +++ b/sysdeps/sparc/sparc64/multiarch/addmul_1-generic.S @@ -0,0 +1,2 @@ +#define __mpn_addmul_1 __mpn_addmul_1_generic +#include <sysdeps/sparc/sparc64/addmul_1.S> diff --git a/sysdeps/sparc/sparc64/multiarch/addmul_1-vis3.S b/sysdeps/sparc/sparc64/multiarch/addmul_1-vis3.S index 9a2f6acd9c..b5e808bddd 100644 --- a/sysdeps/sparc/sparc64/multiarch/addmul_1-vis3.S +++ b/sysdeps/sparc/sparc64/multiarch/addmul_1-vis3.S @@ -1,7 +1,7 @@ ! SPARC v9 64-bit VIS3 __mpn_addmul_1 -- Multiply a limb vector with a ! limb and add the result to a second limb vector. ! -! 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. ! Contributed by David S. Miller <davem@davemloft.net> ! diff --git a/sysdeps/sparc/sparc64/multiarch/addmul_1.S b/sysdeps/sparc/sparc64/multiarch/addmul_1.S deleted file mode 100644 index 4763edd457..0000000000 --- a/sysdeps/sparc/sparc64/multiarch/addmul_1.S +++ /dev/null @@ -1,56 +0,0 @@ -/* Multiple versions of addmul_1 - - Copyright (C) 2013-2016 Free Software Foundation, Inc. - Contributed by David S. Miller (davem@davemloft.net) - 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 <sysdep.h> - -ENTRY(__mpn_addmul_1) - .type __mpn_addmul_1, @gnu_indirect_function -# ifdef SHARED - SETUP_PIC_REG_LEAF(o3, o5) -# endif - set HWCAP_SPARC_VIS3, %o1 - andcc %o0, %o1, %g0 - be 1f - nop -# ifdef SHARED - sethi %gdop_hix22(__mpn_addmul_1_vis3), %o1 - xor %o1, %gdop_lox10(__mpn_addmul_1_vis3), %o1 -# else - set __mpn_addmul_1_vis3, %o1 -# endif - ba 10f - nop -1: -# ifdef SHARED - sethi %gdop_hix22(__mpn_addmul_1_generic), %o1 - xor %o1, %gdop_lox10(__mpn_addmul_1_generic), %o1 -# else - set __mpn_addmul_1_generic, %o1 -# endif -10: -# ifdef SHARED - add %o3, %o1, %o1 -# endif - retl - mov %o1, %o0 -END(__mpn_addmul_1) - -#define __mpn_addmul_1 __mpn_addmul_1_generic -#include "../addmul_1.S" diff --git a/sysdeps/sparc/sparc64/multiarch/addmul_1.c b/sysdeps/sparc/sparc64/multiarch/addmul_1.c new file mode 100644 index 0000000000..afaeca870d --- /dev/null +++ b/sysdeps/sparc/sparc64/multiarch/addmul_1.c @@ -0,0 +1,28 @@ +/* __mpn_addmul_1 ifunc resolver, Linux/sparc64 version. + 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/>. */ + +#include <gmp.h> +#include <sparc-ifunc.h> + +extern __typeof (mpn_addmul_1) __mpn_addmul_1_vis3 attribute_hidden; +extern __typeof (mpn_addmul_1) __mpn_addmul_1_generic attribute_hidden; + +sparc_libm_ifunc (__mpn_addmul_1, + hwcap & HWCAP_SPARC_VIS3 + ? __mpn_addmul_1_vis3 + : __mpn_addmul_1_generic) diff --git a/sysdeps/sparc/sparc64/multiarch/bzero.c b/sysdeps/sparc/sparc64/multiarch/bzero.c new file mode 100644 index 0000000000..3af2ff3d47 --- /dev/null +++ b/sysdeps/sparc/sparc64/multiarch/bzero.c @@ -0,0 +1,33 @@ +/* Multiple versions of bzero. SPARC64/Linux version. + All versions must be listed in ifunc-impl-list.c. + 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/>. */ + +#if IS_IN (libc) +# define bzero __redirect_bzero +# include <string.h> +# undef bzero + +# include <sparc-ifunc.h> + +# define SYMBOL_NAME bzero +# include "ifunc-memset.h" + +sparc_libc_ifunc_redirected (__redirect_bzero, __bzero, IFUNC_SELECTOR) +weak_alias (__bzero, bzero) + +#endif diff --git a/sysdeps/sparc/sparc64/multiarch/ifunc-impl-list.c b/sysdeps/sparc/sparc64/multiarch/ifunc-impl-list.c index e52eeb0650..91c6565c7a 100644 --- a/sysdeps/sparc/sparc64/multiarch/ifunc-impl-list.c +++ b/sysdeps/sparc/sparc64/multiarch/ifunc-impl-list.c @@ -1,5 +1,5 @@ /* Enumerate available IFUNC implementations of a function. sparc version. - 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 @@ -36,6 +36,8 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, hwcap = GLRO(dl_hwcap); IFUNC_IMPL (i, name, memcpy, + IFUNC_IMPL_ADD (array, i, memcpy, hwcap & HWCAP_SPARC_ADP, + __memcpy_niagara7) IFUNC_IMPL_ADD (array, i, memcpy, hwcap & HWCAP_SPARC_CRYPTO, __memcpy_niagara4) IFUNC_IMPL_ADD (array, i, memcpy, hwcap & HWCAP_SPARC_N2, @@ -47,6 +49,8 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, IFUNC_IMPL_ADD (array, i, memcpy, 1, __memcpy_ultra1)); IFUNC_IMPL (i, name, mempcpy, + IFUNC_IMPL_ADD (array, i, mempcpy, hwcap & HWCAP_SPARC_ADP, + __mempcpy_niagara7) IFUNC_IMPL_ADD (array, i, mempcpy, hwcap & HWCAP_SPARC_CRYPTO, __mempcpy_niagara4) IFUNC_IMPL_ADD (array, i, mempcpy, hwcap & HWCAP_SPARC_N2, @@ -58,6 +62,8 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, IFUNC_IMPL_ADD (array, i, mempcpy, 1, __mempcpy_ultra1)); IFUNC_IMPL (i, name, bzero, + IFUNC_IMPL_ADD (array, i, bzero, hwcap & HWCAP_SPARC_ADP, + __bzero_niagara7) IFUNC_IMPL_ADD (array, i, bzero, hwcap & HWCAP_SPARC_CRYPTO, __bzero_niagara4) IFUNC_IMPL_ADD (array, i, bzero, hwcap & HWCAP_SPARC_BLKINIT, @@ -65,11 +71,18 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, IFUNC_IMPL_ADD (array, i, bzero, 1, __bzero_ultra1)); IFUNC_IMPL (i, name, memset, + IFUNC_IMPL_ADD (array, i, memset, hwcap & HWCAP_SPARC_ADP, + __memset_niagara7) IFUNC_IMPL_ADD (array, i, memset, hwcap & HWCAP_SPARC_CRYPTO, __memset_niagara4) IFUNC_IMPL_ADD (array, i, memset, hwcap & HWCAP_SPARC_BLKINIT, __memset_niagara1) IFUNC_IMPL_ADD (array, i, memset, 1, __memset_ultra1)); + IFUNC_IMPL (i, name, memmove, + IFUNC_IMPL_ADD (array, i, memmove, hwcap & HWCAP_SPARC_ADP, + __memmove_niagara7) + IFUNC_IMPL_ADD (array, i, memmove, 1, __memmove_ultra1)); + return i; } diff --git a/sysdeps/sparc/sparc64/multiarch/ifunc-memcpy.h b/sysdeps/sparc/sparc64/multiarch/ifunc-memcpy.h new file mode 100644 index 0000000000..73ea15297a --- /dev/null +++ b/sysdeps/sparc/sparc64/multiarch/ifunc-memcpy.h @@ -0,0 +1,43 @@ +/* Common definition for memcpy and mempcpy implementation. + All versions must be listed in ifunc-impl-list.c. + 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/>. */ + +#include <ifunc-init.h> + +extern __typeof (REDIRECT_NAME) OPTIMIZE (niagara7) attribute_hidden; +extern __typeof (REDIRECT_NAME) OPTIMIZE (niagara4) attribute_hidden; +extern __typeof (REDIRECT_NAME) OPTIMIZE (niagara2) attribute_hidden; +extern __typeof (REDIRECT_NAME) OPTIMIZE (niagara1) attribute_hidden; +extern __typeof (REDIRECT_NAME) OPTIMIZE (ultra3) attribute_hidden; +extern __typeof (REDIRECT_NAME) OPTIMIZE (ultra1) attribute_hidden; + +static inline void * +IFUNC_SELECTOR (int hwcap) +{ + if (hwcap & HWCAP_SPARC_ADP) + return OPTIMIZE (niagara7); + if (hwcap & HWCAP_SPARC_CRYPTO) + return OPTIMIZE (niagara4); + if (hwcap & HWCAP_SPARC_N2) + return OPTIMIZE (niagara2); + if (hwcap & HWCAP_SPARC_BLKINIT) + return OPTIMIZE (niagara1); + if (hwcap & HWCAP_SPARC_ULTRA3) + return OPTIMIZE (ultra3); + return OPTIMIZE (ultra1); +} diff --git a/sysdeps/sparc/sparc64/multiarch/ifunc-memmove.h b/sysdeps/sparc/sparc64/multiarch/ifunc-memmove.h new file mode 100644 index 0000000000..4b89ff4baf --- /dev/null +++ b/sysdeps/sparc/sparc64/multiarch/ifunc-memmove.h @@ -0,0 +1,31 @@ +/* Common definition for memmove implementation. + All versions must be listed in ifunc-impl-list.c. + 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/>. */ + +#include <ifunc-init.h> + +extern __typeof (REDIRECT_NAME) OPTIMIZE (niagara7) attribute_hidden; +extern __typeof (REDIRECT_NAME) OPTIMIZE (ultra1) attribute_hidden; + +static inline void * +IFUNC_SELECTOR (int hwcap) +{ + if (hwcap & HWCAP_SPARC_ADP) + return OPTIMIZE (niagara7); + return OPTIMIZE (ultra1); +} diff --git a/sysdeps/sparc/sparc64/multiarch/ifunc-memset.h b/sysdeps/sparc/sparc64/multiarch/ifunc-memset.h new file mode 100644 index 0000000000..d554638bd6 --- /dev/null +++ b/sysdeps/sparc/sparc64/multiarch/ifunc-memset.h @@ -0,0 +1,37 @@ +/* Common definition for memset/bzero implementation. + All versions must be listed in ifunc-impl-list.c. + 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/>. */ + +#include <ifunc-init.h> + +extern __typeof (REDIRECT_NAME) OPTIMIZE (niagara7) attribute_hidden; +extern __typeof (REDIRECT_NAME) OPTIMIZE (niagara4) attribute_hidden; +extern __typeof (REDIRECT_NAME) OPTIMIZE (niagara1) attribute_hidden; +extern __typeof (REDIRECT_NAME) OPTIMIZE (ultra1) attribute_hidden; + +static inline void * +IFUNC_SELECTOR (int hwcap) +{ + if (hwcap & HWCAP_SPARC_ADP) + return OPTIMIZE (niagara7); + if (hwcap & HWCAP_SPARC_CRYPTO) + return OPTIMIZE (niagara4); + if (hwcap & HWCAP_SPARC_BLKINIT) + return OPTIMIZE (niagara1); + return OPTIMIZE (ultra1); +} diff --git a/sysdeps/sparc/sparc64/multiarch/md5-crop.S b/sysdeps/sparc/sparc64/multiarch/md5-crop.S index de1ba6df2f..764a8aae48 100644 --- a/sysdeps/sparc/sparc64/multiarch/md5-crop.S +++ b/sysdeps/sparc/sparc64/multiarch/md5-crop.S @@ -1,5 +1,5 @@ /* MD5 using sparc crypto opcodes. - 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. Contributed by David S. Miller (davem@davemloft.net) diff --git a/sysdeps/sparc/sparc64/multiarch/memcpy-memmove-niagara7.S b/sysdeps/sparc/sparc64/multiarch/memcpy-memmove-niagara7.S new file mode 100644 index 0000000000..61ba1ed408 --- /dev/null +++ b/sysdeps/sparc/sparc64/multiarch/memcpy-memmove-niagara7.S @@ -0,0 +1,980 @@ +/* Copy SIZE bytes from SRC to DEST. For SUN4V M7. + 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/>. */ + +#include <sysdep.h> + +#ifndef XCC +# define XCC xcc +#endif + .register %g2,#scratch + .register %g3,#scratch + .register %g6,#scratch + +#define FPRS_FEF 0x04 + +/* + * ASI_STBI_P marks the cache line as "least recently used" + * which means if many threads are active, it has a high chance + * of being pushed out of the cache between the first initializing + * store and the final stores. + * Thus, in this algorithm we use ASI_STBIMRU_P which marks the + * cache line as "most recently used" for all but the last cache + * line. + */ + +#define ASI_BLK_INIT_QUAD_LDD_P 0xe2 +#define ASI_ST_BLK_INIT_MRU_P 0xf2 + +#define ASI_STBI_P ASI_BLK_INIT_QUAD_LDD_P +#define ASI_STBIMRU_P ASI_ST_BLK_INIT_MRU_P + +#define BLOCK_SIZE 64 /* L2 data cache line size */ +#define SHORTCOPY 3 +#define SHORTCHECK 14 +#define SHORT_LONG 64 /* max copy for short longword-aligned case */ + /* must be at least 64 */ +#define SMALL_MAX 255 /* max small copy for word/long aligned */ +#define SMALL_UMAX 128 /* max small copy for unaligned case */ +#define MED_WMAX 1023 /* max copy for medium word-aligned case */ +#define MED_MAX 511 /* max copy for medium longword-aligned case */ +#define ST_CHUNK 20 /* ST_CHUNK - block of values for BIS Store */ +/* on T4, prefetch 20 is a strong read prefetch to L1 and L2 data cache + * prefetch 20 can cause inst pipeline to delay if data is in memory + * prefetch 21 is a strong read prefetch to L2 data cache, not L1 data cache */ +#define ALIGN_PRE 20 /* distance for aligned prefetch loop */ + +#define EX_ST(x) x +#define EX_RETVAL(x) x +#define STORE_ASI(src,addr) stxa src, [addr] ASI_STBIMRU_P +#define STORE_INIT(src,addr) stxa src, [addr] ASI_STBI_P + +#if IS_IN (libc) + + .text + +ENTRY(__memmove_niagara7) + /* %o0=dst, %o1=src, %o2=len */ + cmp %o1, %o0 /* if from address is >= to use forward copy */ + bgeu,pn %XCC, .Lforcpy /* else use backward if ... */ + sub %o0, %o1, %o4 /* get difference of two addresses */ + cmp %o2, %o4 /* compare size and difference of addresses */ + bleu,pn %XCC, .Lforcpy /* if size is bigger, do overlapped copy */ + add %o1, %o2, %o5 /* get to end of source space */ + +/* an overlapped copy that must be done "backwards" */ +.Lchksize: + cmp %o2, 8 /* less than 8 byte do byte copy */ + blu,pn %XCC, 2f /* else continue */ + +/* Now size is bigger than 8 */ +.Ldbalign: + add %o0, %o2, %g1 /* get to end of dest space */ + andcc %g1, 7, %o3 /* %o3 has cnt til dst 8 byte align */ + bz,a,pn %XCC, .Ldbbck /* skip if dst is 8 byte aligned */ + andn %o2, 7, %o3 /* force %o3 cnt to multiple of 8 */ + sub %o2, %o3, %o2 /* update o2 with new count */ + +1: dec %o5 /* decrement source */ + ldub [%o5], %g1 /* load one byte */ + deccc %o3 /* decrement count */ + bgu,pt %XCC, 1b /* if not done keep copying */ + stb %g1, [%o5+%o4] /* store one byte into dest */ + andncc %o2, 7, %o3 /* force %o3 cnt to multiple of 8 */ + bz,pn %XCC, 2f /* if size < 8, move to byte copy */ + +/* Now Destination is 8 byte aligned */ +.Ldbbck: + andcc %o5, 7, %o0 /* %o0 has src offset */ + bz,a,pn %XCC, .Ldbcopybc /* if src is aligned do fast memmove */ + sub %o2, %o3, %o2 /* Residue bytes in %o2 */ + +.Lcpy_dbwdbc: /* alignment of src is needed */ + sub %o2, 8, %o2 /* set size one loop ahead */ + sll %o0, 3, %g1 /* %g1 is left shift */ + mov 64, %g5 /* init %g5 to be 64 */ + sub %g5, %g1, %g5 /* %g5 rightshift = (64 - leftshift) */ + sub %o5, %o0, %o5 /* align the src at 8 bytes. */ + add %o4, %o0, %o4 /* increase diff between src & dst */ + ldx [%o5], %o1 /* load first 8 bytes */ + srlx %o1, %g5, %o1 +1: sub %o5, 8, %o5 /* subtract 8 from src */ + ldx [%o5], %o0 /* load 8 byte */ + sllx %o0, %g1, %o3 /* shift loaded val left to tmp reg */ + or %o1, %o3, %o3 /* align data */ + stx %o3, [%o5+%o4] /* store 8 byte */ + subcc %o2, 8, %o2 /* subtract 8 byte from size */ + bg,pt %XCC, 1b /* if size > 0 continue */ + srlx %o0, %g5, %o1 /* move extra byte for the next use */ + + srl %g1, 3, %o0 /* restore %o0 value for alignment */ + add %o5, %o0, %o5 /* restore src alignment */ + sub %o4, %o0, %o4 /* restore diff between src & dest */ + + ba 2f /* branch to the trailing byte copy */ + add %o2, 8, %o2 /* restore size value */ + +.Ldbcopybc: /* alignment of src is not needed */ +1: sub %o5, 8, %o5 /* subtract from src */ + ldx [%o5], %g1 /* load 8 bytes */ + subcc %o3, 8, %o3 /* subtract from size */ + bgu,pt %XCC, 1b /* if size is bigger 0 continue */ + stx %g1, [%o5+%o4] /* store 8 bytes to destination */ + + ba 2f + nop + +.Lbcbyte: +1: ldub [%o5], %g1 /* load one byte */ + stb %g1, [%o5+%o4] /* store one byte */ +2: deccc %o2 /* decrement size */ + bgeu,a,pt %XCC, 1b /* if size is >= 0 continue */ + dec %o5 /* decrement from address */ + +.Lexitbc: /* exit from backward copy */ + retl + add %o5, %o4, %o0 /* restore dest addr */ + + +/* Check to see if memmove is large aligned copy + * If so, use special version of copy that avoids + * use of block store init. */ +.Lforcpy: + cmp %o2, SMALL_MAX /* check for not small case */ + blt,pn %XCC, .Lmv_short /* merge with memcpy */ + mov %o0, %g1 /* save %o0 */ + neg %o0, %o5 + andcc %o5, 7, %o5 /* bytes till DST 8 byte aligned */ + brz,pt %o5, .Lmv_dst_aligned_on_8 + +/* %o5 has the bytes to be written in partial store. */ + sub %o2, %o5, %o2 + sub %o1, %o0, %o1 /* %o1 gets the difference */ +7: /* dst aligning loop */ + ldub [%o1+%o0], %o4 /* load one byte */ + subcc %o5, 1, %o5 + stb %o4, [%o0] + bgu,pt %XCC, 7b + add %o0, 1, %o0 /* advance dst */ + add %o1, %o0, %o1 /* restore %o1 */ +.Lmv_dst_aligned_on_8: + andcc %o1, 7, %o5 + brnz,pn %o5, .Lsrc_dst_unaligned_on_8 + prefetch [%o1 + (1 * BLOCK_SIZE)], 20 + +.Lmv_src_dst_aligned_on_8: +/* check if we are copying MED_MAX or more bytes */ + cmp %o2, MED_MAX /* limit to store buffer size */ + bleu,pt %XCC, .Lmedlong + prefetch [%o1 + (2 * BLOCK_SIZE)], 20 + +/* The mv_align loop below mimics the memcpy code for large aligned copies, + * but does not use the ASI_STBI_P (block initializing store) performance + * optimization. This is used when memcpy is incorrectly invoked with + * overlapping buffers. */ + +.Lmv_large_align8_copy: /* Src and dst share 8 byte align */ + /* align dst to 64 byte boundary */ + andcc %o0, 0x3f, %o3 /* check for dst 64 byte aligned */ + brz,pn %o3, .Lmv_aligned_on_64 + sub %o3, 64, %o3 /* %o3 has negative bytes to move */ + add %o2, %o3, %o2 /* adjust remaining count */ +.Lmv_align_to_64: + ldx [%o1], %o4 + add %o1, 8, %o1 /* increment src ptr */ + addcc %o3, 8, %o3 + stx %o4, [%o0] + brnz,pt %o3, .Lmv_align_to_64 + add %o0, 8, %o0 /* increment dst ptr */ + +.Lmv_aligned_on_64: + andn %o2, 0x3f, %o5 /* %o5 is multiple of block size */ + and %o2, 0x3f, %o2 /* residue bytes in %o2 */ +.Lmv_align_loop: + ldx [%o1],%o4 + stx %o4,[%o0] + prefetch [%o0 + (10 * BLOCK_SIZE)], 22 + prefetch [%o1 + (10 * BLOCK_SIZE)], 21 + subcc %o5, 64, %o5 + ldx [%o1+8],%o4 + stx %o4,[%o0+8] + ldx [%o1+16],%o4 + stx %o4,[%o0+16] + ldx [%o1+24],%o4 + stx %o4,[%o0+24] + ldx [%o1+32],%o4 + stx %o4,[%o0+32] + ldx [%o1+40],%o4 + stx %o4,[%o0+40] + ldx [%o1+48],%o4 + add %o1, 64, %o1 + stx %o4,[%o0+48] + add %o0, 64, %o0 + ldx [%o1-8],%o4 + bgt,pt %XCC, .Lmv_align_loop + stx %o4,[%o0-8] + + ba .Lmedlong + nop +END(__memmove_niagara7) + +ENTRY(__mempcpy_niagara7) + /* %o0=dst, %o1=src, %o2=len */ + ba,pt %icc, 101f + add %o0, %o2, %g1 /* save dst + len */ +END(__mempcpy_niagara7) + + .align 32 +ENTRY(__memcpy_niagara7) +100: /* %o0=dst, %o1=src, %o2=len */ + mov %o0, %g1 /* save %o0 */ +101: +#ifndef __arch64__ + srl %o2, 0, %o2 +#endif + cmp %o2, SMALL_MAX /* check for not small case */ + bgeu,pn %XCC, .Lmedium /* go to larger cases */ +.Lmv_short: + cmp %o2, SHORTCOPY /* check for really short case */ + ble,pn %XCC, .Lsmallfin + or %o0, %o1, %o4 /* prepare alignment check */ + andcc %o4, 0x3, %o5 /* test for word alignment */ + bnz,pn %XCC, .Lsmallunalign /* branch to non-word aligned case */ + nop + subcc %o2, 7, %o2 /* adjust count */ + ble,pn %XCC, .Lsmallwordx + andcc %o4, 0x7, %o5 /* test for long alignment */ +/* 8 or more bytes, src and dest start on word boundary + * %o4 contains or %o0, %o1 */ +.Lsmalllong: + bnz,pn %XCC, .Lsmallwords /* branch to word aligned case */ + cmp %o2, SHORT_LONG-7 + bge,a %XCC, .Lmedl64 /* if we branch */ + sub %o2,56,%o2 /* adjust %o2 to -63 off count */ + +/* slightly unroll the small_long_loop to improve very short copies */ + cmp %o2, 32-7 + blt,a,pn %XCC, .Lsmall_long_l + sub %o1, %o0, %o1 /* %o1 gets the difference */ + + ldx [%o1], %o5 + ldx [%o1+8], %o4 + ldx [%o1+16], %o3 + + subcc %o2, 24, %o2 + sub %o1, %o0, %o1 /* %o1 gets the difference */ + + stx %o5, [%o0] /* write word */ + stx %o4, [%o0+8] /* write word */ + stx %o3, [%o0+16] /* write word */ + + add %o0, 24, %o0 + +/* end loop unroll */ + +.Lsmall_long_l: + ldx [%o1+%o0], %o3 + subcc %o2, 8, %o2 + add %o0, 8, %o0 + bgu,pn %XCC, .Lsmall_long_l /* loop until done */ + stx %o3, [%o0-8] /* write word */ + addcc %o2, 7, %o2 /* restore %o2 to correct count */ + bnz,pn %XCC, .Lsmall_long_x /* check for completion */ + add %o1, %o0, %o1 /* restore %o1 */ + retl + mov EX_RETVAL(%g1), %o0 /* restore %o0 */ +.Lsmall_long_x: + cmp %o2, 4 /* check for 4 or more bytes left */ + blt,pn %XCC, .Lsmallleft3 /* if not, go to finish up */ + nop + lduw [%o1], %o3 + add %o1, 4, %o1 + subcc %o2, 4, %o2 + stw %o3, [%o0] + bnz,pn %XCC, .Lsmallleft3 + add %o0, 4, %o0 + retl + mov EX_RETVAL(%g1), %o0 /* restore %o0 */ + + .align 32 +/* src and dest start on word boundary; 7 or fewer bytes */ +.Lsmallwordx: + lduw [%o1], %o3 /* read word */ + addcc %o2, 3, %o2 /* restore count */ + bz,pt %XCC, .Lsmallexit + stw %o3, [%o0] /* write word */ + deccc %o2 /* reduce count for cc test */ + ldub [%o1+4], %o3 /* load one byte */ + bz,pt %XCC, .Lsmallexit + stb %o3, [%o0+4] /* store one byte */ + ldub [%o1+5], %o3 /* load second byte */ + deccc %o2 + bz,pt %XCC, .Lsmallexit + stb %o3, [%o0+5] /* store second byte */ + ldub [%o1+6], %o3 /* load third byte */ + stb %o3, [%o0+6] /* store third byte */ +.Lsmallexit: + retl + mov EX_RETVAL(%g1), %o0 /* restore %o0 */ + + .align 32 +.Lsmallunalign: + cmp %o2, SHORTCHECK + ble,pn %XCC, .Lsmallrest + cmp %o2, SMALL_UMAX + bge,pt %XCC, .Lmedium_join + andcc %o1, 0x3, %o5 /* is src word aligned */ + bz,pn %XCC, .Laldst + cmp %o5, 2 /* is src half-word aligned */ + be,pt %XCC, .Ls2algn + cmp %o5, 3 /* src is byte aligned */ +.Ls1algn: + ldub [%o1], %o3 /* move 1 or 3 bytes to align it */ + inc 1, %o1 + stb %o3, [%o0] /* move a byte to align src */ + inc 1, %o0 + bne,pt %XCC, .Ls2algn + dec %o2 + b .Lald /* now go align dest */ + andcc %o0, 0x3, %o5 + +.Ls2algn: + lduh [%o1], %o3 /* know src is 2 byte aligned */ + inc 2, %o1 + srl %o3, 8, %o4 + stb %o4, [%o0] /* have to do bytes, */ + stb %o3, [%o0 + 1] /* do not know dst alignment */ + inc 2, %o0 + dec 2, %o2 + +.Laldst: + andcc %o0, 0x3, %o5 /* align the destination address */ +.Lald: + bz,pn %XCC, .Lw4cp + cmp %o5, 2 + be,pn %XCC, .Lw2cp + cmp %o5, 3 +.Lw3cp: lduw [%o1], %o4 + inc 4, %o1 + srl %o4, 24, %o5 + stb %o5, [%o0] + bne,pt %XCC, .Lw1cp + inc %o0 + dec 1, %o2 + andn %o2, 3, %o3 /* %o3 is aligned word count */ + dec 4, %o3 /* avoid reading beyond tail of src */ + sub %o1, %o0, %o1 /* %o1 gets the difference */ + +1: sll %o4, 8, %g5 /* save residual bytes */ + lduw [%o1+%o0], %o4 + deccc 4, %o3 + srl %o4, 24, %o5 /* merge with residual */ + or %o5, %g5, %g5 + st %g5, [%o0] + bnz,pt %XCC, 1b + inc 4, %o0 + sub %o1, 3, %o1 /* used one byte of last word read */ + and %o2, 3, %o2 + b 7f + inc 4, %o2 + +.Lw1cp: srl %o4, 8, %o5 + sth %o5, [%o0] + inc 2, %o0 + dec 3, %o2 + andn %o2, 3, %o3 /* %o3 is aligned word count */ + dec 4, %o3 /* avoid reading beyond tail of src */ + sub %o1, %o0, %o1 /* %o1 gets the difference */ + +2: sll %o4, 24, %g5 /* save residual bytes */ + lduw [%o1+%o0], %o4 + deccc 4, %o3 + srl %o4, 8, %o5 /* merge with residual */ + or %o5, %g5, %g5 + st %g5, [%o0] + bnz,pt %XCC, 2b + inc 4, %o0 + sub %o1, 1, %o1 /* used 3 bytes of last word read */ + and %o2, 3, %o2 + b 7f + inc 4, %o2 + +.Lw2cp: lduw [%o1], %o4 + inc 4, %o1 + srl %o4, 16, %o5 + sth %o5, [%o0] + inc 2, %o0 + dec 2, %o2 + andn %o2, 3, %o3 /* %o3 is aligned word count */ + dec 4, %o3 /* avoid reading beyond tail of src */ + sub %o1, %o0, %o1 /* %o1 gets the difference */ + +3: sll %o4, 16, %g5 /* save residual bytes */ + lduw [%o1+%o0], %o4 + deccc 4, %o3 + srl %o4, 16, %o5 /* merge with residual */ + or %o5, %g5, %g5 + st %g5, [%o0] + bnz,pt %XCC, 3b + inc 4, %o0 + sub %o1, 2, %o1 /* used two bytes of last word read */ + and %o2, 3, %o2 + b 7f + inc 4, %o2 + +.Lw4cp: andn %o2, 3, %o3 /* %o3 is aligned word count */ + sub %o1, %o0, %o1 /* %o1 gets the difference */ + +1: lduw [%o1+%o0], %o4 /* read from address */ + deccc 4, %o3 /* decrement count */ + st %o4, [%o0] /* write at destination address */ + bgu,pt %XCC, 1b + inc 4, %o0 /* increment to address */ + and %o2, 3, %o2 /* number of leftover bytes, if any */ + + /* simple finish up byte copy, works with any alignment */ +7: + add %o1, %o0, %o1 /* restore %o1 */ +.Lsmallrest: + tst %o2 + bz,pt %XCC, .Lsmallx + cmp %o2, 4 + blt,pn %XCC, .Lsmallleft3 + nop + sub %o2, 3, %o2 +.Lsmallnotalign4: + ldub [%o1], %o3 /* read byte */ + subcc %o2, 4, %o2 /* reduce count by 4 */ + stb %o3, [%o0] /* write byte */ + ldub [%o1+1], %o3 /* repeat for total of 4 bytes */ + add %o1, 4, %o1 /* advance SRC by 4 */ + stb %o3, [%o0+1] + ldub [%o1-2], %o3 + add %o0, 4, %o0 /* advance DST by 4 */ + stb %o3, [%o0-2] + ldub [%o1-1], %o3 + bgu,pt %XCC, .Lsmallnotalign4 /* loop til 3 or fewer bytes remain */ + stb %o3, [%o0-1] + addcc %o2, 3, %o2 /* restore count */ + bz,pt %XCC, .Lsmallx +.Lsmallleft3: /* 1, 2, or 3 bytes remain */ + subcc %o2, 1, %o2 + ldub [%o1], %o3 /* load one byte */ + bz,pt %XCC, .Lsmallx + stb %o3, [%o0] /* store one byte */ + ldub [%o1+1], %o3 /* load second byte */ + subcc %o2, 1, %o2 + bz,pt %XCC, .Lsmallx + stb %o3, [%o0+1] /* store second byte */ + ldub [%o1+2], %o3 /* load third byte */ + stb %o3, [%o0+2] /* store third byte */ +.Lsmallx: + retl + mov EX_RETVAL(%g1), %o0 /* restore %o0 */ + +.Lsmallfin: + tst %o2 + bnz,pn %XCC, .Lsmallleft3 + nop + retl + mov EX_RETVAL(%g1), %o0 /* restore %o0 */ + + .align 16 +.Lsmallwords: + lduw [%o1], %o3 /* read word */ + subcc %o2, 8, %o2 /* update count */ + stw %o3, [%o0] /* write word */ + add %o1, 8, %o1 /* update SRC */ + lduw [%o1-4], %o3 /* read word */ + add %o0, 8, %o0 /* update DST */ + bgu,pt %XCC, .Lsmallwords /* loop until done */ + stw %o3, [%o0-4] /* write word */ + addcc %o2, 7, %o2 /* restore count */ + bz,pt %XCC, .Lsmallexit /* check for completion */ + cmp %o2, 4 /* check for 4 or more bytes left */ + blt,pt %XCC, .Lsmallleft3 /* if not, go to finish up */ + nop + lduw [%o1], %o3 + add %o1, 4, %o1 + subcc %o2, 4, %o2 + add %o0, 4, %o0 + bnz,pn %XCC, .Lsmallleft3 + stw %o3, [%o0-4] + retl + mov EX_RETVAL(%g1), %o0 /* restore %o0 */ + + .align 16 +.Lmedium: +.Lmedium_join: + neg %o0, %o5 + andcc %o5, 7, %o5 /* bytes till DST 8 byte aligned */ + brz,pt %o5, .Ldst_aligned_on_8 + + /* %o5 has the bytes to be written in partial store. */ + sub %o2, %o5, %o2 + sub %o1, %o0, %o1 /* %o1 gets the difference */ +7: /* dst aligning loop */ + ldub [%o1+%o0], %o4 /* load one byte */ + subcc %o5, 1, %o5 + stb %o4, [%o0] + bgu,pt %XCC, 7b + add %o0, 1, %o0 /* advance dst */ + add %o1, %o0, %o1 /* restore %o1 */ +.Ldst_aligned_on_8: + andcc %o1, 7, %o5 + brnz,pt %o5, .Lsrc_dst_unaligned_on_8 + nop + +.Lsrc_dst_aligned_on_8: + /* check if we are copying MED_MAX or more bytes */ + cmp %o2, MED_MAX /* limit to store buffer size */ + bgu,pn %XCC, .Llarge_align8_copy + nop +/* + * Special case for handling when src and dest are both long word aligned + * and total data to move is less than MED_MAX bytes + */ +.Lmedlong: + subcc %o2, 63, %o2 /* adjust length to allow cc test */ + ble,pn %XCC, .Lmedl63 /* skip big loop if < 64 bytes */ + nop +.Lmedl64: + ldx [%o1], %o4 /* load */ + subcc %o2, 64, %o2 /* decrement length count */ + stx %o4, [%o0] /* and store */ + ldx [%o1+8], %o3 /* a block of 64 bytes */ + stx %o3, [%o0+8] + ldx [%o1+16], %o4 + stx %o4, [%o0+16] + ldx [%o1+24], %o3 + stx %o3, [%o0+24] + ldx [%o1+32], %o4 /* load */ + stx %o4, [%o0+32] /* and store */ + ldx [%o1+40], %o3 /* a block of 64 bytes */ + add %o1, 64, %o1 /* increase src ptr by 64 */ + stx %o3, [%o0+40] + ldx [%o1-16], %o4 + add %o0, 64, %o0 /* increase dst ptr by 64 */ + stx %o4, [%o0-16] + ldx [%o1-8], %o3 + bgu,pt %XCC, .Lmedl64 /* repeat if at least 64 bytes left */ + stx %o3, [%o0-8] +.Lmedl63: + addcc %o2, 32, %o2 /* adjust remaining count */ + ble,pt %XCC, .Lmedl31 /* to skip if 31 or fewer bytes left */ + nop + ldx [%o1], %o4 /* load */ + sub %o2, 32, %o2 /* decrement length count */ + stx %o4, [%o0] /* and store */ + ldx [%o1+8], %o3 /* a block of 32 bytes */ + add %o1, 32, %o1 /* increase src ptr by 32 */ + stx %o3, [%o0+8] + ldx [%o1-16], %o4 + add %o0, 32, %o0 /* increase dst ptr by 32 */ + stx %o4, [%o0-16] + ldx [%o1-8], %o3 + stx %o3, [%o0-8] +.Lmedl31: + addcc %o2, 16, %o2 /* adjust remaining count */ + ble,pt %XCC, .Lmedl15 /* skip if 15 or fewer bytes left */ + nop + ldx [%o1], %o4 /* load and store 16 bytes */ + add %o1, 16, %o1 /* increase src ptr by 16 */ + stx %o4, [%o0] + sub %o2, 16, %o2 /* decrease count by 16 */ + ldx [%o1-8], %o3 + add %o0, 16, %o0 /* increase dst ptr by 16 */ + stx %o3, [%o0-8] +.Lmedl15: + addcc %o2, 15, %o2 /* restore count */ + bz,pt %XCC, .Lsmallexit /* exit if finished */ + cmp %o2, 8 + blt,pt %XCC, .Lmedw7 /* skip if 7 or fewer bytes left */ + tst %o2 + ldx [%o1], %o4 /* load 8 bytes */ + add %o1, 8, %o1 /* increase src ptr by 8 */ + add %o0, 8, %o0 /* increase dst ptr by 8 */ + subcc %o2, 8, %o2 /* decrease count by 8 */ + bnz,pn %XCC, .Lmedw7 + stx %o4, [%o0-8] /* and store 8 bytes */ + retl + mov EX_RETVAL(%g1), %o0 /* restore %o0 */ + + .align 16 +.Lsrc_dst_unaligned_on_8: + /* DST is 8-byte aligned, src is not */ + andcc %o1, 0x3, %o5 /* test word alignment */ + bnz,pt %XCC, .Lunalignsetup /* branch if not word aligned */ + nop + +/* + * Handle all cases where src and dest are aligned on word + * boundaries. Use unrolled loops for better performance. + * This option wins over standard large data move when + * source and destination is in cache for medium + * to short data moves. + */ + cmp %o2, MED_WMAX /* limit to store buffer size */ + bge,pt %XCC, .Lunalignrejoin /* otherwise rejoin main loop */ + nop + + subcc %o2, 31, %o2 /* adjust length to allow cc test */ + /* for end of loop */ + ble,pt %XCC, .Lmedw31 /* skip big loop if less than 16 */ +.Lmedw32: + ld [%o1], %o4 /* move a block of 32 bytes */ + sllx %o4, 32, %o5 + ld [%o1+4], %o4 + or %o4, %o5, %o5 + stx %o5, [%o0] + subcc %o2, 32, %o2 /* decrement length count */ + ld [%o1+8], %o4 + sllx %o4, 32, %o5 + ld [%o1+12], %o4 + or %o4, %o5, %o5 + stx %o5, [%o0+8] + add %o1, 32, %o1 /* increase src ptr by 32 */ + ld [%o1-16], %o4 + sllx %o4, 32, %o5 + ld [%o1-12], %o4 + or %o4, %o5, %o5 + stx %o5, [%o0+16] + add %o0, 32, %o0 /* increase dst ptr by 32 */ + ld [%o1-8], %o4 + sllx %o4, 32, %o5 + ld [%o1-4], %o4 + or %o4, %o5, %o5 + bgu,pt %XCC, .Lmedw32 /* repeat if at least 32 bytes left */ + stx %o5, [%o0-8] +.Lmedw31: + addcc %o2, 31, %o2 /* restore count */ + bz,pt %XCC, .Lsmallexit /* exit if finished */ + cmp %o2, 16 + blt,pt %XCC, .Lmedw15 + nop + ld [%o1], %o4 /* move a block of 16 bytes */ + sllx %o4, 32, %o5 + subcc %o2, 16, %o2 /* decrement length count */ + ld [%o1+4], %o4 + or %o4, %o5, %o5 + stx %o5, [%o0] + add %o1, 16, %o1 /* increase src ptr by 16 */ + ld [%o1-8], %o4 + add %o0, 16, %o0 /* increase dst ptr by 16 */ + sllx %o4, 32, %o5 + ld [%o1-4], %o4 + or %o4, %o5, %o5 + stx %o5, [%o0-8] +.Lmedw15: + bz,pt %XCC, .Lsmallexit /* exit if finished */ + cmp %o2, 8 + blt,pn %XCC, .Lmedw7 /* skip if 7 or fewer bytes left */ + tst %o2 + ld [%o1], %o4 /* load 4 bytes */ + subcc %o2, 8, %o2 /* decrease count by 8 */ + stw %o4, [%o0] /* and store 4 bytes */ + add %o1, 8, %o1 /* increase src ptr by 8 */ + ld [%o1-4], %o3 /* load 4 bytes */ + add %o0, 8, %o0 /* increase dst ptr by 8 */ + stw %o3, [%o0-4] /* and store 4 bytes */ + bz,pt %XCC, .Lsmallexit /* exit if finished */ +.Lmedw7: /* count is ge 1, less than 8 */ + cmp %o2, 4 /* check for 4 bytes left */ + blt,pn %XCC, .Lsmallleft3 /* skip if 3 or fewer bytes left */ + nop + ld [%o1], %o4 /* load 4 bytes */ + add %o1, 4, %o1 /* increase src ptr by 4 */ + add %o0, 4, %o0 /* increase dst ptr by 4 */ + subcc %o2, 4, %o2 /* decrease count by 4 */ + bnz,pt %XCC, .Lsmallleft3 + stw %o4, [%o0-4] /* and store 4 bytes */ + retl + mov EX_RETVAL(%g1), %o0 /* restore %o0 */ + + .align 16 +.Llarge_align8_copy: /* Src and dst 8 byte aligned */ + /* align dst to 64 byte boundary */ + andcc %o0, 0x3f, %o3 /* check for dst 64 byte aligned */ + brz,pn %o3, .Laligned_to_64 + andcc %o0, 8, %o3 /* odd long words to move? */ + brz,pt %o3, .Laligned_to_16 + nop + ldx [%o1], %o4 + sub %o2, 8, %o2 + add %o1, 8, %o1 /* increment src ptr */ + add %o0, 8, %o0 /* increment dst ptr */ + stx %o4, [%o0-8] +.Laligned_to_16: + andcc %o0, 16, %o3 /* pair of long words to move? */ + brz,pt %o3, .Laligned_to_32 + nop + ldx [%o1], %o4 + sub %o2, 16, %o2 + stx %o4, [%o0] + add %o1, 16, %o1 /* increment src ptr */ + ldx [%o1-8], %o4 + add %o0, 16, %o0 /* increment dst ptr */ + stx %o4, [%o0-8] +.Laligned_to_32: + andcc %o0, 32, %o3 /* four long words to move? */ + brz,pt %o3, .Laligned_to_64 + nop + ldx [%o1], %o4 + sub %o2, 32, %o2 + stx %o4, [%o0] + ldx [%o1+8], %o4 + stx %o4, [%o0+8] + ldx [%o1+16], %o4 + stx %o4, [%o0+16] + add %o1, 32, %o1 /* increment src ptr */ + ldx [%o1-8], %o4 + add %o0, 32, %o0 /* increment dst ptr */ + stx %o4, [%o0-8] +.Laligned_to_64: +/* Following test is included to avoid issues where existing executables + * incorrectly call memcpy with overlapping src and dest instead of memmove + * + * if ( (src ge dst) and (dst+len > src)) go to overlap case + * if ( (src lt dst) and (src+len > dst)) go to overlap case + */ + cmp %o1,%o0 + bge,pt %XCC, 1f + nop +/* src+len > dst? */ + add %o1, %o2, %o4 + cmp %o4, %o0 + bgt,pt %XCC, .Lmv_aligned_on_64 + nop + ba 2f + nop +1: +/* dst+len > src? */ + add %o0, %o2, %o4 + cmp %o4, %o1 + bgt,pt %XCC, .Lmv_aligned_on_64 + nop +2: +/* handle non-overlapped copies + * + * Using block init store (BIS) instructions to avoid fetching cache + * lines from memory. Use ST_CHUNK stores to first element of each cache + * line (similar to prefetching) to avoid overfilling STQ or miss buffers. + * Gives existing cache lines time to be moved out of L1/L2/L3 cache. + */ + andn %o2, 0x3f, %o5 /* %o5 is multiple of block size */ + and %o2, 0x3f, %o2 /* residue bytes in %o2 */ + +/* We use ASI_STBIMRU_P for the first store to each cache line + * followed by ASI_STBI_P (mark as LRU) for the last store. That + * mixed approach reduces the chances the cache line is removed + * before we finish setting it, while minimizing the effects on + * other cached values during a large memcpy + * + * Intermediate stores can be normal since first BIS activates the + * cache line in the L2 cache. + * + * ST_CHUNK batches up initial BIS operations for several cache lines + * to allow multiple requests to not be blocked by overflowing the + * the store miss buffer. Then the matching stores for all those + * BIS operations are executed. + */ + +.Lalign_loop: + cmp %o5, ST_CHUNK*64 + blu,pt %XCC, .Lalign_short + mov ST_CHUNK, %o3 + sllx %o3, 6, %g5 /* ST_CHUNK*64 */ + +.Lalign_loop_start: + prefetch [%o1 + (ALIGN_PRE * BLOCK_SIZE)], 21 + subcc %o3, 2, %o3 + ldx [%o1], %o4 + add %o1, 128, %o1 + EX_ST(STORE_ASI(%o4, %o0)) + add %o0, 64, %o0 + ldx [%o1-64], %o4 + EX_ST(STORE_ASI(%o4, %o0)) + add %o0, 64, %o0 + bgu,pt %XCC, .Lalign_loop_start + prefetch [%o1 + ((ALIGN_PRE-1) * BLOCK_SIZE)], 21 + + mov ST_CHUNK, %o3 + sub %o1, %g5, %o1 /* reset %o1 */ + sub %o0, %g5, %o0 /* reset %o0 */ + + sub %o0, 8, %o0 /* adjust %o0 for ASI alignment */ +.Lalign_loop_rest: + ldx [%o1+8],%o4 + add %o0, 64, %o0 + stx %o4, [%o0-48] + subcc %o3, 1, %o3 + ldx [%o1+16],%o4 + stx %o4, [%o0-40] + sub %o5, 64, %o5 + ldx [%o1+24],%o4 + stx %o4, [%o0-32] + ldx [%o1+32],%o4 + stx %o4, [%o0-24] + ldx [%o1+40],%o4 + stx %o4, [%o0-16] + ldx [%o1+48],%o4 + stx %o4, [%o0-8] + add %o1, 64, %o1 + ldx [%o1-8],%o4 + bgu,pt %XCC, .Lalign_loop_rest + EX_ST(STORE_INIT(%o4,%o0)) /* mark cache line as LRU */ + + mov ST_CHUNK, %o3 + cmp %o5, ST_CHUNK*64 + bgu,pt %XCC, .Lalign_loop_start + add %o0, 8, %o0 /* restore %o0 from ASI alignment */ + + cmp %o5, 0 + beq,pt %XCC, .Lalign_done + +/* no prefetches needed in these loops + * since we are within ALIGN_PRE of the end */ +.Lalign_short: + srl %o5, 6, %o3 +.Lalign_loop_short: + subcc %o3, 1, %o3 + ldx [%o1], %o4 + add %o1, 64, %o1 + EX_ST(STORE_ASI(%o4, %o0)) + bgu,pt %XCC, .Lalign_loop_short + add %o0, 64, %o0 + + sub %o1, %o5, %o1 /* reset %o1 */ + sub %o0, %o5, %o0 /* reset %o0 */ + + sub %o0, 8, %o0 /* adjust %o0 for ASI alignment */ +.Lalign_short_rest: + ldx [%o1+8],%o4 + add %o0, 64, %o0 + stx %o4, [%o0-48] + ldx [%o1+16],%o4 + subcc %o5, 64, %o5 + stx %o4, [%o0-40] + ldx [%o1+24],%o4 + stx %o4, [%o0-32] + ldx [%o1+32],%o4 + stx %o4, [%o0-24] + ldx [%o1+40],%o4 + stx %o4, [%o0-16] + ldx [%o1+48],%o4 + stx %o4, [%o0-8] + add %o1, 64, %o1 + ldx [%o1-8],%o4 + bgu,pt %XCC, .Lalign_short_rest + EX_ST(STORE_INIT(%o4,%o0)) /* mark cache line as LRU */ + + add %o0, 8, %o0 /* restore %o0 from ASI alignment */ + +.Lalign_done: + cmp %o2, 0 + membar #StoreStore + bne,pt %XCC, .Lmedl63 + subcc %o2, 63, %o2 /* adjust length to allow cc test */ + retl + mov EX_RETVAL(%g1), %o0 /* restore %o0 */ + + .align 16 + /* Dst is on 8 byte boundary; src is not; remaining cnt > SMALL_MAX */ + /* Since block load/store and BIS are not in use for unaligned data, + * no need to align dst on 64 byte cache line boundary */ +.Lunalignsetup: +.Lunalignrejoin: + rd %fprs, %g5 /* check for unused fp */ + /* if fprs.fef == 0, set it. + * Setting it when already set costs more than checking */ + andcc %g5, FPRS_FEF, %g5 /* test FEF, fprs.du = fprs.dl = 0 */ + bz,a %XCC, 1f + wr %g0, FPRS_FEF, %fprs /* fprs.fef = 1 */ +1: + andn %o2, 0x3f, %o5 /* %o5 is multiple of block size */ + and %o2, 0x3f, %o2 /* residue bytes in %o2 */ + cmp %o2, 8 /* Insure we do not load beyond */ + bgt,pt %XCC, .Lunalign_adjust /* end of source buffer */ + andn %o1, 0x7, %o4 /* %o4 has 8 byte aligned src addr */ + add %o2, 64, %o2 /* adjust to leave loop */ + sub %o5, 64, %o5 /* early if necessary */ +.Lunalign_adjust: + alignaddr %o1, %g0, %g0 /* generate %gsr */ + add %o1, %o5, %o1 /* advance %o1 to after blocks */ + ldd [%o4], %f0 +.Lunalign_loop: + prefetch [%o0 + (9 * BLOCK_SIZE)], 20 + ldd [%o4+8], %f2 + faligndata %f0, %f2, %f16 + ldd [%o4+16], %f4 + subcc %o5, BLOCK_SIZE, %o5 + std %f16, [%o0] + faligndata %f2, %f4, %f18 + ldd [%o4+24], %f6 + std %f18, [%o0+8] + faligndata %f4, %f6, %f20 + ldd [%o4+32], %f8 + std %f20, [%o0+16] + faligndata %f6, %f8, %f22 + ldd [%o4+40], %f10 + std %f22, [%o0+24] + faligndata %f8, %f10, %f24 + ldd [%o4+48], %f12 + std %f24, [%o0+32] + faligndata %f10, %f12, %f26 + ldd [%o4+56], %f14 + add %o4, BLOCK_SIZE, %o4 + std %f26, [%o0+40] + faligndata %f12, %f14, %f28 + ldd [%o4], %f0 + std %f28, [%o0+48] + faligndata %f14, %f0, %f30 + std %f30, [%o0+56] + add %o0, BLOCK_SIZE, %o0 + bgu,pt %XCC, .Lunalign_loop + prefetch [%o4 + (11 * BLOCK_SIZE)], 20 + + /* Handle trailing bytes, 64 to 127 + * Dest long word aligned, Src not long word aligned */ + cmp %o2, 15 + bleu,pt %XCC, .Lunalign_short + + andn %o2, 0x7, %o5 /* %o5 is multiple of 8 */ + and %o2, 0x7, %o2 /* residue bytes in %o2 */ + add %o2, 8, %o2 + sub %o5, 8, %o5 /* do not load past end of src */ + andn %o1, 0x7, %o4 /* %o4 has 8 byte aligned src addr */ + add %o1, %o5, %o1 /* move %o1 to after multiple of 8 */ + ldd [%o4], %f0 /* fetch partial word */ +.Lunalign_by8: + ldd [%o4+8], %f2 + add %o4, 8, %o4 + faligndata %f0, %f2, %f16 + subcc %o5, 8, %o5 + std %f16, [%o0] + fsrc2 %f2, %f0 + bgu,pt %XCC, .Lunalign_by8 + add %o0, 8, %o0 + +.Lunalign_short: /* restore fprs state */ + brnz,pt %g5, .Lsmallrest + nop + ba .Lsmallrest + wr %g5, %g0, %fprs +END(__memcpy_niagara7) + +#endif diff --git a/sysdeps/sparc/sparc64/multiarch/memcpy-niagara1.S b/sysdeps/sparc/sparc64/multiarch/memcpy-niagara1.S index a3b69f9ef1..50b37af104 100644 --- a/sysdeps/sparc/sparc64/multiarch/memcpy-niagara1.S +++ b/sysdeps/sparc/sparc64/multiarch/memcpy-niagara1.S @@ -1,5 +1,5 @@ /* Copy SIZE bytes from SRC to DEST. For SUN4V Niagara. - Copyright (C) 2006-2016 Free Software Foundation, Inc. + Copyright (C) 2006-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by David S. Miller (davem@davemloft.net) diff --git a/sysdeps/sparc/sparc64/multiarch/memcpy-niagara2.S b/sysdeps/sparc/sparc64/multiarch/memcpy-niagara2.S index 9b3e1651b1..91d9eb3221 100644 --- a/sysdeps/sparc/sparc64/multiarch/memcpy-niagara2.S +++ b/sysdeps/sparc/sparc64/multiarch/memcpy-niagara2.S @@ -1,5 +1,5 @@ /* Copy SIZE bytes from SRC to DEST. For SUN4V Niagara-2. - 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 David S. Miller (davem@davemloft.net) diff --git a/sysdeps/sparc/sparc64/multiarch/memcpy-niagara4.S b/sysdeps/sparc/sparc64/multiarch/memcpy-niagara4.S index 7234a7bf75..096a11cfd8 100644 --- a/sysdeps/sparc/sparc64/multiarch/memcpy-niagara4.S +++ b/sysdeps/sparc/sparc64/multiarch/memcpy-niagara4.S @@ -1,5 +1,5 @@ /* Copy SIZE bytes from SRC to DEST. For SUN4V Niagara-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. Contributed by David S. Miller (davem@davemloft.net) diff --git a/sysdeps/sparc/sparc64/fpu/s_fmax.S b/sysdeps/sparc/sparc64/multiarch/memcpy-ultra1.S index 2082354991..8e0b3e2d48 100644 --- a/sysdeps/sparc/sparc64/fpu/s_fmax.S +++ b/sysdeps/sparc/sparc64/multiarch/memcpy-ultra1.S @@ -1,7 +1,6 @@ -/* fmax function, sparc64 version. - Copyright (C) 2012-2016 Free Software Foundation, Inc. +/* Default SPARC64 memcpy implementation. + Copyright (C) 2017-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by David S. Miller <davem@davemloft.net>, 2012. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -17,20 +16,18 @@ License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ -#include <sysdep.h> +#if IS_IN (libc) +# include <sysdep.h> -#define SIGN_BIT %f12 /* -0.0 */ +# undef libc_hidden_builtin_def +# define libc_hidden_builtin_def(name) +# undef weak_alias +# define weak_alias(x, y) +# undef libc_hidden_def +# define libc_hidden_def(name) -ENTRY (__fmax) - fcmpd %fcc1, %f2, %f2 - fzero SIGN_BIT - fmovdu %fcc1, %f0, %f2 - fnegd SIGN_BIT, SIGN_BIT - fcmpd %fcc2, %f0, %f2 - fmovdul %fcc2, %f2, %f0 - fand %f0, %f2, %f4 - fandnot2 SIGN_BIT, %f4, %f4 - retl - fandnot2 %f0, %f4, %f0 -END (__fmax) -weak_alias (__fmax, fmax) +# define memcpy __memcpy_ultra1 +# define __memcpy_large __memcpy_large_ultra1 +# define __mempcpy __mempcpy_ultra1 +# include <sysdeps/sparc/sparc64/memcpy.S> +#endif diff --git a/sysdeps/sparc/sparc64/multiarch/memcpy-ultra3.S b/sysdeps/sparc/sparc64/multiarch/memcpy-ultra3.S index 5b00c35d44..41cd606f59 100644 --- a/sysdeps/sparc/sparc64/multiarch/memcpy-ultra3.S +++ b/sysdeps/sparc/sparc64/multiarch/memcpy-ultra3.S @@ -1,6 +1,6 @@ /* Copy SIZE bytes from SRC to DEST. For UltraSPARC-III. - 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. Contributed by David S. Miller (davem@redhat.com) diff --git a/sysdeps/sparc/sparc64/multiarch/memcpy.S b/sysdeps/sparc/sparc64/multiarch/memcpy.S deleted file mode 100644 index 328f62152b..0000000000 --- a/sysdeps/sparc/sparc64/multiarch/memcpy.S +++ /dev/null @@ -1,167 +0,0 @@ -/* Multiple versions of memcpy - All versions must be listed in ifunc-impl-list.c. - Copyright (C) 2010-2016 Free Software Foundation, Inc. - Contributed by David S. Miller (davem@davemloft.net) - 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 <sysdep.h> - -#if IS_IN (libc) - .text -ENTRY(memcpy) - .type memcpy, @gnu_indirect_function -# ifdef SHARED - SETUP_PIC_REG_LEAF(o3, o5) -# endif - set HWCAP_SPARC_CRYPTO, %o1 - andcc %o0, %o1, %g0 - be 1f - andcc %o0, HWCAP_SPARC_N2, %g0 -# ifdef SHARED - sethi %gdop_hix22(__memcpy_niagara4), %o1 - xor %o1, %gdop_lox10(__memcpy_niagara4), %o1 -# else - set __memcpy_niagara4, %o1 -# endif - ba 10f - nop -1: be 1f - andcc %o0, HWCAP_SPARC_BLKINIT, %g0 -# ifdef SHARED - sethi %gdop_hix22(__memcpy_niagara2), %o1 - xor %o1, %gdop_lox10(__memcpy_niagara2), %o1 -# else - set __memcpy_niagara2, %o1 -# endif - ba 10f - nop -1: be 1f - andcc %o0, HWCAP_SPARC_ULTRA3, %g0 -# ifdef SHARED - sethi %gdop_hix22(__memcpy_niagara1), %o1 - xor %o1, %gdop_lox10(__memcpy_niagara1), %o1 -# else - set __memcpy_niagara1, %o1 -# endif - ba 10f - nop -1: be 9f - nop -# ifdef SHARED - sethi %gdop_hix22(__memcpy_ultra3), %o1 - xor %o1, %gdop_lox10(__memcpy_ultra3), %o1 -# else - set __memcpy_ultra3, %o1 -# endif - ba 10f - nop -9: -# ifdef SHARED - sethi %gdop_hix22(__memcpy_ultra1), %o1 - xor %o1, %gdop_lox10(__memcpy_ultra1), %o1 -# else - set __memcpy_ultra1, %o1 -# endif -10: -# ifdef SHARED - add %o3, %o1, %o1 -# endif - retl - mov %o1, %o0 -END(memcpy) - -ENTRY(__mempcpy) - .type __mempcpy, @gnu_indirect_function -# ifdef SHARED - SETUP_PIC_REG_LEAF(o3, o5) -# endif - set HWCAP_SPARC_CRYPTO, %o1 - andcc %o0, %o1, %g0 - be 1f - andcc %o0, HWCAP_SPARC_N2, %g0 -# ifdef SHARED - sethi %gdop_hix22(__mempcpy_niagara4), %o1 - xor %o1, %gdop_lox10(__mempcpy_niagara4), %o1 -# else - set __mempcpy_niagara4, %o1 -# endif - ba 10f - nop -1: be 1f - andcc %o0, HWCAP_SPARC_BLKINIT, %g0 -# ifdef SHARED - sethi %gdop_hix22(__mempcpy_niagara2), %o1 - xor %o1, %gdop_lox10(__mempcpy_niagara2), %o1 -# else - set __mempcpy_niagara2, %o1 -# endif - ba 10f - nop -1: be 1f - andcc %o0, HWCAP_SPARC_ULTRA3, %g0 -# ifdef SHARED - sethi %gdop_hix22(__mempcpy_niagara1), %o1 - xor %o1, %gdop_lox10(__mempcpy_niagara1), %o1 -# else - set __mempcpy_niagara1, %o1 -# endif - ba 10f - nop -1: be 9f - nop -# ifdef SHARED - sethi %gdop_hix22(__mempcpy_ultra3), %o1 - xor %o1, %gdop_lox10(__mempcpy_ultra3), %o1 -# else - set __mempcpy_ultra3, %o1 -# endif - ba 10f - nop -9: -# ifdef SHARED - sethi %gdop_hix22(__mempcpy_ultra1), %o1 - xor %o1, %gdop_lox10(__mempcpy_ultra1), %o1 -# else - set __mempcpy_ultra1, %o1 -# endif -10: -# ifdef SHARED - add %o3, %o1, %o1 -# endif - retl - mov %o1, %o0 -END(__mempcpy) - -libc_hidden_builtin_def (memcpy) - -libc_hidden_def (__mempcpy) -weak_alias (__mempcpy, mempcpy) -libc_hidden_builtin_def (mempcpy) - -#undef libc_hidden_builtin_def -#define libc_hidden_builtin_def(name) -#undef weak_alias -#define weak_alias(x, y) -#undef libc_hidden_def -#define libc_hidden_def(name) - -#define memcpy __memcpy_ultra1 -#define __mempcpy __mempcpy_ultra1 - -#endif - -#include "../memcpy.S" diff --git a/sysdeps/sparc/sparc64/multiarch/memcpy.c b/sysdeps/sparc/sparc64/multiarch/memcpy.c new file mode 100644 index 0000000000..7adb2936c7 --- /dev/null +++ b/sysdeps/sparc/sparc64/multiarch/memcpy.c @@ -0,0 +1,33 @@ +/* Multiple versions of memcpy. SPARC64/Linux version. + All versions must be listed in ifunc-impl-list.c. + 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/>. */ + +#if IS_IN (libc) +# define memcpy __redirect_memcpy +# include <string.h> +# undef memcpy + +# include <sparc-ifunc.h> + +# define SYMBOL_NAME memcpy +# include "ifunc-memcpy.h" + +sparc_libc_ifunc_redirected (__redirect_memcpy, memcpy, IFUNC_SELECTOR) + +sparc_ifunc_redirected_hidden_def (__redirect_memcpy, memcpy) +#endif diff --git a/sysdeps/sparc/sparc64/multiarch/memmove-ultra1.S b/sysdeps/sparc/sparc64/multiarch/memmove-ultra1.S new file mode 100644 index 0000000000..2ed85d92e6 --- /dev/null +++ b/sysdeps/sparc/sparc64/multiarch/memmove-ultra1.S @@ -0,0 +1,4 @@ +#define memmove __memmove_ultra1 +#undef libc_hidden_builtin_def +#define libc_hidden_builtin_def(name) +#include <sysdeps/sparc/sparc64/memmove.S> diff --git a/sysdeps/sparc/sparc64/multiarch/memmove.c b/sysdeps/sparc/sparc64/multiarch/memmove.c new file mode 100644 index 0000000000..878d532cea --- /dev/null +++ b/sysdeps/sparc/sparc64/multiarch/memmove.c @@ -0,0 +1,33 @@ +/* Multiple versions of memmove. + All versions must be listed in ifunc-impl-list.c. + 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/>. */ + +#if IS_IN (libc) +# define memmove __redirect_memmove +# include <string.h> +# undef memmove + +# include <sparc-ifunc.h> + +# define SYMBOL_NAME memmove +# include "ifunc-memmove.h" + +sparc_libc_ifunc_redirected (__redirect_memmove, memmove, IFUNC_SELECTOR); + +sparc_ifunc_redirected_hidden_def (__redirect_memmove, memmove) +#endif diff --git a/sysdeps/sparc/sparc64/fpu/w_sqrt.S b/sysdeps/sparc/sparc64/multiarch/mempcpy.c index baa7c47fd2..ab398c6b08 100644 --- a/sysdeps/sparc/sparc64/fpu/w_sqrt.S +++ b/sysdeps/sparc/sparc64/multiarch/mempcpy.c @@ -1,5 +1,6 @@ -/* sqrt function. sparc64 version. - Copyright (C) 2012-2016 Free Software Foundation, Inc. +/* Multiple versions of mempcpy. SPARC64/Linux version. + All versions must be listed in ifunc-impl-list.c. + 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 @@ -16,33 +17,23 @@ License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ -#include <sysdep.h> - -ENTRY (__sqrt) - fzero %f8 - fcmpd %fcc2, %f0, %f8 - fbl,pn %fcc2, 1f - nop -8: retl - fsqrtd %f0, %f0 -1: -#ifdef SHARED - SETUP_PIC_REG_LEAF(o5, g1) - sethi %gdop_hix22(_LIB_VERSION), %g1 - xor %g1, %gdop_lox10(_LIB_VERSION), %g1 - ldx [%o5 + %g1], %g1, %gdop(_LIB_VERSION) -#else - sethi %hi(_LIB_VERSION), %g1 - or %g1, %lo(_LIB_VERSION), %g1 +#if IS_IN (libc) +# define mempcpy __redirect_mempcpy +# define __mempcpy __redirect___mempcpy +# define NO_MEMPCPY_STPCPY_REDIRECT +# define __NO_STRING_INLINES +# include <string.h> +# undef mempcpy +# undef __mempcpy + +# include <sparc-ifunc.h> + +# define SYMBOL_NAME mempcpy +# include "ifunc-memcpy.h" + +sparc_libc_ifunc_redirected (__redirect_mempcpy, __mempcpy, IFUNC_SELECTOR) + +sparc_ifunc_redirected_hidden_def (__redirect___mempcpy, __mempcpy) +weak_alias (__mempcpy, mempcpy) +sparc_ifunc_redirected_hidden_def (__redirect_mempcpy, mempcpy) #endif - ld [%g1], %g1 - cmp %g1, -1 - be,pt %icc, 8b - fmovd %f0, %f2 - mov 26, %o2 - mov %o7, %g1 - call __kernel_standard - mov %g1, %o7 -END (__sqrt) - -weak_alias (__sqrt, sqrt) diff --git a/sysdeps/sparc/sparc64/multiarch/memset-niagara1.S b/sysdeps/sparc/sparc64/multiarch/memset-niagara1.S index fe3e09df73..8752b16f4a 100644 --- a/sysdeps/sparc/sparc64/multiarch/memset-niagara1.S +++ b/sysdeps/sparc/sparc64/multiarch/memset-niagara1.S @@ -1,5 +1,5 @@ /* Set a block of memory to some byte value. For SUN4V Niagara. - Copyright (C) 2006-2016 Free Software Foundation, Inc. + Copyright (C) 2006-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by David S. Miller (davem@davemloft.net) diff --git a/sysdeps/sparc/sparc64/multiarch/memset-niagara4.S b/sysdeps/sparc/sparc64/multiarch/memset-niagara4.S index 85ab05485f..2198463a27 100644 --- a/sysdeps/sparc/sparc64/multiarch/memset-niagara4.S +++ b/sysdeps/sparc/sparc64/multiarch/memset-niagara4.S @@ -1,5 +1,5 @@ /* Set a block of memory to some byte value. For SUN4V Niagara-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. Contributed by David S. Miller (davem@davemloft.net) diff --git a/sysdeps/sparc/sparc64/multiarch/memset-niagara7.S b/sysdeps/sparc/sparc64/multiarch/memset-niagara7.S new file mode 100644 index 0000000000..77910c7b62 --- /dev/null +++ b/sysdeps/sparc/sparc64/multiarch/memset-niagara7.S @@ -0,0 +1,334 @@ +/* Set a block of memory to some byte value. For SUN4V M7. + 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/>. */ + +#include <sysdep.h> + +#ifndef XCC +# define XCC xcc +#endif + .register %g2, #scratch + .register %g3, #scratch + +/* The algorithm is as follows : + * + * For small 7 or fewer bytes stores, bytes will be stored. + * + * For less than 32 bytes stores, align the address on 4 byte boundary. + * Then store as many 4-byte chunks, followed by trailing bytes. + * + * For sizes greater than 32 bytes, align the address on 8 byte boundary. + * if (count >= 64) { + * store 8-bytes chunks to align the address on 64 byte boundary + * if (value to be set is zero && count >= MIN_ZERO) { + * Using BIS stores, set the first long word of each + * 64-byte cache line to zero which will also clear the + * other seven long words of the cache line. + * } + * else if (count >= MIN_LOOP) { + * Using BIS stores, set the first long word of each of + * ST_CHUNK cache lines (64 bytes each) before the main + * loop is entered. + * In the main loop, continue pre-setting the first long + * word of each cache line ST_CHUNK lines in advance while + * setting the other seven long words (56 bytes) of each + * cache line until fewer than ST_CHUNK*64 bytes remain. + * Then set the remaining seven long words of each cache + * line that has already had its first long word set. + * } + * store remaining data in 64-byte chunks until less than + * 64 bytes remain. + * } + * Store as many 8-byte chunks, followed by trailing bytes. + * + * + * BIS = Block Init Store + * Doing the advance store of the first element of the cache line + * initiates the displacement of a cache line while only using a single + * instruction in the pipeline. That avoids various pipeline delays, + * such as filling the miss buffer. The performance effect is + * similar to prefetching for normal stores. + * The special case for zero fills runs faster and uses fewer instruction + * cycles than the normal memset loop. + * + * We only use BIS for memset of greater than MIN_LOOP bytes because a sequence + * BIS stores must be followed by a membar #StoreStore. The benefit of + * the BIS store must be balanced against the cost of the membar operation. + */ + +/* + * ASI_STBI_P marks the cache line as "least recently used" + * which means if many threads are active, it has a high chance + * of being pushed out of the cache between the first initializing + * store and the final stores. + * Thus, we use ASI_STBIMRU_P which marks the cache line as + * "most recently used" for all but the last store to the cache line. + */ + +#define ASI_BLK_INIT_QUAD_LDD_P 0xe2 +#define ASI_ST_BLK_INIT_MRU_P 0xf2 + +#define ASI_STBI_P ASI_BLK_INIT_QUAD_LDD_P +#define ASI_STBIMRU_P ASI_ST_BLK_INIT_MRU_P + +#define ST_CHUNK 24 /* multiple of 4 due to loop unrolling */ +#define MIN_LOOP (ST_CHUNK)*64 +#define MIN_ZERO 256 + +#define EX_ST(x) x +#define EX_RETVAL(x) x +#define STORE_ASI(src,addr) stxa src, [addr] ASI_STBIMRU_P +#define STORE_INIT(src,addr) stxa src, [addr] ASI_STBI_P + +#if IS_IN (libc) + + .text + .align 32 + +ENTRY(__bzero_niagara7) + /* bzero (dst, size) */ + mov %o1, %o2 + mov 0, %o1 + /* fall through into memset code */ +END(__bzero_niagara7) + +ENTRY(__memset_niagara7) + /* memset (src, c, size) */ + mov %o0, %o5 /* copy sp1 before using it */ + cmp %o2, 7 /* if small counts, just write bytes */ + bleu,pn %XCC, .Lwrchar + and %o1, 0xff, %o1 /* o1 is (char)c */ + + sll %o1, 8, %o3 + or %o1, %o3, %o1 /* now o1 has 2 bytes of c */ + sll %o1, 16, %o3 + cmp %o2, 32 + blu,pn %XCC, .Lwdalign + or %o1, %o3, %o1 /* now o1 has 4 bytes of c */ + + sllx %o1, 32, %o3 + or %o1, %o3, %o1 /* now o1 has 8 bytes of c */ + +.Ldbalign: + andcc %o5, 7, %o3 /* is sp1 aligned on a 8 byte bound? */ + bz,pt %XCC, .Lblkalign /* already long word aligned */ + sub %o3, 8, %o3 /* -(bytes till long word aligned) */ + + add %o2, %o3, %o2 /* update o2 with new count */ + /* Set -(%o3) bytes till sp1 long word aligned */ +1: stb %o1, [%o5] /* there is at least 1 byte to set */ + inccc %o3 /* byte clearing loop */ + bl,pt %XCC, 1b + inc %o5 + + /* Now sp1 is long word aligned (sp1 is found in %o5) */ +.Lblkalign: + cmp %o2, 64 /* check if there are 64 bytes to set */ + blu,pn %XCC, .Lwrshort + mov %o2, %o3 + + andcc %o5, 63, %o3 /* is sp1 block aligned? */ + bz,pt %XCC, .Lblkwr /* now block aligned */ + sub %o3, 64, %o3 /* o3 is -(bytes till block aligned) */ + add %o2, %o3, %o2 /* o2 is the remainder */ + + /* Store -(%o3) bytes till dst is block (64 byte) aligned. */ + /* Use long word stores. */ + /* Recall that dst is already long word aligned */ +1: + addcc %o3, 8, %o3 + stx %o1, [%o5] + bl,pt %XCC, 1b + add %o5, 8, %o5 + + /* Now sp1 is block aligned */ +.Lblkwr: + andn %o2, 63, %o4 /* calculate size of blocks in bytes */ + brz,pn %o1, .Lwrzero /* special case if c == 0 */ + and %o2, 63, %o3 /* %o3 = bytes left after blk stores */ + + cmp %o4, MIN_LOOP /* check for enough bytes to set */ + blu,pn %XCC, .Lshort_set /* to justify cost of membar */ + nop /* must be > pre-cleared lines */ + + /* initial cache-clearing stores */ + /* get store pipeline moving */ + +/* Primary memset loop for large memsets */ +.Lwr_loop: + mov ST_CHUNK, %g1 +.Lwr_loop_start: + subcc %g1, 4, %g1 + EX_ST(STORE_ASI(%o1,%o5)) + add %o5, 64, %o5 + EX_ST(STORE_ASI(%o1,%o5)) + add %o5, 64, %o5 + EX_ST(STORE_ASI(%o1,%o5)) + add %o5, 64, %o5 + EX_ST(STORE_ASI(%o1,%o5)) + bgu %XCC, .Lwr_loop_start + add %o5, 64, %o5 + + sub %o5, ST_CHUNK*64, %o5 /* reset %o5 */ + mov ST_CHUNK, %g1 + sub %o5, 8, %o5 /* adjust %o5 for ASI store */ + +.Lwr_loop_rest: + stx %o1,[%o5+8+8] + sub %o4, 64, %o4 + stx %o1,[%o5+16+8] + subcc %g1, 1, %g1 + stx %o1,[%o5+24+8] + stx %o1,[%o5+32+8] + stx %o1,[%o5+40+8] + add %o5, 64, %o5 + stx %o1,[%o5-8] + bgu %XCC, .Lwr_loop_rest + EX_ST(STORE_INIT(%o1,%o5)) + + add %o5, 8, %o5 /* restore %o5 offset */ + + /* If more than ST_CHUNK*64 bytes remain to set, continue */ + /* setting the first long word of each cache line in advance */ + /* to keep the store pipeline moving. */ + + cmp %o4, ST_CHUNK*64 + bge,pt %XCC, .Lwr_loop_start + mov ST_CHUNK, %g1 + + brz,a,pn %o4, .Lasi_done + nop + + sub %o5, 8, %o5 /* adjust %o5 for ASI store */ +.Lwr_loop_small: + add %o5, 8, %o5 /* adjust %o5 for ASI store */ + EX_ST(STORE_ASI(%o1,%o5)) + stx %o1,[%o5+8] + stx %o1,[%o5+16] + stx %o1,[%o5+24] + stx %o1,[%o5+32] + subcc %o4, 64, %o4 + stx %o1,[%o5+40] + add %o5, 56, %o5 + stx %o1,[%o5-8] + bgu,pt %XCC, .Lwr_loop_small + EX_ST(STORE_INIT(%o1,%o5)) + + ba .Lasi_done + add %o5, 8, %o5 /* restore %o5 offset */ + +/* Special case loop for zero fill memsets */ +/* For each 64 byte cache line, single STBI to first element */ +/* clears line */ +.Lwrzero: + cmp %o4, MIN_ZERO /* check if enough bytes to set */ + /* to pay %asi + membar cost */ + blu %XCC, .Lshort_set + nop + sub %o4, 256, %o4 + +.Lwrzero_loop: + mov 64, %g3 + EX_ST(STORE_INIT(%o1,%o5)) + subcc %o4, 256, %o4 + EX_ST(STORE_INIT(%o1,%o5+%g3)) + add %o5, 256, %o5 + sub %g3, 192, %g3 + EX_ST(STORE_INIT(%o1,%o5+%g3)) + add %g3, 64, %g3 + bge,pt %XCC, .Lwrzero_loop + EX_ST(STORE_INIT(%o1,%o5+%g3)) + add %o4, 256, %o4 + + brz,pn %o4, .Lbsi_done + nop +.Lwrzero_small: + EX_ST(STORE_INIT(%o1,%o5)) + subcc %o4, 64, %o4 + bgu,pt %XCC, .Lwrzero_small + add %o5, 64, %o5 + +.Lasi_done: +.Lbsi_done: + membar #StoreStore /* required by use of BSI */ + +.Lshort_set: + cmp %o4, 64 /* check if 64 bytes to set */ + blu %XCC, 5f + nop +4: /* set final blocks of 64 bytes */ + stx %o1, [%o5] + stx %o1, [%o5+8] + stx %o1, [%o5+16] + stx %o1, [%o5+24] + subcc %o4, 64, %o4 + stx %o1, [%o5+32] + stx %o1, [%o5+40] + add %o5, 64, %o5 + stx %o1, [%o5-16] + bgu,pt %XCC, 4b + stx %o1, [%o5-8] + +5: + /* Set the remaining long words */ +.Lwrshort: + subcc %o3, 8, %o3 /* Can we store any long words? */ + blu,pn %XCC, .Lwrchars + and %o2, 7, %o2 /* calc bytes left after long words */ +6: + subcc %o3, 8, %o3 + stx %o1, [%o5] /* store the long words */ + bgeu,pt %XCC, 6b + add %o5, 8, %o5 + +.Lwrchars: /* check for extra chars */ + brnz %o2, .Lwrfin + nop + retl + nop + +.Lwdalign: + andcc %o5, 3, %o3 /* is sp1 aligned on a word boundary */ + bz,pn %XCC, .Lwrword + andn %o2, 3, %o3 /* create word sized count in %o3 */ + + dec %o2 /* decrement count */ + stb %o1, [%o5] /* clear a byte */ + b .Lwdalign + inc %o5 /* next byte */ + +.Lwrword: + subcc %o3, 4, %o3 + st %o1, [%o5] /* 4-byte writing loop */ + bnz,pt %XCC, .Lwrword + add %o5, 4, %o5 + and %o2, 3, %o2 /* leftover count, if any */ + +.Lwrchar: + /* Set the remaining bytes, if any */ + brz %o2, .Lexit + nop +.Lwrfin: + deccc %o2 + stb %o1, [%o5] + bgu,pt %XCC, .Lwrfin + inc %o5 +.Lexit: + retl /* %o0 was preserved */ + nop +END(__memset_niagara7) +#endif diff --git a/sysdeps/sparc/sparc64/multiarch/memset-ultra1.S b/sysdeps/sparc/sparc64/multiarch/memset-ultra1.S new file mode 100644 index 0000000000..dd9d2c17cd --- /dev/null +++ b/sysdeps/sparc/sparc64/multiarch/memset-ultra1.S @@ -0,0 +1,30 @@ +/* Default SPARC64 memset implementation. + 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/>. */ + +#if IS_IN (libc) +# include <sysdep.h> + +# undef libc_hidden_builtin_def +# define libc_hidden_builtin_def(name) +# undef weak_alias +# define weak_alias(x, y) + +# define memset __memset_ultra1 +# define __bzero __bzero_ultra1 +# include <sysdeps/sparc/sparc64/memset.S> +#endif diff --git a/sysdeps/sparc/sparc64/multiarch/memset.S b/sysdeps/sparc/sparc64/multiarch/memset.S deleted file mode 100644 index bd0e160d70..0000000000 --- a/sysdeps/sparc/sparc64/multiarch/memset.S +++ /dev/null @@ -1,124 +0,0 @@ -/* Multiple versions of memset and bzero - All versions must be listed in ifunc-impl-list.c. - Copyright (C) 2010-2016 Free Software Foundation, Inc. - Contributed by David S. Miller (davem@davemloft.net) - 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 <sysdep.h> - -#if IS_IN (libc) - .text -ENTRY(memset) - .type memset, @gnu_indirect_function -# ifdef SHARED - SETUP_PIC_REG_LEAF(o3, o5) -# endif - set HWCAP_SPARC_CRYPTO, %o1 - andcc %o0, %o1, %g0 - be 1f - andcc %o0, HWCAP_SPARC_BLKINIT, %g0 -# ifdef SHARED - sethi %gdop_hix22(__memset_niagara4), %o1 - xor %o1, %gdop_lox10(__memset_niagara4), %o1 -# else - set __memset_niagara4, %o1 -# endif - ba 10f - nop -1: be 9f - nop -# ifdef SHARED - sethi %gdop_hix22(__memset_niagara1), %o1 - xor %o1, %gdop_lox10(__memset_niagara1), %o1 -# else - set __memset_niagara1, %o1 -# endif - ba 10f - nop -9: -# ifdef SHARED - sethi %gdop_hix22(__memset_ultra1), %o1 - xor %o1, %gdop_lox10(__memset_ultra1), %o1 -# else - set __memset_ultra1, %o1 -# endif -10: -# ifdef SHARED - add %o3, %o1, %o1 -# endif - retl - mov %o1, %o0 -END(memset) - -ENTRY(__bzero) - .type bzero, @gnu_indirect_function -# ifdef SHARED - SETUP_PIC_REG_LEAF(o3, o5) -# endif - set HWCAP_SPARC_CRYPTO, %o1 - andcc %o0, %o1, %g0 - be 1f - andcc %o0, HWCAP_SPARC_BLKINIT, %g0 -# ifdef SHARED - sethi %gdop_hix22(__bzero_niagara4), %o1 - xor %o1, %gdop_lox10(__bzero_niagara4), %o1 -# else - set __bzero_niagara4, %o1 -# endif - ba 10f - nop -1: be 9f - nop -# ifdef SHARED - sethi %gdop_hix22(__bzero_niagara1), %o1 - xor %o1, %gdop_lox10(__bzero_niagara1), %o1 -# else - set __bzero_niagara1, %o1 -# endif - ba 10f - nop -9: -# ifdef SHARED - sethi %gdop_hix22(__bzero_ultra1), %o1 - xor %o1, %gdop_lox10(__bzero_ultra1), %o1 -# else - set __bzero_ultra1, %o1 -# endif -10: -# ifdef SHARED - add %o3, %o1, %o1 -# endif - retl - mov %o1, %o0 -END(__bzero) - -weak_alias (__bzero, bzero) - -# undef weak_alias -# define weak_alias(a, b) - -libc_hidden_builtin_def (memset) - -#undef libc_hidden_builtin_def -#define libc_hidden_builtin_def(name) - -#define memset __memset_ultra1 -#define __bzero __bzero_ultra1 - -#endif - -#include "../memset.S" diff --git a/sysdeps/sparc/sparc64/multiarch/memset.c b/sysdeps/sparc/sparc64/multiarch/memset.c new file mode 100644 index 0000000000..c2920c7df7 --- /dev/null +++ b/sysdeps/sparc/sparc64/multiarch/memset.c @@ -0,0 +1,33 @@ +/* Multiple versions of memset. SPARC64/Linux version. + All versions must be listed in ifunc-impl-list.c. + 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/>. */ + +#if IS_IN (libc) +# define memset __redirect_memset +# include <string.h> +# undef memset + +# include <sparc-ifunc.h> + +# define SYMBOL_NAME memset +# include "ifunc-memset.h" + +sparc_libc_ifunc_redirected (__redirect_memset, memset, IFUNC_SELECTOR) +sparc_ifunc_redirected_hidden_def (__redirect_memset, memset) + +#endif diff --git a/sysdeps/sparc/sparc64/multiarch/mul_1-generic.S b/sysdeps/sparc/sparc64/multiarch/mul_1-generic.S new file mode 100644 index 0000000000..f1b7e6026a --- /dev/null +++ b/sysdeps/sparc/sparc64/multiarch/mul_1-generic.S @@ -0,0 +1,2 @@ +#define __mpn_mul_1 __mpn_mul_1_generic +#include <sysdeps/sparc/sparc64/mul_1.S> diff --git a/sysdeps/sparc/sparc64/multiarch/mul_1-vis3.S b/sysdeps/sparc/sparc64/multiarch/mul_1-vis3.S index d2ddd110b0..79452919cc 100644 --- a/sysdeps/sparc/sparc64/multiarch/mul_1-vis3.S +++ b/sysdeps/sparc/sparc64/multiarch/mul_1-vis3.S @@ -1,7 +1,7 @@ ! SPARC v9 64-bit VIS3 __mpn_mul_1 -- Multiply a limb vector with a single ! limb and store the product in a second limb vector. ! -! 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. ! Contributed by David S. Miller <davem@davemloft.net> ! diff --git a/sysdeps/sparc/sparc64/multiarch/mul_1.S b/sysdeps/sparc/sparc64/multiarch/mul_1.S deleted file mode 100644 index 0a1fbdbc51..0000000000 --- a/sysdeps/sparc/sparc64/multiarch/mul_1.S +++ /dev/null @@ -1,56 +0,0 @@ -/* Multiple versions of mul_1 - - Copyright (C) 2013-2016 Free Software Foundation, Inc. - Contributed by David S. Miller (davem@davemloft.net) - 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 <sysdep.h> - -ENTRY(__mpn_mul_1) - .type __mpn_mul_1, @gnu_indirect_function -# ifdef SHARED - SETUP_PIC_REG_LEAF(o3, o5) -# endif - set HWCAP_SPARC_VIS3, %o1 - andcc %o0, %o1, %g0 - be 1f - nop -# ifdef SHARED - sethi %gdop_hix22(__mpn_mul_1_vis3), %o1 - xor %o1, %gdop_lox10(__mpn_mul_1_vis3), %o1 -# else - set __mpn_mul_1_vis3, %o1 -# endif - ba 10f - nop -1: -# ifdef SHARED - sethi %gdop_hix22(__mpn_mul_1_generic), %o1 - xor %o1, %gdop_lox10(__mpn_mul_1_generic), %o1 -# else - set __mpn_mul_1_generic, %o1 -# endif -10: -# ifdef SHARED - add %o3, %o1, %o1 -# endif - retl - mov %o1, %o0 -END(__mpn_mul_1) - -#define __mpn_mul_1 __mpn_mul_1_generic -#include "../mul_1.S" diff --git a/sysdeps/sparc/sparc64/multiarch/mul_1.c b/sysdeps/sparc/sparc64/multiarch/mul_1.c new file mode 100644 index 0000000000..0b8d0cf0da --- /dev/null +++ b/sysdeps/sparc/sparc64/multiarch/mul_1.c @@ -0,0 +1,28 @@ +/* __mpn_mul_1 ifunc resolver, Linux/sparc64 version. + 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/>. */ + +#include <gmp.h> +#include <sparc-ifunc.h> + +extern __typeof (mpn_mul_1) __mpn_mul_1_vis3 attribute_hidden; +extern __typeof (mpn_mul_1) __mpn_mul_1_generic attribute_hidden; + +sparc_libm_ifunc (__mpn_mul_1, + hwcap & HWCAP_SPARC_VIS3 + ? __mpn_mul_1_vis3 + : __mpn_mul_1_generic) diff --git a/sysdeps/sparc/sparc64/multiarch/rtld-memmove.c b/sysdeps/sparc/sparc64/multiarch/rtld-memmove.c new file mode 100644 index 0000000000..e6d9a5c686 --- /dev/null +++ b/sysdeps/sparc/sparc64/multiarch/rtld-memmove.c @@ -0,0 +1 @@ +#include <sysdeps/sparc/sparc64/rtld-memmove.c> diff --git a/sysdeps/sparc/sparc64/multiarch/sha256-block.c b/sysdeps/sparc/sparc64/multiarch/sha256-block.c index 79966b93d7..9d65315a5a 100644 --- a/sysdeps/sparc/sparc64/multiarch/sha256-block.c +++ b/sysdeps/sparc/sparc64/multiarch/sha256-block.c @@ -1,12 +1,12 @@ #include <sparc-ifunc.h> -#define sha256_process_block sha256_process_block_generic -extern void sha256_process_block_generic (const void *buffer, size_t len, - struct sha256_ctx *ctx); +#define __sha256_process_block __sha256_process_block_generic +extern void __sha256_process_block_generic (const void *buffer, size_t len, + struct sha256_ctx *ctx); #include <crypt/sha256-block.c> -#undef sha256_process_block +#undef __sha256_process_block extern void __sha256_process_block_crop (const void *buffer, size_t len, struct sha256_ctx *ctx); @@ -25,6 +25,8 @@ static bool cpu_supports_sha256(int hwcap) return false; } -extern void sha256_process_block (const void *buffer, size_t len, - struct sha256_ctx *ctx); -sparc_libc_ifunc(sha256_process_block, cpu_supports_sha256(hwcap) ? __sha256_process_block_crop : sha256_process_block_generic); +extern void __sha256_process_block (const void *buffer, size_t len, + struct sha256_ctx *ctx); +sparc_libc_ifunc (__sha256_process_block, + cpu_supports_sha256(hwcap) ? __sha256_process_block_crop + : __sha256_process_block_generic); diff --git a/sysdeps/sparc/sparc64/multiarch/sha256-crop.S b/sysdeps/sparc/sparc64/multiarch/sha256-crop.S index 55186780eb..0f07b8d8a2 100644 --- a/sysdeps/sparc/sparc64/multiarch/sha256-crop.S +++ b/sysdeps/sparc/sparc64/multiarch/sha256-crop.S @@ -1,5 +1,5 @@ /* SHA256 using sparc crypto opcodes. - 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. Contributed by David S. Miller (davem@davemloft.net) diff --git a/sysdeps/sparc/sparc64/multiarch/sha512-block.c b/sysdeps/sparc/sparc64/multiarch/sha512-block.c index 0d1c3dd6d8..2863e05d09 100644 --- a/sysdeps/sparc/sparc64/multiarch/sha512-block.c +++ b/sysdeps/sparc/sparc64/multiarch/sha512-block.c @@ -1,12 +1,12 @@ #include <sparc-ifunc.h> -#define sha512_process_block sha512_process_block_generic -extern void sha512_process_block_generic (const void *buffer, size_t len, - struct sha512_ctx *ctx); +#define __sha512_process_block __sha512_process_block_generic +extern void __sha512_process_block_generic (const void *buffer, size_t len, + struct sha512_ctx *ctx); #include <crypt/sha512-block.c> -#undef sha512_process_block +#undef __sha512_process_block extern void __sha512_process_block_crop (const void *buffer, size_t len, struct sha512_ctx *ctx); @@ -25,6 +25,8 @@ static bool cpu_supports_sha512(int hwcap) return false; } -extern void sha512_process_block (const void *buffer, size_t len, - struct sha512_ctx *ctx); -sparc_libc_ifunc(sha512_process_block, cpu_supports_sha512(hwcap) ? __sha512_process_block_crop : sha512_process_block_generic); +extern void __sha512_process_block (const void *buffer, size_t len, + struct sha512_ctx *ctx); +sparc_libc_ifunc (__sha512_process_block, + cpu_supports_sha512(hwcap) ? __sha512_process_block_crop + : __sha512_process_block_generic); diff --git a/sysdeps/sparc/sparc64/multiarch/sha512-crop.S b/sysdeps/sparc/sparc64/multiarch/sha512-crop.S index c08a580e0c..f22eef3206 100644 --- a/sysdeps/sparc/sparc64/multiarch/sha512-crop.S +++ b/sysdeps/sparc/sparc64/multiarch/sha512-crop.S @@ -1,5 +1,5 @@ /* SHA512 using sparc crypto opcodes. - 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. Contributed by David S. Miller (davem@davemloft.net) diff --git a/sysdeps/sparc/sparc64/multiarch/sub_n-generic.S b/sysdeps/sparc/sparc64/multiarch/sub_n-generic.S new file mode 100644 index 0000000000..7cece934a7 --- /dev/null +++ b/sysdeps/sparc/sparc64/multiarch/sub_n-generic.S @@ -0,0 +1,2 @@ +#define __mpn_sub_n __mpn_sub_n_generic +#include <sysdeps/sparc/sparc64/sub_n.S> diff --git a/sysdeps/sparc/sparc64/multiarch/sub_n-vis3.S b/sysdeps/sparc/sparc64/multiarch/sub_n-vis3.S index cc659ed7f4..b71c93d36d 100644 --- a/sysdeps/sparc/sparc64/multiarch/sub_n-vis3.S +++ b/sysdeps/sparc/sparc64/multiarch/sub_n-vis3.S @@ -1,7 +1,7 @@ ! SPARC v9 64-bit VIS3 __mpn_sub_n -- Subtract two limb vectors of the same length > 0 ! and store difference in a third limb vector. ! -! 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. ! Contributed by David S. Miller <davem@davemloft.net> ! diff --git a/sysdeps/sparc/sparc64/multiarch/sub_n.S b/sysdeps/sparc/sparc64/multiarch/sub_n.S deleted file mode 100644 index f69d909614..0000000000 --- a/sysdeps/sparc/sparc64/multiarch/sub_n.S +++ /dev/null @@ -1,56 +0,0 @@ -/* Multiple versions of sub_n - - Copyright (C) 2013-2016 Free Software Foundation, Inc. - Contributed by David S. Miller (davem@davemloft.net) - 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 <sysdep.h> - -ENTRY(__mpn_sub_n) - .type __mpn_sub_n, @gnu_indirect_function -# ifdef SHARED - SETUP_PIC_REG_LEAF(o3, o5) -# endif - set HWCAP_SPARC_VIS3, %o1 - andcc %o0, %o1, %g0 - be 1f - nop -# ifdef SHARED - sethi %gdop_hix22(__mpn_sub_n_vis3), %o1 - xor %o1, %gdop_lox10(__mpn_sub_n_vis3), %o1 -# else - set __mpn_sub_n_vis3, %o1 -# endif - ba 10f - nop -1: -# ifdef SHARED - sethi %gdop_hix22(__mpn_sub_n_generic), %o1 - xor %o1, %gdop_lox10(__mpn_sub_n_generic), %o1 -# else - set __mpn_sub_n_generic, %o1 -# endif -10: -# ifdef SHARED - add %o3, %o1, %o1 -# endif - retl - mov %o1, %o0 -END(__mpn_sub_n) - -#define __mpn_sub_n __mpn_sub_n_generic -#include "../sub_n.S" diff --git a/sysdeps/sparc/sparc64/multiarch/sub_n.c b/sysdeps/sparc/sparc64/multiarch/sub_n.c new file mode 100644 index 0000000000..2c1f428932 --- /dev/null +++ b/sysdeps/sparc/sparc64/multiarch/sub_n.c @@ -0,0 +1,28 @@ +/* __mpn_sub_n ifunc resolver, Linux/sparc64 version. + 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/>. */ + +#include <gmp.h> +#include <sparc-ifunc.h> + +extern __typeof (mpn_sub_n) __mpn_sub_n_vis3 attribute_hidden; +extern __typeof (mpn_sub_n) __mpn_sub_n_generic attribute_hidden; + +sparc_libm_ifunc (__mpn_sub_n, + hwcap & HWCAP_SPARC_VIS3 + ? __mpn_sub_n_vis3 + : __mpn_sub_n_generic) diff --git a/sysdeps/sparc/sparc64/multiarch/submul_1-generic.S b/sysdeps/sparc/sparc64/multiarch/submul_1-generic.S new file mode 100644 index 0000000000..4c1536023d --- /dev/null +++ b/sysdeps/sparc/sparc64/multiarch/submul_1-generic.S @@ -0,0 +1,2 @@ +#define __mpn_submul_1 __mpn_submul_1_generic +#include <sysdeps/sparc/sparc64/submul_1.S> diff --git a/sysdeps/sparc/sparc64/multiarch/submul_1-vis3.S b/sysdeps/sparc/sparc64/multiarch/submul_1-vis3.S index e92c73e912..823f90afdd 100644 --- a/sysdeps/sparc/sparc64/multiarch/submul_1-vis3.S +++ b/sysdeps/sparc/sparc64/multiarch/submul_1-vis3.S @@ -1,7 +1,7 @@ ! SPARC v9 64-bit VIS3 __mpn_submul_1 -- Multiply a limb vector with a ! limb and subtract the result from a second limb vector. ! -! 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. ! Contributed by David S. Miller <davem@davemloft.net> ! diff --git a/sysdeps/sparc/sparc64/multiarch/submul_1.S b/sysdeps/sparc/sparc64/multiarch/submul_1.S deleted file mode 100644 index f0d9f2ffe3..0000000000 --- a/sysdeps/sparc/sparc64/multiarch/submul_1.S +++ /dev/null @@ -1,56 +0,0 @@ -/* Multiple versions of submul_1 - - Copyright (C) 2013-2016 Free Software Foundation, Inc. - Contributed by David S. Miller (davem@davemloft.net) - 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 <sysdep.h> - -ENTRY(__mpn_submul_1) - .type __mpn_submul_1, @gnu_indirect_function -# ifdef SHARED - SETUP_PIC_REG_LEAF(o3, o5) -# endif - set HWCAP_SPARC_VIS3, %o1 - andcc %o0, %o1, %g0 - be 1f - nop -# ifdef SHARED - sethi %gdop_hix22(__mpn_submul_1_vis3), %o1 - xor %o1, %gdop_lox10(__mpn_submul_1_vis3), %o1 -# else - set __mpn_submul_1_vis3, %o1 -# endif - ba 10f - nop -1: -# ifdef SHARED - sethi %gdop_hix22(__mpn_submul_1_generic), %o1 - xor %o1, %gdop_lox10(__mpn_submul_1_generic), %o1 -# else - set __mpn_submul_1_generic, %o1 -# endif -10: -# ifdef SHARED - add %o3, %o1, %o1 -# endif - retl - mov %o1, %o0 -END(__mpn_submul_1) - -#define __mpn_submul_1 __mpn_submul_1_generic -#include "../submul_1.S" diff --git a/sysdeps/sparc/sparc64/multiarch/submul_1.c b/sysdeps/sparc/sparc64/multiarch/submul_1.c new file mode 100644 index 0000000000..6934c6915a --- /dev/null +++ b/sysdeps/sparc/sparc64/multiarch/submul_1.c @@ -0,0 +1,28 @@ +/* __mpn_submul_1 ifunc resolver, Linux/sparc64 version. + 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/>. */ + +#include <gmp.h> +#include <sparc-ifunc.h> + +extern __typeof (mpn_submul_1) __mpn_submul_1_vis3 attribute_hidden; +extern __typeof (mpn_submul_1) __mpn_submul_1_generic attribute_hidden; + +sparc_libm_ifunc (__mpn_submul_1, + hwcap & HWCAP_SPARC_VIS3 + ? __mpn_submul_1_vis3 + : __mpn_submul_1_generic) diff --git a/sysdeps/sparc/sparc64/pthread_spin_lock.S b/sysdeps/sparc/sparc64/pthread_spin_lock.S index 1232e950d2..a0cff0d49f 100644 --- a/sysdeps/sparc/sparc64/pthread_spin_lock.S +++ b/sysdeps/sparc/sparc64/pthread_spin_lock.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 diff --git a/sysdeps/sparc/sparc64/pthread_spin_trylock.S b/sysdeps/sparc/sparc64/pthread_spin_trylock.S index 7fa19a66ac..b8e63322b2 100644 --- a/sysdeps/sparc/sparc64/pthread_spin_trylock.S +++ b/sysdeps/sparc/sparc64/pthread_spin_trylock.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 diff --git a/sysdeps/sparc/sparc64/pthread_spin_unlock.S b/sysdeps/sparc/sparc64/pthread_spin_unlock.S index ce7de6ff34..e6da4cc188 100644 --- a/sysdeps/sparc/sparc64/pthread_spin_unlock.S +++ b/sysdeps/sparc/sparc64/pthread_spin_unlock.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 diff --git a/sysdeps/sparc/sparc64/pthreaddef.h b/sysdeps/sparc/sparc64/pthreaddef.h index 4cebc8473d..62e2290b23 100644 --- a/sysdeps/sparc/sparc64/pthreaddef.h +++ b/sysdeps/sparc/sparc64/pthreaddef.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/sparc/sparc64/soft-fp/qp_add.c b/sysdeps/sparc/sparc64/qp_add.c index bc3bb3dee0..aa9262f40e 100644 --- a/sysdeps/sparc/sparc64/soft-fp/qp_add.c +++ b/sysdeps/sparc/sparc64/qp_add.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. (*c) = (*a) + (*b) - 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/sparc/sparc64/soft-fp/qp_cmp.c b/sysdeps/sparc/sparc64/qp_cmp.c index c3e67501f1..0f97e94cf1 100644 --- a/sysdeps/sparc/sparc64/soft-fp/qp_cmp.c +++ b/sysdeps/sparc/sparc64/qp_cmp.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Compare (*a) and (*b), return float condition code. - 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/sparc/sparc64/soft-fp/qp_cmpe.c b/sysdeps/sparc/sparc64/qp_cmpe.c index ab514283c8..8ff9d400d6 100644 --- a/sysdeps/sparc/sparc64/soft-fp/qp_cmpe.c +++ b/sysdeps/sparc/sparc64/qp_cmpe.c @@ -1,7 +1,7 @@ /* Software floating-point emulation. Compare (*a) and (*b), return float condition code. Signal exception (unless masked) if unordered. - 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/sparc/sparc64/soft-fp/qp_div.c b/sysdeps/sparc/sparc64/qp_div.c index 3598713fda..11a5571368 100644 --- a/sysdeps/sparc/sparc64/soft-fp/qp_div.c +++ b/sysdeps/sparc/sparc64/qp_div.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. (*c) = (*a) / (*b) - 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/sparc/sparc64/soft-fp/qp_dtoq.c b/sysdeps/sparc/sparc64/qp_dtoq.c index e151fb9198..a53040559d 100644 --- a/sysdeps/sparc/sparc64/soft-fp/qp_dtoq.c +++ b/sysdeps/sparc/sparc64/qp_dtoq.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. (*c) = (long double)(a) - 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/sparc/sparc64/soft-fp/qp_feq.c b/sysdeps/sparc/sparc64/qp_feq.c index 47e2d54e08..19d44a3612 100644 --- a/sysdeps/sparc/sparc64/soft-fp/qp_feq.c +++ b/sysdeps/sparc/sparc64/qp_feq.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return 1 if (*a) == (*b) - 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/sparc/sparc64/soft-fp/qp_fge.c b/sysdeps/sparc/sparc64/qp_fge.c index 9ca01e2d7e..1c652f7a3a 100644 --- a/sysdeps/sparc/sparc64/soft-fp/qp_fge.c +++ b/sysdeps/sparc/sparc64/qp_fge.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return 1 if (*a) >= (*b) - 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/sparc/sparc64/soft-fp/qp_fgt.c b/sysdeps/sparc/sparc64/qp_fgt.c index c5a944c3a4..203ad06525 100644 --- a/sysdeps/sparc/sparc64/soft-fp/qp_fgt.c +++ b/sysdeps/sparc/sparc64/qp_fgt.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return 1 if (*a) > (*b) - 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/sparc/sparc64/soft-fp/qp_fle.c b/sysdeps/sparc/sparc64/qp_fle.c index 39adf9eba2..e6b188038d 100644 --- a/sysdeps/sparc/sparc64/soft-fp/qp_fle.c +++ b/sysdeps/sparc/sparc64/qp_fle.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return 1 if (*a) <= (*b) - 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/sparc/sparc64/soft-fp/qp_flt.c b/sysdeps/sparc/sparc64/qp_flt.c index 5887458ced..64cd908f5c 100644 --- a/sysdeps/sparc/sparc64/soft-fp/qp_flt.c +++ b/sysdeps/sparc/sparc64/qp_flt.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return 1 if (*a) < (*b) - 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/sparc/sparc64/soft-fp/qp_fne.c b/sysdeps/sparc/sparc64/qp_fne.c index efcaed5497..2b859d8bb2 100644 --- a/sysdeps/sparc/sparc64/soft-fp/qp_fne.c +++ b/sysdeps/sparc/sparc64/qp_fne.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return 1 if (*a) != (*b) - 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/sparc/sparc64/soft-fp/qp_itoq.c b/sysdeps/sparc/sparc64/qp_itoq.c index 0284eaa80e..626eef7602 100644 --- a/sysdeps/sparc/sparc64/soft-fp/qp_itoq.c +++ b/sysdeps/sparc/sparc64/qp_itoq.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. (*c) = (long double)(a) - 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/sparc/sparc64/soft-fp/qp_mul.c b/sysdeps/sparc/sparc64/qp_mul.c index 7f48e8f077..20583ea026 100644 --- a/sysdeps/sparc/sparc64/soft-fp/qp_mul.c +++ b/sysdeps/sparc/sparc64/qp_mul.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. (*c) = (*a) * (*b) - 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/sparc/sparc64/soft-fp/qp_neg.S b/sysdeps/sparc/sparc64/qp_neg.S index 78e9bf6994..7671a0ef49 100644 --- a/sysdeps/sparc/sparc64/soft-fp/qp_neg.S +++ b/sysdeps/sparc/sparc64/qp_neg.S @@ -1,6 +1,6 @@ /* Quad floating-point emulation. (*c) = !(*a) - Copyright (C) 1999-2016 Free Software Foundation, Inc. + Copyright (C) 1999-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek (jj@ultra.linux.cz). diff --git a/sysdeps/sparc/sparc64/soft-fp/qp_qtod.c b/sysdeps/sparc/sparc64/qp_qtod.c index 1e77bdda0e..c0f0e5370e 100644 --- a/sysdeps/sparc/sparc64/soft-fp/qp_qtod.c +++ b/sysdeps/sparc/sparc64/qp_qtod.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return (double)(*a) - 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/sparc/sparc64/soft-fp/qp_qtoi.c b/sysdeps/sparc/sparc64/qp_qtoi.c index 1761dd0b0e..ca511e9fe5 100644 --- a/sysdeps/sparc/sparc64/soft-fp/qp_qtoi.c +++ b/sysdeps/sparc/sparc64/qp_qtoi.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return (int)(*a) - 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/sparc/sparc64/soft-fp/qp_qtos.c b/sysdeps/sparc/sparc64/qp_qtos.c index 1f6853c45a..f78e15aca3 100644 --- a/sysdeps/sparc/sparc64/soft-fp/qp_qtos.c +++ b/sysdeps/sparc/sparc64/qp_qtos.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return (float)(*a) - 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/sparc/sparc64/soft-fp/qp_qtoui.c b/sysdeps/sparc/sparc64/qp_qtoui.c index 680d8e674f..3822dbd469 100644 --- a/sysdeps/sparc/sparc64/soft-fp/qp_qtoui.c +++ b/sysdeps/sparc/sparc64/qp_qtoui.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return (unsigned int)(*a) - 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/sparc/sparc64/soft-fp/qp_qtoux.c b/sysdeps/sparc/sparc64/qp_qtoux.c index 72ddc455bb..d51192a17c 100644 --- a/sysdeps/sparc/sparc64/soft-fp/qp_qtoux.c +++ b/sysdeps/sparc/sparc64/qp_qtoux.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return (unsigned long)(*a) - 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/sparc/sparc64/soft-fp/qp_qtox.c b/sysdeps/sparc/sparc64/qp_qtox.c index cd25f0c836..50f1057a9b 100644 --- a/sysdeps/sparc/sparc64/soft-fp/qp_qtox.c +++ b/sysdeps/sparc/sparc64/qp_qtox.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return (long)(*a) - 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/sparc/sparc64/soft-fp/qp_sqrt.c b/sysdeps/sparc/sparc64/qp_sqrt.c index 36a41d0985..1b986392cb 100644 --- a/sysdeps/sparc/sparc64/soft-fp/qp_sqrt.c +++ b/sysdeps/sparc/sparc64/qp_sqrt.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. (*c) = sqrtl(*a) - 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/sparc/sparc64/soft-fp/qp_stoq.c b/sysdeps/sparc/sparc64/qp_stoq.c index 581da8eeee..88e5620b63 100644 --- a/sysdeps/sparc/sparc64/soft-fp/qp_stoq.c +++ b/sysdeps/sparc/sparc64/qp_stoq.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. (*c) = (long double)(a) - 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/sparc/sparc64/soft-fp/qp_sub.c b/sysdeps/sparc/sparc64/qp_sub.c index 0ffe2ab6d1..e400c63d33 100644 --- a/sysdeps/sparc/sparc64/soft-fp/qp_sub.c +++ b/sysdeps/sparc/sparc64/qp_sub.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. (*c) = (*a) - (*b) - 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/sparc/sparc64/soft-fp/qp_uitoq.c b/sysdeps/sparc/sparc64/qp_uitoq.c index bf4706efd8..0d43555c82 100644 --- a/sysdeps/sparc/sparc64/soft-fp/qp_uitoq.c +++ b/sysdeps/sparc/sparc64/qp_uitoq.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. (*c) = (long double)(a) - 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/sparc/sparc64/soft-fp/qp_util.c b/sysdeps/sparc/sparc64/qp_util.c index 02ed3508c9..fc9edf2153 100644 --- a/sysdeps/sparc/sparc64/soft-fp/qp_util.c +++ b/sysdeps/sparc/sparc64/qp_util.c @@ -1,7 +1,7 @@ /* Software floating-point emulation. Helper routine for _Qp_* routines. Simulate exceptions using double arithmetics. - Copyright (C) 1999-2016 Free Software Foundation, Inc. + Copyright (C) 1999-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek (jj@ultra.linux.cz). diff --git a/sysdeps/sparc/sparc64/soft-fp/qp_uxtoq.c b/sysdeps/sparc/sparc64/qp_uxtoq.c index eaef32b812..ed2a8985d6 100644 --- a/sysdeps/sparc/sparc64/soft-fp/qp_uxtoq.c +++ b/sysdeps/sparc/sparc64/qp_uxtoq.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. (*c) = (long double)(a) - 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/sparc/sparc64/soft-fp/qp_xtoq.c b/sysdeps/sparc/sparc64/qp_xtoq.c index 952262e2cc..fe3e8e764d 100644 --- a/sysdeps/sparc/sparc64/soft-fp/qp_xtoq.c +++ b/sysdeps/sparc/sparc64/qp_xtoq.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. (*c) = (long double)(*a) - 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/sparc/sparc64/rawmemchr.S b/sysdeps/sparc/sparc64/rawmemchr.S index 657361d17c..dd5e1a6c21 100644 --- a/sysdeps/sparc/sparc64/rawmemchr.S +++ b/sysdeps/sparc/sparc64/rawmemchr.S @@ -1,6 +1,6 @@ /* rawmemchr (str, ch) -- Return pointer to first occurrence of CH in STR. For SPARC v9. - Copyright (C) 1999-2016 Free Software Foundation, Inc. + Copyright (C) 1999-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <jj@ultra.linux.cz>. This version is developed using the same algorithm as the fast C diff --git a/sysdeps/sparc/sparc64/rshift.S b/sysdeps/sparc/sparc64/rshift.S index a41acc23d4..c00ea983b3 100644 --- a/sysdeps/sparc/sparc64/rshift.S +++ b/sysdeps/sparc/sparc64/rshift.S @@ -1,6 +1,6 @@ /* SPARC v9 __mpn_rshift -- - Copyright (C) 1996-2016 Free Software Foundation, Inc. + Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU MP Library. diff --git a/sysdeps/sparc/sparc64/rtld-memmove.c b/sysdeps/sparc/sparc64/rtld-memmove.c new file mode 100644 index 0000000000..1e73c6b442 --- /dev/null +++ b/sysdeps/sparc/sparc64/rtld-memmove.c @@ -0,0 +1,2 @@ +#include <string/wordcopy.c> +#include <string/memmove.c> diff --git a/sysdeps/sparc/sparc64/soft-fp/sfp-machine.h b/sysdeps/sparc/sparc64/sfp-machine.h index 72c03a03bb..333f1988f3 100644 --- a/sysdeps/sparc/sparc64/soft-fp/sfp-machine.h +++ b/sysdeps/sparc/sparc64/sfp-machine.h @@ -1,6 +1,6 @@ /* Machine-dependent software floating-point definitions. Sparc64 userland (_Q_* and _Qp_*) version. - 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), Jakub Jelinek (jj@ultra.linux.cz) and diff --git a/sysdeps/sparc/sparc64/soft-fp/Makefile b/sysdeps/sparc/sparc64/soft-fp/Makefile deleted file mode 100644 index 5e87aafe7b..0000000000 --- a/sysdeps/sparc/sparc64/soft-fp/Makefile +++ /dev/null @@ -1,33 +0,0 @@ -# Software floating-point emulation. -# Makefile for SPARC v9 ABI mandated long double utility -# functions (_Qp_*). -# Copyright (C) 1999-2016 Free Software Foundation, Inc. -# This file is part of the GNU C Library. -# Contributed by Jakub Jelinek (jj@ultra.linux.cz). -# - -# 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/>. - -ifeq ($(subdir),soft-fp) -sparc64-quad-routines := qp_add qp_cmp qp_cmpe qp_div qp_dtoq qp_feq qp_fge \ - qp_fgt qp_fle qp_flt qp_fne qp_itoq qp_mul qp_neg qp_qtod qp_qtoi \ - qp_qtos qp_qtoui qp_qtoux qp_qtox qp_sqrt qp_stoq qp_sub qp_uitoq \ - qp_uxtoq qp_xtoq qp_util -sysdep_routines += $(sparc64-quad-routines) -endif - -ifeq ($(subdir),math) -CPPFLAGS += -I../soft-fp/ -endif diff --git a/sysdeps/sparc/sparc64/soft-fp/Versions b/sysdeps/sparc/sparc64/soft-fp/Versions deleted file mode 100644 index 9e89c3c3ef..0000000000 --- a/sysdeps/sparc/sparc64/soft-fp/Versions +++ /dev/null @@ -1,8 +0,0 @@ -libc { - GLIBC_2.2 { - _Qp_add; _Qp_cmp; _Qp_cmpe; _Qp_div; _Qp_dtoq; _Qp_feq; _Qp_fge; _Qp_fgt; - _Qp_fle; _Qp_flt; _Qp_fne; _Qp_itoq; _Qp_mul; _Qp_neg; _Qp_qtod; _Qp_qtoi; - _Qp_qtos; _Qp_qtoui; _Qp_qtoux; _Qp_qtox; _Qp_sqrt; _Qp_stoq; _Qp_sub; - _Qp_uitoq; _Qp_uxtoq; _Qp_xtoq; - } -} diff --git a/sysdeps/sparc/sparc64/soft-fp/e_ilogbl.c b/sysdeps/sparc/sparc64/soft-fp/e_ilogbl.c deleted file mode 100644 index 9c5b8560bf..0000000000 --- a/sysdeps/sparc/sparc64/soft-fp/e_ilogbl.c +++ /dev/null @@ -1,79 +0,0 @@ -/* Software floating-point emulation. - ilogbl(x, exp) - Copyright (C) 1999-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Jakub Jelinek (jj@ultra.linux.cz). - - 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/>. */ - -/* ilogbl(long double x) - * return the binary exponent of non-zero x - * ilogbl(0) = 0x80000001 - * ilogbl(inf/NaN) = 0x7fffffff (no signal is raised) - */ - -#include "soft-fp.h" -#include "quad.h" -#include <math.h> - -int __ieee754_ilogbl (long double x) -{ - FP_DECL_EX; - FP_DECL_Q(X); - -/* - FP_UNPACK_Q(X, x); - switch (X_c) - { - case FP_CLS_ZERO: - return FP_ILOGB0; - case FP_CLS_NAN: - case FP_CLS_INF: - return FP_ILOGBNAN; - default: - return X_e; - } - */ - FP_UNPACK_RAW_Q(X, x); - switch (X_e) - { - default: - return X_e - _FP_EXPBIAS_Q; - case 0: -#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q - if (_FP_FRAC_ZEROP_4(X)) - return FP_ILOGB0; - else - { - _FP_I_TYPE shift; - _FP_FRAC_CLZ_4(shift, X); - shift -= _FP_FRACXBITS_Q; - return X_e - _FP_EXPBIAS_Q - 1 + shift; - } -#else - if (_FP_FRAC_ZEROP_2(X)) - return FP_ILOGB0; - else - { - _FP_I_TYPE shift; - _FP_FRAC_CLZ_2(shift, X); - shift -= _FP_FRACXBITS_Q; - return X_e - _FP_EXPBIAS_Q - 1 + shift; - } -#endif - case _FP_EXPBIAS_Q: - return FP_ILOGBNAN; - } -} diff --git a/sysdeps/sparc/sparc64/soft-fp/s_frexpl.c b/sysdeps/sparc/sparc64/soft-fp/s_frexpl.c deleted file mode 100644 index 8ca974fa4c..0000000000 --- a/sysdeps/sparc/sparc64/soft-fp/s_frexpl.c +++ /dev/null @@ -1,51 +0,0 @@ -/* Software floating-point emulation. - frexpl(x, exp) - Copyright (C) 1999-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Jakub Jelinek (jj@ultra.linux.cz). - - 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/>. */ - -/* - * for non-zero x - * x = frexpl(arg,&exp); - * return a long double fp quantity x such that 0.5 <= |x| <1.0 - * and the corresponding binary exponent "exp". That is - * arg = x*2^exp. - * If arg is inf, 0.0, or NaN, then frexpl(arg,&exp) returns arg - * with *exp=0. - */ - -#include "soft-fp.h" -#include "quad.h" - -long double __frexpl(long double arg, int *exp) -{ - FP_DECL_EX; - FP_DECL_Q(A); - long double r; - - *exp = 0; - FP_UNPACK_Q(A, arg); - if (A_c != FP_CLS_NORMAL) - return arg; - *exp = A_e + 1; - A_e = -1; - FP_PACK_Q(r, A); - - return r; -} - -weak_alias (__frexpl, frexpl) diff --git a/sysdeps/sparc/sparc64/soft-fp/s_scalblnl.c b/sysdeps/sparc/sparc64/soft-fp/s_scalblnl.c deleted file mode 100644 index 90d273e066..0000000000 --- a/sysdeps/sparc/sparc64/soft-fp/s_scalblnl.c +++ /dev/null @@ -1,52 +0,0 @@ -/* Software floating-point emulation. - scalblnl(x, exp) - Copyright (C) 1999-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Jakub Jelinek (jj@ultra.linux.cz). - - 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/>. */ - -/* - * scalblnl (long double x, long int n) - * scalblnl(x,n) returns x* 2**n computed by exponent - * manipulation rather than by actually performing an - * exponentiation or a multiplication. - */ - -#include "soft-fp.h" -#include "quad.h" - -long double __scalblnl(long double arg, int exp) -{ - FP_DECL_EX; - FP_DECL_Q(A); - long double r; - - FP_UNPACK_Q(A, arg); - switch (A_c) - { - case FP_CLS_ZERO: - return arg; - case FP_CLS_NAN: - case FP_CLS_INF: - FP_HANDLE_EXCEPTIONS; - return arg; - } - A_e += exp; - FP_PACK_Q(r, A); - FP_HANDLE_EXCEPTIONS; - - return r; -} diff --git a/sysdeps/sparc/sparc64/soft-fp/s_scalbnl.c b/sysdeps/sparc/sparc64/soft-fp/s_scalbnl.c deleted file mode 100644 index ba62ec7e0c..0000000000 --- a/sysdeps/sparc/sparc64/soft-fp/s_scalbnl.c +++ /dev/null @@ -1,52 +0,0 @@ -/* Software floating-point emulation. - scalbnl(x, exp) - Copyright (C) 1999-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Jakub Jelinek (jj@ultra.linux.cz). - - 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/>. */ - -/* - * scalbnl (long double x, int n) - * scalbnl(x,n) returns x* 2**n computed by exponent - * manipulation rather than by actually performing an - * exponentiation or a multiplication. - */ - -#include "soft-fp.h" -#include "quad.h" - -long double __scalbnl(long double arg, int exp) -{ - FP_DECL_EX; - FP_DECL_Q(A); - long double r; - - FP_UNPACK_Q(A, arg); - switch (A_c) - { - case FP_CLS_ZERO: - return arg; - case FP_CLS_NAN: - case FP_CLS_INF: - FP_HANDLE_EXCEPTIONS; - return arg; - } - A_e += exp; - FP_PACK_Q(r, A); - FP_HANDLE_EXCEPTIONS; - - return r; -} diff --git a/sysdeps/sparc/sparc64/start.S b/sysdeps/sparc/sparc64/start.S index 818725d771..75ff5093dc 100644 --- a/sysdeps/sparc/sparc64/start.S +++ b/sysdeps/sparc/sparc64/start.S @@ -1,5 +1,5 @@ /* Startup code for elf64-sparc - 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 <richard@gnu.ai.mit.edu>, 1997. @@ -42,7 +42,7 @@ .global _start .type _start,#function _start: -#ifdef SHARED +#ifdef PIC SETUP_PIC_REG(l7) #endif @@ -58,7 +58,7 @@ _start: add %sp, STACK_BIAS+23*8, %o2 /* Load the addresses of the user entry points. */ -#ifndef SHARED +#ifndef PIC sethi %hi(main), %o0 sethi %hi(__libc_csu_init), %o3 sethi %hi(__libc_csu_fini), %o4 diff --git a/sysdeps/sparc/sparc64/stpcpy.S b/sysdeps/sparc/sparc64/stpcpy.S index 4b277e00cc..64996d6448 100644 --- a/sysdeps/sparc/sparc64/stpcpy.S +++ b/sysdeps/sparc/sparc64/stpcpy.S @@ -1,6 +1,6 @@ /* Copy SRC to DEST returning the address of the terminating '\0' in DEST. For SPARC v9. - 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 Jan Vondrak <jvon4518@ss1000.ms.mff.cuni.cz> and Jakub Jelinek <jj@ultra.linux.cz>. diff --git a/sysdeps/sparc/sparc64/stpncpy.S b/sysdeps/sparc/sparc64/stpncpy.S index 05f5e4d66f..15eddc1315 100644 --- a/sysdeps/sparc/sparc64/stpncpy.S +++ b/sysdeps/sparc/sparc64/stpncpy.S @@ -2,7 +2,7 @@ SRC to DEST, returning the address of the terminating '\0' in DEST, if any, or else DEST + N. For SPARC v9. - 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 Jakub Jelinek <jj@ultra.linux.cz> and Jan Vondrak <jvon4518@ss1000.ms.mff.cuni.cz>. diff --git a/sysdeps/sparc/sparc64/strcat.S b/sysdeps/sparc/sparc64/strcat.S index 9996907e7d..b07de53914 100644 --- a/sysdeps/sparc/sparc64/strcat.S +++ b/sysdeps/sparc/sparc64/strcat.S @@ -1,6 +1,6 @@ /* strcat (dest, src) -- Append SRC on the end of DEST. For SPARC v9. - 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 Jakub Jelinek <jj@ultra.linux.cz> and Jan Vondrak <jvon4518@ss1000.ms.mff.cuni.cz>. diff --git a/sysdeps/sparc/sparc64/strchr.S b/sysdeps/sparc/sparc64/strchr.S index 31738abdfc..c026bb2507 100644 --- a/sysdeps/sparc/sparc64/strchr.S +++ b/sysdeps/sparc/sparc64/strchr.S @@ -1,6 +1,6 @@ /* strchr (str, ch) -- Return pointer to first occurrence of CH in STR. For SPARC v9. - 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 Jan Vondrak <jvon4518@ss1000.ms.mff.cuni.cz> and Jakub Jelinek <jj@ultra.linux.cz>. diff --git a/sysdeps/sparc/sparc64/strcmp.S b/sysdeps/sparc/sparc64/strcmp.S index 424d3c4cf5..ddd6337479 100644 --- a/sysdeps/sparc/sparc64/strcmp.S +++ b/sysdeps/sparc/sparc64/strcmp.S @@ -1,6 +1,6 @@ /* Compare two strings for differences. For SPARC v9. - Copyright (C) 2011-2016 Free Software Foundation, Inc. + Copyright (C) 2011-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by David S. Miller <davem@davemloft.net> diff --git a/sysdeps/sparc/sparc64/strcpy.S b/sysdeps/sparc/sparc64/strcpy.S index 7693e3bda2..aad7a77878 100644 --- a/sysdeps/sparc/sparc64/strcpy.S +++ b/sysdeps/sparc/sparc64/strcpy.S @@ -1,6 +1,6 @@ /* Copy SRC to DEST returning DEST. For SPARC v9. - 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 Jan Vondrak <jvon4518@ss1000.ms.mff.cuni.cz> and Jakub Jelinek <jj@ultra.linux.cz>. diff --git a/sysdeps/sparc/sparc64/strcspn.S b/sysdeps/sparc/sparc64/strcspn.S index 5d8d0c872f..40996fed8d 100644 --- a/sysdeps/sparc/sparc64/strcspn.S +++ b/sysdeps/sparc/sparc64/strcspn.S @@ -1,7 +1,7 @@ /* strcspn (str, ss) -- Return the length of the initial segment of STR which contains no characters from SS. For SPARC v9. - Copyright (C) 1999-2016 Free Software Foundation, Inc. + Copyright (C) 1999-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <jj@ultra.linux.cz> diff --git a/sysdeps/sparc/sparc64/strlen.S b/sysdeps/sparc/sparc64/strlen.S index 23f11cc3a4..f843139e55 100644 --- a/sysdeps/sparc/sparc64/strlen.S +++ b/sysdeps/sparc/sparc64/strlen.S @@ -1,5 +1,5 @@ /* Determine the length of a string. For SPARC v9. - 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 Jan Vondrak <jvon4518@ss1000.ms.mff.cuni.cz>, Jakub Jelinek <jj@ultra.linux.cz>, and diff --git a/sysdeps/sparc/sparc64/strncmp.S b/sysdeps/sparc/sparc64/strncmp.S index 0acb5769ec..924190bf2d 100644 --- a/sysdeps/sparc/sparc64/strncmp.S +++ b/sysdeps/sparc/sparc64/strncmp.S @@ -2,7 +2,7 @@ equal to or greater than zero if S1 is lexicographically less than, equal to or greater than S2. For SPARC v9. - 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 Jan Vondrak <jvon4518@ss1000.ms.mff.cuni.cz> and Jakub Jelinek <jj@ultra.linux.cz>. diff --git a/sysdeps/sparc/sparc64/strncpy.S b/sysdeps/sparc/sparc64/strncpy.S index 7469031255..a59671c037 100644 --- a/sysdeps/sparc/sparc64/strncpy.S +++ b/sysdeps/sparc/sparc64/strncpy.S @@ -2,7 +2,7 @@ null-terminated string from SRC to DST. If SRC does not cover all of COUNT, the balance is zeroed. For SPARC v9. - 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 Jan Vondrak <jvon4518@ss1000.ms.mff.cuni.cz> and Jakub Jelinek <jj@ultra.linux.cz>. diff --git a/sysdeps/sparc/sparc64/strpbrk.S b/sysdeps/sparc/sparc64/strpbrk.S index f04507d034..4b26566c9f 100644 --- a/sysdeps/sparc/sparc64/strpbrk.S +++ b/sysdeps/sparc/sparc64/strpbrk.S @@ -1,7 +1,7 @@ /* strpbrk (s, accept) -- Find the first occurrence in S of any character in ACCEPT. For SPARC v9. - Copyright (C) 1999-2016 Free Software Foundation, Inc. + Copyright (C) 1999-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <jj@ultra.linux.cz> diff --git a/sysdeps/sparc/sparc64/strspn.S b/sysdeps/sparc/sparc64/strspn.S index 7fe8e5487a..2a028aa135 100644 --- a/sysdeps/sparc/sparc64/strspn.S +++ b/sysdeps/sparc/sparc64/strspn.S @@ -1,7 +1,7 @@ /* strspn (str, ss) -- Return the length of the maximum initial segment of S which contains only characters in ACCEPT. For SPARC v9. - Copyright (C) 1999-2016 Free Software Foundation, Inc. + Copyright (C) 1999-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <jj@ultra.linux.cz> diff --git a/sysdeps/sparc/sparc64/sub_n.S b/sysdeps/sparc/sparc64/sub_n.S index ca5b666e29..2c8eca17a0 100644 --- a/sysdeps/sparc/sparc64/sub_n.S +++ b/sysdeps/sparc/sparc64/sub_n.S @@ -1,7 +1,7 @@ /* SPARC v9 __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/sparc/sparc64/submul_1.S b/sysdeps/sparc/sparc64/submul_1.S index da71caadd2..490988303d 100644 --- a/sysdeps/sparc/sparc64/submul_1.S +++ b/sysdeps/sparc/sparc64/submul_1.S @@ -1,7 +1,7 @@ /* SPARC v9 __mpn_submul_1 -- Multiply a limb vector with a single limb and subtract the product from a second limb vector. - Copyright (C) 1996-2016 Free Software Foundation, Inc. + Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU MP Library. diff --git a/sysdeps/sparc/sparc64/tst-audit.h b/sysdeps/sparc/sparc64/tst-audit.h index 73b1393ebe..315094d039 100644 --- a/sysdeps/sparc/sparc64/tst-audit.h +++ b/sysdeps/sparc/sparc64/tst-audit.h @@ -1,6 +1,6 @@ /* Definitions for testing PLT entry/exit auditing. SPARC64 version. - 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. |