2463
by j_mayer
Great PowerPC emulation code resynchronisation and improvments: |
1 |
/*
|
2 |
* PowerPC emulation micro-operations for qemu.
|
|
3163
by ths
find -type f | xargs sed -i 's/[\t ]$//g' # on most files |
3 |
*
|
2463
by j_mayer
Great PowerPC emulation code resynchronisation and improvments: |
4 |
* Copyright (c) 2003-2007 Jocelyn Mayer
|
5 |
*
|
|
6 |
* This library is free software; you can redistribute it and/or
|
|
7 |
* modify it under the terms of the GNU Lesser General Public
|
|
8 |
* License as published by the Free Software Foundation; either
|
|
9 |
* version 2 of the License, or (at your option) any later version.
|
|
10 |
*
|
|
11 |
* This library is distributed in the hope that it will be useful,
|
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
14 |
* Lesser General Public License for more details.
|
|
15 |
*
|
|
16 |
* You should have received a copy of the GNU Lesser General Public
|
|
17 |
* License along with this library; if not, write to the Free Software
|
|
18 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
19 |
*/
|
|
525
by bellard
PowerPC system emulation (Jocelyn Mayer) - modified patch to use new TLB api |
20 |
|
3709
by j_mayer
Add new sane low-level memory accessors for PowerPC that do proper |
21 |
#include "op_mem_access.h" |
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
22 |
|
525
by bellard
PowerPC system emulation (Jocelyn Mayer) - modified patch to use new TLB api |
23 |
/*** Integer load ***/
|
24 |
#define PPC_LD_OP(name, op) \
|
|
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
25 |
void OPPROTO glue(glue(op_l, name), MEMSUFFIX) (void) \
|
26 |
{ \
|
|
27 |
T1 = glue(op, MEMSUFFIX)((uint32_t)T0); \
|
|
28 |
RETURN(); \
|
|
29 |
}
|
|
30 |
||
31 |
#if defined(TARGET_PPC64)
|
|
32 |
#define PPC_LD_OP_64(name, op) \
|
|
33 |
void OPPROTO glue(glue(glue(op_l, name), _64), MEMSUFFIX) (void) \
|
|
34 |
{ \
|
|
35 |
T1 = glue(op, MEMSUFFIX)((uint64_t)T0); \
|
|
36 |
RETURN(); \
|
|
37 |
}
|
|
38 |
#endif
|
|
525
by bellard
PowerPC system emulation (Jocelyn Mayer) - modified patch to use new TLB api |
39 |
|
40 |
#define PPC_ST_OP(name, op) \
|
|
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
41 |
void OPPROTO glue(glue(op_st, name), MEMSUFFIX) (void) \
|
42 |
{ \
|
|
43 |
glue(op, MEMSUFFIX)((uint32_t)T0, T1); \
|
|
44 |
RETURN(); \
|
|
45 |
}
|
|
46 |
||
47 |
#if defined(TARGET_PPC64)
|
|
48 |
#define PPC_ST_OP_64(name, op) \
|
|
49 |
void OPPROTO glue(glue(glue(op_st, name), _64), MEMSUFFIX) (void) \
|
|
50 |
{ \
|
|
51 |
glue(op, MEMSUFFIX)((uint64_t)T0, T1); \
|
|
52 |
RETURN(); \
|
|
53 |
}
|
|
54 |
#endif
|
|
525
by bellard
PowerPC system emulation (Jocelyn Mayer) - modified patch to use new TLB api |
55 |
|
3709
by j_mayer
Add new sane low-level memory accessors for PowerPC that do proper |
56 |
PPC_LD_OP(bz, ldu8); |
57 |
PPC_LD_OP(ha, lds16); |
|
58 |
PPC_LD_OP(hz, ldu16); |
|
59 |
PPC_LD_OP(wz, ldu32); |
|
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
60 |
#if defined(TARGET_PPC64)
|
3709
by j_mayer
Add new sane low-level memory accessors for PowerPC that do proper |
61 |
PPC_LD_OP(wa, lds32); |
62 |
PPC_LD_OP(d, ldu64); |
|
63 |
PPC_LD_OP_64(bz, ldu8); |
|
64 |
PPC_LD_OP_64(ha, lds16); |
|
65 |
PPC_LD_OP_64(hz, ldu16); |
|
66 |
PPC_LD_OP_64(wz, ldu32); |
|
67 |
PPC_LD_OP_64(wa, lds32); |
|
68 |
PPC_LD_OP_64(d, ldu64); |
|
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
69 |
#endif
|
525
by bellard
PowerPC system emulation (Jocelyn Mayer) - modified patch to use new TLB api |
70 |
|
3709
by j_mayer
Add new sane low-level memory accessors for PowerPC that do proper |
71 |
PPC_LD_OP(ha_le, lds16r); |
72 |
PPC_LD_OP(hz_le, ldu16r); |
|
73 |
PPC_LD_OP(wz_le, ldu32r); |
|
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
74 |
#if defined(TARGET_PPC64)
|
3709
by j_mayer
Add new sane low-level memory accessors for PowerPC that do proper |
75 |
PPC_LD_OP(wa_le, lds32r); |
76 |
PPC_LD_OP(d_le, ldu64r); |
|
77 |
PPC_LD_OP_64(ha_le, lds16r); |
|
78 |
PPC_LD_OP_64(hz_le, ldu16r); |
|
79 |
PPC_LD_OP_64(wz_le, ldu32r); |
|
80 |
PPC_LD_OP_64(wa_le, lds32r); |
|
81 |
PPC_LD_OP_64(d_le, ldu64r); |
|
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
82 |
#endif
|
1374
by bellard
This patch adds little-endian mode support to PPC emulation. |
83 |
|
525
by bellard
PowerPC system emulation (Jocelyn Mayer) - modified patch to use new TLB api |
84 |
/*** Integer store ***/
|
3709
by j_mayer
Add new sane low-level memory accessors for PowerPC that do proper |
85 |
PPC_ST_OP(b, st8); |
86 |
PPC_ST_OP(h, st16); |
|
87 |
PPC_ST_OP(w, st32); |
|
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
88 |
#if defined(TARGET_PPC64)
|
3709
by j_mayer
Add new sane low-level memory accessors for PowerPC that do proper |
89 |
PPC_ST_OP(d, st64); |
90 |
PPC_ST_OP_64(b, st8); |
|
91 |
PPC_ST_OP_64(h, st16); |
|
92 |
PPC_ST_OP_64(w, st32); |
|
93 |
PPC_ST_OP_64(d, st64); |
|
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
94 |
#endif
|
525
by bellard
PowerPC system emulation (Jocelyn Mayer) - modified patch to use new TLB api |
95 |
|
1374
by bellard
This patch adds little-endian mode support to PPC emulation. |
96 |
PPC_ST_OP(h_le, st16r); |
97 |
PPC_ST_OP(w_le, st32r); |
|
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
98 |
#if defined(TARGET_PPC64)
|
99 |
PPC_ST_OP(d_le, st64r); |
|
100 |
PPC_ST_OP_64(h_le, st16r); |
|
101 |
PPC_ST_OP_64(w_le, st32r); |
|
3709
by j_mayer
Add new sane low-level memory accessors for PowerPC that do proper |
102 |
PPC_ST_OP_64(d_le, st64r); |
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
103 |
#endif
|
1374
by bellard
This patch adds little-endian mode support to PPC emulation. |
104 |
|
525
by bellard
PowerPC system emulation (Jocelyn Mayer) - modified patch to use new TLB api |
105 |
/*** Integer load and store with byte reverse ***/
|
3709
by j_mayer
Add new sane low-level memory accessors for PowerPC that do proper |
106 |
PPC_LD_OP(hbr, ldu16r); |
107 |
PPC_LD_OP(wbr, ldu32r); |
|
526
by bellard
suppressed explicit access type and use the exception routine to infer it from the micro operation |
108 |
PPC_ST_OP(hbr, st16r); |
109 |
PPC_ST_OP(wbr, st32r); |
|
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
110 |
#if defined(TARGET_PPC64)
|
3709
by j_mayer
Add new sane low-level memory accessors for PowerPC that do proper |
111 |
PPC_LD_OP_64(hbr, ldu16r); |
112 |
PPC_LD_OP_64(wbr, ldu32r); |
|
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
113 |
PPC_ST_OP_64(hbr, st16r); |
114 |
PPC_ST_OP_64(wbr, st32r); |
|
115 |
#endif
|
|
525
by bellard
PowerPC system emulation (Jocelyn Mayer) - modified patch to use new TLB api |
116 |
|
3709
by j_mayer
Add new sane low-level memory accessors for PowerPC that do proper |
117 |
PPC_LD_OP(hbr_le, ldu16); |
118 |
PPC_LD_OP(wbr_le, ldu32); |
|
119 |
PPC_ST_OP(hbr_le, st16); |
|
120 |
PPC_ST_OP(wbr_le, st32); |
|
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
121 |
#if defined(TARGET_PPC64)
|
3709
by j_mayer
Add new sane low-level memory accessors for PowerPC that do proper |
122 |
PPC_LD_OP_64(hbr_le, ldu16); |
123 |
PPC_LD_OP_64(wbr_le, ldu32); |
|
124 |
PPC_ST_OP_64(hbr_le, st16); |
|
125 |
PPC_ST_OP_64(wbr_le, st32); |
|
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
126 |
#endif
|
1374
by bellard
This patch adds little-endian mode support to PPC emulation. |
127 |
|
525
by bellard
PowerPC system emulation (Jocelyn Mayer) - modified patch to use new TLB api |
128 |
/*** Integer load and store multiple ***/
|
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
129 |
void OPPROTO glue(op_lmw, MEMSUFFIX) (void) |
525
by bellard
PowerPC system emulation (Jocelyn Mayer) - modified patch to use new TLB api |
130 |
{
|
2463
by j_mayer
Great PowerPC emulation code resynchronisation and improvments: |
131 |
glue(do_lmw, MEMSUFFIX)(PARAM1); |
132 |
RETURN(); |
|
133 |
}
|
|
525
by bellard
PowerPC system emulation (Jocelyn Mayer) - modified patch to use new TLB api |
134 |
|
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
135 |
#if defined(TARGET_PPC64)
|
136 |
void OPPROTO glue(op_lmw_64, MEMSUFFIX) (void) |
|
137 |
{
|
|
138 |
glue(do_lmw_64, MEMSUFFIX)(PARAM1); |
|
139 |
RETURN(); |
|
140 |
}
|
|
141 |
#endif
|
|
142 |
||
143 |
void OPPROTO glue(op_lmw_le, MEMSUFFIX) (void) |
|
2463
by j_mayer
Great PowerPC emulation code resynchronisation and improvments: |
144 |
{
|
145 |
glue(do_lmw_le, MEMSUFFIX)(PARAM1); |
|
525
by bellard
PowerPC system emulation (Jocelyn Mayer) - modified patch to use new TLB api |
146 |
RETURN(); |
147 |
}
|
|
148 |
||
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
149 |
#if defined(TARGET_PPC64)
|
150 |
void OPPROTO glue(op_lmw_le_64, MEMSUFFIX) (void) |
|
151 |
{
|
|
152 |
glue(do_lmw_le_64, MEMSUFFIX)(PARAM1); |
|
153 |
RETURN(); |
|
154 |
}
|
|
155 |
#endif
|
|
156 |
||
157 |
void OPPROTO glue(op_stmw, MEMSUFFIX) (void) |
|
525
by bellard
PowerPC system emulation (Jocelyn Mayer) - modified patch to use new TLB api |
158 |
{
|
2463
by j_mayer
Great PowerPC emulation code resynchronisation and improvments: |
159 |
glue(do_stmw, MEMSUFFIX)(PARAM1); |
1374
by bellard
This patch adds little-endian mode support to PPC emulation. |
160 |
RETURN(); |
161 |
}
|
|
162 |
||
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
163 |
#if defined(TARGET_PPC64)
|
164 |
void OPPROTO glue(op_stmw_64, MEMSUFFIX) (void) |
|
165 |
{
|
|
166 |
glue(do_stmw_64, MEMSUFFIX)(PARAM1); |
|
167 |
RETURN(); |
|
168 |
}
|
|
169 |
#endif
|
|
170 |
||
171 |
void OPPROTO glue(op_stmw_le, MEMSUFFIX) (void) |
|
1374
by bellard
This patch adds little-endian mode support to PPC emulation. |
172 |
{
|
2463
by j_mayer
Great PowerPC emulation code resynchronisation and improvments: |
173 |
glue(do_stmw_le, MEMSUFFIX)(PARAM1); |
1374
by bellard
This patch adds little-endian mode support to PPC emulation. |
174 |
RETURN(); |
175 |
}
|
|
176 |
||
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
177 |
#if defined(TARGET_PPC64)
|
178 |
void OPPROTO glue(op_stmw_le_64, MEMSUFFIX) (void) |
|
179 |
{
|
|
180 |
glue(do_stmw_le_64, MEMSUFFIX)(PARAM1); |
|
181 |
RETURN(); |
|
182 |
}
|
|
183 |
#endif
|
|
184 |
||
525
by bellard
PowerPC system emulation (Jocelyn Mayer) - modified patch to use new TLB api |
185 |
/*** Integer load and store strings ***/
|
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
186 |
void OPPROTO glue(op_lswi, MEMSUFFIX) (void) |
187 |
{
|
|
188 |
glue(do_lsw, MEMSUFFIX)(PARAM1); |
|
189 |
RETURN(); |
|
190 |
}
|
|
191 |
||
192 |
#if defined(TARGET_PPC64)
|
|
193 |
void OPPROTO glue(op_lswi_64, MEMSUFFIX) (void) |
|
194 |
{
|
|
195 |
glue(do_lsw_64, MEMSUFFIX)(PARAM1); |
|
196 |
RETURN(); |
|
197 |
}
|
|
198 |
#endif
|
|
199 |
||
525
by bellard
PowerPC system emulation (Jocelyn Mayer) - modified patch to use new TLB api |
200 |
/* PPC32 specification says we must generate an exception if
|
201 |
* rA is in the range of registers to be loaded.
|
|
202 |
* In an other hand, IBM says this is valid, but rA won't be loaded.
|
|
203 |
* For now, I'll follow the spec...
|
|
204 |
*/
|
|
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
205 |
void OPPROTO glue(op_lswx, MEMSUFFIX) (void) |
206 |
{
|
|
207 |
/* Note: T1 comes from xer_bc then no cast is needed */
|
|
208 |
if (likely(T1 != 0)) { |
|
209 |
if (unlikely((PARAM1 < PARAM2 && (PARAM1 + T1) > PARAM2) || |
|
210 |
(PARAM1 < PARAM3 && (PARAM1 + T1) > PARAM3))) { |
|
3251
by j_mayer
Rework PowerPC exceptions model to make it more versatile: |
211 |
do_raise_exception_err(POWERPC_EXCP_PROGRAM, |
212 |
POWERPC_EXCP_INVAL | |
|
213 |
POWERPC_EXCP_INVAL_LSWX); |
|
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
214 |
} else { |
215 |
glue(do_lsw, MEMSUFFIX)(PARAM1); |
|
216 |
}
|
|
217 |
}
|
|
218 |
RETURN(); |
|
219 |
}
|
|
220 |
||
221 |
#if defined(TARGET_PPC64)
|
|
222 |
void OPPROTO glue(op_lswx_64, MEMSUFFIX) (void) |
|
223 |
{
|
|
224 |
/* Note: T1 comes from xer_bc then no cast is needed */
|
|
225 |
if (likely(T1 != 0)) { |
|
226 |
if (unlikely((PARAM1 < PARAM2 && (PARAM1 + T1) > PARAM2) || |
|
227 |
(PARAM1 < PARAM3 && (PARAM1 + T1) > PARAM3))) { |
|
3251
by j_mayer
Rework PowerPC exceptions model to make it more versatile: |
228 |
do_raise_exception_err(POWERPC_EXCP_PROGRAM, |
229 |
POWERPC_EXCP_INVAL | |
|
230 |
POWERPC_EXCP_INVAL_LSWX); |
|
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
231 |
} else { |
232 |
glue(do_lsw_64, MEMSUFFIX)(PARAM1); |
|
233 |
}
|
|
234 |
}
|
|
235 |
RETURN(); |
|
236 |
}
|
|
237 |
#endif
|
|
238 |
||
239 |
void OPPROTO glue(op_stsw, MEMSUFFIX) (void) |
|
240 |
{
|
|
241 |
glue(do_stsw, MEMSUFFIX)(PARAM1); |
|
242 |
RETURN(); |
|
243 |
}
|
|
244 |
||
245 |
#if defined(TARGET_PPC64)
|
|
246 |
void OPPROTO glue(op_stsw_64, MEMSUFFIX) (void) |
|
247 |
{
|
|
248 |
glue(do_stsw_64, MEMSUFFIX)(PARAM1); |
|
249 |
RETURN(); |
|
250 |
}
|
|
251 |
#endif
|
|
252 |
||
525
by bellard
PowerPC system emulation (Jocelyn Mayer) - modified patch to use new TLB api |
253 |
/*** Floating-point store ***/
|
254 |
#define PPC_STF_OP(name, op) \
|
|
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
255 |
void OPPROTO glue(glue(op_st, name), MEMSUFFIX) (void) \
|
256 |
{ \
|
|
257 |
glue(op, MEMSUFFIX)((uint32_t)T0, FT0); \
|
|
258 |
RETURN(); \
|
|
259 |
}
|
|
260 |
||
261 |
#if defined(TARGET_PPC64)
|
|
262 |
#define PPC_STF_OP_64(name, op) \
|
|
263 |
void OPPROTO glue(glue(glue(op_st, name), _64), MEMSUFFIX) (void) \
|
|
264 |
{ \
|
|
265 |
glue(op, MEMSUFFIX)((uint64_t)T0, FT0); \
|
|
266 |
RETURN(); \
|
|
267 |
}
|
|
268 |
#endif
|
|
525
by bellard
PowerPC system emulation (Jocelyn Mayer) - modified patch to use new TLB api |
269 |
|
4036
by aurel32
Use float32/64 instead of float/double |
270 |
static always_inline void glue(stfs, MEMSUFFIX) (target_ulong EA, float64 d) |
3270
by j_mayer
Improve single-precision floats load & stores: |
271 |
{
|
272 |
glue(stfl, MEMSUFFIX)(EA, float64_to_float32(d, &env->fp_status)); |
|
273 |
}
|
|
274 |
||
4036
by aurel32
Use float32/64 instead of float/double |
275 |
static always_inline void glue(stfiw, MEMSUFFIX) (target_ulong EA, float64 d) |
3270
by j_mayer
Improve single-precision floats load & stores: |
276 |
{
|
4036
by aurel32
Use float32/64 instead of float/double |
277 |
CPU_DoubleU u; |
3270
by j_mayer
Improve single-precision floats load & stores: |
278 |
|
279 |
/* Store the low order 32 bits without any conversion */
|
|
280 |
u.d = d; |
|
4036
by aurel32
Use float32/64 instead of float/double |
281 |
glue(st32, MEMSUFFIX)(EA, u.l.lower); |
3270
by j_mayer
Improve single-precision floats load & stores: |
282 |
}
|
283 |
||
525
by bellard
PowerPC system emulation (Jocelyn Mayer) - modified patch to use new TLB api |
284 |
PPC_STF_OP(fd, stfq); |
3270
by j_mayer
Improve single-precision floats load & stores: |
285 |
PPC_STF_OP(fs, stfs); |
3695
by j_mayer
PowerPC instruction fixes: |
286 |
PPC_STF_OP(fiw, stfiw); |
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
287 |
#if defined(TARGET_PPC64)
|
288 |
PPC_STF_OP_64(fd, stfq); |
|
3270
by j_mayer
Improve single-precision floats load & stores: |
289 |
PPC_STF_OP_64(fs, stfs); |
3695
by j_mayer
PowerPC instruction fixes: |
290 |
PPC_STF_OP_64(fiw, stfiw); |
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
291 |
#endif
|
525
by bellard
PowerPC system emulation (Jocelyn Mayer) - modified patch to use new TLB api |
292 |
|
4036
by aurel32
Use float32/64 instead of float/double |
293 |
static always_inline void glue(stfqr, MEMSUFFIX) (target_ulong EA, float64 d) |
1374
by bellard
This patch adds little-endian mode support to PPC emulation. |
294 |
{
|
4036
by aurel32
Use float32/64 instead of float/double |
295 |
CPU_DoubleU u; |
1374
by bellard
This patch adds little-endian mode support to PPC emulation. |
296 |
|
297 |
u.d = d; |
|
4036
by aurel32
Use float32/64 instead of float/double |
298 |
u.ll = bswap64(u.ll); |
1374
by bellard
This patch adds little-endian mode support to PPC emulation. |
299 |
glue(stfq, MEMSUFFIX)(EA, u.d); |
300 |
}
|
|
301 |
||
4036
by aurel32
Use float32/64 instead of float/double |
302 |
static always_inline void glue(stfsr, MEMSUFFIX) (target_ulong EA, float64 d) |
1374
by bellard
This patch adds little-endian mode support to PPC emulation. |
303 |
{
|
4036
by aurel32
Use float32/64 instead of float/double |
304 |
CPU_FloatU u; |
1374
by bellard
This patch adds little-endian mode support to PPC emulation. |
305 |
|
3270
by j_mayer
Improve single-precision floats load & stores: |
306 |
u.f = float64_to_float32(d, &env->fp_status); |
4036
by aurel32
Use float32/64 instead of float/double |
307 |
u.l = bswap32(u.l); |
1374
by bellard
This patch adds little-endian mode support to PPC emulation. |
308 |
glue(stfl, MEMSUFFIX)(EA, u.f); |
309 |
}
|
|
310 |
||
4036
by aurel32
Use float32/64 instead of float/double |
311 |
static always_inline void glue(stfiwr, MEMSUFFIX) (target_ulong EA, float64 d) |
3270
by j_mayer
Improve single-precision floats load & stores: |
312 |
{
|
4036
by aurel32
Use float32/64 instead of float/double |
313 |
CPU_DoubleU u; |
3270
by j_mayer
Improve single-precision floats load & stores: |
314 |
|
315 |
/* Store the low order 32 bits without any conversion */
|
|
316 |
u.d = d; |
|
4036
by aurel32
Use float32/64 instead of float/double |
317 |
u.l.lower = bswap32(u.l.lower); |
318 |
glue(st32, MEMSUFFIX)(EA, u.l.lower); |
|
3270
by j_mayer
Improve single-precision floats load & stores: |
319 |
}
|
320 |
||
1374
by bellard
This patch adds little-endian mode support to PPC emulation. |
321 |
PPC_STF_OP(fd_le, stfqr); |
3270
by j_mayer
Improve single-precision floats load & stores: |
322 |
PPC_STF_OP(fs_le, stfsr); |
3695
by j_mayer
PowerPC instruction fixes: |
323 |
PPC_STF_OP(fiw_le, stfiwr); |
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
324 |
#if defined(TARGET_PPC64)
|
325 |
PPC_STF_OP_64(fd_le, stfqr); |
|
3270
by j_mayer
Improve single-precision floats load & stores: |
326 |
PPC_STF_OP_64(fs_le, stfsr); |
3695
by j_mayer
PowerPC instruction fixes: |
327 |
PPC_STF_OP_64(fiw_le, stfiwr); |
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
328 |
#endif
|
1374
by bellard
This patch adds little-endian mode support to PPC emulation. |
329 |
|
525
by bellard
PowerPC system emulation (Jocelyn Mayer) - modified patch to use new TLB api |
330 |
/*** Floating-point load ***/
|
331 |
#define PPC_LDF_OP(name, op) \
|
|
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
332 |
void OPPROTO glue(glue(op_l, name), MEMSUFFIX) (void) \
|
333 |
{ \
|
|
334 |
FT0 = glue(op, MEMSUFFIX)((uint32_t)T0); \
|
|
335 |
RETURN(); \
|
|
336 |
}
|
|
337 |
||
338 |
#if defined(TARGET_PPC64)
|
|
339 |
#define PPC_LDF_OP_64(name, op) \
|
|
340 |
void OPPROTO glue(glue(glue(op_l, name), _64), MEMSUFFIX) (void) \
|
|
341 |
{ \
|
|
342 |
FT0 = glue(op, MEMSUFFIX)((uint64_t)T0); \
|
|
343 |
RETURN(); \
|
|
344 |
}
|
|
345 |
#endif
|
|
525
by bellard
PowerPC system emulation (Jocelyn Mayer) - modified patch to use new TLB api |
346 |
|
4036
by aurel32
Use float32/64 instead of float/double |
347 |
static always_inline float64 glue(ldfs, MEMSUFFIX) (target_ulong EA) |
3270
by j_mayer
Improve single-precision floats load & stores: |
348 |
{
|
349 |
return float32_to_float64(glue(ldfl, MEMSUFFIX)(EA), &env->fp_status); |
|
350 |
}
|
|
351 |
||
525
by bellard
PowerPC system emulation (Jocelyn Mayer) - modified patch to use new TLB api |
352 |
PPC_LDF_OP(fd, ldfq); |
3270
by j_mayer
Improve single-precision floats load & stores: |
353 |
PPC_LDF_OP(fs, ldfs); |
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
354 |
#if defined(TARGET_PPC64)
|
355 |
PPC_LDF_OP_64(fd, ldfq); |
|
3270
by j_mayer
Improve single-precision floats load & stores: |
356 |
PPC_LDF_OP_64(fs, ldfs); |
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
357 |
#endif
|
525
by bellard
PowerPC system emulation (Jocelyn Mayer) - modified patch to use new TLB api |
358 |
|
4036
by aurel32
Use float32/64 instead of float/double |
359 |
static always_inline float64 glue(ldfqr, MEMSUFFIX) (target_ulong EA) |
1374
by bellard
This patch adds little-endian mode support to PPC emulation. |
360 |
{
|
4036
by aurel32
Use float32/64 instead of float/double |
361 |
CPU_DoubleU u; |
1374
by bellard
This patch adds little-endian mode support to PPC emulation. |
362 |
|
363 |
u.d = glue(ldfq, MEMSUFFIX)(EA); |
|
4036
by aurel32
Use float32/64 instead of float/double |
364 |
u.ll = bswap64(u.ll); |
1374
by bellard
This patch adds little-endian mode support to PPC emulation. |
365 |
|
366 |
return u.d; |
|
367 |
}
|
|
368 |
||
4036
by aurel32
Use float32/64 instead of float/double |
369 |
static always_inline float64 glue(ldfsr, MEMSUFFIX) (target_ulong EA) |
1374
by bellard
This patch adds little-endian mode support to PPC emulation. |
370 |
{
|
4036
by aurel32
Use float32/64 instead of float/double |
371 |
CPU_FloatU u; |
1374
by bellard
This patch adds little-endian mode support to PPC emulation. |
372 |
|
373 |
u.f = glue(ldfl, MEMSUFFIX)(EA); |
|
4036
by aurel32
Use float32/64 instead of float/double |
374 |
u.l = bswap32(u.l); |
1374
by bellard
This patch adds little-endian mode support to PPC emulation. |
375 |
|
3270
by j_mayer
Improve single-precision floats load & stores: |
376 |
return float32_to_float64(u.f, &env->fp_status); |
1374
by bellard
This patch adds little-endian mode support to PPC emulation. |
377 |
}
|
378 |
||
379 |
PPC_LDF_OP(fd_le, ldfqr); |
|
3270
by j_mayer
Improve single-precision floats load & stores: |
380 |
PPC_LDF_OP(fs_le, ldfsr); |
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
381 |
#if defined(TARGET_PPC64)
|
382 |
PPC_LDF_OP_64(fd_le, ldfqr); |
|
3270
by j_mayer
Improve single-precision floats load & stores: |
383 |
PPC_LDF_OP_64(fs_le, ldfsr); |
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
384 |
#endif
|
1374
by bellard
This patch adds little-endian mode support to PPC emulation. |
385 |
|
563
by bellard
PowerPC merge (Jocelyn Mayer) |
386 |
/* Load and set reservation */
|
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
387 |
void OPPROTO glue(op_lwarx, MEMSUFFIX) (void) |
388 |
{
|
|
389 |
if (unlikely(T0 & 0x03)) { |
|
3251
by j_mayer
Rework PowerPC exceptions model to make it more versatile: |
390 |
do_raise_exception(POWERPC_EXCP_ALIGN); |
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
391 |
} else { |
3709
by j_mayer
Add new sane low-level memory accessors for PowerPC that do proper |
392 |
T1 = glue(ldu32, MEMSUFFIX)((uint32_t)T0); |
3168
by j_mayer
Coding style fixes in PowerPC related code (no functional change): |
393 |
env->reserve = (uint32_t)T0; |
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
394 |
}
|
395 |
RETURN(); |
|
396 |
}
|
|
397 |
||
398 |
#if defined(TARGET_PPC64)
|
|
399 |
void OPPROTO glue(op_lwarx_64, MEMSUFFIX) (void) |
|
400 |
{
|
|
401 |
if (unlikely(T0 & 0x03)) { |
|
3251
by j_mayer
Rework PowerPC exceptions model to make it more versatile: |
402 |
do_raise_exception(POWERPC_EXCP_ALIGN); |
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
403 |
} else { |
3709
by j_mayer
Add new sane low-level memory accessors for PowerPC that do proper |
404 |
T1 = glue(ldu32, MEMSUFFIX)((uint64_t)T0); |
3168
by j_mayer
Coding style fixes in PowerPC related code (no functional change): |
405 |
env->reserve = (uint64_t)T0; |
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
406 |
}
|
407 |
RETURN(); |
|
408 |
}
|
|
409 |
||
2520
by j_mayer
Add missing PowerPC 64 instructions |
410 |
void OPPROTO glue(op_ldarx, MEMSUFFIX) (void) |
411 |
{
|
|
412 |
if (unlikely(T0 & 0x03)) { |
|
3251
by j_mayer
Rework PowerPC exceptions model to make it more versatile: |
413 |
do_raise_exception(POWERPC_EXCP_ALIGN); |
2520
by j_mayer
Add missing PowerPC 64 instructions |
414 |
} else { |
3709
by j_mayer
Add new sane low-level memory accessors for PowerPC that do proper |
415 |
T1 = glue(ldu64, MEMSUFFIX)((uint32_t)T0); |
3168
by j_mayer
Coding style fixes in PowerPC related code (no functional change): |
416 |
env->reserve = (uint32_t)T0; |
2520
by j_mayer
Add missing PowerPC 64 instructions |
417 |
}
|
418 |
RETURN(); |
|
419 |
}
|
|
420 |
||
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
421 |
void OPPROTO glue(op_ldarx_64, MEMSUFFIX) (void) |
422 |
{
|
|
423 |
if (unlikely(T0 & 0x03)) { |
|
3251
by j_mayer
Rework PowerPC exceptions model to make it more versatile: |
424 |
do_raise_exception(POWERPC_EXCP_ALIGN); |
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
425 |
} else { |
3709
by j_mayer
Add new sane low-level memory accessors for PowerPC that do proper |
426 |
T1 = glue(ldu64, MEMSUFFIX)((uint64_t)T0); |
3168
by j_mayer
Coding style fixes in PowerPC related code (no functional change): |
427 |
env->reserve = (uint64_t)T0; |
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
428 |
}
|
429 |
RETURN(); |
|
430 |
}
|
|
431 |
#endif
|
|
432 |
||
433 |
void OPPROTO glue(op_lwarx_le, MEMSUFFIX) (void) |
|
434 |
{
|
|
435 |
if (unlikely(T0 & 0x03)) { |
|
3251
by j_mayer
Rework PowerPC exceptions model to make it more versatile: |
436 |
do_raise_exception(POWERPC_EXCP_ALIGN); |
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
437 |
} else { |
3709
by j_mayer
Add new sane low-level memory accessors for PowerPC that do proper |
438 |
T1 = glue(ldu32r, MEMSUFFIX)((uint32_t)T0); |
3168
by j_mayer
Coding style fixes in PowerPC related code (no functional change): |
439 |
env->reserve = (uint32_t)T0; |
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
440 |
}
|
441 |
RETURN(); |
|
442 |
}
|
|
443 |
||
444 |
#if defined(TARGET_PPC64)
|
|
445 |
void OPPROTO glue(op_lwarx_le_64, MEMSUFFIX) (void) |
|
446 |
{
|
|
447 |
if (unlikely(T0 & 0x03)) { |
|
3251
by j_mayer
Rework PowerPC exceptions model to make it more versatile: |
448 |
do_raise_exception(POWERPC_EXCP_ALIGN); |
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
449 |
} else { |
3709
by j_mayer
Add new sane low-level memory accessors for PowerPC that do proper |
450 |
T1 = glue(ldu32r, MEMSUFFIX)((uint64_t)T0); |
3168
by j_mayer
Coding style fixes in PowerPC related code (no functional change): |
451 |
env->reserve = (uint64_t)T0; |
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
452 |
}
|
453 |
RETURN(); |
|
454 |
}
|
|
455 |
||
2520
by j_mayer
Add missing PowerPC 64 instructions |
456 |
void OPPROTO glue(op_ldarx_le, MEMSUFFIX) (void) |
457 |
{
|
|
458 |
if (unlikely(T0 & 0x03)) { |
|
3251
by j_mayer
Rework PowerPC exceptions model to make it more versatile: |
459 |
do_raise_exception(POWERPC_EXCP_ALIGN); |
2520
by j_mayer
Add missing PowerPC 64 instructions |
460 |
} else { |
3709
by j_mayer
Add new sane low-level memory accessors for PowerPC that do proper |
461 |
T1 = glue(ldu64r, MEMSUFFIX)((uint32_t)T0); |
3168
by j_mayer
Coding style fixes in PowerPC related code (no functional change): |
462 |
env->reserve = (uint32_t)T0; |
2520
by j_mayer
Add missing PowerPC 64 instructions |
463 |
}
|
464 |
RETURN(); |
|
465 |
}
|
|
466 |
||
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
467 |
void OPPROTO glue(op_ldarx_le_64, MEMSUFFIX) (void) |
468 |
{
|
|
469 |
if (unlikely(T0 & 0x03)) { |
|
3251
by j_mayer
Rework PowerPC exceptions model to make it more versatile: |
470 |
do_raise_exception(POWERPC_EXCP_ALIGN); |
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
471 |
} else { |
3709
by j_mayer
Add new sane low-level memory accessors for PowerPC that do proper |
472 |
T1 = glue(ldu64r, MEMSUFFIX)((uint64_t)T0); |
3168
by j_mayer
Coding style fixes in PowerPC related code (no functional change): |
473 |
env->reserve = (uint64_t)T0; |
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
474 |
}
|
475 |
RETURN(); |
|
476 |
}
|
|
477 |
#endif
|
|
1374
by bellard
This patch adds little-endian mode support to PPC emulation. |
478 |
|
525
by bellard
PowerPC system emulation (Jocelyn Mayer) - modified patch to use new TLB api |
479 |
/* Store with reservation */
|
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
480 |
void OPPROTO glue(op_stwcx, MEMSUFFIX) (void) |
481 |
{
|
|
482 |
if (unlikely(T0 & 0x03)) { |
|
3251
by j_mayer
Rework PowerPC exceptions model to make it more versatile: |
483 |
do_raise_exception(POWERPC_EXCP_ALIGN); |
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
484 |
} else { |
3168
by j_mayer
Coding style fixes in PowerPC related code (no functional change): |
485 |
if (unlikely(env->reserve != (uint32_t)T0)) { |
3169
by j_mayer
PowerPC flags update/use fixes: |
486 |
env->crf[0] = xer_so; |
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
487 |
} else { |
3709
by j_mayer
Add new sane low-level memory accessors for PowerPC that do proper |
488 |
glue(st32, MEMSUFFIX)((uint32_t)T0, T1); |
3169
by j_mayer
PowerPC flags update/use fixes: |
489 |
env->crf[0] = xer_so | 0x02; |
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
490 |
}
|
491 |
}
|
|
3617
by j_mayer
More PowerPC target -1 usage fixes (reservation address). |
492 |
env->reserve = (target_ulong)-1ULL; |
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
493 |
RETURN(); |
494 |
}
|
|
495 |
||
496 |
#if defined(TARGET_PPC64)
|
|
497 |
void OPPROTO glue(op_stwcx_64, MEMSUFFIX) (void) |
|
498 |
{
|
|
499 |
if (unlikely(T0 & 0x03)) { |
|
3251
by j_mayer
Rework PowerPC exceptions model to make it more versatile: |
500 |
do_raise_exception(POWERPC_EXCP_ALIGN); |
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
501 |
} else { |
3168
by j_mayer
Coding style fixes in PowerPC related code (no functional change): |
502 |
if (unlikely(env->reserve != (uint64_t)T0)) { |
3169
by j_mayer
PowerPC flags update/use fixes: |
503 |
env->crf[0] = xer_so; |
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
504 |
} else { |
3709
by j_mayer
Add new sane low-level memory accessors for PowerPC that do proper |
505 |
glue(st32, MEMSUFFIX)((uint64_t)T0, T1); |
3169
by j_mayer
PowerPC flags update/use fixes: |
506 |
env->crf[0] = xer_so | 0x02; |
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
507 |
}
|
508 |
}
|
|
3617
by j_mayer
More PowerPC target -1 usage fixes (reservation address). |
509 |
env->reserve = (target_ulong)-1ULL; |
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
510 |
RETURN(); |
511 |
}
|
|
512 |
||
2520
by j_mayer
Add missing PowerPC 64 instructions |
513 |
void OPPROTO glue(op_stdcx, MEMSUFFIX) (void) |
514 |
{
|
|
515 |
if (unlikely(T0 & 0x03)) { |
|
3251
by j_mayer
Rework PowerPC exceptions model to make it more versatile: |
516 |
do_raise_exception(POWERPC_EXCP_ALIGN); |
2520
by j_mayer
Add missing PowerPC 64 instructions |
517 |
} else { |
3168
by j_mayer
Coding style fixes in PowerPC related code (no functional change): |
518 |
if (unlikely(env->reserve != (uint32_t)T0)) { |
3169
by j_mayer
PowerPC flags update/use fixes: |
519 |
env->crf[0] = xer_so; |
2520
by j_mayer
Add missing PowerPC 64 instructions |
520 |
} else { |
3709
by j_mayer
Add new sane low-level memory accessors for PowerPC that do proper |
521 |
glue(st64, MEMSUFFIX)((uint32_t)T0, T1); |
3169
by j_mayer
PowerPC flags update/use fixes: |
522 |
env->crf[0] = xer_so | 0x02; |
2520
by j_mayer
Add missing PowerPC 64 instructions |
523 |
}
|
524 |
}
|
|
3617
by j_mayer
More PowerPC target -1 usage fixes (reservation address). |
525 |
env->reserve = (target_ulong)-1ULL; |
2520
by j_mayer
Add missing PowerPC 64 instructions |
526 |
RETURN(); |
527 |
}
|
|
528 |
||
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
529 |
void OPPROTO glue(op_stdcx_64, MEMSUFFIX) (void) |
530 |
{
|
|
531 |
if (unlikely(T0 & 0x03)) { |
|
3251
by j_mayer
Rework PowerPC exceptions model to make it more versatile: |
532 |
do_raise_exception(POWERPC_EXCP_ALIGN); |
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
533 |
} else { |
3168
by j_mayer
Coding style fixes in PowerPC related code (no functional change): |
534 |
if (unlikely(env->reserve != (uint64_t)T0)) { |
3169
by j_mayer
PowerPC flags update/use fixes: |
535 |
env->crf[0] = xer_so; |
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
536 |
} else { |
3709
by j_mayer
Add new sane low-level memory accessors for PowerPC that do proper |
537 |
glue(st64, MEMSUFFIX)((uint64_t)T0, T1); |
3169
by j_mayer
PowerPC flags update/use fixes: |
538 |
env->crf[0] = xer_so | 0x02; |
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
539 |
}
|
540 |
}
|
|
3617
by j_mayer
More PowerPC target -1 usage fixes (reservation address). |
541 |
env->reserve = (target_ulong)-1ULL; |
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
542 |
RETURN(); |
543 |
}
|
|
544 |
#endif
|
|
545 |
||
546 |
void OPPROTO glue(op_stwcx_le, MEMSUFFIX) (void) |
|
547 |
{
|
|
548 |
if (unlikely(T0 & 0x03)) { |
|
3251
by j_mayer
Rework PowerPC exceptions model to make it more versatile: |
549 |
do_raise_exception(POWERPC_EXCP_ALIGN); |
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
550 |
} else { |
3168
by j_mayer
Coding style fixes in PowerPC related code (no functional change): |
551 |
if (unlikely(env->reserve != (uint32_t)T0)) { |
3169
by j_mayer
PowerPC flags update/use fixes: |
552 |
env->crf[0] = xer_so; |
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
553 |
} else { |
554 |
glue(st32r, MEMSUFFIX)((uint32_t)T0, T1); |
|
3169
by j_mayer
PowerPC flags update/use fixes: |
555 |
env->crf[0] = xer_so | 0x02; |
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
556 |
}
|
557 |
}
|
|
3617
by j_mayer
More PowerPC target -1 usage fixes (reservation address). |
558 |
env->reserve = (target_ulong)-1ULL; |
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
559 |
RETURN(); |
560 |
}
|
|
561 |
||
562 |
#if defined(TARGET_PPC64)
|
|
563 |
void OPPROTO glue(op_stwcx_le_64, MEMSUFFIX) (void) |
|
564 |
{
|
|
565 |
if (unlikely(T0 & 0x03)) { |
|
3251
by j_mayer
Rework PowerPC exceptions model to make it more versatile: |
566 |
do_raise_exception(POWERPC_EXCP_ALIGN); |
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
567 |
} else { |
3168
by j_mayer
Coding style fixes in PowerPC related code (no functional change): |
568 |
if (unlikely(env->reserve != (uint64_t)T0)) { |
3169
by j_mayer
PowerPC flags update/use fixes: |
569 |
env->crf[0] = xer_so; |
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
570 |
} else { |
571 |
glue(st32r, MEMSUFFIX)((uint64_t)T0, T1); |
|
3169
by j_mayer
PowerPC flags update/use fixes: |
572 |
env->crf[0] = xer_so | 0x02; |
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
573 |
}
|
574 |
}
|
|
3617
by j_mayer
More PowerPC target -1 usage fixes (reservation address). |
575 |
env->reserve = (target_ulong)-1ULL; |
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
576 |
RETURN(); |
577 |
}
|
|
578 |
||
2520
by j_mayer
Add missing PowerPC 64 instructions |
579 |
void OPPROTO glue(op_stdcx_le, MEMSUFFIX) (void) |
580 |
{
|
|
581 |
if (unlikely(T0 & 0x03)) { |
|
3251
by j_mayer
Rework PowerPC exceptions model to make it more versatile: |
582 |
do_raise_exception(POWERPC_EXCP_ALIGN); |
2520
by j_mayer
Add missing PowerPC 64 instructions |
583 |
} else { |
3168
by j_mayer
Coding style fixes in PowerPC related code (no functional change): |
584 |
if (unlikely(env->reserve != (uint32_t)T0)) { |
3169
by j_mayer
PowerPC flags update/use fixes: |
585 |
env->crf[0] = xer_so; |
2520
by j_mayer
Add missing PowerPC 64 instructions |
586 |
} else { |
587 |
glue(st64r, MEMSUFFIX)((uint32_t)T0, T1); |
|
3169
by j_mayer
PowerPC flags update/use fixes: |
588 |
env->crf[0] = xer_so | 0x02; |
2520
by j_mayer
Add missing PowerPC 64 instructions |
589 |
}
|
590 |
}
|
|
3617
by j_mayer
More PowerPC target -1 usage fixes (reservation address). |
591 |
env->reserve = (target_ulong)-1ULL; |
2520
by j_mayer
Add missing PowerPC 64 instructions |
592 |
RETURN(); |
593 |
}
|
|
594 |
||
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
595 |
void OPPROTO glue(op_stdcx_le_64, MEMSUFFIX) (void) |
596 |
{
|
|
597 |
if (unlikely(T0 & 0x03)) { |
|
3251
by j_mayer
Rework PowerPC exceptions model to make it more versatile: |
598 |
do_raise_exception(POWERPC_EXCP_ALIGN); |
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
599 |
} else { |
3168
by j_mayer
Coding style fixes in PowerPC related code (no functional change): |
600 |
if (unlikely(env->reserve != (uint64_t)T0)) { |
3169
by j_mayer
PowerPC flags update/use fixes: |
601 |
env->crf[0] = xer_so; |
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
602 |
} else { |
603 |
glue(st64r, MEMSUFFIX)((uint64_t)T0, T1); |
|
3169
by j_mayer
PowerPC flags update/use fixes: |
604 |
env->crf[0] = xer_so | 0x02; |
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
605 |
}
|
606 |
}
|
|
3617
by j_mayer
More PowerPC target -1 usage fixes (reservation address). |
607 |
env->reserve = (target_ulong)-1ULL; |
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
608 |
RETURN(); |
609 |
}
|
|
610 |
#endif
|
|
611 |
||
3311
by j_mayer
Make PowerPC cache line size implementation dependant. |
612 |
void OPPROTO glue(op_dcbz_l32, MEMSUFFIX) (void) |
613 |
{
|
|
3709
by j_mayer
Add new sane low-level memory accessors for PowerPC that do proper |
614 |
T0 &= ~((uint32_t)31); |
615 |
glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x00), 0); |
|
616 |
glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x04), 0); |
|
617 |
glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x08), 0); |
|
618 |
glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x0C), 0); |
|
619 |
glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x10), 0); |
|
620 |
glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x14), 0); |
|
621 |
glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x18), 0); |
|
622 |
glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x1C), 0); |
|
3311
by j_mayer
Make PowerPC cache line size implementation dependant. |
623 |
RETURN(); |
624 |
}
|
|
625 |
||
626 |
void OPPROTO glue(op_dcbz_l64, MEMSUFFIX) (void) |
|
627 |
{
|
|
3709
by j_mayer
Add new sane low-level memory accessors for PowerPC that do proper |
628 |
T0 &= ~((uint32_t)63); |
629 |
glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x00), 0); |
|
630 |
glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x04), 0); |
|
631 |
glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x08), 0); |
|
632 |
glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x0C), 0); |
|
633 |
glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x10), 0); |
|
634 |
glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x14), 0); |
|
635 |
glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x18), 0); |
|
636 |
glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x1C), 0); |
|
637 |
glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x20UL), 0); |
|
638 |
glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x24UL), 0); |
|
639 |
glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x28UL), 0); |
|
640 |
glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x2CUL), 0); |
|
641 |
glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x30UL), 0); |
|
642 |
glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x34UL), 0); |
|
643 |
glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x38UL), 0); |
|
644 |
glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x3CUL), 0); |
|
3311
by j_mayer
Make PowerPC cache line size implementation dependant. |
645 |
RETURN(); |
646 |
}
|
|
647 |
||
648 |
void OPPROTO glue(op_dcbz_l128, MEMSUFFIX) (void) |
|
649 |
{
|
|
3709
by j_mayer
Add new sane low-level memory accessors for PowerPC that do proper |
650 |
T0 &= ~((uint32_t)127); |
651 |
glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x00), 0); |
|
652 |
glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x04), 0); |
|
653 |
glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x08), 0); |
|
654 |
glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x0C), 0); |
|
655 |
glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x10), 0); |
|
656 |
glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x14), 0); |
|
657 |
glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x18), 0); |
|
658 |
glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x1C), 0); |
|
659 |
glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x20UL), 0); |
|
660 |
glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x24UL), 0); |
|
661 |
glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x28UL), 0); |
|
662 |
glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x2CUL), 0); |
|
663 |
glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x30UL), 0); |
|
664 |
glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x34UL), 0); |
|
665 |
glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x38UL), 0); |
|
666 |
glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x3CUL), 0); |
|
667 |
glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x40UL), 0); |
|
668 |
glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x44UL), 0); |
|
669 |
glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x48UL), 0); |
|
670 |
glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x4CUL), 0); |
|
671 |
glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x50UL), 0); |
|
672 |
glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x54UL), 0); |
|
673 |
glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x58UL), 0); |
|
674 |
glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x5CUL), 0); |
|
675 |
glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x60UL), 0); |
|
676 |
glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x64UL), 0); |
|
677 |
glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x68UL), 0); |
|
678 |
glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x6CUL), 0); |
|
679 |
glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x70UL), 0); |
|
680 |
glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x74UL), 0); |
|
681 |
glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x78UL), 0); |
|
682 |
glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x7CUL), 0); |
|
3311
by j_mayer
Make PowerPC cache line size implementation dependant. |
683 |
RETURN(); |
684 |
}
|
|
685 |
||
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
686 |
void OPPROTO glue(op_dcbz, MEMSUFFIX) (void) |
687 |
{
|
|
3311
by j_mayer
Make PowerPC cache line size implementation dependant. |
688 |
glue(do_dcbz, MEMSUFFIX)(); |
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
689 |
RETURN(); |
690 |
}
|
|
691 |
||
692 |
#if defined(TARGET_PPC64)
|
|
3311
by j_mayer
Make PowerPC cache line size implementation dependant. |
693 |
void OPPROTO glue(op_dcbz_l32_64, MEMSUFFIX) (void) |
694 |
{
|
|
3709
by j_mayer
Add new sane low-level memory accessors for PowerPC that do proper |
695 |
T0 &= ~((uint64_t)31); |
696 |
glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x00), 0); |
|
697 |
glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x04), 0); |
|
698 |
glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x08), 0); |
|
699 |
glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x0C), 0); |
|
700 |
glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x10), 0); |
|
701 |
glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x14), 0); |
|
702 |
glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x18), 0); |
|
703 |
glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x1C), 0); |
|
3311
by j_mayer
Make PowerPC cache line size implementation dependant. |
704 |
RETURN(); |
705 |
}
|
|
706 |
||
707 |
void OPPROTO glue(op_dcbz_l64_64, MEMSUFFIX) (void) |
|
708 |
{
|
|
3709
by j_mayer
Add new sane low-level memory accessors for PowerPC that do proper |
709 |
T0 &= ~((uint64_t)63); |
710 |
glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x00), 0); |
|
711 |
glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x04), 0); |
|
712 |
glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x08), 0); |
|
713 |
glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x0C), 0); |
|
714 |
glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x10), 0); |
|
715 |
glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x14), 0); |
|
716 |
glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x18), 0); |
|
717 |
glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x1C), 0); |
|
718 |
glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x20UL), 0); |
|
719 |
glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x24UL), 0); |
|
720 |
glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x28UL), 0); |
|
721 |
glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x2CUL), 0); |
|
722 |
glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x30UL), 0); |
|
723 |
glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x34UL), 0); |
|
724 |
glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x38UL), 0); |
|
725 |
glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x3CUL), 0); |
|
3311
by j_mayer
Make PowerPC cache line size implementation dependant. |
726 |
RETURN(); |
727 |
}
|
|
728 |
||
729 |
void OPPROTO glue(op_dcbz_l128_64, MEMSUFFIX) (void) |
|
730 |
{
|
|
3709
by j_mayer
Add new sane low-level memory accessors for PowerPC that do proper |
731 |
T0 &= ~((uint64_t)127); |
732 |
glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x00), 0); |
|
733 |
glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x04), 0); |
|
734 |
glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x08), 0); |
|
735 |
glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x0C), 0); |
|
736 |
glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x10), 0); |
|
737 |
glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x14), 0); |
|
738 |
glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x18), 0); |
|
739 |
glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x1C), 0); |
|
740 |
glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x20UL), 0); |
|
741 |
glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x24UL), 0); |
|
742 |
glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x28UL), 0); |
|
743 |
glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x2CUL), 0); |
|
744 |
glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x30UL), 0); |
|
745 |
glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x34UL), 0); |
|
746 |
glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x38UL), 0); |
|
747 |
glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x3CUL), 0); |
|
748 |
glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x40UL), 0); |
|
749 |
glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x44UL), 0); |
|
750 |
glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x48UL), 0); |
|
751 |
glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x4CUL), 0); |
|
752 |
glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x50UL), 0); |
|
753 |
glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x54UL), 0); |
|
754 |
glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x58UL), 0); |
|
755 |
glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x5CUL), 0); |
|
756 |
glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x60UL), 0); |
|
757 |
glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x64UL), 0); |
|
758 |
glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x68UL), 0); |
|
759 |
glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x6CUL), 0); |
|
760 |
glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x70UL), 0); |
|
761 |
glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x74UL), 0); |
|
762 |
glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x78UL), 0); |
|
763 |
glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x7CUL), 0); |
|
3311
by j_mayer
Make PowerPC cache line size implementation dependant. |
764 |
RETURN(); |
765 |
}
|
|
766 |
||
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
767 |
void OPPROTO glue(op_dcbz_64, MEMSUFFIX) (void) |
768 |
{
|
|
3311
by j_mayer
Make PowerPC cache line size implementation dependant. |
769 |
glue(do_dcbz_64, MEMSUFFIX)(); |
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
770 |
RETURN(); |
771 |
}
|
|
772 |
#endif
|
|
525
by bellard
PowerPC system emulation (Jocelyn Mayer) - modified patch to use new TLB api |
773 |
|
2482
by j_mayer
As icbi is not a priviledge instruction and is treated as a load by the MMU |
774 |
/* Instruction cache block invalidate */
|
775 |
void OPPROTO glue(op_icbi, MEMSUFFIX) (void) |
|
776 |
{
|
|
777 |
glue(do_icbi, MEMSUFFIX)(); |
|
778 |
RETURN(); |
|
779 |
}
|
|
780 |
||
781 |
#if defined(TARGET_PPC64)
|
|
782 |
void OPPROTO glue(op_icbi_64, MEMSUFFIX) (void) |
|
783 |
{
|
|
784 |
glue(do_icbi_64, MEMSUFFIX)(); |
|
785 |
RETURN(); |
|
786 |
}
|
|
787 |
#endif
|
|
788 |
||
525
by bellard
PowerPC system emulation (Jocelyn Mayer) - modified patch to use new TLB api |
789 |
/* External access */
|
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
790 |
void OPPROTO glue(op_eciwx, MEMSUFFIX) (void) |
791 |
{
|
|
3709
by j_mayer
Add new sane low-level memory accessors for PowerPC that do proper |
792 |
T1 = glue(ldu32, MEMSUFFIX)((uint32_t)T0); |
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
793 |
RETURN(); |
794 |
}
|
|
795 |
||
796 |
#if defined(TARGET_PPC64)
|
|
797 |
void OPPROTO glue(op_eciwx_64, MEMSUFFIX) (void) |
|
798 |
{
|
|
3709
by j_mayer
Add new sane low-level memory accessors for PowerPC that do proper |
799 |
T1 = glue(ldu32, MEMSUFFIX)((uint64_t)T0); |
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
800 |
RETURN(); |
801 |
}
|
|
802 |
#endif
|
|
803 |
||
804 |
void OPPROTO glue(op_ecowx, MEMSUFFIX) (void) |
|
805 |
{
|
|
3709
by j_mayer
Add new sane low-level memory accessors for PowerPC that do proper |
806 |
glue(st32, MEMSUFFIX)((uint32_t)T0, T1); |
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
807 |
RETURN(); |
808 |
}
|
|
809 |
||
810 |
#if defined(TARGET_PPC64)
|
|
811 |
void OPPROTO glue(op_ecowx_64, MEMSUFFIX) (void) |
|
812 |
{
|
|
3709
by j_mayer
Add new sane low-level memory accessors for PowerPC that do proper |
813 |
glue(st32, MEMSUFFIX)((uint64_t)T0, T1); |
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
814 |
RETURN(); |
815 |
}
|
|
816 |
#endif
|
|
817 |
||
818 |
void OPPROTO glue(op_eciwx_le, MEMSUFFIX) (void) |
|
819 |
{
|
|
3709
by j_mayer
Add new sane low-level memory accessors for PowerPC that do proper |
820 |
T1 = glue(ldu32r, MEMSUFFIX)((uint32_t)T0); |
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
821 |
RETURN(); |
822 |
}
|
|
823 |
||
824 |
#if defined(TARGET_PPC64)
|
|
825 |
void OPPROTO glue(op_eciwx_le_64, MEMSUFFIX) (void) |
|
826 |
{
|
|
3709
by j_mayer
Add new sane low-level memory accessors for PowerPC that do proper |
827 |
T1 = glue(ldu32r, MEMSUFFIX)((uint64_t)T0); |
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
828 |
RETURN(); |
829 |
}
|
|
830 |
#endif
|
|
831 |
||
832 |
void OPPROTO glue(op_ecowx_le, MEMSUFFIX) (void) |
|
833 |
{
|
|
834 |
glue(st32r, MEMSUFFIX)((uint32_t)T0, T1); |
|
835 |
RETURN(); |
|
836 |
}
|
|
837 |
||
838 |
#if defined(TARGET_PPC64)
|
|
839 |
void OPPROTO glue(op_ecowx_le_64, MEMSUFFIX) (void) |
|
840 |
{
|
|
841 |
glue(st32r, MEMSUFFIX)((uint64_t)T0, T1); |
|
842 |
RETURN(); |
|
843 |
}
|
|
844 |
#endif
|
|
1374
by bellard
This patch adds little-endian mode support to PPC emulation. |
845 |
|
2463
by j_mayer
Great PowerPC emulation code resynchronisation and improvments: |
846 |
/* XXX: those micro-ops need tests ! */
|
847 |
/* PowerPC 601 specific instructions (POWER bridge) */
|
|
848 |
void OPPROTO glue(op_POWER_lscbx, MEMSUFFIX) (void) |
|
849 |
{
|
|
850 |
/* When byte count is 0, do nothing */
|
|
2472
by j_mayer
Make it safe to use 64 bits GPR and/or 64 bits host registers. |
851 |
if (likely(T1 != 0)) { |
2463
by j_mayer
Great PowerPC emulation code resynchronisation and improvments: |
852 |
glue(do_POWER_lscbx, MEMSUFFIX)(PARAM1, PARAM2, PARAM3); |
853 |
}
|
|
854 |
RETURN(); |
|
855 |
}
|
|
856 |
||
857 |
/* POWER2 quad load and store */
|
|
858 |
/* XXX: TAGs are not managed */
|
|
859 |
void OPPROTO glue(op_POWER2_lfq, MEMSUFFIX) (void) |
|
860 |
{
|
|
861 |
glue(do_POWER2_lfq, MEMSUFFIX)(); |
|
862 |
RETURN(); |
|
863 |
}
|
|
864 |
||
865 |
void glue(op_POWER2_lfq_le, MEMSUFFIX) (void) |
|
866 |
{
|
|
867 |
glue(do_POWER2_lfq_le, MEMSUFFIX)(); |
|
868 |
RETURN(); |
|
869 |
}
|
|
870 |
||
871 |
void OPPROTO glue(op_POWER2_stfq, MEMSUFFIX) (void) |
|
872 |
{
|
|
873 |
glue(do_POWER2_stfq, MEMSUFFIX)(); |
|
874 |
RETURN(); |
|
875 |
}
|
|
876 |
||
877 |
void OPPROTO glue(op_POWER2_stfq_le, MEMSUFFIX) (void) |
|
878 |
{
|
|
879 |
glue(do_POWER2_stfq_le, MEMSUFFIX)(); |
|
880 |
RETURN(); |
|
881 |
}
|
|
882 |
||
3339
by j_mayer
Implement PowerPC Altivec load & stores, used by Apple firmware for memcpy. |
883 |
/* Altivec vector extension */
|
884 |
#if defined(WORDS_BIGENDIAN)
|
|
885 |
#define VR_DWORD0 0
|
|
886 |
#define VR_DWORD1 1
|
|
887 |
#else
|
|
888 |
#define VR_DWORD0 1
|
|
889 |
#define VR_DWORD1 0
|
|
890 |
#endif
|
|
891 |
void OPPROTO glue(op_vr_lvx, MEMSUFFIX) (void) |
|
892 |
{
|
|
3709
by j_mayer
Add new sane low-level memory accessors for PowerPC that do proper |
893 |
AVR0.u64[VR_DWORD0] = glue(ldu64, MEMSUFFIX)((uint32_t)T0); |
894 |
AVR0.u64[VR_DWORD1] = glue(ldu64, MEMSUFFIX)((uint32_t)T0 + 8); |
|
3339
by j_mayer
Implement PowerPC Altivec load & stores, used by Apple firmware for memcpy. |
895 |
}
|
896 |
||
897 |
void OPPROTO glue(op_vr_lvx_le, MEMSUFFIX) (void) |
|
898 |
{
|
|
3709
by j_mayer
Add new sane low-level memory accessors for PowerPC that do proper |
899 |
AVR0.u64[VR_DWORD1] = glue(ldu64r, MEMSUFFIX)((uint32_t)T0); |
900 |
AVR0.u64[VR_DWORD0] = glue(ldu64r, MEMSUFFIX)((uint32_t)T0 + 8); |
|
3339
by j_mayer
Implement PowerPC Altivec load & stores, used by Apple firmware for memcpy. |
901 |
}
|
902 |
||
903 |
void OPPROTO glue(op_vr_stvx, MEMSUFFIX) (void) |
|
904 |
{
|
|
3709
by j_mayer
Add new sane low-level memory accessors for PowerPC that do proper |
905 |
glue(st64, MEMSUFFIX)((uint32_t)T0, AVR0.u64[VR_DWORD0]); |
906 |
glue(st64, MEMSUFFIX)((uint32_t)T0 + 8, AVR0.u64[VR_DWORD1]); |
|
3339
by j_mayer
Implement PowerPC Altivec load & stores, used by Apple firmware for memcpy. |
907 |
}
|
908 |
||
909 |
void OPPROTO glue(op_vr_stvx_le, MEMSUFFIX) (void) |
|
910 |
{
|
|
3709
by j_mayer
Add new sane low-level memory accessors for PowerPC that do proper |
911 |
glue(st64r, MEMSUFFIX)((uint32_t)T0, AVR0.u64[VR_DWORD1]); |
912 |
glue(st64r, MEMSUFFIX)((uint32_t)T0 + 8, AVR0.u64[VR_DWORD0]); |
|
3339
by j_mayer
Implement PowerPC Altivec load & stores, used by Apple firmware for memcpy. |
913 |
}
|
914 |
||
915 |
#if defined(TARGET_PPC64)
|
|
916 |
void OPPROTO glue(op_vr_lvx_64, MEMSUFFIX) (void) |
|
917 |
{
|
|
3709
by j_mayer
Add new sane low-level memory accessors for PowerPC that do proper |
918 |
AVR0.u64[VR_DWORD0] = glue(ldu64, MEMSUFFIX)((uint64_t)T0); |
919 |
AVR0.u64[VR_DWORD1] = glue(ldu64, MEMSUFFIX)((uint64_t)T0 + 8); |
|
3339
by j_mayer
Implement PowerPC Altivec load & stores, used by Apple firmware for memcpy. |
920 |
}
|
921 |
||
922 |
void OPPROTO glue(op_vr_lvx_le_64, MEMSUFFIX) (void) |
|
923 |
{
|
|
3709
by j_mayer
Add new sane low-level memory accessors for PowerPC that do proper |
924 |
AVR0.u64[VR_DWORD1] = glue(ldu64r, MEMSUFFIX)((uint64_t)T0); |
925 |
AVR0.u64[VR_DWORD0] = glue(ldu64r, MEMSUFFIX)((uint64_t)T0 + 8); |
|
3339
by j_mayer
Implement PowerPC Altivec load & stores, used by Apple firmware for memcpy. |
926 |
}
|
927 |
||
928 |
void OPPROTO glue(op_vr_stvx_64, MEMSUFFIX) (void) |
|
929 |
{
|
|
3709
by j_mayer
Add new sane low-level memory accessors for PowerPC that do proper |
930 |
glue(st64, MEMSUFFIX)((uint64_t)T0, AVR0.u64[VR_DWORD0]); |
931 |
glue(st64, MEMSUFFIX)((uint64_t)T0 + 8, AVR0.u64[VR_DWORD1]); |
|
3339
by j_mayer
Implement PowerPC Altivec load & stores, used by Apple firmware for memcpy. |
932 |
}
|
933 |
||
934 |
void OPPROTO glue(op_vr_stvx_le_64, MEMSUFFIX) (void) |
|
935 |
{
|
|
3709
by j_mayer
Add new sane low-level memory accessors for PowerPC that do proper |
936 |
glue(st64r, MEMSUFFIX)((uint64_t)T0, AVR0.u64[VR_DWORD1]); |
937 |
glue(st64r, MEMSUFFIX)((uint64_t)T0 + 8, AVR0.u64[VR_DWORD0]); |
|
3339
by j_mayer
Implement PowerPC Altivec load & stores, used by Apple firmware for memcpy. |
938 |
}
|
939 |
#endif
|
|
940 |
#undef VR_DWORD0
|
|
941 |
#undef VR_DWORD1
|
|
942 |
||
2509
by j_mayer
PowerPC 2.03 SPE extension - first pass. |
943 |
/* SPE extension */
|
944 |
#define _PPC_SPE_LD_OP(name, op) \
|
|
945 |
void OPPROTO glue(glue(op_spe_l, name), MEMSUFFIX) (void) \
|
|
946 |
{ \
|
|
947 |
T1_64 = glue(op, MEMSUFFIX)((uint32_t)T0); \
|
|
948 |
RETURN(); \
|
|
949 |
}
|
|
950 |
||
951 |
#if defined(TARGET_PPC64)
|
|
952 |
#define _PPC_SPE_LD_OP_64(name, op) \
|
|
953 |
void OPPROTO glue(glue(glue(op_spe_l, name), _64), MEMSUFFIX) (void) \
|
|
954 |
{ \
|
|
955 |
T1_64 = glue(op, MEMSUFFIX)((uint64_t)T0); \
|
|
956 |
RETURN(); \
|
|
957 |
}
|
|
958 |
#define PPC_SPE_LD_OP(name, op) \
|
|
959 |
_PPC_SPE_LD_OP(name, op); \
|
|
960 |
_PPC_SPE_LD_OP_64(name, op)
|
|
961 |
#else
|
|
962 |
#define PPC_SPE_LD_OP(name, op) \
|
|
963 |
_PPC_SPE_LD_OP(name, op)
|
|
964 |
#endif
|
|
965 |
||
966 |
#define _PPC_SPE_ST_OP(name, op) \
|
|
967 |
void OPPROTO glue(glue(op_spe_st, name), MEMSUFFIX) (void) \
|
|
968 |
{ \
|
|
969 |
glue(op, MEMSUFFIX)((uint32_t)T0, T1_64); \
|
|
970 |
RETURN(); \
|
|
971 |
}
|
|
972 |
||
973 |
#if defined(TARGET_PPC64)
|
|
974 |
#define _PPC_SPE_ST_OP_64(name, op) \
|
|
975 |
void OPPROTO glue(glue(glue(op_spe_st, name), _64), MEMSUFFIX) (void) \
|
|
976 |
{ \
|
|
977 |
glue(op, MEMSUFFIX)((uint64_t)T0, T1_64); \
|
|
978 |
RETURN(); \
|
|
979 |
}
|
|
980 |
#define PPC_SPE_ST_OP(name, op) \
|
|
981 |
_PPC_SPE_ST_OP(name, op); \
|
|
982 |
_PPC_SPE_ST_OP_64(name, op)
|
|
983 |
#else
|
|
984 |
#define PPC_SPE_ST_OP(name, op) \
|
|
985 |
_PPC_SPE_ST_OP(name, op)
|
|
986 |
#endif
|
|
987 |
||
988 |
#if !defined(TARGET_PPC64)
|
|
3709
by j_mayer
Add new sane low-level memory accessors for PowerPC that do proper |
989 |
PPC_SPE_LD_OP(dd, ldu64); |
990 |
PPC_SPE_ST_OP(dd, st64); |
|
991 |
PPC_SPE_LD_OP(dd_le, ldu64r); |
|
2509
by j_mayer
PowerPC 2.03 SPE extension - first pass. |
992 |
PPC_SPE_ST_OP(dd_le, st64r); |
993 |
#endif
|
|
3337
by j_mayer
PowerPC target optimisations: make intensive use of always_inline. |
994 |
static always_inline uint64_t glue(spe_ldw, MEMSUFFIX) (target_ulong EA) |
2509
by j_mayer
PowerPC 2.03 SPE extension - first pass. |
995 |
{
|
996 |
uint64_t ret; |
|
3709
by j_mayer
Add new sane low-level memory accessors for PowerPC that do proper |
997 |
ret = (uint64_t)glue(ldu32, MEMSUFFIX)(EA) << 32; |
998 |
ret |= (uint64_t)glue(ldu32, MEMSUFFIX)(EA + 4); |
|
2509
by j_mayer
PowerPC 2.03 SPE extension - first pass. |
999 |
return ret; |
1000 |
}
|
|
1001 |
PPC_SPE_LD_OP(dw, spe_ldw); |
|
3337
by j_mayer
PowerPC target optimisations: make intensive use of always_inline. |
1002 |
static always_inline void glue(spe_stdw, MEMSUFFIX) (target_ulong EA, |
1003 |
uint64_t data) |
|
2509
by j_mayer
PowerPC 2.03 SPE extension - first pass. |
1004 |
{
|
3709
by j_mayer
Add new sane low-level memory accessors for PowerPC that do proper |
1005 |
glue(st32, MEMSUFFIX)(EA, data >> 32); |
1006 |
glue(st32, MEMSUFFIX)(EA + 4, data); |
|
2509
by j_mayer
PowerPC 2.03 SPE extension - first pass. |
1007 |
}
|
1008 |
PPC_SPE_ST_OP(dw, spe_stdw); |
|
3337
by j_mayer
PowerPC target optimisations: make intensive use of always_inline. |
1009 |
static always_inline uint64_t glue(spe_ldw_le, MEMSUFFIX) (target_ulong EA) |
2509
by j_mayer
PowerPC 2.03 SPE extension - first pass. |
1010 |
{
|
1011 |
uint64_t ret; |
|
3709
by j_mayer
Add new sane low-level memory accessors for PowerPC that do proper |
1012 |
ret = (uint64_t)glue(ldu32r, MEMSUFFIX)(EA) << 32; |
1013 |
ret |= (uint64_t)glue(ldu32r, MEMSUFFIX)(EA + 4); |
|
2509
by j_mayer
PowerPC 2.03 SPE extension - first pass. |
1014 |
return ret; |
1015 |
}
|
|
1016 |
PPC_SPE_LD_OP(dw_le, spe_ldw_le); |
|
3337
by j_mayer
PowerPC target optimisations: make intensive use of always_inline. |
1017 |
static always_inline void glue(spe_stdw_le, MEMSUFFIX) (target_ulong EA, |
1018 |
uint64_t data) |
|
2509
by j_mayer
PowerPC 2.03 SPE extension - first pass. |
1019 |
{
|
1020 |
glue(st32r, MEMSUFFIX)(EA, data >> 32); |
|
1021 |
glue(st32r, MEMSUFFIX)(EA + 4, data); |
|
1022 |
}
|
|
1023 |
PPC_SPE_ST_OP(dw_le, spe_stdw_le); |
|
3337
by j_mayer
PowerPC target optimisations: make intensive use of always_inline. |
1024 |
static always_inline uint64_t glue(spe_ldh, MEMSUFFIX) (target_ulong EA) |
2509
by j_mayer
PowerPC 2.03 SPE extension - first pass. |
1025 |
{
|
1026 |
uint64_t ret; |
|
3709
by j_mayer
Add new sane low-level memory accessors for PowerPC that do proper |
1027 |
ret = (uint64_t)glue(ldu16, MEMSUFFIX)(EA) << 48; |
1028 |
ret |= (uint64_t)glue(ldu16, MEMSUFFIX)(EA + 2) << 32; |
|
1029 |
ret |= (uint64_t)glue(ldu16, MEMSUFFIX)(EA + 4) << 16; |
|
1030 |
ret |= (uint64_t)glue(ldu16, MEMSUFFIX)(EA + 6); |
|
2509
by j_mayer
PowerPC 2.03 SPE extension - first pass. |
1031 |
return ret; |
1032 |
}
|
|
1033 |
PPC_SPE_LD_OP(dh, spe_ldh); |
|
3337
by j_mayer
PowerPC target optimisations: make intensive use of always_inline. |
1034 |
static always_inline void glue(spe_stdh, MEMSUFFIX) (target_ulong EA, |
1035 |
uint64_t data) |
|
2509
by j_mayer
PowerPC 2.03 SPE extension - first pass. |
1036 |
{
|
3709
by j_mayer
Add new sane low-level memory accessors for PowerPC that do proper |
1037 |
glue(st16, MEMSUFFIX)(EA, data >> 48); |
1038 |
glue(st16, MEMSUFFIX)(EA + 2, data >> 32); |
|
1039 |
glue(st16, MEMSUFFIX)(EA + 4, data >> 16); |
|
1040 |
glue(st16, MEMSUFFIX)(EA + 6, data); |
|
2509
by j_mayer
PowerPC 2.03 SPE extension - first pass. |
1041 |
}
|
1042 |
PPC_SPE_ST_OP(dh, spe_stdh); |
|
3337
by j_mayer
PowerPC target optimisations: make intensive use of always_inline. |
1043 |
static always_inline uint64_t glue(spe_ldh_le, MEMSUFFIX) (target_ulong EA) |
2509
by j_mayer
PowerPC 2.03 SPE extension - first pass. |
1044 |
{
|
1045 |
uint64_t ret; |
|
3709
by j_mayer
Add new sane low-level memory accessors for PowerPC that do proper |
1046 |
ret = (uint64_t)glue(ldu16r, MEMSUFFIX)(EA) << 48; |
1047 |
ret |= (uint64_t)glue(ldu16r, MEMSUFFIX)(EA + 2) << 32; |
|
1048 |
ret |= (uint64_t)glue(ldu16r, MEMSUFFIX)(EA + 4) << 16; |
|
1049 |
ret |= (uint64_t)glue(ldu16r, MEMSUFFIX)(EA + 6); |
|
2509
by j_mayer
PowerPC 2.03 SPE extension - first pass. |
1050 |
return ret; |
1051 |
}
|
|
1052 |
PPC_SPE_LD_OP(dh_le, spe_ldh_le); |
|
3337
by j_mayer
PowerPC target optimisations: make intensive use of always_inline. |
1053 |
static always_inline void glue(spe_stdh_le, MEMSUFFIX) (target_ulong EA, |
1054 |
uint64_t data) |
|
2509
by j_mayer
PowerPC 2.03 SPE extension - first pass. |
1055 |
{
|
1056 |
glue(st16r, MEMSUFFIX)(EA, data >> 48); |
|
1057 |
glue(st16r, MEMSUFFIX)(EA + 2, data >> 32); |
|
1058 |
glue(st16r, MEMSUFFIX)(EA + 4, data >> 16); |
|
1059 |
glue(st16r, MEMSUFFIX)(EA + 6, data); |
|
1060 |
}
|
|
1061 |
PPC_SPE_ST_OP(dh_le, spe_stdh_le); |
|
3337
by j_mayer
PowerPC target optimisations: make intensive use of always_inline. |
1062 |
static always_inline uint64_t glue(spe_lwhe, MEMSUFFIX) (target_ulong EA) |
2509
by j_mayer
PowerPC 2.03 SPE extension - first pass. |
1063 |
{
|
1064 |
uint64_t ret; |
|
3709
by j_mayer
Add new sane low-level memory accessors for PowerPC that do proper |
1065 |
ret = (uint64_t)glue(ldu16, MEMSUFFIX)(EA) << 48; |
1066 |
ret |= (uint64_t)glue(ldu16, MEMSUFFIX)(EA + 2) << 16; |
|
2509
by j_mayer
PowerPC 2.03 SPE extension - first pass. |
1067 |
return ret; |
1068 |
}
|
|
1069 |
PPC_SPE_LD_OP(whe, spe_lwhe); |
|
3337
by j_mayer
PowerPC target optimisations: make intensive use of always_inline. |
1070 |
static always_inline void glue(spe_stwhe, MEMSUFFIX) (target_ulong EA, |
1071 |
uint64_t data) |
|
2509
by j_mayer
PowerPC 2.03 SPE extension - first pass. |
1072 |
{
|
3709
by j_mayer
Add new sane low-level memory accessors for PowerPC that do proper |
1073 |
glue(st16, MEMSUFFIX)(EA, data >> 48); |
1074 |
glue(st16, MEMSUFFIX)(EA + 2, data >> 16); |
|
2509
by j_mayer
PowerPC 2.03 SPE extension - first pass. |
1075 |
}
|
1076 |
PPC_SPE_ST_OP(whe, spe_stwhe); |
|
3337
by j_mayer
PowerPC target optimisations: make intensive use of always_inline. |
1077 |
static always_inline uint64_t glue(spe_lwhe_le, MEMSUFFIX) (target_ulong EA) |
2509
by j_mayer
PowerPC 2.03 SPE extension - first pass. |
1078 |
{
|
1079 |
uint64_t ret; |
|
3709
by j_mayer
Add new sane low-level memory accessors for PowerPC that do proper |
1080 |
ret = (uint64_t)glue(ldu16r, MEMSUFFIX)(EA) << 48; |
1081 |
ret |= (uint64_t)glue(ldu16r, MEMSUFFIX)(EA + 2) << 16; |
|
2509
by j_mayer
PowerPC 2.03 SPE extension - first pass. |
1082 |
return ret; |
1083 |
}
|
|
1084 |
PPC_SPE_LD_OP(whe_le, spe_lwhe_le); |
|
3337
by j_mayer
PowerPC target optimisations: make intensive use of always_inline. |
1085 |
static always_inline void glue(spe_stwhe_le, MEMSUFFIX) (target_ulong EA, |
1086 |
uint64_t data) |
|
2509
by j_mayer
PowerPC 2.03 SPE extension - first pass. |
1087 |
{
|
1088 |
glue(st16r, MEMSUFFIX)(EA, data >> 48); |
|
1089 |
glue(st16r, MEMSUFFIX)(EA + 2, data >> 16); |
|
1090 |
}
|
|
1091 |
PPC_SPE_ST_OP(whe_le, spe_stwhe_le); |
|
3337
by j_mayer
PowerPC target optimisations: make intensive use of always_inline. |
1092 |
static always_inline uint64_t glue(spe_lwhou, MEMSUFFIX) (target_ulong EA) |
2509
by j_mayer
PowerPC 2.03 SPE extension - first pass. |
1093 |
{
|
1094 |
uint64_t ret; |
|
3709
by j_mayer
Add new sane low-level memory accessors for PowerPC that do proper |
1095 |
ret = (uint64_t)glue(ldu16, MEMSUFFIX)(EA) << 32; |
1096 |
ret |= (uint64_t)glue(ldu16, MEMSUFFIX)(EA + 2); |
|
2509
by j_mayer
PowerPC 2.03 SPE extension - first pass. |
1097 |
return ret; |
1098 |
}
|
|
1099 |
PPC_SPE_LD_OP(whou, spe_lwhou); |
|
3337
by j_mayer
PowerPC target optimisations: make intensive use of always_inline. |
1100 |
static always_inline uint64_t glue(spe_lwhos, MEMSUFFIX) (target_ulong EA) |
2509
by j_mayer
PowerPC 2.03 SPE extension - first pass. |
1101 |
{
|
1102 |
uint64_t ret; |
|
3709
by j_mayer
Add new sane low-level memory accessors for PowerPC that do proper |
1103 |
ret = ((uint64_t)((int32_t)glue(lds16, MEMSUFFIX)(EA))) << 32; |
1104 |
ret |= (uint64_t)((int32_t)glue(lds16, MEMSUFFIX)(EA + 2)); |
|
2509
by j_mayer
PowerPC 2.03 SPE extension - first pass. |
1105 |
return ret; |
1106 |
}
|
|
1107 |
PPC_SPE_LD_OP(whos, spe_lwhos); |
|
3337
by j_mayer
PowerPC target optimisations: make intensive use of always_inline. |
1108 |
static always_inline void glue(spe_stwho, MEMSUFFIX) (target_ulong EA, |
1109 |
uint64_t data) |
|
2509
by j_mayer
PowerPC 2.03 SPE extension - first pass. |
1110 |
{
|
3709
by j_mayer
Add new sane low-level memory accessors for PowerPC that do proper |
1111 |
glue(st16, MEMSUFFIX)(EA, data >> 32); |
1112 |
glue(st16, MEMSUFFIX)(EA + 2, data); |
|
2509
by j_mayer
PowerPC 2.03 SPE extension - first pass. |
1113 |
}
|
1114 |
PPC_SPE_ST_OP(who, spe_stwho); |
|
3337
by j_mayer
PowerPC target optimisations: make intensive use of always_inline. |
1115 |
static always_inline uint64_t glue(spe_lwhou_le, MEMSUFFIX) (target_ulong EA) |
2509
by j_mayer
PowerPC 2.03 SPE extension - first pass. |
1116 |
{
|
1117 |
uint64_t ret; |
|
3709
by j_mayer
Add new sane low-level memory accessors for PowerPC that do proper |
1118 |
ret = (uint64_t)glue(ldu16r, MEMSUFFIX)(EA) << 32; |
1119 |
ret |= (uint64_t)glue(ldu16r, MEMSUFFIX)(EA + 2); |
|
2509
by j_mayer
PowerPC 2.03 SPE extension - first pass. |
1120 |
return ret; |
1121 |
}
|
|
1122 |
PPC_SPE_LD_OP(whou_le, spe_lwhou_le); |
|
3337
by j_mayer
PowerPC target optimisations: make intensive use of always_inline. |
1123 |
static always_inline uint64_t glue(spe_lwhos_le, MEMSUFFIX) (target_ulong EA) |
2509
by j_mayer
PowerPC 2.03 SPE extension - first pass. |
1124 |
{
|
1125 |
uint64_t ret; |
|
3709
by j_mayer
Add new sane low-level memory accessors for PowerPC that do proper |
1126 |
ret = ((uint64_t)((int32_t)glue(lds16r, MEMSUFFIX)(EA))) << 32; |
1127 |
ret |= (uint64_t)((int32_t)glue(lds16r, MEMSUFFIX)(EA + 2)); |
|
2509
by j_mayer
PowerPC 2.03 SPE extension - first pass. |
1128 |
return ret; |
1129 |
}
|
|
1130 |
PPC_SPE_LD_OP(whos_le, spe_lwhos_le); |
|
3337
by j_mayer
PowerPC target optimisations: make intensive use of always_inline. |
1131 |
static always_inline void glue(spe_stwho_le, MEMSUFFIX) (target_ulong EA, |
1132 |
uint64_t data) |
|
2509
by j_mayer
PowerPC 2.03 SPE extension - first pass. |
1133 |
{
|
1134 |
glue(st16r, MEMSUFFIX)(EA, data >> 32); |
|
1135 |
glue(st16r, MEMSUFFIX)(EA + 2, data); |
|
1136 |
}
|
|
1137 |
PPC_SPE_ST_OP(who_le, spe_stwho_le); |
|
1138 |
#if !defined(TARGET_PPC64)
|
|
3337
by j_mayer
PowerPC target optimisations: make intensive use of always_inline. |
1139 |
static always_inline void glue(spe_stwwo, MEMSUFFIX) (target_ulong EA, |
1140 |
uint64_t data) |
|
2509
by j_mayer
PowerPC 2.03 SPE extension - first pass. |
1141 |
{
|
3709
by j_mayer
Add new sane low-level memory accessors for PowerPC that do proper |
1142 |
glue(st32, MEMSUFFIX)(EA, data); |
2509
by j_mayer
PowerPC 2.03 SPE extension - first pass. |
1143 |
}
|
1144 |
PPC_SPE_ST_OP(wwo, spe_stwwo); |
|
3337
by j_mayer
PowerPC target optimisations: make intensive use of always_inline. |
1145 |
static always_inline void glue(spe_stwwo_le, MEMSUFFIX) (target_ulong EA, |
1146 |
uint64_t data) |
|
2509
by j_mayer
PowerPC 2.03 SPE extension - first pass. |
1147 |
{
|
1148 |
glue(st32r, MEMSUFFIX)(EA, data); |
|
1149 |
}
|
|
1150 |
PPC_SPE_ST_OP(wwo_le, spe_stwwo_le); |
|
1151 |
#endif
|
|
3337
by j_mayer
PowerPC target optimisations: make intensive use of always_inline. |
1152 |
static always_inline uint64_t glue(spe_lh, MEMSUFFIX) (target_ulong EA) |
2509
by j_mayer
PowerPC 2.03 SPE extension - first pass. |
1153 |
{
|
1154 |
uint16_t tmp; |
|
3709
by j_mayer
Add new sane low-level memory accessors for PowerPC that do proper |
1155 |
tmp = glue(ldu16, MEMSUFFIX)(EA); |
2509
by j_mayer
PowerPC 2.03 SPE extension - first pass. |
1156 |
return ((uint64_t)tmp << 48) | ((uint64_t)tmp << 16); |
1157 |
}
|
|
1158 |
PPC_SPE_LD_OP(h, spe_lh); |
|
3337
by j_mayer
PowerPC target optimisations: make intensive use of always_inline. |
1159 |
static always_inline uint64_t glue(spe_lh_le, MEMSUFFIX) (target_ulong EA) |
2509
by j_mayer
PowerPC 2.03 SPE extension - first pass. |
1160 |
{
|
1161 |
uint16_t tmp; |
|
3709
by j_mayer
Add new sane low-level memory accessors for PowerPC that do proper |
1162 |
tmp = glue(ldu16r, MEMSUFFIX)(EA); |
2509
by j_mayer
PowerPC 2.03 SPE extension - first pass. |
1163 |
return ((uint64_t)tmp << 48) | ((uint64_t)tmp << 16); |
1164 |
}
|
|
1165 |
PPC_SPE_LD_OP(h_le, spe_lh_le); |
|
3337
by j_mayer
PowerPC target optimisations: make intensive use of always_inline. |
1166 |
static always_inline uint64_t glue(spe_lwwsplat, MEMSUFFIX) (target_ulong EA) |
2509
by j_mayer
PowerPC 2.03 SPE extension - first pass. |
1167 |
{
|
1168 |
uint32_t tmp; |
|
3709
by j_mayer
Add new sane low-level memory accessors for PowerPC that do proper |
1169 |
tmp = glue(ldu32, MEMSUFFIX)(EA); |
2509
by j_mayer
PowerPC 2.03 SPE extension - first pass. |
1170 |
return ((uint64_t)tmp << 32) | (uint64_t)tmp; |
1171 |
}
|
|
1172 |
PPC_SPE_LD_OP(wwsplat, spe_lwwsplat); |
|
3337
by j_mayer
PowerPC target optimisations: make intensive use of always_inline. |
1173 |
static always_inline |
1174 |
uint64_t glue(spe_lwwsplat_le, MEMSUFFIX) (target_ulong EA) |
|
2509
by j_mayer
PowerPC 2.03 SPE extension - first pass. |
1175 |
{
|
1176 |
uint32_t tmp; |
|
3709
by j_mayer
Add new sane low-level memory accessors for PowerPC that do proper |
1177 |
tmp = glue(ldu32r, MEMSUFFIX)(EA); |
2509
by j_mayer
PowerPC 2.03 SPE extension - first pass. |
1178 |
return ((uint64_t)tmp << 32) | (uint64_t)tmp; |
1179 |
}
|
|
1180 |
PPC_SPE_LD_OP(wwsplat_le, spe_lwwsplat_le); |
|
3337
by j_mayer
PowerPC target optimisations: make intensive use of always_inline. |
1181 |
static always_inline uint64_t glue(spe_lwhsplat, MEMSUFFIX) (target_ulong EA) |
2509
by j_mayer
PowerPC 2.03 SPE extension - first pass. |
1182 |
{
|
1183 |
uint64_t ret; |
|
1184 |
uint16_t tmp; |
|
3709
by j_mayer
Add new sane low-level memory accessors for PowerPC that do proper |
1185 |
tmp = glue(ldu16, MEMSUFFIX)(EA); |
2509
by j_mayer
PowerPC 2.03 SPE extension - first pass. |
1186 |
ret = ((uint64_t)tmp << 48) | ((uint64_t)tmp << 32); |
3709
by j_mayer
Add new sane low-level memory accessors for PowerPC that do proper |
1187 |
tmp = glue(ldu16, MEMSUFFIX)(EA + 2); |
2509
by j_mayer
PowerPC 2.03 SPE extension - first pass. |
1188 |
ret |= ((uint64_t)tmp << 16) | (uint64_t)tmp; |
1189 |
return ret; |
|
1190 |
}
|
|
1191 |
PPC_SPE_LD_OP(whsplat, spe_lwhsplat); |
|
3337
by j_mayer
PowerPC target optimisations: make intensive use of always_inline. |
1192 |
static always_inline |
1193 |
uint64_t glue(spe_lwhsplat_le, MEMSUFFIX) (target_ulong EA) |
|
2509
by j_mayer
PowerPC 2.03 SPE extension - first pass. |
1194 |
{
|
1195 |
uint64_t ret; |
|
1196 |
uint16_t tmp; |
|
3709
by j_mayer
Add new sane low-level memory accessors for PowerPC that do proper |
1197 |
tmp = glue(ldu16r, MEMSUFFIX)(EA); |
2509
by j_mayer
PowerPC 2.03 SPE extension - first pass. |
1198 |
ret = ((uint64_t)tmp << 48) | ((uint64_t)tmp << 32); |
3709
by j_mayer
Add new sane low-level memory accessors for PowerPC that do proper |
1199 |
tmp = glue(ldu16r, MEMSUFFIX)(EA + 2); |
2509
by j_mayer
PowerPC 2.03 SPE extension - first pass. |
1200 |
ret |= ((uint64_t)tmp << 16) | (uint64_t)tmp; |
1201 |
return ret; |
|
1202 |
}
|
|
1203 |
PPC_SPE_LD_OP(whsplat_le, spe_lwhsplat_le); |
|
1204 |
||
525
by bellard
PowerPC system emulation (Jocelyn Mayer) - modified patch to use new TLB api |
1205 |
#undef MEMSUFFIX
|