[glibc/tuliom/libmvec] powerpc64: Fix libmvec's logf4 build on GCC < 8

Tulio Magno Quites Machado Filho tuliom@sourceware.org
Wed Feb 12 17:44:00 GMT 2020


https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=1bd6ae3a5a738030515e94a9a888ed48f47ea687

commit 1bd6ae3a5a738030515e94a9a888ed48f47ea687
Author: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
Date:   Tue May 28 14:53:39 2019 -0300

    powerpc64: Fix libmvec's logf4 build on GCC < 8
    
    The built-in vec_float was added to GCC 8.0, requiring an alternative
    implementation when using older GCC versions.

Diff:
---
 sysdeps/powerpc/powerpc64/fpu/multiarch/vec_s_logf4_vsx.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/vec_s_logf4_vsx.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/vec_s_logf4_vsx.c
index 80e5077..6fb4a5d 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/vec_s_logf4_vsx.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/vec_s_logf4_vsx.c
@@ -32,6 +32,17 @@ LOGF_POLY_ORDER = 4.  */
 #define N (1 << LOGF_TABLE_BITS)
 #define OFF 0x3f330000
 
+/* The vec_float built-in was added to GCC 8.  */
+#if !__GNUC_PREREQ (8, 0)
+vector float
+vec_float (vector signed int xb)
+{
+  vector float tmp;
+  __asm__ volatile ("xvcvsxwsp %x0,%x1" : "=wa" (tmp) : "wa" (xb));
+  return tmp;
+}
+#endif
+
 vector float
 _ZGVbN4v_logf (vector float x)
 {



More information about the Glibc-cvs mailing list