aboutsummaryrefslogtreecommitdiff
path: root/sim/common
diff options
context:
space:
mode:
authorDoug Evans <dje@google.com>2010-01-22 08:23:26 +0000
committerDoug Evans <dje@google.com>2010-01-22 08:23:26 +0000
commit1377e154b39b6ea20786182af21d6eb84c74b3a8 (patch)
tree0471b62ea0aaf170d1304136fd43005fd6c9b58c /sim/common
parentaf2cdeae83b5b69c6ad5fe598e9c511b58abf8bd (diff)
downloadgdb-1377e154b39b6ea20786182af21d6eb84c74b3a8.zip
gdb-1377e154b39b6ea20786182af21d6eb84c74b3a8.tar.gz
gdb-1377e154b39b6ea20786182af21d6eb84c74b3a8.tar.bz2
* cgen-ops.h (SUBWORDXFSI): Fix word ordering.
(SUBWORDTFSI, JOINSIDI): Ditto.
Diffstat (limited to 'sim/common')
-rw-r--r--sim/common/ChangeLog5
-rw-r--r--sim/common/cgen-ops.h15
2 files changed, 14 insertions, 6 deletions
diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog
index 7bf5434..dfe328c 100644
--- a/sim/common/ChangeLog
+++ b/sim/common/ChangeLog
@@ -1,3 +1,8 @@
+2010-01-22 Doug Evans <dje@sebabeach.org>
+
+ * cgen-ops.h (SUBWORDXFSI): Fix word ordering.
+ (SUBWORDTFSI, JOINSIDI): Ditto.
+
2010-01-05 Doug Evans <dje@sebabeach.org>
* cgen-types.h (SETDI): Delete, unused.
diff --git a/sim/common/cgen-ops.h b/sim/common/cgen-ops.h
index 64ed737..b6f38cf 100644
--- a/sim/common/cgen-ops.h
+++ b/sim/common/cgen-ops.h
@@ -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