Statistics
| Branch: | Revision:

root / target-mips / op_mem.c @ aa343735

History | View | Annotate | Download (9.7 kB)

1 6af0bf9c bellard
/*
2 6af0bf9c bellard
 *  MIPS emulation memory micro-operations for qemu.
3 5fafdf24 ths
 *
4 6af0bf9c bellard
 *  Copyright (c) 2004-2005 Jocelyn Mayer
5 6af0bf9c bellard
 *
6 6af0bf9c bellard
 * This library is free software; you can redistribute it and/or
7 6af0bf9c bellard
 * modify it under the terms of the GNU Lesser General Public
8 6af0bf9c bellard
 * License as published by the Free Software Foundation; either
9 6af0bf9c bellard
 * version 2 of the License, or (at your option) any later version.
10 6af0bf9c bellard
 *
11 6af0bf9c bellard
 * This library is distributed in the hope that it will be useful,
12 6af0bf9c bellard
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 6af0bf9c bellard
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 6af0bf9c bellard
 * Lesser General Public License for more details.
15 6af0bf9c bellard
 *
16 6af0bf9c bellard
 * You should have received a copy of the GNU Lesser General Public
17 6af0bf9c bellard
 * License along with this library; if not, write to the Free Software
18 6af0bf9c bellard
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19 6af0bf9c bellard
 */
20 6af0bf9c bellard
21 6af0bf9c bellard
/* Standard loads and stores */
22 6af0bf9c bellard
void glue(op_lb, MEMSUFFIX) (void)
23 6af0bf9c bellard
{
24 6af0bf9c bellard
    T0 = glue(ldsb, MEMSUFFIX)(T0);
25 6af0bf9c bellard
    RETURN();
26 6af0bf9c bellard
}
27 6af0bf9c bellard
28 6af0bf9c bellard
void glue(op_lbu, MEMSUFFIX) (void)
29 6af0bf9c bellard
{
30 6af0bf9c bellard
    T0 = glue(ldub, MEMSUFFIX)(T0);
31 6af0bf9c bellard
    RETURN();
32 6af0bf9c bellard
}
33 6af0bf9c bellard
34 6af0bf9c bellard
void glue(op_sb, MEMSUFFIX) (void)
35 6af0bf9c bellard
{
36 6af0bf9c bellard
    glue(stb, MEMSUFFIX)(T0, T1);
37 6af0bf9c bellard
    RETURN();
38 6af0bf9c bellard
}
39 6af0bf9c bellard
40 6af0bf9c bellard
void glue(op_lh, MEMSUFFIX) (void)
41 6af0bf9c bellard
{
42 6af0bf9c bellard
    T0 = glue(ldsw, MEMSUFFIX)(T0);
43 6af0bf9c bellard
    RETURN();
44 6af0bf9c bellard
}
45 6af0bf9c bellard
46 6af0bf9c bellard
void glue(op_lhu, MEMSUFFIX) (void)
47 6af0bf9c bellard
{
48 6af0bf9c bellard
    T0 = glue(lduw, MEMSUFFIX)(T0);
49 6af0bf9c bellard
    RETURN();
50 6af0bf9c bellard
}
51 6af0bf9c bellard
52 6af0bf9c bellard
void glue(op_sh, MEMSUFFIX) (void)
53 6af0bf9c bellard
{
54 6af0bf9c bellard
    glue(stw, MEMSUFFIX)(T0, T1);
55 6af0bf9c bellard
    RETURN();
56 6af0bf9c bellard
}
57 6af0bf9c bellard
58 6af0bf9c bellard
void glue(op_lw, MEMSUFFIX) (void)
59 6af0bf9c bellard
{
60 6af0bf9c bellard
    T0 = glue(ldl, MEMSUFFIX)(T0);
61 6af0bf9c bellard
    RETURN();
62 6af0bf9c bellard
}
63 6af0bf9c bellard
64 d796321b bellard
void glue(op_lwu, MEMSUFFIX) (void)
65 d796321b bellard
{
66 c811cf2c ths
    T0 = (uint32_t)glue(ldl, MEMSUFFIX)(T0);
67 d796321b bellard
    RETURN();
68 d796321b bellard
}
69 d796321b bellard
70 6af0bf9c bellard
void glue(op_sw, MEMSUFFIX) (void)
71 6af0bf9c bellard
{
72 6af0bf9c bellard
    glue(stl, MEMSUFFIX)(T0, T1);
73 6af0bf9c bellard
    RETURN();
74 6af0bf9c bellard
}
75 6af0bf9c bellard
76 4ad40f36 bellard
/* "half" load and stores.  We must do the memory access inline,
77 4ad40f36 bellard
   or fault handling won't work.  */
