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