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]

GNU C Library master sources branch ibm/2.24/master updated. glibc-2.24-19-g0271fac


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, ibm/2.24/master has been updated
       via  0271fac6ade279ccb3f5201443f0a48aff7bed53 (commit)
      from  24033104e3e8c90f081c01f24e7c3e38ed16b9f0 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=0271fac6ade279ccb3f5201443f0a48aff7bed53

commit 0271fac6ade279ccb3f5201443f0a48aff7bed53
Author: Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>
Date:   Tue Oct 18 15:30:23 2016 -0200

    powerpc: Add a POWER8 implementation for GET|SET_FLOAT_WORD
    
    Provides a POWER8 implementation for GET_FLOAT_WORD and SET_FLOAT_WORD
    that is able to extract or set a float using only VSR and GPR.
    
    This is a workaround for GCC bug #70568.

diff --git a/ChangeLog b/ChangeLog
index b0c1d93..7a68f49 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2016-10-18  Tulio Magno Quites Machado Filho  <tuliom@linux.vnet.ibm.com>
+
+	* sysdeps/powerpc/powerpc64/power8/fpu/math_private.h (GET_FLOAT_WORD):
+	(SET_FLOAT_WORD): New macros.
+
 2016-09-19  Tulio Magno Quites Machado Filho  <tuliom@linux.vnet.ibm.com>
 
 	[BZ #20615]
diff --git a/sysdeps/powerpc/powerpc64/power8/fpu/math_private.h b/sysdeps/powerpc/powerpc64/power8/fpu/math_private.h
new file mode 100644
index 0000000..fe00c73
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/power8/fpu/math_private.h
@@ -0,0 +1,49 @@
+/* Private inline math functions for POWER8.
+   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/>.  */
+
+/* The compiler isn't extracting this without going through memory, so
+   we use some VSX scalar instructions to convert to the 32b format
+   and move to a GPR.  */
+#define GET_FLOAT_WORD(i,d)			\
+  do {						\
+      float tmpd = d;				\
+      double tmp;				\
+      long tmpi;				\
+      __asm__ ("xscvdpspn %x1, %x2\n\t"		\
+	       "mfvsrd %0, %x1\n\t"		\
+	       : "=wr" (tmpi),			\
+		 "=wa" (tmp)			\
+	       : "wa" (tmpd) );			\
+      i = tmpi >> 32;				\
+    } while(0)
+
+/* To ensure that we don't go through memory, we use some VSX scalar
+   instructions to move VSR and to convert to the 32b format.  */
+#define SET_FLOAT_WORD(d,i)		\
+  do {					\
+    long tmpi = i;			\
+    float tmpd;				\
+    tmpi = tmpi << 32;			\
+    __asm__ ("mtvsrd %x0, %1\n\t"	\
+	     "xscvspdpn %x0, %x0\n\t"	\
+	     : "=wa" (tmpd)		\
+	     : "wr" (tmpi) );		\
+    d = tmpd;				\
+  } while(0)
+
+#include_next <math_private.h>

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                                          |    5 ++
 .../powerpc/powerpc64/power8/fpu/math_private.h    |   49 ++++++++++++++++++++
 2 files changed, 54 insertions(+), 0 deletions(-)
 create mode 100644 sysdeps/powerpc/powerpc64/power8/fpu/math_private.h


hooks/post-receive
-- 
GNU C Library master sources


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