78 4e9f8537 ths
79 4e9f8537 ths
#ifdef TARGET_WORDS_BIGENDIAN
80 4e9f8537 ths
#define GET_LMASK(v) ((v) & 3)
81 4e9f8537 ths
#define GET_OFFSET(addr, offset) (addr + (offset))
82 4e9f8537 ths
#else
83 4e9f8537 ths
#define GET_LMASK(v) (((v) & 3) ^ 3)
84 4e9f8537 ths
#define GET_OFFSET(addr, offset) (addr - (offset))
85 4e9f8537 ths
#endif
86 4e9f8537 ths
87 6af0bf9c bellard
void glue(op_lwl, MEMSUFFIX) (void)
88 6af0bf9c bellard
{
89 4e9f8537 ths
    target_ulong tmp;
90 4e9f8537 ths
91 4e9f8537 ths
    tmp = glue(ldub, MEMSUFFIX)(T0);
92 4e9f8537 ths
    T1 = (int32_t)((T1 & 0x00FFFFFF) | (tmp << 24));
93 4e9f8537 ths
94 4e9f8537 ths
    if (GET_LMASK(T0) <= 2) {
95 4e9f8537 ths
        tmp = glue(ldub, MEMSUFFIX)(GET_OFFSET(T0, 1));
96 4e9f8537 ths
        T1 = (T1 & 0xFF00FFFF) | (tmp << 16);
97 4e9f8537 ths
    }
98 4e9f8537 ths
99 4e9f8537 ths
    if (GET_LMASK(T0) <= 1) {
100 4e9f8537 ths
        tmp = glue(ldub, MEMSUFFIX)(GET_OFFSET(T0, 2));
101 4e9f8537 ths
        T1 = (T1 & 0xFFFF00FF) | (tmp << 8);
102 4e9f8537 ths
    }
103 4e9f8537 ths
104 4e9f8537 ths
    if (GET_LMASK(T0) == 0) {
105 4e9f8537 ths
        tmp = glue(ldub, MEMSUFFIX)(GET_OFFSET(T0, 3));
106 4e9f8537 ths
        T1 = (T1 & 0xFFFFFF00) | tmp;
107 4e9f8537 ths
    }
108 6af0bf9c bellard
    RETURN();
109 6af0bf9c bellard
}
110 6af0bf9c bellard
111 6af0bf9c bellard
void glue(op_lwr, MEMSUFFIX) (void)
112 6af0bf9c bellard
{
113 4e9f8537 ths
    target_ulong tmp;
114 4e9f8537 ths
115 4e9f8537 ths
    tmp = glue(ldub, MEMSUFFIX)(T0);
116 4e9f8537 ths
    T1 = (T1 & 0xFFFFFF00) | tmp;
117 4e9f8537 ths
118 4e9f8537 ths
    if (GET_LMASK(T0) >= 1) {
119 4e9f8537 ths
        tmp = glue(ldub, MEMSUFFIX)(GET_OFFSET(T0, -1));
120 4e9f8537 ths
        T1 = (T1 & 0xFFFF00FF) | (tmp << 8);
121 4e9f8537 ths
    }
122 4e9f8537 ths
123 4e9f8537 ths
    if (GET_LMASK(T0) >= 2) {
124 4e9f8537 ths
        tmp = glue(ldub, MEMSUFFIX)(GET_OFFSET(T0, -2));
125 4e9f8537 ths
        T1 = (T1 & 0xFF00FFFF) | (tmp << 16);
126 4e9f8537 ths
    }
127 4e9f8537 ths
128 4e9f8537 ths
    if (GET_LMASK(T0) == 3) {
129 4e9f8537 ths
        tmp = glue(ldub, MEMSUFFIX)(GET_OFFSET(T0, -3));
130 4e9f8537 ths
        T1 = (T1 & 0x00FFFFFF) | (tmp << 24);
131 4e9f8537 ths
    }
132 6af0bf9c bellard
    RETURN();
133 6af0bf9c bellard
}
134 6af0bf9c bellard
135 6af0bf9c bellard
void glue(op_swl, MEMSUFFIX) (void)
136 6af0bf9c bellard
{
137 4e9f8537 ths
    glue(stb, MEMSUFFIX)(T0, (uint8_t)(T1 >> 24));
138 4e9f8537 ths
139 4e9f8537 ths
    if (GET_LMASK(T0) <= 2)
140 4e9f8537 ths
        glue(stb, MEMSUFFIX)(GET_OFFSET(T0, 1), (uint8_t)(T1 >> 16));
141 4e9f8537 ths
142 4e9f8537 ths
    if (GET_LMASK(T0) <= 1)
143 4e9f8537 ths
        glue(stb, MEMSUFFIX)(GET_OFFSET(T0, 2), (uint8_t)(T1 >> 8));
144 4e9f8537 ths
145 4e9f8537 ths
    if (GET_LMASK(T0) == 0)
146 4e9f8537 ths
        glue(stb, MEMSUFFIX)(GET_OFFSET(T0, 3), (uint8_t)T1);
147 4e9f8537 ths
148 6af0bf9c bellard
    RETURN();
149 6af0bf9c bellard
}
150 6af0bf9c bellard
151 6af0bf9c bellard
void glue(op_swr, MEMSUFFIX) (void)
152 6af0bf9c bellard
{
153 4e9f8537 ths
    glue(stb, MEMSUFFIX)(T0, (uint8_t)T1);
154 4e9f8537 ths
155 4e9f8537 ths
    if (GET_LMASK(T0) >= 1)
156 4e9f8537 ths
        glue(stb, MEMSUFFIX)(GET_OFFSET(T0, -1), (uint8_t)(T1 >> 8));
157 4e9f8537 ths
158 4e9f8537 ths
    if (GET_LMASK(T0) >= 2)
159 4e9f8537 ths
        glue(stb, MEMSUFFIX)(GET_OFFSET(T0, -2), (uint8_t)(T1 >> 16));
160 4e9f8537 ths
161 4e9f8537 ths
    if (GET_LMASK(T0) == 3)
162 4e9f8537 ths
        glue(stb, MEMSUFFIX)(GET_OFFSET(T0, -3), (uint8_t)(T1 >> 24));
163 4e9f8537 ths
164 6af0bf9c bellard
    RETURN();
165 6af0bf9c bellard
}
166 6af0bf9c bellard
167 6af0bf9c bellard
void glue(op_ll, MEMSUFFIX) (void)
168 6af0bf9c bellard
{
169 6af0bf9c bellard
    T1 = T0;
170 6af0bf9c bellard
    T0 = glue(ldl, MEMSUFFIX)(T0);
171 6af0bf9c bellard
    env->CP0_LLAddr = T1;
172 6af0bf9c bellard
    RETURN();
173 6af0bf9c bellard
}
174 6af0bf9c bellard
175 6af0bf9c bellard
void glue(op_sc, MEMSUFFIX) (void)
176 6af0bf9c bellard
{
177 6af0bf9c bellard
    CALL_FROM_TB0(dump_sc);
178 62c5609a ths
    if (T0 & 0x3) {
179 62c5609a ths
        env->CP0_BadVAddr = T0;
180 62c5609a ths
        CALL_FROM_TB1(do_raise_exception, EXCP_AdES);
181 62c5609a ths
    }
182 6af0bf9c bellard
    if (T0 == env->CP0_LLAddr) {
183 6af0bf9c bellard
        glue(stl, MEMSUFFIX)(T0, T1);
184 6af0bf9c bellard
        T0 = 1;
185 6af0bf9c bellard
    } else {
186 6af0bf9c bellard
        T0 = 0;
187 6af0bf9c bellard
    }
188 6af0bf9c bellard
    RETURN();
189 6af0bf9c bellard
}
190 6ea83fed bellard
191 540635ba ths
#if defined(TARGET_MIPSN32) || defined(TARGET_MIPS64)
192 c570fd16 ths
void glue(op_ld, MEMSUFFIX) (void)
193 c570fd16 ths
{
194 c570fd16 ths
    T0 = glue(ldq, MEMSUFFIX)(T0);
195 c570fd16 ths
    RETURN();
196 c570fd16 ths
}
197 c570fd16 ths
198 c570fd16 ths
void glue(op_sd, MEMSUFFIX) (void)
199 c570fd16 ths
{
200 c570fd16 ths
    glue(stq, MEMSUFFIX)(T0, T1);
201 c570fd16 ths
    RETURN();
202 c570fd16 ths
}
203 c570fd16 ths
204 c570fd16 ths
/* "half" load and stores.  We must do the memory access inline,
205 c570fd16 ths
   or fault handling won't work.  */
