Commit 9f25f11fe58e48d735339e1c8362e8ff242f02f5

Authored by bellard
1 parent 909a8762

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
Showing 1 changed file with 10 additions and 4 deletions
target-mips/op_helper_mem.c
  1 +#ifdef TARGET_WORDS_BIGENDIAN
  2 +#define GET_LMASK(v) ((v) & 3)
  3 +#else
  4 +#define GET_LMASK(v) (((v) & 3) ^ 3)
  5 +#endif
  6 +
1 7 void glue(do_lwl, MEMSUFFIX) (uint32_t tmp)
2 8 {
3 9 #if defined (DEBUG_OP)
... ... @@ -7,7 +13,7 @@ void glue(do_lwl, MEMSUFFIX) (uint32_t tmp)
7 13 /* XXX: this is valid only in big-endian mode
8 14 * should be reverted for little-endian...
9 15 */
10   - switch (T0 & 3) {
  16 + switch (GET_LMASK(T0)) {
11 17 case 0:
12 18 T0 = tmp;
13 19 break;
... ... @@ -39,7 +45,7 @@ void glue(do_lwr, MEMSUFFIX) (uint32_t tmp)
39 45 /* XXX: this is valid only in big-endian mode
40 46 * should be reverted for little-endian...
41 47 */
42   - switch (T0 & 3) {
  48 + switch (GET_LMASK(T0)) {
43 49 case 0:
44 50 T0 = (tmp >> 24) | (T1 & 0xFFFFFF00);
45 51 break;
... ... @@ -74,7 +80,7 @@ uint32_t glue(do_swl, MEMSUFFIX) (uint32_t tmp)
74 80 /* XXX: this is valid only in big-endian mode
75 81 * should be reverted for little-endian...
76 82 */
77   - switch (T0 & 3) {
  83 + switch (GET_LMASK(T0)) {
78 84 case 0:
79 85 tmp = T1;
80 86 break;
... ... @@ -110,7 +116,7 @@ uint32_t glue(do_swr, MEMSUFFIX) (uint32_t tmp)
110 116 /* XXX: this is valid only in big-endian mode
111 117 * should be reverted for little-endian...
112 118 */
113   - switch (T0 & 3) {
  119 + switch (GET_LMASK(T0)) {
114 120 case 0:
115 121 tmp = (tmp & 0x00FFFFFF) | (T1 << 24);
116 122 break;
... ...