5de29b
# commit fef13a78ea30d4c26d6bab48d731ebe864ee31b0
5de29b
# Author: Alan Modra <amodra@gmail.com>
5de29b
# Date:   Sat Aug 17 18:33:45 2013 +0930
5de29b
# 
5de29b
#     PowerPC floating point little-endian [15 of 15]
5de29b
#     http://sourceware.org/ml/libc-alpha/2013-07/msg00206.html
5de29b
#     
5de29b
#     The union loses when little-endian.
5de29b
#     
5de29b
#         * sysdeps/powerpc/powerpc32/power4/hp-timing.h (HP_TIMING_NOW):
5de29b
#         Don't use a union to pack hi/low value.
5de29b
# 
12745e
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/hp-timing.h glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/hp-timing.h
12745e
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/hp-timing.h	2014-05-27 22:53:37.000000000 -0500
12745e
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/hp-timing.h	2014-05-27 22:53:39.000000000 -0500
5de29b
@@ -87,18 +87,15 @@
5de29b
 
5de29b
 #define HP_TIMING_NOW(Var)						\
5de29b
   do {									\
5de29b
-        union { long long ll; long ii[2]; } _var;			\
5de29b
-	long tmp;							\
5de29b
-        __asm__ __volatile__ (						\
5de29b
-		"1:	mfspr	%0,269;"				\
5de29b
-		"	mfspr	%1,268;"				\
5de29b
-		"	mfspr	%2,269;"				\
5de29b
-		"	cmpw	%0,%2;"					\
5de29b
-		"	bne	1b;"					\
5de29b
-		: "=r" (_var.ii[0]), "=r" (_var.ii[1]) , "=r" (tmp)	\
5de29b
-		: : "cr0"						\
5de29b
-		);							\
5de29b
-	Var = _var.ll;							\
5de29b
+    unsigned int hi, lo, tmp;						\
5de29b
+    __asm__ __volatile__ ("1:	mfspr	%0,269;"			\
5de29b
+			  "	mfspr	%1,268;"			\
5de29b
+			  "	mfspr	%2,269;"			\
5de29b
+			  "	cmpw	%0,%2;"				\
5de29b
+			  "	bne	1b;"				\
5de29b
+			  : "=&r" (hi), "=&r" (lo), "=&r" (tmp)		\
5de29b
+			  : : "cr0");					\
5de29b
+    Var = ((hp_timing_t) hi << 32) | lo;				\
5de29b
   } while (0)
5de29b
 
5de29b