This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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

commit d0758956242c0c5c70ad1912160413152305e1e9
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.
    
    2019-05-28  Tulio Magno Quites Machado Filho  <tuliom@linux.ibm.com>
    
    	* sysdeps/powerpc/powerpc64/fpu/multiarch/vec_s_logf4_vsx.c:
    	[!__GNUC_PREREQ (8, 0)] (vec_float): Add an alternative
    	implementation for GCC < 8.

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)
 {


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]