aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/ieee754
diff options
context:
space:
mode:
authorAurelien Jarno <aurelien@aurel32.net>2016-07-31 23:45:52 +0200
committerAurelien Jarno <aurelien@aurel32.net>2016-08-03 13:35:22 +0200
commitbdf20beac183c705abef5aef8de2db5fac00bc8b (patch)
tree85346cf83298702d3a4c3c5874918c671ea51427 /sysdeps/ieee754
parent3ef3f1b93fdf20143865cc16dd75f39a7f0fac2f (diff)
downloadglibc-bdf20beac183c705abef5aef8de2db5fac00bc8b.zip
glibc-bdf20beac183c705abef5aef8de2db5fac00bc8b.tar.gz
glibc-bdf20beac183c705abef5aef8de2db5fac00bc8b.tar.bz2
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/ieee754')
-rw-r--r--sysdeps/ieee754/dbl-64/s_trunc.c4
-rw-r--r--sysdeps/ieee754/dbl-64/wordsize-64/s_trunc.c4
-rw-r--r--sysdeps/ieee754/flt-32/s_truncf.c2
3 files changed, 8 insertions, 2 deletions
diff --git a/sysdeps/ieee754/dbl-64/s_trunc.c b/sysdeps/ieee754/dbl-64/s_trunc.c
index f64e097..7663f61 100644
--- a/sysdeps/ieee754/dbl-64/s_trunc.c
+++ b/sysdeps/ieee754/dbl-64/s_trunc.c
@@ -53,8 +53,10 @@ __trunc (double x)
return x;
}
+#ifndef __trunc
weak_alias (__trunc, trunc)
-#ifdef NO_LONG_DOUBLE
+# ifdef NO_LONG_DOUBLE
strong_alias (__trunc, __truncl)
weak_alias (__trunc, truncl)
+# endif
#endif
diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/s_trunc.c b/sysdeps/ieee754/dbl-64/wordsize-64/s_trunc.c
index 81ac55e..f961e52 100644
--- a/sysdeps/ieee754/dbl-64/wordsize-64/s_trunc.c
+++ b/sysdeps/ieee754/dbl-64/wordsize-64/s_trunc.c
@@ -48,8 +48,10 @@ __trunc (double x)
return x;
}
+#ifndef __trunc
weak_alias (__trunc, trunc)
-#ifdef NO_LONG_DOUBLE
+# ifdef NO_LONG_DOUBLE
strong_alias (__trunc, __truncl)
weak_alias (__trunc, truncl)
+# endif
#endif
diff --git a/sysdeps/ieee754/flt-32/s_truncf.c b/sysdeps/ieee754/flt-32/s_truncf.c
index 43d35c7..5228ec6 100644
--- a/sysdeps/ieee754/flt-32/s_truncf.c
+++ b/sysdeps/ieee754/flt-32/s_truncf.c
@@ -48,4 +48,6 @@ __truncf (float x)
return x;
}
+#ifndef __truncf
weak_alias (__truncf, truncf)
+#endif