This is the mail archive of the libc-alpha@sources.redhat.com 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]

Re: glibc 2.1.92 make check results under Linux PPC


On Wed, 16 Aug 2000, Geoff Keating wrote:
> > From: Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
> > Date: Thu, 17 Aug 2000 00:51:26 +0200
> >
> > 	* sysdeps/powerpc/fpu_control.h: Clobber the right amount of memory.
>
> I think this won't work the way you might like, because of type-based
> alias analysis.  Instead, we need a union:
>
> union { double d; fpu_control_t c[2]; } tmp;

Ah, yes, sure, I forgot about that. Find appended a new version of the patch.

This leaves the ELF visibility failure, with Kevin's description it feels a 
bit like a cache invalidation problem...

Franz.
Index: sysdeps/powerpc/fpu_control.h
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/powerpc/fpu_control.h,v
retrieving revision 1.4
diff -u -p -r1.4 fpu_control.h
--- sysdeps/powerpc/fpu_control.h	1998/11/26 12:00:14	1.4
+++ sysdeps/powerpc/fpu_control.h	2000/08/17 18:39:04
@@ -50,15 +50,15 @@ typedef unsigned int fpu_control_t __att
 
 /* Macros for accessing the hardware control word.  */
 #define _FPU_GETCW(cw) ( { \
-  fpu_control_t tmp[2] __attribute__ ((__aligned__(8))); \
-  __asm__ ("mffs 0; stfd 0,%0" : "=m" (*tmp) : : "fr0"); \
-  (cw)=tmp[1]; \
-  tmp[1]; } )
+  union { double d; fpu_control_t cw[2]; } tmp __attribute__ ((__aligned__(8))); \
+  __asm__ ("mffs 0; stfd 0,%0" : "=m" (tmp.d) : : "fr0"); \
+  (cw)=tmp.cw[1]; \
+  tmp.cw[1]; } )
 #define _FPU_SETCW(cw) { \
-  fpu_control_t tmp[2] __attribute__ ((__aligned__(8))); \
-  tmp[0] = 0xFFF80000; /* More-or-less arbitrary; this is a QNaN. */ \
-  tmp[1] = cw; \
-  __asm__ ("lfd 0,%0; mtfsf 255,0" : : "m" (*tmp) : "fr0"); \
+  union { double d; fpu_control_t cw[2]; } tmp __attribute__ ((__aligned__(8))); \
+  tmp.cw[0] = 0xFFF80000; /* More-or-less arbitrary; this is a QNaN. */ \
+  tmp.cw[1] = cw; \
+  __asm__ ("lfd 0,%0; mtfsf 255,0" : : "m" (tmp.d) : "fr0"); \
 }
 
 /* Default control word set at startup.  */

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