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
This commit is contained in:
bellard 2005-12-06 21:44:28 +00:00
parent 909a8762ee
commit 9f25f11fe5

View File

@ -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;