about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-08-17 20:31:43 +0000
committerUlrich Drepper <drepper@redhat.com>2000-08-17 20:31:43 +0000
commit319b400bb50e6e70c97d7fabdbb365cd946780ac (patch)
tree70c44b705c3b194b3d9f2857a46fbfa7ab0d58d2
parent0f6b172f72efea7cd99a9b790df75045f6c85dba (diff)
downloadglibc-319b400bb50e6e70c97d7fabdbb365cd946780ac.tar.gz
glibc-319b400bb50e6e70c97d7fabdbb365cd946780ac.tar.xz
glibc-319b400bb50e6e70c97d7fabdbb365cd946780ac.zip
Update.
	* sysdeps/powerpc/fpu_control.h (_FPU_GETCW): Use type-correct code.
	(_FPU_SETCW): Likewise.
	Patch by Franz Sirl <Franz.Sirl-kernel@lauterbach.com>.
-rw-r--r--ChangeLog4
-rw-r--r--sysdeps/powerpc/fpu_control.h16
2 files changed, 12 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 9cad0a7198..9373e08987 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2000-08-17  Ulrich Drepper  <drepper@redhat.com>
 
+	* sysdeps/powerpc/fpu_control.h (_FPU_GETCW): Use type-correct code.
+	(_FPU_SETCW): Likewise.
+	Patch by Franz Sirl <Franz.Sirl-kernel@lauterbach.com>.
+
 	* stdio-common/printf_fp.c: Fix chars_needed computation.
 	Patch by Greg McGary <greg@mcgary.org>.
 
diff --git a/sysdeps/powerpc/fpu_control.h b/sysdeps/powerpc/fpu_control.h
index ed54ecba99..cb6a772dd2 100644
--- a/sysdeps/powerpc/fpu_control.h
+++ b/sysdeps/powerpc/fpu_control.h
@@ -50,15 +50,15 @@ typedef unsigned int fpu_control_t __attribute__ ((__mode__ (__SI__)));
 
 /* 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.  */