olga / rpms / glibc

Forked from rpms/glibc 5 years ago
Clone

Blame SOURCES/glibc-ppc64le-14.patch

00db10
# commit 603e84104cdc709c8e7dcbac54b9a585bf8dff78
00db10
# Author: Alan Modra <amodra@gmail.com>
00db10
# Date:   Sat Aug 17 18:29:43 2013 +0930
00db10
# 
00db10
#     PowerPC floating point little-endian [9 of 15]
00db10
#     http://sourceware.org/ml/libc-alpha/2013-07/msg00200.html
00db10
#     
00db10
#     This works around the fact that vsx is disabled in current
00db10
#     little-endian gcc.  Also, float constants take 4 bytes in memory
00db10
#     vs. 16 bytes for vector constants, and we don't need to write one lot
00db10
#     of masks for double (register format) and another for float (mem
00db10
#     format).
00db10
#     
00db10
#         * sysdeps/powerpc/fpu/s_float_bitwise.h (__float_and_test28): Don't
00db10
#         use vector int constants.
00db10
#         (__float_and_test24, __float_and8, __float_get_exp): Likewise.
00db10
# 
00db10
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/fpu/s_float_bitwise.h glibc-2.17-c758a686/sysdeps/powerpc/fpu/s_float_bitwise.h
00db10
--- glibc-2.17-c758a686/sysdeps/powerpc/fpu/s_float_bitwise.h	2014-05-27 22:37:18.000000000 -0500
00db10
+++ glibc-2.17-c758a686/sysdeps/powerpc/fpu/s_float_bitwise.h	2014-05-27 22:37:20.000000000 -0500
00db10
@@ -23,18 +23,19 @@
00db10
 #include <math_private.h>
00db10
 
00db10
 /* Returns (int)(num & 0x7FFFFFF0 == value) */
00db10
-static inline
00db10
-int __float_and_test28 (float num, float value)
00db10
+static inline int
00db10
+__float_and_test28 (float num, float value)
00db10
 {
00db10
   float ret;
00db10
 #ifdef _ARCH_PWR7
00db10
-  vector int mask = (vector int) {
00db10
-    0x7ffffffe, 0x00000000, 0x00000000, 0x0000000
00db10
-  };
00db10
+  union {
00db10
+    int i;
00db10
+    float f;
00db10
+  } mask = { .i = 0x7ffffff0 };
00db10
   __asm__ (
00db10
-  /* the 'f' constrain is use on mask because we just need
00db10
+  /* the 'f' constraint is used on mask because we just need
00db10
    * to compare floats, not full vector */
00db10
-    "xxland %x0,%x1,%x2" : "=f" (ret) : "f" (num), "f" (mask)
00db10
+    "xxland %x0,%x1,%x2" : "=f" (ret) : "f" (num), "f" (mask.f)
00db10
   );
00db10
 #else
00db10
   int32_t inum;
00db10
@@ -46,16 +47,17 @@
00db10
 }
00db10
 
00db10
 /* Returns (int)(num & 0x7FFFFF00 == value) */
00db10
-static inline
00db10
-int __float_and_test24 (float num, float value)
00db10
+static inline int
00db10
+__float_and_test24 (float num, float value)
00db10
 {
00db10
   float ret;
00db10
 #ifdef _ARCH_PWR7
00db10
-  vector int mask = (vector int) {
00db10
-    0x7fffffe0, 0x00000000, 0x00000000, 0x0000000
00db10
-  };
00db10
+  union {
00db10
+    int i;
00db10
+    float f;
00db10
+  } mask = { .i = 0x7fffff00 };
00db10
   __asm__ (
00db10
-    "xxland %x0,%x1,%x2" : "=f" (ret) : "f" (num), "f" (mask)
00db10
+    "xxland %x0,%x1,%x2" : "=f" (ret) : "f" (num), "f" (mask.f)
00db10
   );
00db10
 #else
00db10
   int32_t inum;
00db10
@@ -67,16 +69,17 @@
00db10
 }
00db10
 
00db10
 /* Returns (float)(num & 0x7F800000) */
00db10
-static inline
00db10
-float __float_and8 (float num)
00db10
+static inline float
00db10
+__float_and8 (float num)
00db10
 {
00db10
   float ret;
00db10
 #ifdef _ARCH_PWR7
00db10
-  vector int mask = (vector int) {
00db10
-    0x7ff00000, 0x00000000, 0x00000000, 0x00000000
00db10
-  };
00db10
+  union {
00db10
+    int i;
00db10
+    float f;
00db10
+  } mask = { .i = 0x7f800000 };
00db10
   __asm__ (
00db10
-    "xxland %x0,%x1,%x2" : "=f" (ret) : "f" (num), "f" (mask)
00db10
+    "xxland %x0,%x1,%x2" : "=f" (ret) : "f" (num), "f" (mask.f)
00db10
   );
00db10
 #else
00db10
   int32_t inum;
00db10
@@ -88,17 +91,18 @@
00db10
 }
00db10
 
00db10
 /* Returns ((int32_t)(num & 0x7F800000) >> 23) */
00db10
-static inline
00db10
-int32_t __float_get_exp (float num)
00db10
+static inline int32_t
00db10
+__float_get_exp (float num)
00db10
 {
00db10
   int32_t inum;
00db10
 #ifdef _ARCH_PWR7
00db10
   float ret;
00db10
-  vector int mask = (vector int) {
00db10
-    0x7ff00000, 0x00000000, 0x00000000, 0x00000000
00db10
-  };
00db10
+  union {
00db10
+    int i;
00db10
+    float f;
00db10
+  } mask = { .i = 0x7f800000 };
00db10
   __asm__ (
00db10
-    "xxland %x0,%x1,%x2" : "=f" (ret) : "f" (num), "f" (mask)
00db10
+    "xxland %x0,%x1,%x2" : "=f" (ret) : "f" (num), "f" (mask.f)
00db10
   );
00db10
   GET_FLOAT_WORD(inum, ret);
00db10
 #else