summaryrefslogtreecommitdiff
path: root/target-mips
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2005-12-06 21:44:28 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2005-12-06 21:44:28 +0000
commit9f25f11fe58e48d735339e1c8362e8ff242f02f5 (patch)
tree8bc09943e78328a71bad7c466097f2d8d3cd5fdb /target-mips
parent909a8762eeec347a5105e6b0e4eb59be7448aa3f (diff)
downloadqemu-9f25f11fe58e48d735339e1c8362e8ff242f02f5.tar.gz
qemu-9f25f11fe58e48d735339e1c8362e8ff242f02f5.tar.bz2
qemu-9f25f11fe58e48d735339e1c8362e8ff242f02f5.zip
fix for mipsel (will need change for softmmu case)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1701 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-mips')
-rw-r--r--target-mips/op_helper_mem.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/target-mips/op_helper_mem.c b/target-mips/op_helper_mem.c
index 3a6d386a68..4711f7a6cd 100644
--- a/target-mips/op_helper_mem.c
+++ b/target-mips/op_helper_mem.c
@@ -1,3 +1,9 @@
+#ifdef TARGET_WORDS_BIGENDIAN
+#define GET_LMASK(v) ((v) & 3)
+#else
+#define GET_LMASK(v) (((v) & 3) ^ 3)
+#endif
+
void glue(do_lwl, MEMSUFFIX) (uint32_t tmp)
{
#if defined (DEBUG_OP)
@@ -7,7 +13,7 @@ void glue(do_lwl, MEMSUFFIX) (uint32_t tmp)
/* XXX: this is valid only in big-endian mode
* should be reverted for little-endian...
*/
- switch (T0 & 3) {
+ switch (GET_LMASK(T0)) {
case 0:
T0 = tmp;
break;
@@ -39,7 +45,7 @@ void glue(do_lwr, MEMSUFFIX) (uint32_t tmp)
/* XXX: this is valid only in big-endian mode
* should be reverted for little-endian...
*/
- switch (T0 & 3) {
+ switch (GET_LMASK(T0)) {
case 0:
T0 = (tmp >> 24) | (T1 & 0xFFFFFF00);
break;
@@ -74,7 +80,7 @@ uint32_t glue(do_swl, MEMSUFFIX) (uint32_t tmp)
/* XXX: this is valid only in big-endian mode
* should be reverted for little-endian...
*/
- switch (T0 & 3) {
+ switch (GET_LMASK(T0)) {
case 0:
tmp = T1;
break;
@@ -110,7 +116,7 @@ uint32_t glue(do_swr, MEMSUFFIX) (uint32_t tmp)
/* XXX: this is valid only in big-endian mode
* should be reverted for little-endian...
*/
- switch (T0 & 3) {
+ switch (GET_LMASK(T0)) {
case 0:
tmp = (tmp & 0x00FFFFFF) | (T1 << 24);
break;