206 4e9f8537 ths
207 4e9f8537 ths
#ifdef TARGET_WORDS_BIGENDIAN
208 4e9f8537 ths
#define GET_LMASK64(v) ((v) & 7)
209 4e9f8537 ths
#else
210 4e9f8537 ths
#define GET_LMASK64(v) (((v) & 7) ^ 7)
211 4e9f8537 ths
#endif
212 4e9f8537 ths
213 c570fd16 ths
void glue(op_ldl, MEMSUFFIX) (void)
214 c570fd16 ths
{
215 4e9f8537 ths
    uint64_t tmp;
216 4e9f8537 ths
217 4e9f8537 ths
    tmp = glue(ldub, MEMSUFFIX)(T0);
218 4e9f8537 ths
    T1 = (T1 & 0x00FFFFFFFFFFFFFFULL) | (tmp << 56);
219 4e9f8537 ths
220 4e9f8537 ths
    if (GET_LMASK64(T0) <= 6) {
221 4e9f8537 ths
        tmp = glue(ldub, MEMSUFFIX)(GET_OFFSET(T0, 1));
222 4e9f8537 ths
        T1 = (T1 & 0xFF00FFFFFFFFFFFFULL) | (tmp << 48);
223 4e9f8537 ths
    }
224 4e9f8537 ths
225 4e9f8537 ths
    if (GET_LMASK64(T0) <= 5) {
226 4e9f8537 ths
        tmp = glue(ldub, MEMSUFFIX)(GET_OFFSET(T0, 2));
227 4e9f8537 ths
        T1 = (T1 & 0xFFFF00FFFFFFFFFFULL) | (tmp << 40);
228 4e9f8537 ths
    }
229 4e9f8537 ths
230 4e9f8537 ths
    if (GET_LMASK64(T0) <= 4) {
231 4e9f8537 ths
        tmp = glue(ldub, MEMSUFFIX)(GET_OFFSET(T0, 3));
232 4e9f8537 ths
        T1 = (T1 & 0xFFFFFF00FFFFFFFFULL) | (tmp << 32);
233 4e9f8537 ths
    }
234 4e9f8537 ths
235 4e9f8537 ths
    if (GET_LMASK64(T0) <= 3) {
236 4e9f8537 ths
        tmp = glue(ldub, MEMSUFFIX)(GET_OFFSET(T0, 4));
237 4e9f8537 ths
        T1 = (T1 & 0xFFFFFFFF00FFFFFFULL) | (tmp << 24);
238 4e9f8537 ths
    }
239 4e9f8537 ths
240 4e9f8537 ths
    if (GET_LMASK64(T0) <= 2) {
241 4e9f8537 ths
        tmp = glue(ldub, MEMSUFFIX)(GET_OFFSET(T0, 5));
242 4e9f8537 ths
        T1 = (T1 & 0xFFFFFFFFFF00FFFFULL) | (tmp << 16);
243 4e9f8537 ths
    }
244 4e9f8537 ths
245 4e9f8537 ths
    if (GET_LMASK64(T0) <= 1) {
246 4e9f8537 ths
        tmp = glue(ldub, MEMSUFFIX)(GET_OFFSET(T0, 6));
247 4e9f8537 ths
        T1 = (T1 & 0xFFFFFFFFFFFF00FFULL) | (tmp << 8);
248 4e9f8537 ths
    }
249 4e9f8537 ths
250 4e9f8537 ths
    if (GET_LMASK64(T0) == 0) {
251 4e9f8537 ths
        tmp = glue(ldub, MEMSUFFIX)(GET_OFFSET(T0, 7));
252 4e9f8537 ths
        T1 = (T1 & 0xFFFFFFFFFFFFFF00ULL) | tmp;
253 4e9f8537 ths
    }
254 4e9f8537 ths
255 c570fd16 ths
    RETURN();
256 c570fd16 ths
}
257 c570fd16 ths
258 c570fd16 ths
void glue(op_ldr, MEMSUFFIX) (void)
259 c570fd16 ths
{
260 4e9f8537 ths
    uint64_t tmp;
261 4e9f8537 ths
262 4e9f8537 ths
    tmp = glue(ldub, MEMSUFFIX)(T0);
263 4e9f8537 ths
    T1 = (T1 & 0xFFFFFFFFFFFFFF00ULL) | tmp;
264 4e9f8537 ths
265 4e9f8537 ths
    if (GET_LMASK64(T0) >= 1) {
266 4e9f8537 ths
        tmp = glue(ldub, MEMSUFFIX)(GET_OFFSET(T0, -1));
267 4e9f8537 ths
        T1 = (T1 & 0xFFFFFFFFFFFF00FFULL) | (tmp  << 8);
268 4e9f8537 ths
    }
269 4e9f8537 ths
270 4e9f8537 ths
    if (GET_LMASK64(T0) >= 2) {
271 4e9f8537 ths
        tmp = glue(ldub, MEMSUFFIX)(GET_OFFSET(T0, -2));
272 4e9f8537 ths
        T1 = (T1 & 0xFFFFFFFFFF00FFFFULL) | (tmp << 16);
273 4e9f8537 ths
    }
274 4e9f8537 ths
275 4e9f8537 ths
    if (GET_LMASK64(T0) >= 3) {
276 4e9f8537 ths
        tmp = glue(ldub, MEMSUFFIX)(GET_OFFSET(T0, -3));
277 4e9f8537 ths
        T1 = (T1 & 0xFFFFFFFF00FFFFFFULL) | (tmp << 24);
278 4e9f8537 ths
    }
279 4e9f8537 ths
280 4e9f8537 ths
    if (GET_LMASK64(T0) >= 4) {
281 4e9f8537 ths
        tmp = glue(ldub, MEMSUFFIX)(GET_OFFSET(T0, -4));
282 4e9f8537 ths
        T1 = (T1 & 0xFFFFFF00FFFFFFFFULL) | (tmp << 32);
283 4e9f8537 ths
    }
284 4e9f8537 ths
285 4e9f8537 ths
    if (GET_LMASK64(T0) >= 5) {
286 4e9f8537 ths
        tmp = glue(ldub, MEMSUFFIX)(GET_OFFSET(T0, -5));
287 4e9f8537 ths
        T1 = (T1 & 0xFFFF00FFFFFFFFFFULL) | (tmp << 40);
288 4e9f8537 ths
    }
289 4e9f8537 ths
290 4e9f8537 ths
    if (GET_LMASK64(T0) >= 6) {
291 4e9f8537 ths
        tmp = glue(ldub, MEMSUFFIX)(GET_OFFSET(T0, -6));
292 4e9f8537 ths
        T1 = (T1 & 0xFF00FFFFFFFFFFFFULL) | (tmp << 48);
293 4e9f8537 ths
    }
294 4e9f8537 ths
295 4e9f8537 ths
    if (GET_LMASK64(T0) == 7) {
296 4e9f8537 ths
        tmp = glue(ldub, MEMSUFFIX)(GET_OFFSET(T0, -7));
297 4e9f8537 ths
        T1 = (T1 & 0x00FFFFFFFFFFFFFFULL) | (tmp << 56);
298 4e9f8537 ths
    }
299 4e9f8537 ths
300 c570fd16 ths
    RETURN();
301 c570fd16 ths
}
302 c570fd16 ths
303 c570fd16 ths
void glue(op_sdl, MEMSUFFIX) (void)
304 c570fd16 ths
{
305 4e9f8537 ths
    glue(stb, MEMSUFFIX)(T0, (uint8_t)(T1 >> 56));
306 4e9f8537 ths
307 4e9f8537 ths
    if (GET_LMASK64(T0) <= 6)
308 4e9f8537 ths
        glue(stb, MEMSUFFIX)(GET_OFFSET(T0, 1), (uint8_t)(T1 >> 48));
309 4e9f8537 ths
310 4e9f8537 ths
    if (GET_LMASK64(T0) <= 5)
311 4e9f8537 ths
        glue(stb, MEMSUFFIX)(GET_OFFSET(T0, 2), (uint8_t)(T1 >> 40));
312 4e9f8537 ths
313 4e9f8537 ths
    if (GET_LMASK64(T0) <= 4)
314 4e9f8537 ths
        glue(stb, MEMSUFFIX)(GET_OFFSET(T0, 3), (uint8_t)(T1 >> 32));
315 4e9f8537 ths
316 4e9f8537 ths
    if (GET_LMASK64(T0) <= 3)
317 4e9f8537 ths
        glue(stb, MEMSUFFIX)(GET_OFFSET(T0, 4), (uint8_t)(T1 >> 24));
318 4e9f8537 ths
319 4e9f8537 ths
    if (GET_LMASK64(T0) <= 2)
320 4e9f8537 ths
        glue(stb, MEMSUFFIX)(GET_OFFSET(T0, 5), (uint8_t)(T1 >> 16));
321 4e9f8537 ths
322 4e9f8537 ths
    if (GET_LMASK64(T0) <= 1)
323 4e9f8537 ths
        glue(stb, MEMSUFFIX)(GET_OFFSET(T0, 6), (uint8_t)(T1 >> 8));
324 4e9f8537 ths
325 4e9f8537 ths
    if (GET_LMASK64(T0) <= 0)
326 4e9f8537 ths
        glue(stb, MEMSUFFIX)(GET_OFFSET(T0, 7), (uint8_t)T1);
327 4e9f8537 ths
328 c570fd16 ths
    RETURN();
329 c570fd16 ths
}
330 c570fd16 ths
331 c570fd16 ths
void glue(op_sdr, MEMSUFFIX) (void)
332 c570fd16 ths
{
333 4e9f8537 ths
    glue(stb, MEMSUFFIX)(T0, (uint8_t)T1);
334 4e9f8537 ths
335 4e9f8537 ths
    if (GET_LMASK64(T0) >= 1)
336 4e9f8537 ths
        glue(stb, MEMSUFFIX)(GET_OFFSET(T0, -1), (uint8_t)(T1 >> 8));
337 4e9f8537 ths
338 4e9f8537 ths
    if (GET_LMASK64(T0) >= 2)
339 4e9f8537 ths
        glue(stb, MEMSUFFIX)(GET_OFFSET(T0, -2), (uint8_t)(T1 >> 16));
340 4e9f8537 ths
341 4e9f8537 ths
    if (GET_LMASK64(T0) >= 3)
342 4e9f8537 ths
        glue(stb, MEMSUFFIX)(GET_OFFSET(T0, -3), (uint8_t)(T1 >> 24));
343 4e9f8537 ths
344 4e9f8537 ths
    if (GET_LMASK64(T0) >= 4)
345 4e9f8537 ths
        glue(stb, MEMSUFFIX)(GET_OFFSET(T0, -4), (uint8_t)(T1 >> 32));
346 4e9f8537 ths
347 4e9f8537 ths
    if (GET_LMASK64(T0) >= 5)
348 4e9f8537 ths
        glue(stb, MEMSUFFIX)(GET_OFFSET(T0, -5), (uint8_t)(T1 >> 40));
349 4e9f8537 ths
350 4e9f8537 ths
    if (GET_LMASK64(T0) >= 6)
351 4e9f8537 ths
        glue(stb, MEMSUFFIX)(GET_OFFSET(T0, -6), (uint8_t)(T1 >> 48));
352 4e9f8537 ths
353 4e9f8537 ths
    if (GET_LMASK64(T0) == 7)
354 4e9f8537 ths
        glue(stb, MEMSUFFIX)(GET_OFFSET(T0, -7), (uint8_t)(T1 >> 56));
355 4e9f8537 ths
356 c570fd16 ths
    RETURN();
357 c570fd16 ths
}
358 c570fd16 ths
359 c570fd16 ths
void glue(op_lld, MEMSUFFIX) (void)
360 c570fd16 ths
{
361 c570fd16 ths
    T1 = T0;
362 c570fd16 ths
    T0 = glue(ldq, MEMSUFFIX)(T0);
363 c570fd16 ths
    env->CP0_LLAddr = T1;
364 c570fd16 ths
    RETURN();
365 c570fd16 ths
}
366 c570fd16 ths
367 c570fd16 ths
void glue(op_scd, MEMSUFFIX) (void)
368 c570fd16 ths
{
369 c570fd16 ths
    CALL_FROM_TB0(dump_sc);
370 62c5609a ths
    if (T0 & 0x7) {
371 62c5609a ths
        env->CP0_BadVAddr = T0;
372 62c5609a ths
        CALL_FROM_TB1(do_raise_exception, EXCP_AdES);
373 62c5609a ths
    }
374 c570fd16 ths
    if (T0 == env->CP0_LLAddr) {
375 c570fd16 ths
        glue(stq, MEMSUFFIX)(T0, T1);
376 c570fd16 ths
        T0 = 1;
377 c570fd16 ths
    } else {
378 c570fd16 ths
        T0 = 0;
379 c570fd16 ths
    }
380 c570fd16 ths
    RETURN();
381 c570fd16 ths
}
382 540635ba ths
#endif /* TARGET_MIPSN32 || TARGET_MIPS64 */
383 c570fd16 ths
384 6ea83fed bellard
void glue(op_lwc1, MEMSUFFIX) (void)
385 6ea83fed bellard
{
386 6ea83fed bellard
    WT0 = glue(ldl, MEMSUFFIX)(T0);
387 6ea83fed bellard
    RETURN();
388 6ea83fed bellard
}
389 6ea83fed bellard
void glue(op_swc1, MEMSUFFIX) (void)
390 6ea83fed bellard
{
391 6ea83fed bellard
    glue(stl, MEMSUFFIX)(T0, WT0);
392 6ea83fed bellard
    RETURN();
393 6ea83fed bellard
}
394 6ea83fed bellard
void glue(op_ldc1, MEMSUFFIX) (void)
395 6ea83fed bellard
{
396 6ea83fed bellard
    DT0 = glue(ldq, MEMSUFFIX)(T0);
397 6ea83fed bellard
    RETURN();
398 6ea83fed bellard
}
399 6ea83fed bellard
void glue(op_sdc1, MEMSUFFIX) (void)
400 6ea83fed bellard
{
401 6ea83fed bellard
    glue(stq, MEMSUFFIX)(T0, DT0);
402 6ea83fed bellard
    RETURN();
403 6ea83fed bellard
}
404 5a5012ec ths
void glue(op_luxc1, MEMSUFFIX) (void)
405 5a5012ec ths
{
406 93b12ccc ths
    DT0 = glue(ldq, MEMSUFFIX)(T0 & ~0x7);
407 5a5012ec ths
    RETURN();
408 5a5012ec ths
}
409 5a5012ec ths
void glue(op_suxc1, MEMSUFFIX) (void)
410 5a5012ec ths
{
411 93b12ccc ths
    glue(stq, MEMSUFFIX)(T0 & ~0x7, DT0);
412 5a5012ec ths
    RETURN();
413 5a5012ec ths
}