diff options
author | Aurelien Jarno <aurelien@aurel32.net> | 2016-07-31 23:45:52 +0200 |
---|---|---|
committer | Aurelien Jarno <aurelien@aurel32.net> | 2016-08-03 13:35:22 +0200 |
commit | bdf20beac183c705abef5aef8de2db5fac00bc8b (patch) | |
tree | 85346cf83298702d3a4c3c5874918c671ea51427 /sysdeps/sparc/sparc64/fpu/multiarch/s_trunc-vis3.c | |
parent | 3ef3f1b93fdf20143865cc16dd75f39a7f0fac2f (diff) | |
download | glibc-bdf20beac183c705abef5aef8de2db5fac00bc8b.tar.gz glibc-bdf20beac183c705abef5aef8de2db5fac00bc8b.tar.xz glibc-bdf20beac183c705abef5aef8de2db5fac00bc8b.zip |
sparc64: add a VIS3 version of ceil, floor and trunc
sparc64 passes floating point values in the floating point registers. As the the generic ceil, floor and trunc functions use integer instructions, it makes sense to provide a VIS3 version consisting in the the generic version compiled with -mvis3. GCC will then use movdtox, movxtod, movwtos and movstow instructions. sparc32 passes the floating point values in the integer registers, so it doesn't make sense to do the same. Changelog: * sysdeps/ieee754/dbl-64/s_trunc.c: Avoid alias renamed. * sysdeps/ieee754/dbl-64/wordsize-64/s_trunc.c: Likewise. * sysdeps/ieee754/flt-32/s_truncf.c: Likewise. * sysdeps/sparc/sparc64/fpu/multiarch/Makefile [$(subdir) = math && $(have-as-vis3) = yes] (libm-sysdep_routines): Add s_ceilf-vis3, s_ceil-vis3, s_floorf-vis3, s_floor-vis3, s_truncf-vis3, s_trunc-vis3. (CFLAGS-s_ceilf-vis3.c): New. Set to -Wa,-Av9d -mvis3. (CFLAGS-s_ceil-vis3.c): Likewise. (CFLAGS-s_floorf-vis3.c): Likewise. (CFLAGS-s_floor-vis3.c): Likewise. (CFLAGS-s_truncf-vis3.c): Likewise. (CFLAGS-s_trunc-vis3.c): Likewise. * sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-vis3.c: New file. * sysdeps/sparc/sparc64/fpu/multiarch/s_ceil.c: Likewise. * sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-vis3.c: Likewise. * sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf.c: Likewise. * sysdeps/sparc/sparc64/fpu/multiarch/s_floor-vis3.c: Likewise. * sysdeps/sparc/sparc64/fpu/multiarch/s_floor.c: Likewise. * sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-vis3.c: Likewise. * sysdeps/sparc/sparc64/fpu/multiarch/s_floorf.c: Likewise. * sysdeps/sparc/sparc64/fpu/multiarch/s_trunc-vis3.c: Likewise. * sysdeps/sparc/sparc64/fpu/multiarch/s_trunc.c: Likewise. * sysdeps/sparc/sparc64/fpu/multiarch/s_truncf-vis3.c: Likewise. * sysdeps/sparc/sparc64/fpu/multiarch/s_truncf.c: Likewise.
Diffstat (limited to 'sysdeps/sparc/sparc64/fpu/multiarch/s_trunc-vis3.c')
-rw-r--r-- | sysdeps/sparc/sparc64/fpu/multiarch/s_trunc-vis3.c | 23 |
1 files changed, 23 insertions, 0 deletions
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..2451034e9e --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc-vis3.c @@ -0,0 +1,23 @@ +/* trunc function, sparc64 vis3 version. + Copyright (C) 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 <math.h> + +#define __trunc __trunc_vis3 + +#include <sysdeps/ieee754/dbl-64/wordsize-64/s_trunc.c> |