aboutsummaryrefslogtreecommitdiff
path: root/target-mips
diff options
context:
space:
mode:
authorths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2007-10-23 23:23:43 +0000
committerths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2007-10-23 23:23:43 +0000
commit7d307e9edc944e255fc3462ff536ffeb78ac2c68 (patch)
tree53f19d2c8e0e52ca52af4e76cf41c427fc364cee /target-mips
parent67fc07d3fba681f3362f7644a69b7a581a2670e8 (diff)
Enforce proper sign extension for lwl/lwr on MIPS64.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3430 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-mips')
-rw-r--r--target-mips/op_mem.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/target-mips/op_mem.c b/target-mips/op_mem.c
index d402d616b1..42f5e2ba3f 100644
--- a/target-mips/op_mem.c
+++ b/target-mips/op_mem.c
@@ -89,7 +89,7 @@ void glue(op_lwl, MEMSUFFIX) (void)
target_ulong tmp;
tmp = glue(ldub, MEMSUFFIX)(T0);
- T1 = (int32_t)((T1 & 0x00FFFFFF) | (tmp << 24));
+ T1 = (T1 & 0x00FFFFFF) | (tmp << 24);
if (GET_LMASK(T0) <= 2) {
tmp = glue(ldub, MEMSUFFIX)(GET_OFFSET(T0, 1));
@@ -105,6 +105,7 @@ void glue(op_lwl, MEMSUFFIX) (void)
tmp = glue(ldub, MEMSUFFIX)(GET_OFFSET(T0, 3));
T1 = (T1 & 0xFFFFFF00) | tmp;
}
+ T1 = (int32_t)T1;
RETURN();
}
@@ -129,6 +130,7 @@ void glue(op_lwr, MEMSUFFIX) (void)
tmp = glue(ldub, MEMSUFFIX)(GET_OFFSET(T0, -3));
T1 = (T1 & 0x00FFFFFF) | (tmp << 24);
}
+ T1 = (int32_t)T1;
RETURN();
}