Commit 7d307e9edc944e255fc3462ff536ffeb78ac2c68
1 parent
67fc07d3
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
Showing
1 changed file
with
3 additions
and
1 deletions
target-mips/op_mem.c
... | ... | @@ -89,7 +89,7 @@ void glue(op_lwl, MEMSUFFIX) (void) |
89 | 89 | target_ulong tmp; |
90 | 90 | |
91 | 91 | tmp = glue(ldub, MEMSUFFIX)(T0); |
92 | - T1 = (int32_t)((T1 & 0x00FFFFFF) | (tmp << 24)); | |
92 | + T1 = (T1 & 0x00FFFFFF) | (tmp << 24); | |
93 | 93 | |
94 | 94 | if (GET_LMASK(T0) <= 2) { |
95 | 95 | tmp = glue(ldub, MEMSUFFIX)(GET_OFFSET(T0, 1)); |
... | ... | @@ -105,6 +105,7 @@ void glue(op_lwl, MEMSUFFIX) (void) |
105 | 105 | tmp = glue(ldub, MEMSUFFIX)(GET_OFFSET(T0, 3)); |
106 | 106 | T1 = (T1 & 0xFFFFFF00) | tmp; |
107 | 107 | } |
108 | + T1 = (int32_t)T1; | |
108 | 109 | RETURN(); |
109 | 110 | } |
110 | 111 | |
... | ... | @@ -129,6 +130,7 @@ void glue(op_lwr, MEMSUFFIX) (void) |
129 | 130 | tmp = glue(ldub, MEMSUFFIX)(GET_OFFSET(T0, -3)); |
130 | 131 | T1 = (T1 & 0x00FFFFFF) | (tmp << 24); |
131 | 132 | } |
133 | + T1 = (int32_t)T1; | |
132 | 134 | RETURN(); |
133 | 135 | } |
134 | 136 | ... | ... |