Fix lwl/lwr for 64bit emulation, also debug output spec for 64bit emulation.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2283 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
7495fd0f4a
commit
3a3f24fce8
@ -1,3 +1,5 @@
|
||||
#undef DEBUG_OP
|
||||
|
||||
#ifdef TARGET_WORDS_BIGENDIAN
|
||||
#define GET_LMASK(v) ((v) & 3)
|
||||
#else
|
||||
@ -12,21 +14,21 @@ void glue(do_lwl, MEMSUFFIX) (uint32_t tmp)
|
||||
|
||||
switch (GET_LMASK(T0)) {
|
||||
case 0:
|
||||
T0 = tmp;
|
||||
T0 = (int32_t)tmp;
|
||||
break;
|
||||
case 1:
|
||||
T0 = (tmp << 8) | (T1 & 0x000000FF);
|
||||
T0 = (int32_t)((tmp << 8) | (T1 & 0x000000FF));
|
||||
break;
|
||||
case 2:
|
||||
T0 = (tmp << 16) | (T1 & 0x0000FFFF);
|
||||
T0 = (int32_t)((tmp << 16) | (T1 & 0x0000FFFF));
|
||||
break;
|
||||
case 3:
|
||||
T0 = (tmp << 24) | (T1 & 0x00FFFFFF);
|
||||
T0 = (int32_t)((tmp << 24) | (T1 & 0x00FFFFFF));
|
||||
break;
|
||||
}
|
||||
#if defined (DEBUG_OP)
|
||||
if (logfile) {
|
||||
fprintf(logfile, "%s: %08x - %08x %08x => %08x\n",
|
||||
fprintf(logfile, "%s: " TLSZ " - %08x " TLSZ " => " TLSZ "\n",
|
||||
__func__, sav, tmp, T1, T0);
|
||||
}
|
||||
#endif
|
||||
@ -41,21 +43,21 @@ void glue(do_lwr, MEMSUFFIX) (uint32_t tmp)
|
||||
|
||||
switch (GET_LMASK(T0)) {
|
||||
case 0:
|
||||
T0 = (tmp >> 24) | (T1 & 0xFFFFFF00);
|
||||
T0 = (int32_t)((tmp >> 24) | (T1 & 0xFFFFFF00));
|
||||
break;
|
||||
case 1:
|
||||
T0 = (tmp >> 16) | (T1 & 0xFFFF0000);
|
||||
T0 = (int32_t)((tmp >> 16) | (T1 & 0xFFFF0000));
|
||||
break;
|
||||
case 2:
|
||||
T0 = (tmp >> 8) | (T1 & 0xFF000000);
|
||||
T0 = (int32_t)((tmp >> 8) | (T1 & 0xFF000000));
|
||||
break;
|
||||
case 3:
|
||||
T0 = tmp;
|
||||
T0 = (int32_t)tmp;
|
||||
break;
|
||||
}
|
||||
#if defined (DEBUG_OP)
|
||||
if (logfile) {
|
||||
fprintf(logfile, "%s: %08x - %08x %08x => %08x\n",
|
||||
fprintf(logfile, "%s: " TLSZ " - %08x " TLSZ " => " TLSZ "\n",
|
||||
__func__, sav, tmp, T1, T0);
|
||||
}
|
||||
#endif
|
||||
@ -70,21 +72,21 @@ uint32_t glue(do_swl, MEMSUFFIX) (uint32_t tmp)
|
||||
|
||||
switch (GET_LMASK(T0)) {
|
||||
case 0:
|
||||
tmp = T1;
|
||||
tmp = (int32_t)T1;
|
||||
break;
|
||||
case 1:
|
||||
tmp = (tmp & 0xFF000000) | (T1 >> 8);
|
||||
tmp = (int32_t)((tmp & 0xFF000000) | ((uint32_t)T1 >> 8));
|
||||
break;
|
||||
case 2:
|
||||
tmp = (tmp & 0xFFFF0000) | (T1 >> 16);
|
||||
tmp = (int32_t)((tmp & 0xFFFF0000) | ((uint32_t)T1 >> 16));
|
||||
break;
|
||||
case 3:
|
||||
tmp = (tmp & 0xFFFFFF00) | (T1 >> 24);
|
||||
tmp = (int32_t)((tmp & 0xFFFFFF00) | ((uint32_t)T1 >> 24));
|
||||
break;
|
||||
}
|
||||
#if defined (DEBUG_OP)
|
||||
if (logfile) {
|
||||
fprintf(logfile, "%s: %08x - %08x %08x => %08x\n",
|
||||
fprintf(logfile, "%s: " TLSZ " - " TLSZ " " TLSZ " => %08x\n",
|
||||
__func__, T0, sav, T1, tmp);
|
||||
}
|
||||
#endif
|
||||
@ -100,21 +102,21 @@ uint32_t glue(do_swr, MEMSUFFIX) (uint32_t tmp)
|
||||
|
||||
switch (GET_LMASK(T0)) {
|
||||
case 0:
|
||||
tmp = (tmp & 0x00FFFFFF) | (T1 << 24);
|
||||
tmp = (int32_t)((tmp & 0x00FFFFFF) | (T1 << 24));
|
||||
break;
|
||||
case 1:
|
||||
tmp = (tmp & 0x0000FFFF) | (T1 << 16);
|
||||
tmp = (int32_t)((tmp & 0x0000FFFF) | (T1 << 16));
|
||||
break;
|
||||
case 2:
|
||||
tmp = (tmp & 0x000000FF) | (T1 << 8);
|
||||
tmp = (int32_t)((tmp & 0x000000FF) | (T1 << 8));
|
||||
break;
|
||||
case 3:
|
||||
tmp = T1;
|
||||
tmp = (int32_t)T1;
|
||||
break;
|
||||
}
|
||||
#if defined (DEBUG_OP)
|
||||
if (logfile) {
|
||||
fprintf(logfile, "%s: %08x - %08x %08x => %08x\n",
|
||||
fprintf(logfile, "%s: " TLSZ " - " TLSZ " " TLSZ " => %08x\n",
|
||||
__func__, T0, sav, T1, tmp);
|
||||
}
|
||||
#endif
|
||||
@ -164,7 +166,7 @@ void glue(do_ldl, MEMSUFFIX) (uint64_t tmp)
|
||||
}
|
||||
#if defined (DEBUG_OP)
|
||||
if (logfile) {
|
||||
fprintf(logfile, "%s: %08x - %08x %08x => %08x\n",
|
||||
fprintf(logfile, "%s: " TLSZ " - " TLSZ " " TLSZ " => " TLSZ "\n",
|
||||
__func__, sav, tmp, T1, T0);
|
||||
}
|
||||
#endif
|
||||
@ -205,7 +207,7 @@ void glue(do_ldr, MEMSUFFIX) (uint64_t tmp)
|
||||
}
|
||||
#if defined (DEBUG_OP)
|
||||
if (logfile) {
|
||||
fprintf(logfile, "%s: %08x - %08x %08x => %08x\n",
|
||||
fprintf(logfile, "%s: " TLSZ " - " TLSZ " " TLSZ " => " TLSZ "\n",
|
||||
__func__, sav, tmp, T1, T0);
|
||||
}
|
||||
#endif
|
||||
@ -246,7 +248,7 @@ uint64_t glue(do_sdl, MEMSUFFIX) (uint64_t tmp)
|
||||
}
|
||||
#if defined (DEBUG_OP)
|
||||
if (logfile) {
|
||||
fprintf(logfile, "%s: %08x - %08x %08x => %08x\n",
|
||||
fprintf(logfile, "%s: " TLSZ " - " TLSZ " " TLSZ " => " TLSZ "\n",
|
||||
__func__, T0, sav, T1, tmp);
|
||||
}
|
||||
#endif
|
||||
@ -288,7 +290,7 @@ uint64_t glue(do_sdr, MEMSUFFIX) (uint64_t tmp)
|
||||
}
|
||||
#if defined (DEBUG_OP)
|
||||
if (logfile) {
|
||||
fprintf(logfile, "%s: %08x - %08x %08x => %08x\n",
|
||||
fprintf(logfile, "%s: " TLSZ " - " TLSZ " " TLSZ " => " TLSZ "\n",
|
||||
__func__, T0, sav, T1, tmp);
|
||||
}
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user