Revision ac9eb073 target-ppc/op_mem.h

b/target-ppc/op_mem.h
2 2
void glue(do_lsw, MEMSUFFIX) (int dst);
3 3
void glue(do_stsw, MEMSUFFIX) (int src);
4 4

  
5
/* Internal helpers for sign extension and byte-reverse */
6
static inline uint32_t glue(_ld16x, MEMSUFFIX) (void *EA, int type)
5
static inline uint16_t glue(ld16r, MEMSUFFIX) (void *EA)
7 6
{
8
    return s_ext16(glue(_lduw, MEMSUFFIX)(EA, type));
9
}
10

  
11
static inline uint16_t glue(_ld16r, MEMSUFFIX) (void *EA, int type)
12
{
13
    uint16_t tmp = glue(_lduw, MEMSUFFIX)(EA, type);
7
    uint16_t tmp = glue(lduw, MEMSUFFIX)(EA);
14 8
    return ((tmp & 0xFF00) >> 8) | ((tmp & 0x00FF) << 8);
15 9
}
16 10

  
17
static inline uint32_t glue(_ld32r, MEMSUFFIX) (void *EA, int type)
11
static inline uint32_t glue(ld32r, MEMSUFFIX) (void *EA)
18 12
{
19
    uint32_t tmp = glue(_ldl, MEMSUFFIX)(EA, type);
13
    uint32_t tmp = glue(ldl, MEMSUFFIX)(EA);
20 14
    return ((tmp & 0xFF000000) >> 24) | ((tmp & 0x00FF0000) >> 8) |
21 15
        ((tmp & 0x0000FF00) << 8) | ((tmp & 0x000000FF) << 24);
22 16
}
23 17

  
24
static inline void glue(_st16r, MEMSUFFIX) (void *EA, uint16_t data, int type)
18
static inline void glue(st16r, MEMSUFFIX) (void *EA, uint16_t data)
25 19
{
26 20
    uint16_t tmp = ((data & 0xFF00) >> 8) | ((data & 0x00FF) << 8);
27
    glue(_stw, MEMSUFFIX)(EA, tmp, type);
21
    glue(stw, MEMSUFFIX)(EA, tmp);
28 22
}
29 23

  
30
static inline void glue(_st32r, MEMSUFFIX) (void *EA, uint32_t data, int type)
24
static inline void glue(st32r, MEMSUFFIX) (void *EA, uint32_t data)
31 25
{
32 26
    uint32_t tmp = ((data & 0xFF000000) >> 24) | ((data & 0x00FF0000) >> 8) |
33 27
        ((data & 0x0000FF00) << 8) | ((data & 0x000000FF) << 24);
34
    glue(_stl, MEMSUFFIX)(EA, tmp, type);
28
    glue(stl, MEMSUFFIX)(EA, tmp);
35 29
}
36 30

  
37 31
/***                             Integer load                              ***/
38 32
#define PPC_LD_OP(name, op)                                                   \
39 33
PPC_OP(glue(glue(l, name), MEMSUFFIX))                                        \
40 34
{                                                                             \
41
    T1 = glue(op, MEMSUFFIX)((void *)T0, ACCESS_INT);                         \
35
    T1 = glue(op, MEMSUFFIX)((void *)T0);                                     \
42 36
    RETURN();                                                                 \
43 37
}
44 38

  
45 39
#define PPC_ST_OP(name, op)                                                   \
46 40
PPC_OP(glue(glue(st, name), MEMSUFFIX))                                       \
47 41
{                                                                             \
48
    glue(op, MEMSUFFIX)((void *)T0, T1, ACCESS_INT);                          \
42
    glue(op, MEMSUFFIX)((void *)T0, T1);                                      \
49 43
    RETURN();                                                                 \
50 44
}
51 45

  
52
PPC_LD_OP(bz, _ldub);
53
PPC_LD_OP(ha, _ld16x);
54
PPC_LD_OP(hz, _lduw);
55
PPC_LD_OP(wz, _ldl);
46
PPC_LD_OP(bz, ldub);
47
PPC_LD_OP(ha, ldsw);
48
PPC_LD_OP(hz, lduw);
49
PPC_LD_OP(wz, ldl);
56 50

  
57 51
/***                              Integer store                            ***/
58
PPC_ST_OP(b, _stb);
59
PPC_ST_OP(h, _stw);
60
PPC_ST_OP(w, _stl);
52
PPC_ST_OP(b, stb);
53
PPC_ST_OP(h, stw);
54
PPC_ST_OP(w, stl);
61 55

  
62 56
/***                Integer load and store with byte reverse               ***/
63
PPC_LD_OP(hbr, _ld16r);
64
PPC_LD_OP(wbr, _ld32r);
65
PPC_ST_OP(hbr, _st16r);
66
PPC_ST_OP(wbr, _st32r);
57
PPC_LD_OP(hbr, ld16r);
58
PPC_LD_OP(wbr, ld32r);
59
PPC_ST_OP(hbr, st16r);
60
PPC_ST_OP(wbr, st32r);
67 61

  
68 62
/***                    Integer load and store multiple                    ***/
69 63
PPC_OP(glue(lmw, MEMSUFFIX))
......
71 65
    int dst = PARAM(1);
