root / target-ppc / op_helper_mem.h @ afc7df11
History | View | Annotate | Download (1007 Bytes)
1 |
void glue(do_lsw, MEMSUFFIX) (int dst) |
---|---|
2 |
{ |
3 |
uint32_t tmp; |
4 |
int sh;
|
5 |
|
6 |
if (loglevel > 0) { |
7 |
fprintf(logfile, "%s: addr=0x%08x count=%d reg=%d\n",
|
8 |
__func__, T0, T1, dst); |
9 |
} |
10 |
for (; T1 > 3; T1 -= 4, T0 += 4) { |
11 |
ugpr(dst++) = glue(ldl, MEMSUFFIX)(T0); |
12 |
if (dst == 32) |
13 |
dst = 0;
|
14 |
} |
15 |
if (T1 > 0) { |
16 |
tmp = 0;
|
17 |
for (sh = 24; T1 > 0; T1--, T0++, sh -= 8) { |
18 |
tmp |= glue(ldub, MEMSUFFIX)(T0) << sh; |
19 |
} |
20 |
ugpr(dst) = tmp; |
21 |
} |
22 |
} |
23 |
|
24 |
void glue(do_stsw, MEMSUFFIX) (int src) |
25 |
{ |
26 |
int sh;
|
27 |
|
28 |
if (loglevel > 0) { |
29 |
fprintf(logfile, "%s: addr=0x%08x count=%d reg=%d\n",
|
30 |
__func__, T0, T1, src); |
31 |
} |
32 |
for (; T1 > 3; T1 -= 4, T0 += 4) { |
33 |
glue(stl, MEMSUFFIX)(T0, ugpr(src++)); |
34 |
if (src == 32) |
35 |
src = 0;
|
36 |
} |
37 |
if (T1 > 0) { |
38 |
for (sh = 24; T1 > 0; T1--, T0++, sh -= 8) |
39 |
glue(stb, MEMSUFFIX)(T0, (ugpr(src) >> sh) & 0xFF);
|
40 |
} |
41 |
} |
42 |
|
43 |
#undef MEMSUFFIX
|