2004-01-05 01:58:38 +03:00
|
|
|
void glue(do_lsw, MEMSUFFIX) (int dst)
|
|
|
|
{
|
|
|
|
uint32_t tmp;
|
|
|
|
int sh;
|
|
|
|
|
2005-06-05 02:19:46 +04:00
|
|
|
#if 0
|
2005-06-05 18:38:00 +04:00
|
|
|
if (loglevel > 0) {
|
|
|
|
fprintf(logfile, "%s: addr=0x%08x count=%d reg=%d\n",
|
|
|
|
__func__, T0, T1, dst);
|
|
|
|
}
|
2005-06-05 02:19:46 +04:00
|
|
|
#endif
|
2004-01-05 01:58:38 +03:00
|
|
|
for (; T1 > 3; T1 -= 4, T0 += 4) {
|
2005-01-04 02:43:32 +03:00
|
|
|
ugpr(dst++) = glue(ldl, MEMSUFFIX)(T0);
|
2004-01-05 01:58:38 +03:00
|
|
|
if (dst == 32)
|
|
|
|
dst = 0;
|
|
|
|
}
|
|
|
|
if (T1 > 0) {
|
|
|
|
tmp = 0;
|
|
|
|
for (sh = 24; T1 > 0; T1--, T0++, sh -= 8) {
|
2005-01-04 02:43:32 +03:00
|
|
|
tmp |= glue(ldub, MEMSUFFIX)(T0) << sh;
|
2004-01-05 01:58:38 +03:00
|
|
|
}
|
|
|
|
ugpr(dst) = tmp;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void glue(do_stsw, MEMSUFFIX) (int src)
|
|
|
|
{
|
|
|
|
int sh;
|
|
|
|
|
2005-06-05 02:19:46 +04:00
|
|
|
#if 0
|
2005-06-05 18:38:00 +04:00
|
|
|
if (loglevel > 0) {
|
|
|
|
fprintf(logfile, "%s: addr=0x%08x count=%d reg=%d\n",
|
|
|
|
__func__, T0, T1, src);
|
|
|
|
}
|
2005-06-05 02:19:46 +04:00
|
|
|
#endif
|
2004-01-05 01:58:38 +03:00
|
|
|
for (; T1 > 3; T1 -= 4, T0 += 4) {
|
2005-01-04 02:43:32 +03:00
|
|
|
glue(stl, MEMSUFFIX)(T0, ugpr(src++));
|
2004-01-05 01:58:38 +03:00
|
|
|
if (src == 32)
|
|
|
|
src = 0;
|
|
|
|
}
|
|
|
|
if (T1 > 0) {
|
|
|
|
for (sh = 24; T1 > 0; T1--, T0++, sh -= 8)
|
2005-01-04 02:43:32 +03:00
|
|
|
glue(stb, MEMSUFFIX)(T0, (ugpr(src) >> sh) & 0xFF);
|
2004-01-05 01:58:38 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-04-23 22:16:07 +04:00
|
|
|
void glue(do_lsw_le, MEMSUFFIX) (int dst)
|
|
|
|
{
|
|
|
|
uint32_t tmp;
|
|
|
|
int sh;
|
|
|
|
|
2005-06-05 02:19:46 +04:00
|
|
|
#if 0
|
2005-06-05 18:38:00 +04:00
|
|
|
if (loglevel > 0) {
|
2005-04-23 22:16:07 +04:00
|
|
|
fprintf(logfile, "%s: addr=0x%08x count=%d reg=%d\n",
|
|
|
|
__func__, T0, T1, dst);
|
2005-06-05 18:38:00 +04:00
|
|
|
}
|
2005-06-05 02:19:46 +04:00
|
|
|
#endif
|
2005-04-23 22:16:07 +04:00
|
|
|
for (; T1 > 3; T1 -= 4, T0 += 4) {
|
|
|
|
tmp = glue(ldl, MEMSUFFIX)(T0);
|
|
|
|
ugpr(dst++) = ((tmp & 0xFF000000) >> 24) | ((tmp & 0x00FF0000) >> 8) |
|
|
|
|
((tmp & 0x0000FF00) << 8) | ((tmp & 0x000000FF) << 24);
|
|
|
|
if (dst == 32)
|
|
|
|
dst = 0;
|
|
|
|
}
|
|
|
|
if (T1 > 0) {
|
|
|
|
tmp = 0;
|
|
|
|
for (sh = 0; T1 > 0; T1--, T0++, sh += 8) {
|
|
|
|
tmp |= glue(ldub, MEMSUFFIX)(T0) << sh;
|
|
|
|
}
|
|
|
|
ugpr(dst) = tmp;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void glue(do_stsw_le, MEMSUFFIX) (int src)
|
|
|
|
{
|
|
|
|
uint32_t tmp;
|
|
|
|
int sh;
|
|
|
|
|
2005-06-05 02:19:46 +04:00
|
|
|
#if 0
|
2005-06-05 18:38:00 +04:00
|
|
|
if (loglevel > 0) {
|
2005-04-23 22:16:07 +04:00
|
|
|
fprintf(logfile, "%s: addr=0x%08x count=%d reg=%d\n",
|
|
|
|
__func__, T0, T1, src);
|
2005-06-05 18:38:00 +04:00
|
|
|
}
|
2005-06-05 02:19:46 +04:00
|
|
|
#endif
|
2005-04-23 22:16:07 +04:00
|
|
|
for (; T1 > 3; T1 -= 4, T0 += 4) {
|
|
|
|
tmp = ((ugpr(src++) & 0xFF000000) >> 24);
|
|
|
|
tmp |= ((ugpr(src++) & 0x00FF0000) >> 8);
|
|
|
|
tmp |= ((ugpr(src++) & 0x0000FF00) << 8);
|
|
|
|
tmp |= ((ugpr(src++) & 0x000000FF) << 24);
|
|
|
|
glue(stl, MEMSUFFIX)(T0, tmp);
|
|
|
|
if (src == 32)
|
|
|
|
src = 0;
|
|
|
|
}
|
|
|
|
if (T1 > 0) {
|
|
|
|
for (sh = 0; T1 > 0; T1--, T0++, sh += 8)
|
|
|
|
glue(stb, MEMSUFFIX)(T0, (ugpr(src) >> sh) & 0xFF);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-01-05 01:58:38 +03:00
|
|
|
#undef MEMSUFFIX
|