72 66

  
73 67
    for (; dst < 32; dst++, T0 += 4) {
74
        ugpr(dst) = glue(_ldl, MEMSUFFIX)((void *)T0, ACCESS_INT);
68
        ugpr(dst) = glue(ldl, MEMSUFFIX)((void *)T0);
75 69
    }
76 70
    RETURN();
77 71
}
......
81 75
    int src = PARAM(1);
82 76

  
83 77
    for (; src < 32; src++, T0 += 4) {
84
        glue(_stl, MEMSUFFIX)((void *)T0, ugpr(src), ACCESS_INT);
78
        glue(stl, MEMSUFFIX)((void *)T0, ugpr(src));
85 79
    }
86 80
    RETURN();
87 81
}
......
150 144
        if (regs->reserve != T0) {
151 145
            env->crf[0] = xer_ov;
152 146
        } else {
153
            glue(_stl, MEMSUFFIX)((void *)T0, T1, ACCESS_RES);
147
            glue(stl, MEMSUFFIX)((void *)T0, T1);
154 148
            env->crf[0] = xer_ov | 0x02;
155 149
        }
156 150
    }
......
160 154

  
161 155
PPC_OP(glue(dcbz, MEMSUFFIX))
162 156
{
163
    glue(_stl, MEMSUFFIX)((void *)(T0 + 0x00), 0, ACCESS_INT);
164
    glue(_stl, MEMSUFFIX)((void *)(T0 + 0x04), 0, ACCESS_INT);
165
    glue(_stl, MEMSUFFIX)((void *)(T0 + 0x08), 0, ACCESS_INT);
166
    glue(_stl, MEMSUFFIX)((void *)(T0 + 0x0C), 0, ACCESS_INT);
167
    glue(_stl, MEMSUFFIX)((void *)(T0 + 0x10), 0, ACCESS_INT);
168
    glue(_stl, MEMSUFFIX)((void *)(T0 + 0x14), 0, ACCESS_INT);
169
    glue(_stl, MEMSUFFIX)((void *)(T0 + 0x18), 0, ACCESS_INT);
170
    glue(_stl, MEMSUFFIX)((void *)(T0 + 0x1C), 0, ACCESS_INT);
157
    glue(stl, MEMSUFFIX)((void *)(T0 + 0x00), 0);
158
    glue(stl, MEMSUFFIX)((void *)(T0 + 0x04), 0);
159
    glue(stl, MEMSUFFIX)((void *)(T0 + 0x08), 0);
160
    glue(stl, MEMSUFFIX)((void *)(T0 + 0x0C), 0);
161
    glue(stl, MEMSUFFIX)((void *)(T0 + 0x10), 0);
162
    glue(stl, MEMSUFFIX)((void *)(T0 + 0x14), 0);
163
    glue(stl, MEMSUFFIX)((void *)(T0 + 0x18), 0);
164
    glue(stl, MEMSUFFIX)((void *)(T0 + 0x1C), 0);
171 165
    RETURN();
172 166
}
173 167

  
174 168
/* External access */
175 169
PPC_OP(glue(eciwx, MEMSUFFIX))
176 170
{
177
    T1 = glue(_ldl, MEMSUFFIX)((void *)T0, ACCESS_EXT);
171
    T1 = glue(ldl, MEMSUFFIX)((void *)T0);
178 172
    RETURN();
179 173
}
180 174

  
181 175
PPC_OP(glue(ecowx, MEMSUFFIX))
182 176
{
183
    glue(_stl, MEMSUFFIX)((void *)T0, T1, ACCESS_EXT);
177
    glue(stl, MEMSUFFIX)((void *)T0, T1);
184 178
    RETURN();
185 179
}
186 180

  

Also available in: Unified diff