diff options
author | David S. Miller <davem@davemloft.net> | 2012-03-15 23:09:16 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-03-15 23:09:16 -0700 |
commit | e6a62e18fd9d429950e25db97ac216fa570bfa30 (patch) | |
tree | fc9cb7df1e12d2fe12e7045673fe5ac779f26496 /sysdeps/sparc/sparc64/fpu | |
parent | c4a7b16eb80d59539d2d2cc1f9445e877b55cd2b (diff) | |
download | glibc-e6a62e18fd9d429950e25db97ac216fa570bfa30.tar.gz |
Add sparc vis3 optimized fma/fmaf.
* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fma-vis3.S: New file.
* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fma.c: New file.
* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaf-vis3.S: New file.
* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaf.c: New file.
* sysdeps/sparc/sparc64/fpu/multiarch/s_fma-vis3.S: New file.
* sysdeps/sparc/sparc64/fpu/multiarch/s_fma.c: New file.
* sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf-vis3.S: New file.
* sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf.c: New file.
* sysdeps/sparc/sparc64/fpu/multiarch/Makefile: Add fma/fmaf
sysdep routines.
* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile: Likewise.
Diffstat (limited to 'sysdeps/sparc/sparc64/fpu')
-rw-r--r-- | sysdeps/sparc/sparc64/fpu/multiarch/Makefile | 3 | ||||
-rw-r--r-- | sysdeps/sparc/sparc64/fpu/multiarch/s_fma-vis3.S | 25 | ||||
-rw-r--r-- | sysdeps/sparc/sparc64/fpu/multiarch/s_fma.c | 14 | ||||
-rw-r--r-- | sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf-vis3.S | 25 | ||||
-rw-r--r-- | sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf.c | 14 |
5 files changed, 80 insertions, 1 deletions
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/Makefile b/sysdeps/sparc/sparc64/fpu/multiarch/Makefile index 0aa40464e0..83458484a7 100644 --- a/sysdeps/sparc/sparc64/fpu/multiarch/Makefile +++ b/sysdeps/sparc/sparc64/fpu/multiarch/Makefile @@ -6,7 +6,8 @@ libm-sysdep_routines += m_signbitf-vis3 m_signbit-vis3 s_ceilf-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_fmaxf-vis3 s_fmax-vis3 s_fmaf-vis3 \ + s_fma-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 diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_fma-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_fma-vis3.S new file mode 100644 index 0000000000..8b57eb234f --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_fma-vis3.S @@ -0,0 +1,25 @@ +/* fma function, sparc64 vis3 version. + Copyright (C) 2012 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> + +ENTRY (__fma_vis3) + retl + fmaddd %f0, %f2, %f4, %f0 +END (__fma_vis3) diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_fma.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_fma.c new file mode 100644 index 0000000000..3f2f1622c8 --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_fma.c @@ -0,0 +1,14 @@ +#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> diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf-vis3.S new file mode 100644 index 0000000000..e431e7170b --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf-vis3.S @@ -0,0 +1,25 @@ +/* fmaf function, sparc64 vis3 version. + Copyright (C) 2012 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> + +ENTRY (__fmaf_vis3) + retl + fmadds %f1, %f3, %f5, %f0 +END (__fmaf_vis3) diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf.c new file mode 100644 index 0000000000..7a273a3b13 --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf.c @@ -0,0 +1,14 @@ +#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> |