Index: fpa11.h
===================================================================
RCS file: /cvs/pub/kernel/armlinux/arch/arm/nwfpe/fpa11.h,v
retrieving revision 1.7.2.2
diff -u -u -r1.7.2.2 fpa11.h
--- fpa11.h	9 Mar 2003 21:44:25 -0000	1.7.2.2
+++ fpa11.h	15 Jan 2004 17:23:00 -0000
@@ -43,10 +43,22 @@
 	float64 fDouble;
 #ifdef CONFIG_FPE_NWFPE_XP
 	floatx80 fExtended;
-#else
-	int padding[3];
 #endif
+	unsigned int words[3];
 } FPREG;
+
+/* Big/Little endian offsets when accessing float64 as two words */
+#ifdef __ARMEB__
+# define F64_MSW 0
+# define F64_LSW 1
+#else
+# define F64_MSW 1
+# define F64_LSW 0
+#endif
+
+/* When accessing a floatx80, the 2nd and 3rd words must be flipped */
+#define F80_MSW (1 + F64_MSW)
+#define F80_LSW (1 + F64_LSW)
 
 /* FPA11 device model */
 typedef struct tagFPA11 {
Index: double_cpdo.c
===================================================================
RCS file: /cvs/pub/kernel/armlinux/arch/arm/nwfpe/double_cpdo.c,v
retrieving revision 1.16.2.3
diff -u -u -r1.16.2.3 double_cpdo.c
--- double_cpdo.c	20 Mar 2003 01:02:02 -0000	1.16.2.3
+++ double_cpdo.c	15 Jan 2004 17:23:00 -0000
@@ -22,11 +22,6 @@
 
 #include "fpopcode.h"
 
-union float64_components {
-	float64 f64;
-	unsigned int i[2];
-};
-
 float64 float64_exp(float64 Fm);
 float64 float64_ln(float64 Fm);
 float64 float64_sin(float64 rFm);
@@ -71,22 +66,22 @@
 
 static float64 float64_mnf(float64 rFm)
 {
-	union float64_components u;
+	union tagFPREG u;
+	
+	u.fDouble = rFm;
+	u.words[F64_MSW] ^= 0x80000000;
 
-	u.f64 = rFm;
-	u.i[1] ^= 0x80000000;
-
-	return u.f64;
+	return u.fDouble;
 }
 
 static float64 float64_abs(float64 rFm)
 {
-	union float64_components u;
-
-	u.f64 = rFm;
-	u.i[1] &= 0x7fffffff;
+	union tagFPREG u;
+       
+	u.fDouble = rFm;
+	u.words[F64_MSW] &= 0x7fffffff;
 
-	return u.f64;
+	return u.fDouble;
 }
 
 static float64 (*const monadic_double[16])(float64 rFm) = {
Index: fpa11_cpdt.c
===================================================================
RCS file: /cvs/pub/kernel/armlinux/arch/arm/nwfpe/fpa11_cpdt.c,v
retrieving revision 1.10.2.1
diff -u -u -r1.10.2.1 fpa11_cpdt.c
--- fpa11_cpdt.c	9 Mar 2003 21:44:26 -0000	1.10.2.1
+++ fpa11_cpdt.c	15 Jan 2004 17:23:00 -0000
@@ -36,23 +36,21 @@
 static inline void loadDouble(const unsigned int Fn, const unsigned int *pMem)
 {
 	FPA11 *fpa11 = GET_FPA11();
-	unsigned int *p;
-	p = (unsigned int *) &fpa11->fpreg[Fn].fDouble;
+	unsigned int *p = fpa11->fpreg[Fn].words;
 	fpa11->fType[Fn] = typeDouble;
-	get_user(p[0], &pMem[1]);
-	get_user(p[1], &pMem[0]);	/* sign & exponent */
+	get_user(p[F64_MSW], &pMem[0]);	/* sign & exponent */
+	get_user(p[F64_LSW], &pMem[1]);
 }
 
 #ifdef CONFIG_FPE_NWFPE_XP
 static inline void loadExtended(const unsigned int Fn, const unsigned int *pMem)
 {
 	FPA11 *fpa11 = GET_FPA11();
-	unsigned int *p;
-	p = (unsigned int *) &fpa11->fpreg[Fn].fExtended;
+	unsigned int *p = fpa11->fpreg[Fn].words;
 	fpa11->fType[Fn] = typeExtended;
 	get_user(p[0], &pMem[0]);	/* sign & exponent */
-	get_user(p[1], &pMem[2]);	/* ls bits */
-	get_user(p[2], &pMem[1]);	/* ms bits */
+	get_user(p[F80_MSW], &pMem[1]);	/* ms bits */
+	get_user(p[F80_LSW], &pMem[2]);	/* ls bits */
 }
 #endif
 
@@ -62,7 +60,7 @@
 	register unsigned int *p;
 	unsigned long x;
 
-	p = (unsigned int *) &(fpa11->fpreg[Fn]);
+	p = fpa11->fpreg[Fn].words;
 	get_user(x, &pMem[0]);
 	fpa11->fType[Fn] = (x >> 14) & 0x00000003;
 
@@ -70,8 +68,8 @@
 	case typeSingle:
 	case typeDouble:
 		{
-			get_user(p[0], &pMem[2]);	/* Single */
-			get_user(p[1], &pMem[1]);	/* double msw */
+			get_user(p[F64_LSW], &pMem[2]);	/* Single */
+			get_user(p[F64_MSW], &pMem[1]);	/* double msw */
 			p[2] = 0;			/* empty */
 		}
 		break;
@@ -79,8 +77,8 @@
 #ifdef CONFIG_FPE_NWFPE_XP
 	case typeExtended:
 		{
-			get_user(p[1], &pMem[2]);
-			get_user(p[2], &pMem[1]);	/* msw */
+			get_user(p[F80_LSW], &pMem[2]);
+			get_user(p[F80_MSW], &pMem[1]);	/* msw */
 			p[0] = (x & 0x80003fff);
 		}
 		break;
@@ -92,7 +90,6 @@
 {
 	FPA11 *fpa11 = GET_FPA11();
 	float32 val;
-	register unsigned int *p = (unsigned int *) &val;
 
 	switch (fpa11->fType[Fn]) {
 	case typeDouble:
@@ -109,56 +106,55 @@
 		val = fpa11->fpreg[Fn].fSingle;
 	}
 
-	put_user(p[0], pMem);
+	put_user(val, pMem);
 }
 
 static inline void storeDouble(const unsigned int Fn, unsigned int *pMem)
 {
 	FPA11 *fpa11 = GET_FPA11();
-	float64 val;
-	register unsigned int *p = (unsigned int *) &val;
+	FPREG val;
 
 	switch (fpa11->fType[Fn]) {
 	case typeSingle:
-		val = float32_to_float64(fpa11->fpreg[Fn].fSingle);
+		val.fDouble = float32_to_float64(fpa11->fpreg[Fn].fSingle);
 		break;
 
 #ifdef CONFIG_FPE_NWFPE_XP
 	case typeExtended:
-		val = floatx80_to_float64(fpa11->fpreg[Fn].fExtended);
+		val.fDouble = floatx80_to_float64(fpa11->fpreg[Fn].fExtended);
 		break;
 #endif
 
 	default:
-		val = fpa11->fpreg[Fn].fDouble;
+		val.fDouble = fpa11->fpreg[Fn].fDouble;
 	}
-	put_user(p[1], &pMem[0]);	/* msw */
-	put_user(p[0], &pMem[1]);	/* lsw */
+
+	put_user(val.words[F64_MSW], &pMem[0]);	/* msw */
+	put_user(val.words[F64_LSW], &pMem[1]);	/* lsw */
 }
 
 #ifdef CONFIG_FPE_NWFPE_XP
 static inline void storeExtended(const unsigned int Fn, unsigned int *pMem)
 {
 	FPA11 *fpa11 = GET_FPA11();
-	floatx80 val;
-	register unsigned int *p = (unsigned int *) &val;
+	FPREG val;
 
 	switch (fpa11->fType[Fn]) {
 	case typeSingle:
-		val = float32_to_floatx80(fpa11->fpreg[Fn].fSingle);
+		val.fExtended = float32_to_floatx80(fpa11->fpreg[Fn].fSingle);
 		break;
 
 	case typeDouble:
-		val = float64_to_floatx80(fpa11->fpreg[Fn].fDouble);
+		val.fExtended = float64_to_floatx80(fpa11->fpreg[Fn].fDouble);
 		break;
 
 	default:
-		val = fpa11->fpreg[Fn].fExtended;
+		val.fExtended = fpa11->fpreg[Fn].fExtended;
 	}
 
-	put_user(p[0], &pMem[0]);	/* sign & exp */
-	put_user(p[1], &pMem[2]);
-	put_user(p[2], &pMem[1]);	/* msw */
+	put_user(val.words[0], &pMem[0]);	/* sign & exp */
+	put_user(val.words[F80_MSW], &pMem[1]);	/* msw */
+	put_user(val.words[F80_LSW], &pMem[2]);
 }
 #endif
 
@@ -167,15 +163,15 @@
 	FPA11 *fpa11 = GET_FPA11();
 	register unsigned int nType, *p;
 
-	p = (unsigned int *) &(fpa11->fpreg[Fn]);
+	p = fpa11->fpreg[Fn].words;
 	nType = fpa11->fType[Fn];
 
 	switch (nType) {
 	case typeSingle:
 	case typeDouble:
 		{
-			put_user(p[0], &pMem[2]);	/* single */
-			put_user(p[1], &pMem[1]);	/* double msw */
+			put_user(p[F64_LSW], &pMem[2]);	/* single */
+			put_user(p[F64_MSW], &pMem[1]);	/* double msw */
 			put_user(nType << 14, &pMem[0]);
 		}
 		break;
@@ -183,8 +179,8 @@
 #ifdef CONFIG_FPE_NWFPE_XP
 	case typeExtended:
 		{
-			put_user(p[2], &pMem[1]);	/* msw */
-			put_user(p[1], &pMem[2]);
+			put_user(p[F80_MSW], &pMem[1]);	/* msw */
+			put_user(p[F80_LSW], &pMem[2]);
 			put_user((p[0] & 0x80003fff) | (nType << 14), &pMem[0]);
 		}
 		break;
