Add missing FORCE_RET()
[qemu/mini2440.git] / target-ppc / op_helper_mem.h
blobfb90691f2ba2739b83ac1fcc80f23f38d3faa1c9
1 void glue(do_lsw, MEMSUFFIX) (int dst)
3 uint32_t tmp;
4 int sh;
6 #if 0
7 if (loglevel > 0) {
8 fprintf(logfile, "%s: addr=0x%08x count=%d reg=%d\n",
9 __func__, T0, T1, dst);
11 #endif
12 for (; T1 > 3; T1 -= 4, T0 += 4) {
13 ugpr(dst++) = glue(ldl, MEMSUFFIX)(T0);
14 if (dst == 32)
15 dst = 0;
17 if (T1 > 0) {
18 tmp = 0;
19 for (sh = 24; T1 > 0; T1--, T0++, sh -= 8) {
20 tmp |= glue(ldub, MEMSUFFIX)(T0) << sh;
22 ugpr(dst) = tmp;
26 void glue(do_stsw, MEMSUFFIX) (int src)
28 int sh;
30 #if 0
31 if (loglevel > 0) {
32 fprintf(logfile, "%s: addr=0x%08x count=%d reg=%d\n",
33 __func__, T0, T1, src);
35 #endif
36 for (; T1 > 3; T1 -= 4, T0 += 4) {
37 glue(stl, MEMSUFFIX)(T0, ugpr(src++));
38 if (src == 32)
39 src = 0;
41 if (T1 > 0) {
42 for (sh = 24; T1 > 0; T1--, T0++, sh -= 8)
43 glue(stb, MEMSUFFIX)(T0, (ugpr(src) >> sh) & 0xFF);
47 void glue(do_lsw_le, MEMSUFFIX) (int dst)
49 uint32_t tmp;
50 int sh;
52 #if 0
53 if (loglevel > 0) {
54 fprintf(logfile, "%s: addr=0x%08x count=%d reg=%d\n",
55 __func__, T0, T1, dst);
57 #endif
58 for (; T1 > 3; T1 -= 4, T0 += 4) {
59 tmp = glue(ldl, MEMSUFFIX)(T0);
60 ugpr(dst++) = ((tmp & 0xFF000000) >> 24) | ((tmp & 0x00FF0000) >> 8) |
61 ((tmp & 0x0000FF00) << 8) | ((tmp & 0x000000FF) << 24);
62 if (dst == 32)
63 dst = 0;
65 if (T1 > 0) {
66 tmp = 0;
67 for (sh = 0; T1 > 0; T1--, T0++, sh += 8) {
68 tmp |= glue(ldub, MEMSUFFIX)(T0) << sh;
70 ugpr(dst) = tmp;
74 void glue(do_stsw_le, MEMSUFFIX) (int src)
76 uint32_t tmp;
77 int sh;
79 #if 0
80 if (loglevel > 0) {
81 fprintf(logfile, "%s: addr=0x%08x count=%d reg=%d\n",
82 __func__, T0, T1, src);
84 #endif
85 for (; T1 > 3; T1 -= 4, T0 += 4) {
86 tmp = ((ugpr(src++) & 0xFF000000) >> 24);
87 tmp |= ((ugpr(src++) & 0x00FF0000) >> 8);
88 tmp |= ((ugpr(src++) & 0x0000FF00) << 8);
89 tmp |= ((ugpr(src++) & 0x000000FF) << 24);
90 glue(stl, MEMSUFFIX)(T0, tmp);
91 if (src == 32)
92 src = 0;
94 if (T1 > 0) {
95 for (sh = 0; T1 > 0; T1--, T0++, sh += 8)
96 glue(stb, MEMSUFFIX)(T0, (ugpr(src) >> sh) & 0xFF);
100 #undef MEMSUFFIX