public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [commit] Fix some word ordering bugs in sim/common/cgen-ops.h
@ 2010-01-22  8:25 Doug Evans
  0 siblings, 0 replies; only message in thread
From: Doug Evans @ 2010-01-22  8:25 UTC (permalink / raw)
  To: gdb-patches

Hi.

fyi, I checked this in.

2010-01-22  Doug Evans  <dje@sebabeach.org>

	* cgen-ops.h (SUBWORDXFSI): Fix word ordering.
	(SUBWORDTFSI, JOINSIDI): Ditto.

Index: cgen-ops.h
===================================================================
RCS file: /cvs/src/src/sim/common/cgen-ops.h,v
retrieving revision 1.12
diff -u -p -r1.12 cgen-ops.h
--- cgen-ops.h	1 Jan 2010 10:03:27 -0000	1.12
+++ cgen-ops.h	22 Jan 2010 08:20:24 -0000
@@ -404,7 +404,10 @@ SUBWORDXFSI (XF in, int word)
   /* Note: typedef struct { SI parts[3]; } XF; */
   union { XF in; SI out[3]; } x;
   x.in = in;
-  return x.out[word];
+  if (CURRENT_TARGET_BYTE_ORDER == BIG_ENDIAN)
+    return x.out[word];
+  else
+    return x.out[2 - word];
 }
 
 SEMOPS_INLINE SI
@@ -413,16 +416,16 @@ SUBWORDTFSI (TF in, int word)
   /* Note: typedef struct { SI parts[4]; } TF; */
   union { TF in; SI out[4]; } x;
   x.in = in;
-  return x.out[word];
+  if (CURRENT_TARGET_BYTE_ORDER == BIG_ENDIAN)
+    return x.out[word];
+  else
+    return x.out[3 - word];
 }
 
 SEMOPS_INLINE DI
 JOINSIDI (SI x0, SI x1)
 {
-  if (CURRENT_TARGET_BYTE_ORDER == BIG_ENDIAN)
-    return MAKEDI (x0, x1);
-  else
-    return MAKEDI (x1, x0);
+  return MAKEDI (x0, x1);
 }
 
 SEMOPS_INLINE DF

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-01-22  8:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-22  8:25 [commit] Fix some word ordering bugs in sim/common/cgen-ops.h Doug Evans

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).