Commit e7c240035fe1ffbb6efba10e8db002f92459ad00
1 parent
67d6abff
Add new sane low-level memory accessors for PowerPC that do proper
size or zero extension, with homogenous names. Fix load & store strings: those are now endian-sensitive, by definition. Fix dcbz: must always align the target address to a cache line boundary. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3719 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
5 changed files
with
443 additions
and
524 deletions
target-ppc/op_helper.h
... | ... | @@ -22,9 +22,7 @@ |
22 | 22 | |
23 | 23 | /* Memory load/store helpers */ |
24 | 24 | void glue(do_lsw, MEMSUFFIX) (int dst); |
25 | -void glue(do_lsw_le, MEMSUFFIX) (int dst); | |
26 | 25 | void glue(do_stsw, MEMSUFFIX) (int src); |
27 | -void glue(do_stsw_le, MEMSUFFIX) (int src); | |
28 | 26 | void glue(do_lmw, MEMSUFFIX) (int dst); |
29 | 27 | void glue(do_lmw_le, MEMSUFFIX) (int dst); |
30 | 28 | void glue(do_stmw, MEMSUFFIX) (int src); |
... | ... | @@ -39,9 +37,7 @@ void glue(do_POWER2_stfq_le, MEMSUFFIX) (void); |
39 | 37 | |
40 | 38 | #if defined(TARGET_PPC64) |
41 | 39 | void glue(do_lsw_64, MEMSUFFIX) (int dst); |
42 | -void glue(do_lsw_le_64, MEMSUFFIX) (int dst); | |
43 | 40 | void glue(do_stsw_64, MEMSUFFIX) (int src); |
44 | -void glue(do_stsw_le_64, MEMSUFFIX) (int src); | |
45 | 41 | void glue(do_lmw_64, MEMSUFFIX) (int dst); |
46 | 42 | void glue(do_lmw_le_64, MEMSUFFIX) (int dst); |
47 | 43 | void glue(do_stmw_64, MEMSUFFIX) (int src); | ... | ... |
target-ppc/op_helper_mem.h
... | ... | @@ -18,27 +18,13 @@ |
18 | 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
19 | 19 | */ |
20 | 20 | |
21 | -/* Multiple word / string load and store */ | |
22 | -static always_inline target_ulong glue(ld32r, MEMSUFFIX) (target_ulong EA) | |
23 | -{ | |
24 | - uint32_t tmp = glue(ldl, MEMSUFFIX)(EA); | |
25 | - return ((tmp & 0xFF000000UL) >> 24) | ((tmp & 0x00FF0000UL) >> 8) | | |
26 | - ((tmp & 0x0000FF00UL) << 8) | ((tmp & 0x000000FFUL) << 24); | |
27 | -} | |
28 | - | |
29 | -static always_inline void glue(st32r, MEMSUFFIX) (target_ulong EA, | |
30 | - target_ulong data) | |
31 | -{ | |
32 | - uint32_t tmp = | |
33 | - ((data & 0xFF000000UL) >> 24) | ((data & 0x00FF0000UL) >> 8) | | |
34 | - ((data & 0x0000FF00UL) << 8) | ((data & 0x000000FFUL) << 24); | |
35 | - glue(stl, MEMSUFFIX)(EA, tmp); | |
36 | -} | |
21 | +#include "op_mem_access.h" | |
37 | 22 | |
23 | +/* Multiple word / string load and store */ | |
38 | 24 | void glue(do_lmw, MEMSUFFIX) (int dst) |
39 | 25 | { |
40 | 26 | for (; dst < 32; dst++, T0 += 4) { |
41 | - env->gpr[dst] = glue(ldl, MEMSUFFIX)((uint32_t)T0); | |
27 | + env->gpr[dst] = glue(ldu32, MEMSUFFIX)((uint32_t)T0); | |
42 | 28 | } |
43 | 29 | } |
44 | 30 | |
... | ... | @@ -46,7 +32,7 @@ void glue(do_lmw, MEMSUFFIX) (int dst) |
46 | 32 | void glue(do_lmw_64, MEMSUFFIX) (int dst) |
47 | 33 | { |
48 | 34 | for (; dst < 32; dst++, T0 += 4) { |
49 | - env->gpr[dst] = glue(ldl, MEMSUFFIX)((uint64_t)T0); | |
35 | + env->gpr[dst] = glue(ldu32, MEMSUFFIX)((uint64_t)T0); | |
50 | 36 | } |
51 | 37 | } |
52 | 38 | #endif |
... | ... | @@ -54,7 +40,7 @@ void glue(do_lmw_64, MEMSUFFIX) (int dst) |
54 | 40 | void glue(do_stmw, MEMSUFFIX) (int src) |
55 | 41 | { |
56 | 42 | for (; src < 32; src++, T0 += 4) { |
57 | - glue(stl, MEMSUFFIX)((uint32_t)T0, env->gpr[src]); | |
43 | + glue(st32, MEMSUFFIX)((uint32_t)T0, env->gpr[src]); | |
58 | 44 | } |
59 | 45 | } |
60 | 46 | |
... | ... | @@ -62,7 +48,7 @@ void glue(do_stmw, MEMSUFFIX) (int src) |
62 | 48 | void glue(do_stmw_64, MEMSUFFIX) (int src) |
63 | 49 | { |
64 | 50 | for (; src < 32; src++, T0 += 4) { |
65 | - glue(stl, MEMSUFFIX)((uint64_t)T0, env->gpr[src]); | |
51 | + glue(st32, MEMSUFFIX)((uint64_t)T0, env->gpr[src]); | |
66 | 52 | } |
67 | 53 | } |
68 | 54 | #endif |
... | ... | @@ -70,7 +56,7 @@ void glue(do_stmw_64, MEMSUFFIX) (int src) |
70 | 56 | void glue(do_lmw_le, MEMSUFFIX) (int dst) |
71 | 57 | { |
72 | 58 | for (; dst < 32; dst++, T0 += 4) { |
73 | - env->gpr[dst] = glue(ld32r, MEMSUFFIX)((uint32_t)T0); | |
59 | + env->gpr[dst] = glue(ldu32r, MEMSUFFIX)((uint32_t)T0); | |
74 | 60 | } |
75 | 61 | } |
76 | 62 | |
... | ... | @@ -78,7 +64,7 @@ void glue(do_lmw_le, MEMSUFFIX) (int dst) |
78 | 64 | void glue(do_lmw_le_64, MEMSUFFIX) (int dst) |
79 | 65 | { |
80 | 66 | for (; dst < 32; dst++, T0 += 4) { |
81 | - env->gpr[dst] = glue(ld32r, MEMSUFFIX)((uint64_t)T0); | |
67 | + env->gpr[dst] = glue(ldu32r, MEMSUFFIX)((uint64_t)T0); | |
82 | 68 | } |
83 | 69 | } |
84 | 70 | #endif |
... | ... | @@ -105,14 +91,14 @@ void glue(do_lsw, MEMSUFFIX) (int dst) |
105 | 91 | int sh; |
106 | 92 | |
107 | 93 | for (; T1 > 3; T1 -= 4, T0 += 4) { |
108 | - env->gpr[dst++] = glue(ldl, MEMSUFFIX)((uint32_t)T0); | |
94 | + env->gpr[dst++] = glue(ldu32, MEMSUFFIX)((uint32_t)T0); | |
109 | 95 | if (unlikely(dst == 32)) |
110 | 96 | dst = 0; |
111 | 97 | } |
112 | 98 | if (unlikely(T1 != 0)) { |
113 | 99 | tmp = 0; |
114 | 100 | for (sh = 24; T1 > 0; T1--, T0++, sh -= 8) { |
115 | - tmp |= glue(ldub, MEMSUFFIX)((uint32_t)T0) << sh; | |
101 | + tmp |= glue(ldu8, MEMSUFFIX)((uint32_t)T0) << sh; | |
116 | 102 | } |
117 | 103 | env->gpr[dst] = tmp; |
118 | 104 | } |
... | ... | @@ -125,14 +111,14 @@ void glue(do_lsw_64, MEMSUFFIX) (int dst) |
125 | 111 | int sh; |
126 | 112 | |
127 | 113 | for (; T1 > 3; T1 -= 4, T0 += 4) { |
128 | - env->gpr[dst++] = glue(ldl, MEMSUFFIX)((uint64_t)T0); | |
114 | + env->gpr[dst++] = glue(ldu32, MEMSUFFIX)((uint64_t)T0); | |
129 | 115 | if (unlikely(dst == 32)) |
130 | 116 | dst = 0; |
131 | 117 | } |
132 | 118 | if (unlikely(T1 != 0)) { |
133 | 119 | tmp = 0; |
134 | 120 | for (sh = 24; T1 > 0; T1--, T0++, sh -= 8) { |
135 | - tmp |= glue(ldub, MEMSUFFIX)((uint64_t)T0) << sh; | |
121 | + tmp |= glue(ldu8, MEMSUFFIX)((uint64_t)T0) << sh; | |
136 | 122 | } |
137 | 123 | env->gpr[dst] = tmp; |
138 | 124 | } |
... | ... | @@ -144,13 +130,13 @@ void glue(do_stsw, MEMSUFFIX) (int src) |
144 | 130 | int sh; |
145 | 131 | |
146 | 132 | for (; T1 > 3; T1 -= 4, T0 += 4) { |
147 | - glue(stl, MEMSUFFIX)((uint32_t)T0, env->gpr[src++]); | |
133 | + glue(st32, MEMSUFFIX)((uint32_t)T0, env->gpr[src++]); | |
148 | 134 | if (unlikely(src == 32)) |
149 | 135 | src = 0; |
150 | 136 | } |
151 | 137 | if (unlikely(T1 != 0)) { |
152 | 138 | for (sh = 24; T1 > 0; T1--, T0++, sh -= 8) |
153 | - glue(stb, MEMSUFFIX)((uint32_t)T0, (env->gpr[src] >> sh) & 0xFF); | |
139 | + glue(st8, MEMSUFFIX)((uint32_t)T0, (env->gpr[src] >> sh) & 0xFF); | |
154 | 140 | } |
155 | 141 | } |
156 | 142 | |
... | ... | @@ -160,85 +146,13 @@ void glue(do_stsw_64, MEMSUFFIX) (int src) |
160 | 146 | int sh; |
161 | 147 | |
162 | 148 | for (; T1 > 3; T1 -= 4, T0 += 4) { |
163 | - glue(stl, MEMSUFFIX)((uint64_t)T0, env->gpr[src++]); | |
149 | + glue(st32, MEMSUFFIX)((uint64_t)T0, env->gpr[src++]); | |
164 | 150 | if (unlikely(src == 32)) |
165 | 151 | src = 0; |
166 | 152 | } |
167 | 153 | if (unlikely(T1 != 0)) { |
168 | 154 | for (sh = 24; T1 > 0; T1--, T0++, sh -= 8) |
169 | - glue(stb, MEMSUFFIX)((uint64_t)T0, (env->gpr[src] >> sh) & 0xFF); | |
170 | - } | |
171 | -} | |
172 | -#endif | |
173 | - | |
174 | -void glue(do_lsw_le, MEMSUFFIX) (int dst) | |
175 | -{ | |
176 | - uint32_t tmp; | |
177 | - int sh; | |
178 | - | |
179 | - for (; T1 > 3; T1 -= 4, T0 += 4) { | |
180 | - env->gpr[dst++] = glue(ld32r, MEMSUFFIX)((uint32_t)T0); | |
181 | - if (unlikely(dst == 32)) | |
182 | - dst = 0; | |
183 | - } | |
184 | - if (unlikely(T1 != 0)) { | |
185 | - tmp = 0; | |
186 | - for (sh = 0; T1 > 0; T1--, T0++, sh += 8) { | |
187 | - tmp |= glue(ldub, MEMSUFFIX)((uint32_t)T0) << sh; | |
188 | - } | |
189 | - env->gpr[dst] = tmp; | |
190 | - } | |
191 | -} | |
192 | - | |
193 | -#if defined(TARGET_PPC64) | |
194 | -void glue(do_lsw_le_64, MEMSUFFIX) (int dst) | |
195 | -{ | |
196 | - uint32_t tmp; | |
197 | - int sh; | |
198 | - | |
199 | - for (; T1 > 3; T1 -= 4, T0 += 4) { | |
200 | - env->gpr[dst++] = glue(ld32r, MEMSUFFIX)((uint64_t)T0); | |
201 | - if (unlikely(dst == 32)) | |
202 | - dst = 0; | |
203 | - } | |
204 | - if (unlikely(T1 != 0)) { | |
205 | - tmp = 0; | |
206 | - for (sh = 0; T1 > 0; T1--, T0++, sh += 8) { | |
207 | - tmp |= glue(ldub, MEMSUFFIX)((uint64_t)T0) << sh; | |
208 | - } | |
209 | - env->gpr[dst] = tmp; | |
210 | - } | |
211 | -} | |
212 | -#endif | |
213 | - | |
214 | -void glue(do_stsw_le, MEMSUFFIX) (int src) | |
215 | -{ | |
216 | - int sh; | |
217 | - | |
218 | - for (; T1 > 3; T1 -= 4, T0 += 4) { | |
219 | - glue(st32r, MEMSUFFIX)((uint32_t)T0, env->gpr[src++]); | |
220 | - if (unlikely(src == 32)) | |
221 | - src = 0; | |
222 | - } | |
223 | - if (unlikely(T1 != 0)) { | |
224 | - for (sh = 0; T1 > 0; T1--, T0++, sh += 8) | |
225 | - glue(stb, MEMSUFFIX)((uint32_t)T0, (env->gpr[src] >> sh) & 0xFF); | |
226 | - } | |
227 | -} | |
228 | - | |
229 | -#if defined(TARGET_PPC64) | |
230 | -void glue(do_stsw_le_64, MEMSUFFIX) (int src) | |
231 | -{ | |
232 | - int sh; | |
233 | - | |
234 | - for (; T1 > 3; T1 -= 4, T0 += 4) { | |
235 | - glue(st32r, MEMSUFFIX)((uint64_t)T0, env->gpr[src++]); | |
236 | - if (unlikely(src == 32)) | |
237 | - src = 0; | |
238 | - } | |
239 | - if (unlikely(T1 != 0)) { | |
240 | - for (sh = 0; T1 > 0; T1--, T0++, sh += 8) | |
241 | - glue(stb, MEMSUFFIX)((uint64_t)T0, (env->gpr[src] >> sh) & 0xFF); | |
155 | + glue(st8, MEMSUFFIX)((uint64_t)T0, (env->gpr[src] >> sh) & 0xFF); | |
242 | 156 | } |
243 | 157 | } |
244 | 158 | #endif |
... | ... | @@ -281,6 +195,7 @@ void glue(do_dcbz, MEMSUFFIX) (void) |
281 | 195 | /* XXX: should be 970 specific (?) */ |
282 | 196 | if (((env->spr[SPR_970_HID5] >> 7) & 0x3) == 1) |
283 | 197 | dcache_line_size = 32; |
198 | + T0 &= ~(uint32_t)(dcache_line_size - 1); | |
284 | 199 | glue(stl, MEMSUFFIX)((uint32_t)(T0 + 0x00), 0); |
285 | 200 | glue(stl, MEMSUFFIX)((uint32_t)(T0 + 0x04), 0); |
286 | 201 | glue(stl, MEMSUFFIX)((uint32_t)(T0 + 0x08), 0); |
... | ... | @@ -327,6 +242,7 @@ void glue(do_dcbz_64, MEMSUFFIX) (void) |
327 | 242 | /* XXX: should be 970 specific (?) */ |
328 | 243 | if (((env->spr[SPR_970_HID5] >> 6) & 0x3) == 0x2) |
329 | 244 | dcache_line_size = 32; |
245 | + T0 &= ~(uint64_t)(dcache_line_size - 1); | |
330 | 246 | glue(stl, MEMSUFFIX)((uint64_t)(T0 + 0x00), 0); |
331 | 247 | glue(stl, MEMSUFFIX)((uint64_t)(T0 + 0x04), 0); |
332 | 248 | glue(stl, MEMSUFFIX)((uint64_t)(T0 + 0x08), 0); |
... | ... | @@ -375,7 +291,7 @@ void glue(do_POWER_lscbx, MEMSUFFIX) (int dest, int ra, int rb) |
375 | 291 | d = 24; |
376 | 292 | reg = dest; |
377 | 293 | for (i = 0; i < T1; i++) { |
378 | - c = glue(ldub, MEMSUFFIX)((uint32_t)T0++); | |
294 | + c = glue(ldu8, MEMSUFFIX)((uint32_t)T0++); | |
379 | 295 | /* ra (if not 0) and rb are never modified */ |
380 | 296 | if (likely(reg != rb && (ra == 0 || reg != ra))) { |
381 | 297 | env->gpr[reg] = (env->gpr[reg] & ~(0xFF << d)) | (c << d); |
... | ... | @@ -408,14 +324,7 @@ static always_inline double glue(ldfqr, MEMSUFFIX) (target_ulong EA) |
408 | 324 | } u; |
409 | 325 | |
410 | 326 | u.d = glue(ldfq, MEMSUFFIX)(EA); |
411 | - u.u = ((u.u & 0xFF00000000000000ULL) >> 56) | | |
412 | - ((u.u & 0x00FF000000000000ULL) >> 40) | | |
413 | - ((u.u & 0x0000FF0000000000ULL) >> 24) | | |
414 | - ((u.u & 0x000000FF00000000ULL) >> 8) | | |
415 | - ((u.u & 0x00000000FF000000ULL) << 8) | | |
416 | - ((u.u & 0x0000000000FF0000ULL) << 24) | | |
417 | - ((u.u & 0x000000000000FF00ULL) << 40) | | |
418 | - ((u.u & 0x00000000000000FFULL) << 56); | |
327 | + u.u = bswap64(u.u); | |
419 | 328 | |
420 | 329 | return u.d; |
421 | 330 | } |
... | ... | @@ -440,14 +349,7 @@ static always_inline void glue(stfqr, MEMSUFFIX) (target_ulong EA, double d) |
440 | 349 | } u; |
441 | 350 | |
442 | 351 | u.d = d; |
443 | - u.u = ((u.u & 0xFF00000000000000ULL) >> 56) | | |
444 | - ((u.u & 0x00FF000000000000ULL) >> 40) | | |
445 | - ((u.u & 0x0000FF0000000000ULL) >> 24) | | |
446 | - ((u.u & 0x000000FF00000000ULL) >> 8) | | |
447 | - ((u.u & 0x00000000FF000000ULL) << 8) | | |
448 | - ((u.u & 0x0000000000FF0000ULL) << 24) | | |
449 | - ((u.u & 0x000000000000FF00ULL) << 40) | | |
450 | - ((u.u & 0x00000000000000FFULL) << 56); | |
352 | + u.u = bswap64(u.u); | |
451 | 353 | glue(stfq, MEMSUFFIX)(EA, u.d); |
452 | 354 | } |
453 | 355 | ... | ... |
target-ppc/op_mem.h
... | ... | @@ -18,80 +18,7 @@ |
18 | 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
19 | 19 | */ |
20 | 20 | |
21 | -static always_inline uint16_t glue(ld16r, MEMSUFFIX) (target_ulong EA) | |
22 | -{ | |
23 | - uint16_t tmp = glue(lduw, MEMSUFFIX)(EA); | |
24 | - return ((tmp & 0xFF00) >> 8) | ((tmp & 0x00FF) << 8); | |
25 | -} | |
26 | - | |
27 | -static always_inline int32_t glue(ld16rs, MEMSUFFIX) (target_ulong EA) | |
28 | -{ | |
29 | - int16_t tmp = glue(lduw, MEMSUFFIX)(EA); | |
30 | - return (int16_t)((tmp & 0xFF00) >> 8) | ((tmp & 0x00FF) << 8); | |
31 | -} | |
32 | - | |
33 | -static always_inline uint32_t glue(ld32r, MEMSUFFIX) (target_ulong EA) | |
34 | -{ | |
35 | - uint32_t tmp = glue(ldl, MEMSUFFIX)(EA); | |
36 | - return ((tmp & 0xFF000000) >> 24) | ((tmp & 0x00FF0000) >> 8) | | |
37 | - ((tmp & 0x0000FF00) << 8) | ((tmp & 0x000000FF) << 24); | |
38 | -} | |
39 | - | |
40 | -static always_inline uint64_t glue(ld64r, MEMSUFFIX) (target_ulong EA) | |
41 | -{ | |
42 | - uint64_t tmp = glue(ldq, MEMSUFFIX)(EA); | |
43 | - return ((tmp & 0xFF00000000000000ULL) >> 56) | | |
44 | - ((tmp & 0x00FF000000000000ULL) >> 40) | | |
45 | - ((tmp & 0x0000FF0000000000ULL) >> 24) | | |
46 | - ((tmp & 0x000000FF00000000ULL) >> 8) | | |
47 | - ((tmp & 0x00000000FF000000ULL) << 8) | | |
48 | - ((tmp & 0x0000000000FF0000ULL) << 24) | | |
49 | - ((tmp & 0x000000000000FF00ULL) << 40) | | |
50 | - ((tmp & 0x00000000000000FFULL) << 54); | |
51 | -} | |
52 | - | |
53 | -#if defined(TARGET_PPC64) | |
54 | -static always_inline int64_t glue(ldsl, MEMSUFFIX) (target_ulong EA) | |
55 | -{ | |
56 | - return (int32_t)glue(ldl, MEMSUFFIX)(EA); | |
57 | -} | |
58 | - | |
59 | -static always_inline int64_t glue(ld32rs, MEMSUFFIX) (target_ulong EA) | |
60 | -{ | |
61 | - uint32_t tmp = glue(ldl, MEMSUFFIX)(EA); | |
62 | - return (int32_t)((tmp & 0xFF000000) >> 24) | ((tmp & 0x00FF0000) >> 8) | | |
63 | - ((tmp & 0x0000FF00) << 8) | ((tmp & 0x000000FF) << 24); | |
64 | -} | |
65 | -#endif | |
66 | - | |
67 | -static always_inline void glue(st16r, MEMSUFFIX) (target_ulong EA, | |
68 | - uint16_t data) | |
69 | -{ | |
70 | - uint16_t tmp = ((data & 0xFF00) >> 8) | ((data & 0x00FF) << 8); | |
71 | - glue(stw, MEMSUFFIX)(EA, tmp); | |
72 | -} | |
73 | - | |
74 | -static always_inline void glue(st32r, MEMSUFFIX) (target_ulong EA, | |
75 | - uint32_t data) | |
76 | -{ | |
77 | - uint32_t tmp = ((data & 0xFF000000) >> 24) | ((data & 0x00FF0000) >> 8) | | |
78 | - ((data & 0x0000FF00) << 8) | ((data & 0x000000FF) << 24); | |
79 | - glue(stl, MEMSUFFIX)(EA, tmp); | |
80 | -} | |
81 | - | |
82 | -static always_inline void glue(st64r, MEMSUFFIX) (target_ulong EA, | |
83 | - uint64_t data) | |
84 | -{ | |
85 | - uint64_t tmp = ((data & 0xFF00000000000000ULL) >> 56) | | |
86 | - ((data & 0x00FF000000000000ULL) >> 40) | | |
87 | - ((data & 0x0000FF0000000000ULL) >> 24) | | |
88 | - ((data & 0x000000FF00000000ULL) >> 8) | | |
89 | - ((data & 0x00000000FF000000ULL) << 8) | | |
90 | - ((data & 0x0000000000FF0000ULL) << 24) | | |
91 | - ((data & 0x000000000000FF00ULL) << 40) | | |
92 | - ((data & 0x00000000000000FFULL) << 56); | |
93 | - glue(stq, MEMSUFFIX)(EA, tmp); | |
94 | -} | |
21 | +#include "op_mem_access.h" | |
95 | 22 | |
96 | 23 | /*** Integer load ***/ |
97 | 24 | #define PPC_LD_OP(name, op) \ |
... | ... | @@ -126,76 +53,76 @@ void OPPROTO glue(glue(glue(op_st, name), _64), MEMSUFFIX) (void) \ |
126 | 53 | } |
127 | 54 | #endif |
128 | 55 | |
129 | -PPC_LD_OP(bz, ldub); | |
130 | -PPC_LD_OP(ha, ldsw); | |
131 | -PPC_LD_OP(hz, lduw); | |
132 | -PPC_LD_OP(wz, ldl); | |
56 | +PPC_LD_OP(bz, ldu8); | |
57 | +PPC_LD_OP(ha, lds16); | |
58 | +PPC_LD_OP(hz, ldu16); | |
59 | +PPC_LD_OP(wz, ldu32); | |
133 | 60 | #if defined(TARGET_PPC64) |
134 | -PPC_LD_OP(d, ldq); | |
135 | -PPC_LD_OP(wa, ldsl); | |
136 | -PPC_LD_OP_64(d, ldq); | |
137 | -PPC_LD_OP_64(wa, ldsl); | |
138 | -PPC_LD_OP_64(bz, ldub); | |
139 | -PPC_LD_OP_64(ha, ldsw); | |
140 | -PPC_LD_OP_64(hz, lduw); | |
141 | -PPC_LD_OP_64(wz, ldl); | |
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); | |
142 | 69 | #endif |
143 | 70 | |
144 | -PPC_LD_OP(ha_le, ld16rs); | |
145 | -PPC_LD_OP(hz_le, ld16r); | |
146 | -PPC_LD_OP(wz_le, ld32r); | |
71 | +PPC_LD_OP(ha_le, lds16r); | |
72 | +PPC_LD_OP(hz_le, ldu16r); | |
73 | +PPC_LD_OP(wz_le, ldu32r); | |
147 | 74 | #if defined(TARGET_PPC64) |
148 | -PPC_LD_OP(d_le, ld64r); | |
149 | -PPC_LD_OP(wa_le, ld32rs); | |
150 | -PPC_LD_OP_64(d_le, ld64r); | |
151 | -PPC_LD_OP_64(wa_le, ld32rs); | |
152 | -PPC_LD_OP_64(ha_le, ld16rs); | |
153 | -PPC_LD_OP_64(hz_le, ld16r); | |
154 | -PPC_LD_OP_64(wz_le, ld32r); | |
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); | |
155 | 82 | #endif |
156 | 83 | |
157 | 84 | /*** Integer store ***/ |
158 | -PPC_ST_OP(b, stb); | |
159 | -PPC_ST_OP(h, stw); | |
160 | -PPC_ST_OP(w, stl); | |
85 | +PPC_ST_OP(b, st8); | |
86 | +PPC_ST_OP(h, st16); | |
87 | +PPC_ST_OP(w, st32); | |
161 | 88 | #if defined(TARGET_PPC64) |
162 | -PPC_ST_OP(d, stq); | |
163 | -PPC_ST_OP_64(d, stq); | |
164 | -PPC_ST_OP_64(b, stb); | |
165 | -PPC_ST_OP_64(h, stw); | |
166 | -PPC_ST_OP_64(w, stl); | |
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); | |
167 | 94 | #endif |
168 | 95 | |
169 | 96 | PPC_ST_OP(h_le, st16r); |
170 | 97 | PPC_ST_OP(w_le, st32r); |
171 | 98 | #if defined(TARGET_PPC64) |
172 | 99 | PPC_ST_OP(d_le, st64r); |
173 | -PPC_ST_OP_64(d_le, st64r); | |
174 | 100 | PPC_ST_OP_64(h_le, st16r); |
175 | 101 | PPC_ST_OP_64(w_le, st32r); |
102 | +PPC_ST_OP_64(d_le, st64r); | |
176 | 103 | #endif |
177 | 104 | |
178 | 105 | /*** Integer load and store with byte reverse ***/ |
179 | -PPC_LD_OP(hbr, ld16r); | |
180 | -PPC_LD_OP(wbr, ld32r); | |
106 | +PPC_LD_OP(hbr, ldu16r); | |
107 | +PPC_LD_OP(wbr, ldu32r); | |
181 | 108 | PPC_ST_OP(hbr, st16r); |
182 | 109 | PPC_ST_OP(wbr, st32r); |
183 | 110 | #if defined(TARGET_PPC64) |
184 | -PPC_LD_OP_64(hbr, ld16r); | |
185 | -PPC_LD_OP_64(wbr, ld32r); | |
111 | +PPC_LD_OP_64(hbr, ldu16r); | |
112 | +PPC_LD_OP_64(wbr, ldu32r); | |
186 | 113 | PPC_ST_OP_64(hbr, st16r); |
187 | 114 | PPC_ST_OP_64(wbr, st32r); |
188 | 115 | #endif |
189 | 116 | |
190 | -PPC_LD_OP(hbr_le, lduw); | |
191 | -PPC_LD_OP(wbr_le, ldl); | |
192 | -PPC_ST_OP(hbr_le, stw); | |
193 | -PPC_ST_OP(wbr_le, stl); | |
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); | |
194 | 121 | #if defined(TARGET_PPC64) |
195 | -PPC_LD_OP_64(hbr_le, lduw); | |
196 | -PPC_LD_OP_64(wbr_le, ldl); | |
197 | -PPC_ST_OP_64(hbr_le, stw); | |
198 | -PPC_ST_OP_64(wbr_le, stl); | |
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); | |
199 | 126 | #endif |
200 | 127 | |
201 | 128 | /*** Integer load and store multiple ***/ |
... | ... | @@ -270,20 +197,6 @@ void OPPROTO glue(op_lswi_64, MEMSUFFIX) (void) |
270 | 197 | } |
271 | 198 | #endif |
272 | 199 | |
273 | -void OPPROTO glue(op_lswi_le, MEMSUFFIX) (void) | |
274 | -{ | |
275 | - glue(do_lsw_le, MEMSUFFIX)(PARAM1); | |
276 | - RETURN(); | |
277 | -} | |
278 | - | |
279 | -#if defined(TARGET_PPC64) | |
280 | -void OPPROTO glue(op_lswi_le_64, MEMSUFFIX) (void) | |
281 | -{ | |
282 | - glue(do_lsw_le_64, MEMSUFFIX)(PARAM1); | |
283 | - RETURN(); | |
284 | -} | |
285 | -#endif | |
286 | - | |
287 | 200 | /* PPC32 specification says we must generate an exception if |
288 | 201 | * rA is in the range of registers to be loaded. |
289 | 202 | * In an other hand, IBM says this is valid, but rA won't be loaded. |
... | ... | @@ -323,40 +236,6 @@ void OPPROTO glue(op_lswx_64, MEMSUFFIX) (void) |
323 | 236 | } |
324 | 237 | #endif |
325 | 238 | |
326 | -void OPPROTO glue(op_lswx_le, MEMSUFFIX) (void) | |
327 | -{ | |
328 | - /* Note: T1 comes from xer_bc then no cast is needed */ | |
329 | - if (likely(T1 != 0)) { | |
330 | - if (unlikely((PARAM1 < PARAM2 && (PARAM1 + T1) > PARAM2) || | |
331 | - (PARAM1 < PARAM3 && (PARAM1 + T1) > PARAM3))) { | |
332 | - do_raise_exception_err(POWERPC_EXCP_PROGRAM, | |
333 | - POWERPC_EXCP_INVAL | | |
334 | - POWERPC_EXCP_INVAL_LSWX); | |
335 | - } else { | |
336 | - glue(do_lsw_le, MEMSUFFIX)(PARAM1); | |
337 | - } | |
338 | - } | |
339 | - RETURN(); | |
340 | -} | |
341 | - | |
342 | -#if defined(TARGET_PPC64) | |
343 | -void OPPROTO glue(op_lswx_le_64, MEMSUFFIX) (void) | |
344 | -{ | |
345 | - /* Note: T1 comes from xer_bc then no cast is needed */ | |
346 | - if (likely(T1 != 0)) { | |
347 | - if (unlikely((PARAM1 < PARAM2 && (PARAM1 + T1) > PARAM2) || | |
348 | - (PARAM1 < PARAM3 && (PARAM1 + T1) > PARAM3))) { | |
349 | - do_raise_exception_err(POWERPC_EXCP_PROGRAM, | |
350 | - POWERPC_EXCP_INVAL | | |
351 | - POWERPC_EXCP_INVAL_LSWX); | |
352 | - } else { | |
353 | - glue(do_lsw_le_64, MEMSUFFIX)(PARAM1); | |
354 | - } | |
355 | - } | |
356 | - RETURN(); | |
357 | -} | |
358 | -#endif | |
359 | - | |
360 | 239 | void OPPROTO glue(op_stsw, MEMSUFFIX) (void) |
361 | 240 | { |
362 | 241 | glue(do_stsw, MEMSUFFIX)(PARAM1); |
... | ... | @@ -371,20 +250,6 @@ void OPPROTO glue(op_stsw_64, MEMSUFFIX) (void) |
371 | 250 | } |
372 | 251 | #endif |
373 | 252 | |
374 | -void OPPROTO glue(op_stsw_le, MEMSUFFIX) (void) | |
375 | -{ | |
376 | - glue(do_stsw_le, MEMSUFFIX)(PARAM1); | |
377 | - RETURN(); | |
378 | -} | |
379 | - | |
380 | -#if defined(TARGET_PPC64) | |
381 | -void OPPROTO glue(op_stsw_le_64, MEMSUFFIX) (void) | |
382 | -{ | |
383 | - glue(do_stsw_le_64, MEMSUFFIX)(PARAM1); | |
384 | - RETURN(); | |
385 | -} | |
386 | -#endif | |
387 | - | |
388 | 253 | /*** Floating-point store ***/ |
389 | 254 | #define PPC_STF_OP(name, op) \ |
390 | 255 | void OPPROTO glue(glue(op_st, name), MEMSUFFIX) (void) \ |
... | ... | @@ -423,7 +288,7 @@ static always_inline void glue(stfiw, MEMSUFFIX) (target_ulong EA, double d) |
423 | 288 | |
424 | 289 | /* Store the low order 32 bits without any conversion */ |
425 | 290 | u.d = d; |
426 | - glue(stl, MEMSUFFIX)(EA, u.u[WORD0]); | |
291 | + glue(st32, MEMSUFFIX)(EA, u.u[WORD0]); | |
427 | 292 | } |
428 | 293 | #undef WORD0 |
429 | 294 | #undef WORD1 |
... | ... | @@ -445,14 +310,7 @@ static always_inline void glue(stfqr, MEMSUFFIX) (target_ulong EA, double d) |
445 | 310 | } u; |
446 | 311 | |
447 | 312 | u.d = d; |
448 | - u.u = ((u.u & 0xFF00000000000000ULL) >> 56) | | |
449 | - ((u.u & 0x00FF000000000000ULL) >> 40) | | |
450 | - ((u.u & 0x0000FF0000000000ULL) >> 24) | | |
451 | - ((u.u & 0x000000FF00000000ULL) >> 8) | | |
452 | - ((u.u & 0x00000000FF000000ULL) << 8) | | |
453 | - ((u.u & 0x0000000000FF0000ULL) << 24) | | |
454 | - ((u.u & 0x000000000000FF00ULL) << 40) | | |
455 | - ((u.u & 0x00000000000000FFULL) << 56); | |
313 | + u.u = bswap64(u.u); | |
456 | 314 | glue(stfq, MEMSUFFIX)(EA, u.d); |
457 | 315 | } |
458 | 316 | |
... | ... | @@ -464,10 +322,7 @@ static always_inline void glue(stfsr, MEMSUFFIX) (target_ulong EA, double d) |
464 | 322 | } u; |
465 | 323 | |
466 | 324 | u.f = float64_to_float32(d, &env->fp_status); |
467 | - u.u = ((u.u & 0xFF000000UL) >> 24) | | |
468 | - ((u.u & 0x00FF0000ULL) >> 8) | | |
469 | - ((u.u & 0x0000FF00UL) << 8) | | |
470 | - ((u.u & 0x000000FFULL) << 24); | |
325 | + u.u = bswap32(u.u); | |
471 | 326 | glue(stfl, MEMSUFFIX)(EA, u.f); |
472 | 327 | } |
473 | 328 | |
... | ... | @@ -480,11 +335,8 @@ static always_inline void glue(stfiwr, MEMSUFFIX) (target_ulong EA, double d) |
480 | 335 | |
481 | 336 | /* Store the low order 32 bits without any conversion */ |
482 | 337 | u.d = d; |
483 | - u.u = ((u.u & 0xFF000000UL) >> 24) | | |
484 | - ((u.u & 0x00FF0000ULL) >> 8) | | |
485 | - ((u.u & 0x0000FF00UL) << 8) | | |
486 | - ((u.u & 0x000000FFULL) << 24); | |
487 | - glue(stl, MEMSUFFIX)(EA, u.u); | |
338 | + u.u = bswap32(u.u); | |
339 | + glue(st32, MEMSUFFIX)(EA, u.u); | |
488 | 340 | } |
489 | 341 | |
490 | 342 | PPC_STF_OP(fd_le, stfqr); |
... | ... | @@ -533,14 +385,7 @@ static always_inline double glue(ldfqr, MEMSUFFIX) (target_ulong EA) |
533 | 385 | } u; |
534 | 386 | |
535 | 387 | u.d = glue(ldfq, MEMSUFFIX)(EA); |
536 | - u.u = ((u.u & 0xFF00000000000000ULL) >> 56) | | |
537 | - ((u.u & 0x00FF000000000000ULL) >> 40) | | |
538 | - ((u.u & 0x0000FF0000000000ULL) >> 24) | | |
539 | - ((u.u & 0x000000FF00000000ULL) >> 8) | | |
540 | - ((u.u & 0x00000000FF000000ULL) << 8) | | |
541 | - ((u.u & 0x0000000000FF0000ULL) << 24) | | |
542 | - ((u.u & 0x000000000000FF00ULL) << 40) | | |
543 | - ((u.u & 0x00000000000000FFULL) << 56); | |
388 | + u.u = bswap64(u.u); | |
544 | 389 | |
545 | 390 | return u.d; |
546 | 391 | } |
... | ... | @@ -553,10 +398,7 @@ static always_inline double glue(ldfsr, MEMSUFFIX) (target_ulong EA) |
553 | 398 | } u; |
554 | 399 | |
555 | 400 | u.f = glue(ldfl, MEMSUFFIX)(EA); |
556 | - u.u = ((u.u & 0xFF000000UL) >> 24) | | |
557 | - ((u.u & 0x00FF0000ULL) >> 8) | | |
558 | - ((u.u & 0x0000FF00UL) << 8) | | |
559 | - ((u.u & 0x000000FFULL) << 24); | |
401 | + u.u = bswap32(u.u); | |
560 | 402 | |
561 | 403 | return float32_to_float64(u.f, &env->fp_status); |
562 | 404 | } |
... | ... | @@ -574,7 +416,7 @@ void OPPROTO glue(op_lwarx, MEMSUFFIX) (void) |
574 | 416 | if (unlikely(T0 & 0x03)) { |
575 | 417 | do_raise_exception(POWERPC_EXCP_ALIGN); |
576 | 418 | } else { |
577 | - T1 = glue(ldl, MEMSUFFIX)((uint32_t)T0); | |
419 | + T1 = glue(ldu32, MEMSUFFIX)((uint32_t)T0); | |
578 | 420 | env->reserve = (uint32_t)T0; |
579 | 421 | } |
580 | 422 | RETURN(); |
... | ... | @@ -586,7 +428,7 @@ void OPPROTO glue(op_lwarx_64, MEMSUFFIX) (void) |
586 | 428 | if (unlikely(T0 & 0x03)) { |
587 | 429 | do_raise_exception(POWERPC_EXCP_ALIGN); |
588 | 430 | } else { |
589 | - T1 = glue(ldl, MEMSUFFIX)((uint64_t)T0); | |
431 | + T1 = glue(ldu32, MEMSUFFIX)((uint64_t)T0); | |
590 | 432 | env->reserve = (uint64_t)T0; |
591 | 433 | } |
592 | 434 | RETURN(); |
... | ... | @@ -597,7 +439,7 @@ void OPPROTO glue(op_ldarx, MEMSUFFIX) (void) |
597 | 439 | if (unlikely(T0 & 0x03)) { |
598 | 440 | do_raise_exception(POWERPC_EXCP_ALIGN); |
599 | 441 | } else { |
600 | - T1 = glue(ldq, MEMSUFFIX)((uint32_t)T0); | |
442 | + T1 = glue(ldu64, MEMSUFFIX)((uint32_t)T0); | |
601 | 443 | env->reserve = (uint32_t)T0; |
602 | 444 | } |
603 | 445 | RETURN(); |
... | ... | @@ -608,7 +450,7 @@ void OPPROTO glue(op_ldarx_64, MEMSUFFIX) (void) |
608 | 450 | if (unlikely(T0 & 0x03)) { |
609 | 451 | do_raise_exception(POWERPC_EXCP_ALIGN); |
610 | 452 | } else { |
611 | - T1 = glue(ldq, MEMSUFFIX)((uint64_t)T0); | |
453 | + T1 = glue(ldu64, MEMSUFFIX)((uint64_t)T0); | |
612 | 454 | env->reserve = (uint64_t)T0; |
613 | 455 | } |
614 | 456 | RETURN(); |
... | ... | @@ -620,7 +462,7 @@ void OPPROTO glue(op_lwarx_le, MEMSUFFIX) (void) |
620 | 462 | if (unlikely(T0 & 0x03)) { |
621 | 463 | do_raise_exception(POWERPC_EXCP_ALIGN); |
622 | 464 | } else { |
623 | - T1 = glue(ld32r, MEMSUFFIX)((uint32_t)T0); | |
465 | + T1 = glue(ldu32r, MEMSUFFIX)((uint32_t)T0); | |
624 | 466 | env->reserve = (uint32_t)T0; |
625 | 467 | } |
626 | 468 | RETURN(); |
... | ... | @@ -632,7 +474,7 @@ void OPPROTO glue(op_lwarx_le_64, MEMSUFFIX) (void) |
632 | 474 | if (unlikely(T0 & 0x03)) { |
633 | 475 | do_raise_exception(POWERPC_EXCP_ALIGN); |
634 | 476 | } else { |
635 | - T1 = glue(ld32r, MEMSUFFIX)((uint64_t)T0); | |
477 | + T1 = glue(ldu32r, MEMSUFFIX)((uint64_t)T0); | |
636 | 478 | env->reserve = (uint64_t)T0; |
637 | 479 | } |
638 | 480 | RETURN(); |
... | ... | @@ -643,7 +485,7 @@ void OPPROTO glue(op_ldarx_le, MEMSUFFIX) (void) |
643 | 485 | if (unlikely(T0 & 0x03)) { |
644 | 486 | do_raise_exception(POWERPC_EXCP_ALIGN); |
645 | 487 | } else { |
646 | - T1 = glue(ld64r, MEMSUFFIX)((uint32_t)T0); | |
488 | + T1 = glue(ldu64r, MEMSUFFIX)((uint32_t)T0); | |
647 | 489 | env->reserve = (uint32_t)T0; |
648 | 490 | } |
649 | 491 | RETURN(); |
... | ... | @@ -654,7 +496,7 @@ void OPPROTO glue(op_ldarx_le_64, MEMSUFFIX) (void) |
654 | 496 | if (unlikely(T0 & 0x03)) { |
655 | 497 | do_raise_exception(POWERPC_EXCP_ALIGN); |
656 | 498 | } else { |
657 | - T1 = glue(ld64r, MEMSUFFIX)((uint64_t)T0); | |
499 | + T1 = glue(ldu64r, MEMSUFFIX)((uint64_t)T0); | |
658 | 500 | env->reserve = (uint64_t)T0; |
659 | 501 | } |
660 | 502 | RETURN(); |
... | ... | @@ -670,7 +512,7 @@ void OPPROTO glue(op_stwcx, MEMSUFFIX) (void) |
670 | 512 | if (unlikely(env->reserve != (uint32_t)T0)) { |
671 | 513 | env->crf[0] = xer_so; |
672 | 514 | } else { |
673 | - glue(stl, MEMSUFFIX)((uint32_t)T0, T1); | |
515 | + glue(st32, MEMSUFFIX)((uint32_t)T0, T1); | |
674 | 516 | env->crf[0] = xer_so | 0x02; |
675 | 517 | } |
676 | 518 | } |
... | ... | @@ -687,7 +529,7 @@ void OPPROTO glue(op_stwcx_64, MEMSUFFIX) (void) |
687 | 529 | if (unlikely(env->reserve != (uint64_t)T0)) { |
688 | 530 | env->crf[0] = xer_so; |
689 | 531 | } else { |
690 | - glue(stl, MEMSUFFIX)((uint64_t)T0, T1); | |
532 | + glue(st32, MEMSUFFIX)((uint64_t)T0, T1); | |
691 | 533 | env->crf[0] = xer_so | 0x02; |
692 | 534 | } |
693 | 535 | } |
... | ... | @@ -703,7 +545,7 @@ void OPPROTO glue(op_stdcx, MEMSUFFIX) (void) |
703 | 545 | if (unlikely(env->reserve != (uint32_t)T0)) { |
704 | 546 | env->crf[0] = xer_so; |
705 | 547 | } else { |
706 | - glue(stq, MEMSUFFIX)((uint32_t)T0, T1); | |
548 | + glue(st64, MEMSUFFIX)((uint32_t)T0, T1); | |
707 | 549 | env->crf[0] = xer_so | 0x02; |
708 | 550 | } |
709 | 551 | } |
... | ... | @@ -719,7 +561,7 @@ void OPPROTO glue(op_stdcx_64, MEMSUFFIX) (void) |
719 | 561 | if (unlikely(env->reserve != (uint64_t)T0)) { |
720 | 562 | env->crf[0] = xer_so; |
721 | 563 | } else { |
722 | - glue(stq, MEMSUFFIX)((uint64_t)T0, T1); | |
564 | + glue(st64, MEMSUFFIX)((uint64_t)T0, T1); | |
723 | 565 | env->crf[0] = xer_so | 0x02; |
724 | 566 | } |
725 | 567 | } |
... | ... | @@ -796,72 +638,75 @@ void OPPROTO glue(op_stdcx_le_64, MEMSUFFIX) (void) |
796 | 638 | |
797 | 639 | void OPPROTO glue(op_dcbz_l32, MEMSUFFIX) (void) |
798 | 640 | { |
799 | - glue(stl, MEMSUFFIX)((uint32_t)(T0 + 0x00), 0); | |
800 | - glue(stl, MEMSUFFIX)((uint32_t)(T0 + 0x04), 0); | |
801 | - glue(stl, MEMSUFFIX)((uint32_t)(T0 + 0x08), 0); | |
802 | - glue(stl, MEMSUFFIX)((uint32_t)(T0 + 0x0C), 0); | |
803 | - glue(stl, MEMSUFFIX)((uint32_t)(T0 + 0x10), 0); | |
804 | - glue(stl, MEMSUFFIX)((uint32_t)(T0 + 0x14), 0); | |
805 | - glue(stl, MEMSUFFIX)((uint32_t)(T0 + 0x18), 0); | |
806 | - glue(stl, MEMSUFFIX)((uint32_t)(T0 + 0x1C), 0); | |
641 | + T0 &= ~((uint32_t)31); | |
642 | + glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x00), 0); | |
643 | + glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x04), 0); | |
644 | + glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x08), 0); | |
645 | + glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x0C), 0); | |
646 | + glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x10), 0); | |
647 | + glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x14), 0); | |
648 | + glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x18), 0); | |
649 | + glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x1C), 0); | |
807 | 650 | RETURN(); |
808 | 651 | } |
809 | 652 | |
810 | 653 | void OPPROTO glue(op_dcbz_l64, MEMSUFFIX) (void) |
811 | 654 | { |
812 | - glue(stl, MEMSUFFIX)((uint32_t)(T0 + 0x00), 0); | |
813 | - glue(stl, MEMSUFFIX)((uint32_t)(T0 + 0x04), 0); | |
814 | - glue(stl, MEMSUFFIX)((uint32_t)(T0 + 0x08), 0); | |
815 | - glue(stl, MEMSUFFIX)((uint32_t)(T0 + 0x0C), 0); | |
816 | - glue(stl, MEMSUFFIX)((uint32_t)(T0 + 0x10), 0); | |
817 | - glue(stl, MEMSUFFIX)((uint32_t)(T0 + 0x14), 0); | |
818 | - glue(stl, MEMSUFFIX)((uint32_t)(T0 + 0x18), 0); | |
819 | - glue(stl, MEMSUFFIX)((uint32_t)(T0 + 0x1C), 0); | |
820 | - glue(stl, MEMSUFFIX)((uint32_t)(T0 + 0x20UL), 0); | |
821 | - glue(stl, MEMSUFFIX)((uint32_t)(T0 + 0x24UL), 0); | |
822 | - glue(stl, MEMSUFFIX)((uint32_t)(T0 + 0x28UL), 0); | |
823 | - glue(stl, MEMSUFFIX)((uint32_t)(T0 + 0x2CUL), 0); | |
824 | - glue(stl, MEMSUFFIX)((uint32_t)(T0 + 0x30UL), 0); | |
825 | - glue(stl, MEMSUFFIX)((uint32_t)(T0 + 0x34UL), 0); | |
826 | - glue(stl, MEMSUFFIX)((uint32_t)(T0 + 0x38UL), 0); | |
827 | - glue(stl, MEMSUFFIX)((uint32_t)(T0 + 0x3CUL), 0); | |
655 | + T0 &= ~((uint32_t)63); | |
656 | + glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x00), 0); | |
657 | + glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x04), 0); | |
658 | + glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x08), 0); | |
659 | + glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x0C), 0); | |
660 | + glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x10), 0); | |
661 | + glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x14), 0); | |
662 | + glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x18), 0); | |
663 | + glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x1C), 0); | |
664 | + glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x20UL), 0); | |
665 | + glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x24UL), 0); | |
666 | + glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x28UL), 0); | |
667 | + glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x2CUL), 0); | |
668 | + glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x30UL), 0); | |
669 | + glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x34UL), 0); | |
670 | + glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x38UL), 0); | |
671 | + glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x3CUL), 0); | |
828 | 672 | RETURN(); |
829 | 673 | } |
830 | 674 | |
831 | 675 | void OPPROTO glue(op_dcbz_l128, MEMSUFFIX) (void) |
832 | 676 | { |
833 | - glue(stl, MEMSUFFIX)((uint32_t)(T0 + 0x00), 0); | |
834 | - glue(stl, MEMSUFFIX)((uint32_t)(T0 + 0x04), 0); | |
835 | - glue(stl, MEMSUFFIX)((uint32_t)(T0 + 0x08), 0); | |
836 | - glue(stl, MEMSUFFIX)((uint32_t)(T0 + 0x0C), 0); | |
837 | - glue(stl, MEMSUFFIX)((uint32_t)(T0 + 0x10), 0); | |
838 | - glue(stl, MEMSUFFIX)((uint32_t)(T0 + 0x14), 0); | |
839 | - glue(stl, MEMSUFFIX)((uint32_t)(T0 + 0x18), 0); | |
840 | - glue(stl, MEMSUFFIX)((uint32_t)(T0 + 0x1C), 0); | |
841 | - glue(stl, MEMSUFFIX)((uint32_t)(T0 + 0x20UL), 0); | |
842 | - glue(stl, MEMSUFFIX)((uint32_t)(T0 + 0x24UL), 0); | |
843 | - glue(stl, MEMSUFFIX)((uint32_t)(T0 + 0x28UL), 0); | |
844 | - glue(stl, MEMSUFFIX)((uint32_t)(T0 + 0x2CUL), 0); | |
845 | - glue(stl, MEMSUFFIX)((uint32_t)(T0 + 0x30UL), 0); | |
846 | - glue(stl, MEMSUFFIX)((uint32_t)(T0 + 0x34UL), 0); | |
847 | - glue(stl, MEMSUFFIX)((uint32_t)(T0 + 0x38UL), 0); | |
848 | - glue(stl, MEMSUFFIX)((uint32_t)(T0 + 0x3CUL), 0); | |
849 | - glue(stl, MEMSUFFIX)((uint32_t)(T0 + 0x40UL), 0); | |
850 | - glue(stl, MEMSUFFIX)((uint32_t)(T0 + 0x44UL), 0); | |
851 | - glue(stl, MEMSUFFIX)((uint32_t)(T0 + 0x48UL), 0); | |
852 | - glue(stl, MEMSUFFIX)((uint32_t)(T0 + 0x4CUL), 0); | |
853 | - glue(stl, MEMSUFFIX)((uint32_t)(T0 + 0x50UL), 0); | |
854 | - glue(stl, MEMSUFFIX)((uint32_t)(T0 + 0x54UL), 0); | |
855 | - glue(stl, MEMSUFFIX)((uint32_t)(T0 + 0x58UL), 0); | |
856 | - glue(stl, MEMSUFFIX)((uint32_t)(T0 + 0x5CUL), 0); | |
857 | - glue(stl, MEMSUFFIX)((uint32_t)(T0 + 0x60UL), 0); | |
858 | - glue(stl, MEMSUFFIX)((uint32_t)(T0 + 0x64UL), 0); | |
859 | - glue(stl, MEMSUFFIX)((uint32_t)(T0 + 0x68UL), 0); | |
860 | - glue(stl, MEMSUFFIX)((uint32_t)(T0 + 0x6CUL), 0); | |
861 | - glue(stl, MEMSUFFIX)((uint32_t)(T0 + 0x70UL), 0); | |
862 | - glue(stl, MEMSUFFIX)((uint32_t)(T0 + 0x74UL), 0); | |
863 | - glue(stl, MEMSUFFIX)((uint32_t)(T0 + 0x78UL), 0); | |
864 | - glue(stl, MEMSUFFIX)((uint32_t)(T0 + 0x7CUL), 0); | |
677 | + T0 &= ~((uint32_t)127); | |
678 | + glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x00), 0); | |
679 | + glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x04), 0); | |
680 | + glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x08), 0); | |
681 | + glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x0C), 0); | |
682 | + glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x10), 0); | |
683 | + glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x14), 0); | |
684 | + glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x18), 0); | |
685 | + glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x1C), 0); | |
686 | + glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x20UL), 0); | |
687 | + glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x24UL), 0); | |
688 | + glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x28UL), 0); | |
689 | + glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x2CUL), 0); | |
690 | + glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x30UL), 0); | |
691 | + glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x34UL), 0); | |
692 | + glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x38UL), 0); | |
693 | + glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x3CUL), 0); | |
694 | + glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x40UL), 0); | |
695 | + glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x44UL), 0); | |
696 | + glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x48UL), 0); | |
697 | + glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x4CUL), 0); | |
698 | + glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x50UL), 0); | |
699 | + glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x54UL), 0); | |
700 | + glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x58UL), 0); | |
701 | + glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x5CUL), 0); | |
702 | + glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x60UL), 0); | |
703 | + glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x64UL), 0); | |
704 | + glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x68UL), 0); | |
705 | + glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x6CUL), 0); | |
706 | + glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x70UL), 0); | |
707 | + glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x74UL), 0); | |
708 | + glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x78UL), 0); | |
709 | + glue(st32, MEMSUFFIX)((uint32_t)(T0 + 0x7CUL), 0); | |
865 | 710 | RETURN(); |
866 | 711 | } |
867 | 712 | |
... | ... | @@ -874,72 +719,75 @@ void OPPROTO glue(op_dcbz, MEMSUFFIX) (void) |
874 | 719 | #if defined(TARGET_PPC64) |
875 | 720 | void OPPROTO glue(op_dcbz_l32_64, MEMSUFFIX) (void) |
876 | 721 | { |
877 | - glue(stl, MEMSUFFIX)((uint64_t)(T0 + 0x00), 0); | |
878 | - glue(stl, MEMSUFFIX)((uint64_t)(T0 + 0x04), 0); | |
879 | - glue(stl, MEMSUFFIX)((uint64_t)(T0 + 0x08), 0); | |
880 | - glue(stl, MEMSUFFIX)((uint64_t)(T0 + 0x0C), 0); | |
881 | - glue(stl, MEMSUFFIX)((uint64_t)(T0 + 0x10), 0); | |
882 | - glue(stl, MEMSUFFIX)((uint64_t)(T0 + 0x14), 0); | |
883 | - glue(stl, MEMSUFFIX)((uint64_t)(T0 + 0x18), 0); | |
884 | - glue(stl, MEMSUFFIX)((uint64_t)(T0 + 0x1C), 0); | |
722 | + T0 &= ~((uint64_t)31); | |
723 | + glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x00), 0); | |
724 | + glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x04), 0); | |
725 | + glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x08), 0); | |
726 | + glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x0C), 0); | |
727 | + glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x10), 0); | |
728 | + glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x14), 0); | |
729 | + glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x18), 0); | |
730 | + glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x1C), 0); | |
885 | 731 | RETURN(); |
886 | 732 | } |
887 | 733 | |
888 | 734 | void OPPROTO glue(op_dcbz_l64_64, MEMSUFFIX) (void) |
889 | 735 | { |
890 | - glue(stl, MEMSUFFIX)((uint64_t)(T0 + 0x00), 0); | |
891 | - glue(stl, MEMSUFFIX)((uint64_t)(T0 + 0x04), 0); | |
892 | - glue(stl, MEMSUFFIX)((uint64_t)(T0 + 0x08), 0); | |
893 | - glue(stl, MEMSUFFIX)((uint64_t)(T0 + 0x0C), 0); | |
894 | - glue(stl, MEMSUFFIX)((uint64_t)(T0 + 0x10), 0); | |
895 | - glue(stl, MEMSUFFIX)((uint64_t)(T0 + 0x14), 0); | |
896 | - glue(stl, MEMSUFFIX)((uint64_t)(T0 + 0x18), 0); | |
897 | - glue(stl, MEMSUFFIX)((uint64_t)(T0 + 0x1C), 0); | |
898 | - glue(stl, MEMSUFFIX)((uint64_t)(T0 + 0x20UL), 0); | |
899 | - glue(stl, MEMSUFFIX)((uint64_t)(T0 + 0x24UL), 0); | |
900 | - glue(stl, MEMSUFFIX)((uint64_t)(T0 + 0x28UL), 0); | |
901 | - glue(stl, MEMSUFFIX)((uint64_t)(T0 + 0x2CUL), 0); | |
902 | - glue(stl, MEMSUFFIX)((uint64_t)(T0 + 0x30UL), 0); | |
903 | - glue(stl, MEMSUFFIX)((uint64_t)(T0 + 0x34UL), 0); | |
904 | - glue(stl, MEMSUFFIX)((uint64_t)(T0 + 0x38UL), 0); | |
905 | - glue(stl, MEMSUFFIX)((uint64_t)(T0 + 0x3CUL), 0); | |
736 | + T0 &= ~((uint64_t)63); | |
737 | + glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x00), 0); | |
738 | + glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x04), 0); | |
739 | + glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x08), 0); | |
740 | + glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x0C), 0); | |
741 | + glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x10), 0); | |
742 | + glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x14), 0); | |
743 | + glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x18), 0); | |
744 | + glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x1C), 0); | |
745 | + glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x20UL), 0); | |
746 | + glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x24UL), 0); | |
747 | + glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x28UL), 0); | |
748 | + glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x2CUL), 0); | |
749 | + glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x30UL), 0); | |
750 | + glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x34UL), 0); | |
751 | + glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x38UL), 0); | |
752 | + glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x3CUL), 0); | |
906 | 753 | RETURN(); |
907 | 754 | } |
908 | 755 | |
909 | 756 | void OPPROTO glue(op_dcbz_l128_64, MEMSUFFIX) (void) |
910 | 757 | { |
911 | - glue(stl, MEMSUFFIX)((uint64_t)(T0 + 0x00), 0); | |
912 | - glue(stl, MEMSUFFIX)((uint64_t)(T0 + 0x04), 0); | |
913 | - glue(stl, MEMSUFFIX)((uint64_t)(T0 + 0x08), 0); | |
914 | - glue(stl, MEMSUFFIX)((uint64_t)(T0 + 0x0C), 0); | |
915 | - glue(stl, MEMSUFFIX)((uint64_t)(T0 + 0x10), 0); | |
916 | - glue(stl, MEMSUFFIX)((uint64_t)(T0 + 0x14), 0); | |
917 | - glue(stl, MEMSUFFIX)((uint64_t)(T0 + 0x18), 0); | |
918 | - glue(stl, MEMSUFFIX)((uint64_t)(T0 + 0x1C), 0); | |
919 | - glue(stl, MEMSUFFIX)((uint64_t)(T0 + 0x20UL), 0); | |
920 | - glue(stl, MEMSUFFIX)((uint64_t)(T0 + 0x24UL), 0); | |
921 | - glue(stl, MEMSUFFIX)((uint64_t)(T0 + 0x28UL), 0); | |
922 | - glue(stl, MEMSUFFIX)((uint64_t)(T0 + 0x2CUL), 0); | |
923 | - glue(stl, MEMSUFFIX)((uint64_t)(T0 + 0x30UL), 0); | |
924 | - glue(stl, MEMSUFFIX)((uint64_t)(T0 + 0x34UL), 0); | |
925 | - glue(stl, MEMSUFFIX)((uint64_t)(T0 + 0x38UL), 0); | |
926 | - glue(stl, MEMSUFFIX)((uint64_t)(T0 + 0x3CUL), 0); | |
927 | - glue(stl, MEMSUFFIX)((uint64_t)(T0 + 0x40UL), 0); | |
928 | - glue(stl, MEMSUFFIX)((uint64_t)(T0 + 0x44UL), 0); | |
929 | - glue(stl, MEMSUFFIX)((uint64_t)(T0 + 0x48UL), 0); | |
930 | - glue(stl, MEMSUFFIX)((uint64_t)(T0 + 0x4CUL), 0); | |
931 | - glue(stl, MEMSUFFIX)((uint64_t)(T0 + 0x50UL), 0); | |
932 | - glue(stl, MEMSUFFIX)((uint64_t)(T0 + 0x54UL), 0); | |
933 | - glue(stl, MEMSUFFIX)((uint64_t)(T0 + 0x58UL), 0); | |
934 | - glue(stl, MEMSUFFIX)((uint64_t)(T0 + 0x5CUL), 0); | |
935 | - glue(stl, MEMSUFFIX)((uint64_t)(T0 + 0x60UL), 0); | |
936 | - glue(stl, MEMSUFFIX)((uint64_t)(T0 + 0x64UL), 0); | |
937 | - glue(stl, MEMSUFFIX)((uint64_t)(T0 + 0x68UL), 0); | |
938 | - glue(stl, MEMSUFFIX)((uint64_t)(T0 + 0x6CUL), 0); | |
939 | - glue(stl, MEMSUFFIX)((uint64_t)(T0 + 0x70UL), 0); | |
940 | - glue(stl, MEMSUFFIX)((uint64_t)(T0 + 0x74UL), 0); | |
941 | - glue(stl, MEMSUFFIX)((uint64_t)(T0 + 0x78UL), 0); | |
942 | - glue(stl, MEMSUFFIX)((uint64_t)(T0 + 0x7CUL), 0); | |
758 | + T0 &= ~((uint64_t)127); | |
759 | + glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x00), 0); | |
760 | + glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x04), 0); | |
761 | + glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x08), 0); | |
762 | + glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x0C), 0); | |
763 | + glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x10), 0); | |
764 | + glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x14), 0); | |
765 | + glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x18), 0); | |
766 | + glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x1C), 0); | |
767 | + glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x20UL), 0); | |
768 | + glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x24UL), 0); | |
769 | + glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x28UL), 0); | |
770 | + glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x2CUL), 0); | |
771 | + glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x30UL), 0); | |
772 | + glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x34UL), 0); | |
773 | + glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x38UL), 0); | |
774 | + glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x3CUL), 0); | |
775 | + glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x40UL), 0); | |
776 | + glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x44UL), 0); | |
777 | + glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x48UL), 0); | |
778 | + glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x4CUL), 0); | |
779 | + glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x50UL), 0); | |
780 | + glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x54UL), 0); | |
781 | + glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x58UL), 0); | |
782 | + glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x5CUL), 0); | |
783 | + glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x60UL), 0); | |
784 | + glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x64UL), 0); | |
785 | + glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x68UL), 0); | |
786 | + glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x6CUL), 0); | |
787 | + glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x70UL), 0); | |
788 | + glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x74UL), 0); | |
789 | + glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x78UL), 0); | |
790 | + glue(st32, MEMSUFFIX)((uint64_t)(T0 + 0x7CUL), 0); | |
943 | 791 | RETURN(); |
944 | 792 | } |
945 | 793 | |
... | ... | @@ -968,42 +816,42 @@ void OPPROTO glue(op_icbi_64, MEMSUFFIX) (void) |
968 | 816 | /* External access */ |
969 | 817 | void OPPROTO glue(op_eciwx, MEMSUFFIX) (void) |
970 | 818 | { |
971 | - T1 = glue(ldl, MEMSUFFIX)((uint32_t)T0); | |
819 | + T1 = glue(ldu32, MEMSUFFIX)((uint32_t)T0); | |
972 | 820 | RETURN(); |
973 | 821 | } |
974 | 822 | |
975 | 823 | #if defined(TARGET_PPC64) |
976 | 824 | void OPPROTO glue(op_eciwx_64, MEMSUFFIX) (void) |
977 | 825 | { |
978 | - T1 = glue(ldl, MEMSUFFIX)((uint64_t)T0); | |
826 | + T1 = glue(ldu32, MEMSUFFIX)((uint64_t)T0); | |
979 | 827 | RETURN(); |
980 | 828 | } |
981 | 829 | #endif |
982 | 830 | |
983 | 831 | void OPPROTO glue(op_ecowx, MEMSUFFIX) (void) |
984 | 832 | { |
985 | - glue(stl, MEMSUFFIX)((uint32_t)T0, T1); | |
833 | + glue(st32, MEMSUFFIX)((uint32_t)T0, T1); | |
986 | 834 | RETURN(); |
987 | 835 | } |
988 | 836 | |
989 | 837 | #if defined(TARGET_PPC64) |
990 | 838 | void OPPROTO glue(op_ecowx_64, MEMSUFFIX) (void) |
991 | 839 | { |
992 | - glue(stl, MEMSUFFIX)((uint64_t)T0, T1); | |
840 | + glue(st32, MEMSUFFIX)((uint64_t)T0, T1); | |
993 | 841 | RETURN(); |
994 | 842 | } |
995 | 843 | #endif |
996 | 844 | |
997 | 845 | void OPPROTO glue(op_eciwx_le, MEMSUFFIX) (void) |
998 | 846 | { |
999 | - T1 = glue(ld32r, MEMSUFFIX)((uint32_t)T0); | |
847 | + T1 = glue(ldu32r, MEMSUFFIX)((uint32_t)T0); | |
1000 | 848 | RETURN(); |
1001 | 849 | } |
1002 | 850 | |
1003 | 851 | #if defined(TARGET_PPC64) |
1004 | 852 | void OPPROTO glue(op_eciwx_le_64, MEMSUFFIX) (void) |
1005 | 853 | { |
1006 | - T1 = glue(ld32r, MEMSUFFIX)((uint64_t)T0); | |
854 | + T1 = glue(ldu32r, MEMSUFFIX)((uint64_t)T0); | |
1007 | 855 | RETURN(); |
1008 | 856 | } |
1009 | 857 | #endif |
... | ... | @@ -1069,51 +917,51 @@ void OPPROTO glue(op_POWER2_stfq_le, MEMSUFFIX) (void) |
1069 | 917 | #endif |
1070 | 918 | void OPPROTO glue(op_vr_lvx, MEMSUFFIX) (void) |
1071 | 919 | { |
1072 | - AVR0.u64[VR_DWORD0] = glue(ldq, MEMSUFFIX)((uint32_t)T0); | |
1073 | - AVR0.u64[VR_DWORD1] = glue(ldq, MEMSUFFIX)((uint32_t)T0 + 8); | |
920 | + AVR0.u64[VR_DWORD0] = glue(ldu64, MEMSUFFIX)((uint32_t)T0); | |
921 | + AVR0.u64[VR_DWORD1] = glue(ldu64, MEMSUFFIX)((uint32_t)T0 + 8); | |
1074 | 922 | } |
1075 | 923 | |
1076 | 924 | void OPPROTO glue(op_vr_lvx_le, MEMSUFFIX) (void) |
1077 | 925 | { |
1078 | - AVR0.u64[VR_DWORD1] = glue(ldq, MEMSUFFIX)((uint32_t)T0); | |
1079 | - AVR0.u64[VR_DWORD0] = glue(ldq, MEMSUFFIX)((uint32_t)T0 + 8); | |
926 | + AVR0.u64[VR_DWORD1] = glue(ldu64r, MEMSUFFIX)((uint32_t)T0); | |
927 | + AVR0.u64[VR_DWORD0] = glue(ldu64r, MEMSUFFIX)((uint32_t)T0 + 8); | |
1080 | 928 | } |
1081 | 929 | |
1082 | 930 | void OPPROTO glue(op_vr_stvx, MEMSUFFIX) (void) |
1083 | 931 | { |
1084 | - glue(stq, MEMSUFFIX)((uint32_t)T0, AVR0.u64[VR_DWORD0]); | |
1085 | - glue(stq, MEMSUFFIX)((uint32_t)T0 + 8, AVR0.u64[VR_DWORD1]); | |
932 | + glue(st64, MEMSUFFIX)((uint32_t)T0, AVR0.u64[VR_DWORD0]); | |
933 | + glue(st64, MEMSUFFIX)((uint32_t)T0 + 8, AVR0.u64[VR_DWORD1]); | |
1086 | 934 | } |
1087 | 935 | |
1088 | 936 | void OPPROTO glue(op_vr_stvx_le, MEMSUFFIX) (void) |
1089 | 937 | { |
1090 | - glue(stq, MEMSUFFIX)((uint32_t)T0, AVR0.u64[VR_DWORD1]); | |
1091 | - glue(stq, MEMSUFFIX)((uint32_t)T0 + 8, AVR0.u64[VR_DWORD0]); | |
938 | + glue(st64r, MEMSUFFIX)((uint32_t)T0, AVR0.u64[VR_DWORD1]); | |
939 | + glue(st64r, MEMSUFFIX)((uint32_t)T0 + 8, AVR0.u64[VR_DWORD0]); | |
1092 | 940 | } |
1093 | 941 | |
1094 | 942 | #if defined(TARGET_PPC64) |
1095 | 943 | void OPPROTO glue(op_vr_lvx_64, MEMSUFFIX) (void) |
1096 | 944 | { |
1097 | - AVR0.u64[VR_DWORD0] = glue(ldq, MEMSUFFIX)((uint64_t)T0); | |
1098 | - AVR0.u64[VR_DWORD1] = glue(ldq, MEMSUFFIX)((uint64_t)T0 + 8); | |
945 | + AVR0.u64[VR_DWORD0] = glue(ldu64, MEMSUFFIX)((uint64_t)T0); | |
946 | + AVR0.u64[VR_DWORD1] = glue(ldu64, MEMSUFFIX)((uint64_t)T0 + 8); | |
1099 | 947 | } |
1100 | 948 | |
1101 | 949 | void OPPROTO glue(op_vr_lvx_le_64, MEMSUFFIX) (void) |
1102 | 950 | { |
1103 | - AVR0.u64[VR_DWORD1] = glue(ldq, MEMSUFFIX)((uint64_t)T0); | |
1104 | - AVR0.u64[VR_DWORD0] = glue(ldq, MEMSUFFIX)((uint64_t)T0 + 8); | |
951 | + AVR0.u64[VR_DWORD1] = glue(ldu64r, MEMSUFFIX)((uint64_t)T0); | |
952 | + AVR0.u64[VR_DWORD0] = glue(ldu64r, MEMSUFFIX)((uint64_t)T0 + 8); | |
1105 | 953 | } |
1106 | 954 | |
1107 | 955 | void OPPROTO glue(op_vr_stvx_64, MEMSUFFIX) (void) |
1108 | 956 | { |
1109 | - glue(stq, MEMSUFFIX)((uint64_t)T0, AVR0.u64[VR_DWORD0]); | |
1110 | - glue(stq, MEMSUFFIX)((uint64_t)T0 + 8, AVR0.u64[VR_DWORD1]); | |
957 | + glue(st64, MEMSUFFIX)((uint64_t)T0, AVR0.u64[VR_DWORD0]); | |
958 | + glue(st64, MEMSUFFIX)((uint64_t)T0 + 8, AVR0.u64[VR_DWORD1]); | |
1111 | 959 | } |
1112 | 960 | |
1113 | 961 | void OPPROTO glue(op_vr_stvx_le_64, MEMSUFFIX) (void) |
1114 | 962 | { |
1115 | - glue(stq, MEMSUFFIX)((uint64_t)T0, AVR0.u64[VR_DWORD1]); | |
1116 | - glue(stq, MEMSUFFIX)((uint64_t)T0 + 8, AVR0.u64[VR_DWORD0]); | |
963 | + glue(st64r, MEMSUFFIX)((uint64_t)T0, AVR0.u64[VR_DWORD1]); | |
964 | + glue(st64r, MEMSUFFIX)((uint64_t)T0 + 8, AVR0.u64[VR_DWORD0]); | |
1117 | 965 | } |
1118 | 966 | #endif |
1119 | 967 | #undef VR_DWORD0 |
... | ... | @@ -1165,31 +1013,31 @@ _PPC_SPE_ST_OP(name, op) |
1165 | 1013 | #endif |
1166 | 1014 | |
1167 | 1015 | #if !defined(TARGET_PPC64) |
1168 | -PPC_SPE_LD_OP(dd, ldq); | |
1169 | -PPC_SPE_ST_OP(dd, stq); | |
1170 | -PPC_SPE_LD_OP(dd_le, ld64r); | |
1016 | +PPC_SPE_LD_OP(dd, ldu64); | |
1017 | +PPC_SPE_ST_OP(dd, st64); | |
1018 | +PPC_SPE_LD_OP(dd_le, ldu64r); | |
1171 | 1019 | PPC_SPE_ST_OP(dd_le, st64r); |
1172 | 1020 | #endif |
1173 | 1021 | static always_inline uint64_t glue(spe_ldw, MEMSUFFIX) (target_ulong EA) |
1174 | 1022 | { |
1175 | 1023 | uint64_t ret; |
1176 | - ret = (uint64_t)glue(ldl, MEMSUFFIX)(EA) << 32; | |
1177 | - ret |= (uint64_t)glue(ldl, MEMSUFFIX)(EA + 4); | |
1024 | + ret = (uint64_t)glue(ldu32, MEMSUFFIX)(EA) << 32; | |
1025 | + ret |= (uint64_t)glue(ldu32, MEMSUFFIX)(EA + 4); | |
1178 | 1026 | return ret; |
1179 | 1027 | } |
1180 | 1028 | PPC_SPE_LD_OP(dw, spe_ldw); |
1181 | 1029 | static always_inline void glue(spe_stdw, MEMSUFFIX) (target_ulong EA, |
1182 | 1030 | uint64_t data) |
1183 | 1031 | { |
1184 | - glue(stl, MEMSUFFIX)(EA, data >> 32); | |
1185 | - glue(stl, MEMSUFFIX)(EA + 4, data); | |
1032 | + glue(st32, MEMSUFFIX)(EA, data >> 32); | |
1033 | + glue(st32, MEMSUFFIX)(EA + 4, data); | |
1186 | 1034 | } |
1187 | 1035 | PPC_SPE_ST_OP(dw, spe_stdw); |
1188 | 1036 | static always_inline uint64_t glue(spe_ldw_le, MEMSUFFIX) (target_ulong EA) |
1189 | 1037 | { |
1190 | 1038 | uint64_t ret; |
1191 | - ret = (uint64_t)glue(ld32r, MEMSUFFIX)(EA) << 32; | |
1192 | - ret |= (uint64_t)glue(ld32r, MEMSUFFIX)(EA + 4); | |
1039 | + ret = (uint64_t)glue(ldu32r, MEMSUFFIX)(EA) << 32; | |
1040 | + ret |= (uint64_t)glue(ldu32r, MEMSUFFIX)(EA + 4); | |
1193 | 1041 | return ret; |
1194 | 1042 | } |
1195 | 1043 | PPC_SPE_LD_OP(dw_le, spe_ldw_le); |
... | ... | @@ -1203,29 +1051,29 @@ PPC_SPE_ST_OP(dw_le, spe_stdw_le); |
1203 | 1051 | static always_inline uint64_t glue(spe_ldh, MEMSUFFIX) (target_ulong EA) |
1204 | 1052 | { |
1205 | 1053 | uint64_t ret; |
1206 | - ret = (uint64_t)glue(lduw, MEMSUFFIX)(EA) << 48; | |
1207 | - ret |= (uint64_t)glue(lduw, MEMSUFFIX)(EA + 2) << 32; | |
1208 | - ret |= (uint64_t)glue(lduw, MEMSUFFIX)(EA + 4) << 16; | |
1209 | - ret |= (uint64_t)glue(lduw, MEMSUFFIX)(EA + 6); | |
1054 | + ret = (uint64_t)glue(ldu16, MEMSUFFIX)(EA) << 48; | |
1055 | + ret |= (uint64_t)glue(ldu16, MEMSUFFIX)(EA + 2) << 32; | |
1056 | + ret |= (uint64_t)glue(ldu16, MEMSUFFIX)(EA + 4) << 16; | |
1057 | + ret |= (uint64_t)glue(ldu16, MEMSUFFIX)(EA + 6); | |
1210 | 1058 | return ret; |
1211 | 1059 | } |
1212 | 1060 | PPC_SPE_LD_OP(dh, spe_ldh); |
1213 | 1061 | static always_inline void glue(spe_stdh, MEMSUFFIX) (target_ulong EA, |
1214 | 1062 | uint64_t data) |
1215 | 1063 | { |
1216 | - glue(stw, MEMSUFFIX)(EA, data >> 48); | |
1217 | - glue(stw, MEMSUFFIX)(EA + 2, data >> 32); | |
1218 | - glue(stw, MEMSUFFIX)(EA + 4, data >> 16); | |
1219 | - glue(stw, MEMSUFFIX)(EA + 6, data); | |
1064 | + glue(st16, MEMSUFFIX)(EA, data >> 48); | |
1065 | + glue(st16, MEMSUFFIX)(EA + 2, data >> 32); | |
1066 | + glue(st16, MEMSUFFIX)(EA + 4, data >> 16); | |
1067 | + glue(st16, MEMSUFFIX)(EA + 6, data); | |
1220 | 1068 | } |
1221 | 1069 | PPC_SPE_ST_OP(dh, spe_stdh); |
1222 | 1070 | static always_inline uint64_t glue(spe_ldh_le, MEMSUFFIX) (target_ulong EA) |
1223 | 1071 | { |
1224 | 1072 | uint64_t ret; |
1225 | - ret = (uint64_t)glue(ld16r, MEMSUFFIX)(EA) << 48; | |
1226 | - ret |= (uint64_t)glue(ld16r, MEMSUFFIX)(EA + 2) << 32; | |
1227 | - ret |= (uint64_t)glue(ld16r, MEMSUFFIX)(EA + 4) << 16; | |
1228 | - ret |= (uint64_t)glue(ld16r, MEMSUFFIX)(EA + 6); | |
1073 | + ret = (uint64_t)glue(ldu16r, MEMSUFFIX)(EA) << 48; | |
1074 | + ret |= (uint64_t)glue(ldu16r, MEMSUFFIX)(EA + 2) << 32; | |
1075 | + ret |= (uint64_t)glue(ldu16r, MEMSUFFIX)(EA + 4) << 16; | |
1076 | + ret |= (uint64_t)glue(ldu16r, MEMSUFFIX)(EA + 6); | |
1229 | 1077 | return ret; |
1230 | 1078 | } |
1231 | 1079 | PPC_SPE_LD_OP(dh_le, spe_ldh_le); |
... | ... | @@ -1241,23 +1089,23 @@ PPC_SPE_ST_OP(dh_le, spe_stdh_le); |
1241 | 1089 | static always_inline uint64_t glue(spe_lwhe, MEMSUFFIX) (target_ulong EA) |
1242 | 1090 | { |
1243 | 1091 | uint64_t ret; |
1244 | - ret = (uint64_t)glue(lduw, MEMSUFFIX)(EA) << 48; | |
1245 | - ret |= (uint64_t)glue(lduw, MEMSUFFIX)(EA + 2) << 16; | |
1092 | + ret = (uint64_t)glue(ldu16, MEMSUFFIX)(EA) << 48; | |
1093 | + ret |= (uint64_t)glue(ldu16, MEMSUFFIX)(EA + 2) << 16; | |
1246 | 1094 | return ret; |
1247 | 1095 | } |
1248 | 1096 | PPC_SPE_LD_OP(whe, spe_lwhe); |
1249 | 1097 | static always_inline void glue(spe_stwhe, MEMSUFFIX) (target_ulong EA, |
1250 | 1098 | uint64_t data) |
1251 | 1099 | { |
1252 | - glue(stw, MEMSUFFIX)(EA, data >> 48); | |
1253 | - glue(stw, MEMSUFFIX)(EA + 2, data >> 16); | |
1100 | + glue(st16, MEMSUFFIX)(EA, data >> 48); | |
1101 | + glue(st16, MEMSUFFIX)(EA + 2, data >> 16); | |
1254 | 1102 | } |
1255 | 1103 | PPC_SPE_ST_OP(whe, spe_stwhe); |
1256 | 1104 | static always_inline uint64_t glue(spe_lwhe_le, MEMSUFFIX) (target_ulong EA) |
1257 | 1105 | { |
1258 | 1106 | uint64_t ret; |
1259 | - ret = (uint64_t)glue(ld16r, MEMSUFFIX)(EA) << 48; | |
1260 | - ret |= (uint64_t)glue(ld16r, MEMSUFFIX)(EA + 2) << 16; | |
1107 | + ret = (uint64_t)glue(ldu16r, MEMSUFFIX)(EA) << 48; | |
1108 | + ret |= (uint64_t)glue(ldu16r, MEMSUFFIX)(EA + 2) << 16; | |
1261 | 1109 | return ret; |
1262 | 1110 | } |
1263 | 1111 | PPC_SPE_LD_OP(whe_le, spe_lwhe_le); |
... | ... | @@ -1271,39 +1119,39 @@ PPC_SPE_ST_OP(whe_le, spe_stwhe_le); |
1271 | 1119 | static always_inline uint64_t glue(spe_lwhou, MEMSUFFIX) (target_ulong EA) |
1272 | 1120 | { |
1273 | 1121 | uint64_t ret; |
1274 | - ret = (uint64_t)glue(lduw, MEMSUFFIX)(EA) << 32; | |
1275 | - ret |= (uint64_t)glue(lduw, MEMSUFFIX)(EA + 2); | |
1122 | + ret = (uint64_t)glue(ldu16, MEMSUFFIX)(EA) << 32; | |
1123 | + ret |= (uint64_t)glue(ldu16, MEMSUFFIX)(EA + 2); | |
1276 | 1124 | return ret; |
1277 | 1125 | } |
1278 | 1126 | PPC_SPE_LD_OP(whou, spe_lwhou); |
1279 | 1127 | static always_inline uint64_t glue(spe_lwhos, MEMSUFFIX) (target_ulong EA) |
1280 | 1128 | { |
1281 | 1129 | uint64_t ret; |
1282 | - ret = ((uint64_t)((int32_t)glue(ldsw, MEMSUFFIX)(EA))) << 32; | |
1283 | - ret |= (uint64_t)((int32_t)glue(ldsw, MEMSUFFIX)(EA + 2)); | |
1130 | + ret = ((uint64_t)((int32_t)glue(lds16, MEMSUFFIX)(EA))) << 32; | |
1131 | + ret |= (uint64_t)((int32_t)glue(lds16, MEMSUFFIX)(EA + 2)); | |
1284 | 1132 | return ret; |
1285 | 1133 | } |
1286 | 1134 | PPC_SPE_LD_OP(whos, spe_lwhos); |
1287 | 1135 | static always_inline void glue(spe_stwho, MEMSUFFIX) (target_ulong EA, |
1288 | 1136 | uint64_t data) |
1289 | 1137 | { |
1290 | - glue(stw, MEMSUFFIX)(EA, data >> 32); | |
1291 | - glue(stw, MEMSUFFIX)(EA + 2, data); | |
1138 | + glue(st16, MEMSUFFIX)(EA, data >> 32); | |
1139 | + glue(st16, MEMSUFFIX)(EA + 2, data); | |
1292 | 1140 | } |
1293 | 1141 | PPC_SPE_ST_OP(who, spe_stwho); |
1294 | 1142 | static always_inline uint64_t glue(spe_lwhou_le, MEMSUFFIX) (target_ulong EA) |
1295 | 1143 | { |
1296 | 1144 | uint64_t ret; |
1297 | - ret = (uint64_t)glue(ld16r, MEMSUFFIX)(EA) << 32; | |
1298 | - ret |= (uint64_t)glue(ld16r, MEMSUFFIX)(EA + 2); | |
1145 | + ret = (uint64_t)glue(ldu16r, MEMSUFFIX)(EA) << 32; | |
1146 | + ret |= (uint64_t)glue(ldu16r, MEMSUFFIX)(EA + 2); | |
1299 | 1147 | return ret; |
1300 | 1148 | } |
1301 | 1149 | PPC_SPE_LD_OP(whou_le, spe_lwhou_le); |
1302 | 1150 | static always_inline uint64_t glue(spe_lwhos_le, MEMSUFFIX) (target_ulong EA) |
1303 | 1151 | { |
1304 | 1152 | uint64_t ret; |
1305 | - ret = ((uint64_t)((int32_t)glue(ld16rs, MEMSUFFIX)(EA))) << 32; | |
1306 | - ret |= (uint64_t)((int32_t)glue(ld16rs, MEMSUFFIX)(EA + 2)); | |
1153 | + ret = ((uint64_t)((int32_t)glue(lds16r, MEMSUFFIX)(EA))) << 32; | |
1154 | + ret |= (uint64_t)((int32_t)glue(lds16r, MEMSUFFIX)(EA + 2)); | |
1307 | 1155 | return ret; |
1308 | 1156 | } |
1309 | 1157 | PPC_SPE_LD_OP(whos_le, spe_lwhos_le); |
... | ... | @@ -1318,7 +1166,7 @@ PPC_SPE_ST_OP(who_le, spe_stwho_le); |
1318 | 1166 | static always_inline void glue(spe_stwwo, MEMSUFFIX) (target_ulong EA, |
1319 | 1167 | uint64_t data) |
1320 | 1168 | { |
1321 | - glue(stl, MEMSUFFIX)(EA, data); | |
1169 | + glue(st32, MEMSUFFIX)(EA, data); | |
1322 | 1170 | } |
1323 | 1171 | PPC_SPE_ST_OP(wwo, spe_stwwo); |
1324 | 1172 | static always_inline void glue(spe_stwwo_le, MEMSUFFIX) (target_ulong EA, |
... | ... | @@ -1331,21 +1179,21 @@ PPC_SPE_ST_OP(wwo_le, spe_stwwo_le); |
1331 | 1179 | static always_inline uint64_t glue(spe_lh, MEMSUFFIX) (target_ulong EA) |
1332 | 1180 | { |
1333 | 1181 | uint16_t tmp; |
1334 | - tmp = glue(lduw, MEMSUFFIX)(EA); | |
1182 | + tmp = glue(ldu16, MEMSUFFIX)(EA); | |
1335 | 1183 | return ((uint64_t)tmp << 48) | ((uint64_t)tmp << 16); |
1336 | 1184 | } |
1337 | 1185 | PPC_SPE_LD_OP(h, spe_lh); |
1338 | 1186 | static always_inline uint64_t glue(spe_lh_le, MEMSUFFIX) (target_ulong EA) |
1339 | 1187 | { |
1340 | 1188 | uint16_t tmp; |
1341 | - tmp = glue(ld16r, MEMSUFFIX)(EA); | |
1189 | + tmp = glue(ldu16r, MEMSUFFIX)(EA); | |
1342 | 1190 | return ((uint64_t)tmp << 48) | ((uint64_t)tmp << 16); |
1343 | 1191 | } |
1344 | 1192 | PPC_SPE_LD_OP(h_le, spe_lh_le); |
1345 | 1193 | static always_inline uint64_t glue(spe_lwwsplat, MEMSUFFIX) (target_ulong EA) |
1346 | 1194 | { |
1347 | 1195 | uint32_t tmp; |
1348 | - tmp = glue(ldl, MEMSUFFIX)(EA); | |
1196 | + tmp = glue(ldu32, MEMSUFFIX)(EA); | |
1349 | 1197 | return ((uint64_t)tmp << 32) | (uint64_t)tmp; |
1350 | 1198 | } |
1351 | 1199 | PPC_SPE_LD_OP(wwsplat, spe_lwwsplat); |
... | ... | @@ -1353,7 +1201,7 @@ static always_inline |
1353 | 1201 | uint64_t glue(spe_lwwsplat_le, MEMSUFFIX) (target_ulong EA) |
1354 | 1202 | { |
1355 | 1203 | uint32_t tmp; |
1356 | - tmp = glue(ld32r, MEMSUFFIX)(EA); | |
1204 | + tmp = glue(ldu32r, MEMSUFFIX)(EA); | |
1357 | 1205 | return ((uint64_t)tmp << 32) | (uint64_t)tmp; |
1358 | 1206 | } |
1359 | 1207 | PPC_SPE_LD_OP(wwsplat_le, spe_lwwsplat_le); |
... | ... | @@ -1361,9 +1209,9 @@ static always_inline uint64_t glue(spe_lwhsplat, MEMSUFFIX) (target_ulong EA) |
1361 | 1209 | { |
1362 | 1210 | uint64_t ret; |
1363 | 1211 | uint16_t tmp; |
1364 | - tmp = glue(lduw, MEMSUFFIX)(EA); | |
1212 | + tmp = glue(ldu16, MEMSUFFIX)(EA); | |
1365 | 1213 | ret = ((uint64_t)tmp << 48) | ((uint64_t)tmp << 32); |
1366 | - tmp = glue(lduw, MEMSUFFIX)(EA + 2); | |
1214 | + tmp = glue(ldu16, MEMSUFFIX)(EA + 2); | |
1367 | 1215 | ret |= ((uint64_t)tmp << 16) | (uint64_t)tmp; |
1368 | 1216 | return ret; |
1369 | 1217 | } |
... | ... | @@ -1373,9 +1221,9 @@ uint64_t glue(spe_lwhsplat_le, MEMSUFFIX) (target_ulong EA) |
1373 | 1221 | { |
1374 | 1222 | uint64_t ret; |
1375 | 1223 | uint16_t tmp; |
1376 | - tmp = glue(ld16r, MEMSUFFIX)(EA); | |
1224 | + tmp = glue(ldu16r, MEMSUFFIX)(EA); | |
1377 | 1225 | ret = ((uint64_t)tmp << 48) | ((uint64_t)tmp << 32); |
1378 | - tmp = glue(ld16r, MEMSUFFIX)(EA + 2); | |
1226 | + tmp = glue(ldu16r, MEMSUFFIX)(EA + 2); | |
1379 | 1227 | ret |= ((uint64_t)tmp << 16) | (uint64_t)tmp; |
1380 | 1228 | return ret; |
1381 | 1229 | } | ... | ... |
target-ppc/op_mem_access.h
0 โ 100644
1 | +/* | |
2 | + * PowerPC emulation memory access helpers for qemu. | |
3 | + * | |
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 | + */ | |
20 | + | |
21 | +/* 8 bits accesses */ | |
22 | +static always_inline target_ulong glue(ldu8, MEMSUFFIX) (target_ulong EA) | |
23 | +{ | |
24 | + return (uint8_t)glue(ldub, MEMSUFFIX)(EA); | |
25 | +} | |
26 | + | |
27 | +static always_inline target_long glue(lds8, MEMSUFFIX) (target_ulong EA) | |
28 | +{ | |
29 | + return (int8_t)glue(ldsb, MEMSUFFIX)(EA); | |
30 | +} | |
31 | + | |
32 | +static always_inline void glue(st8, MEMSUFFIX) (target_ulong EA, uint8_t val) | |
33 | +{ | |
34 | + glue(stb, MEMSUFFIX)(EA, val); | |
35 | +} | |
36 | + | |
37 | +/* 16 bits accesses */ | |
38 | +static always_inline target_ulong glue(ldu16, MEMSUFFIX) (target_ulong EA) | |
39 | +{ | |
40 | + return (uint16_t)glue(lduw, MEMSUFFIX)(EA); | |
41 | +} | |
42 | + | |
43 | +static always_inline target_long glue(lds16, MEMSUFFIX) (target_ulong EA) | |
44 | +{ | |
45 | + return (int16_t)glue(ldsw, MEMSUFFIX)(EA); | |
46 | +} | |
47 | + | |
48 | +static always_inline void glue(st16, MEMSUFFIX) (target_ulong EA, uint16_t val) | |
49 | +{ | |
50 | + glue(stw, MEMSUFFIX)(EA, val); | |
51 | +} | |
52 | + | |
53 | +static always_inline target_ulong glue(ldu16r, MEMSUFFIX) (target_ulong EA) | |
54 | +{ | |
55 | + return (uint16_t)bswap16(glue(lduw, MEMSUFFIX)(EA)); | |
56 | +} | |
57 | + | |
58 | +static always_inline target_long glue(lds16r, MEMSUFFIX) (target_ulong EA) | |
59 | +{ | |
60 | + return (int16_t)bswap16(glue(lduw, MEMSUFFIX)(EA)); | |
61 | +} | |
62 | + | |
63 | +static always_inline void glue(st16r, MEMSUFFIX) (target_ulong EA, uint16_t val) | |
64 | +{ | |
65 | + glue(stw, MEMSUFFIX)(EA, bswap16(val)); | |
66 | +} | |
67 | + | |
68 | +/* 32 bits accesses */ | |
69 | +static always_inline uint32_t glue(__ldul, MEMSUFFIX) (target_ulong EA) | |
70 | +{ | |
71 | + return (uint32_t)glue(ldl, MEMSUFFIX)(EA); | |
72 | +} | |
73 | + | |
74 | +static always_inline int32_t glue(__ldsl, MEMSUFFIX) (target_ulong EA) | |
75 | +{ | |
76 | + return (int32_t)glue(ldl, MEMSUFFIX)(EA); | |
77 | +} | |
78 | + | |
79 | +static always_inline target_ulong glue(ldu32, MEMSUFFIX) (target_ulong EA) | |
80 | +{ | |
81 | + return glue(__ldul, MEMSUFFIX)(EA); | |
82 | +} | |
83 | + | |
84 | +static always_inline target_long glue(lds32, MEMSUFFIX) (target_ulong EA) | |
85 | +{ | |
86 | + return glue(__ldsl, MEMSUFFIX)(EA); | |
87 | +} | |
88 | + | |
89 | +static always_inline void glue(st32, MEMSUFFIX) (target_ulong EA, uint32_t val) | |
90 | +{ | |
91 | + glue(stl, MEMSUFFIX)(EA, val); | |
92 | +} | |
93 | + | |
94 | +static always_inline target_ulong glue(ldu32r, MEMSUFFIX) (target_ulong EA) | |
95 | +{ | |
96 | + return bswap32(glue(__ldul, MEMSUFFIX)(EA)); | |
97 | +} | |
98 | + | |
99 | +static always_inline target_long glue(lds32r, MEMSUFFIX) (target_ulong EA) | |
100 | +{ | |
101 | + return (int32_t)bswap32(glue(__ldul, MEMSUFFIX)(EA)); | |
102 | +} | |
103 | + | |
104 | +static always_inline void glue(st32r, MEMSUFFIX) (target_ulong EA, uint32_t val) | |
105 | +{ | |
106 | + glue(stl, MEMSUFFIX)(EA, bswap32(val)); | |
107 | +} | |
108 | + | |
109 | +/* 64 bits accesses */ | |
110 | +static always_inline uint64_t glue(__lduq, MEMSUFFIX) (target_ulong EA) | |
111 | +{ | |
112 | + return (uint64_t)glue(ldq, MEMSUFFIX)(EA); | |
113 | +} | |
114 | + | |
115 | +static always_inline int64_t glue(__ldsq, MEMSUFFIX) (target_ulong EA) | |
116 | +{ | |
117 | + return (int64_t)glue(ldq, MEMSUFFIX)(EA); | |
118 | +} | |
119 | + | |
120 | +static always_inline uint64_t glue(ldu64, MEMSUFFIX) (target_ulong EA) | |
121 | +{ | |
122 | + return glue(__lduq, MEMSUFFIX)(EA); | |
123 | +} | |
124 | + | |
125 | +static always_inline int64_t glue(lds64, MEMSUFFIX) (target_ulong EA) | |
126 | +{ | |
127 | + return glue(__ldsq, MEMSUFFIX)(EA); | |
128 | +} | |
129 | + | |
130 | +static always_inline void glue(st64, MEMSUFFIX) (target_ulong EA, uint64_t val) | |
131 | +{ | |
132 | + glue(stq, MEMSUFFIX)(EA, val); | |
133 | +} | |
134 | + | |
135 | +static always_inline uint64_t glue(ldu64r, MEMSUFFIX) (target_ulong EA) | |
136 | +{ | |
137 | + return bswap64(glue(__lduq, MEMSUFFIX)(EA)); | |
138 | +} | |
139 | + | |
140 | +static always_inline int64_t glue(lds64r, MEMSUFFIX) (target_ulong EA) | |
141 | +{ | |
142 | + return (int64_t)bswap64(glue(__lduq, MEMSUFFIX)(EA)); | |
143 | +} | |
144 | + | |
145 | +static always_inline void glue(st64r, MEMSUFFIX) (target_ulong EA, uint64_t val) | |
146 | +{ | |
147 | + glue(stq, MEMSUFFIX)(EA, bswap64(val)); | |
148 | +} | ... | ... |
target-ppc/translate.c
... | ... | @@ -2455,12 +2455,37 @@ GEN_HANDLER(stmw, 0x2F, 0xFF, 0xFF, 0x00000000, PPC_INTEGER) |
2455 | 2455 | /*** Integer load and store strings ***/ |
2456 | 2456 | #define op_ldsts(name, start) (*gen_op_##name[ctx->mem_idx])(start) |
2457 | 2457 | #define op_ldstsx(name, rd, ra, rb) (*gen_op_##name[ctx->mem_idx])(rd, ra, rb) |
2458 | +/* string load & stores are by definition endian-safe */ | |
2459 | +#define gen_op_lswi_le_raw gen_op_lswi_raw | |
2460 | +#define gen_op_lswi_le_user gen_op_lswi_user | |
2461 | +#define gen_op_lswi_le_kernel gen_op_lswi_kernel | |
2462 | +#define gen_op_lswi_le_hypv gen_op_lswi_hypv | |
2463 | +#define gen_op_lswi_le_64_raw gen_op_lswi_raw | |
2464 | +#define gen_op_lswi_le_64_user gen_op_lswi_user | |
2465 | +#define gen_op_lswi_le_64_kernel gen_op_lswi_kernel | |
2466 | +#define gen_op_lswi_le_64_hypv gen_op_lswi_hypv | |
2458 | 2467 | static GenOpFunc1 *gen_op_lswi[NB_MEM_FUNCS] = { |
2459 | 2468 | GEN_MEM_FUNCS(lswi), |
2460 | 2469 | }; |
2470 | +#define gen_op_lswx_le_raw gen_op_lswx_raw | |
2471 | +#define gen_op_lswx_le_user gen_op_lswx_user | |
2472 | +#define gen_op_lswx_le_kernel gen_op_lswx_kernel | |
2473 | +#define gen_op_lswx_le_hypv gen_op_lswx_hypv | |
2474 | +#define gen_op_lswx_le_64_raw gen_op_lswx_raw | |
2475 | +#define gen_op_lswx_le_64_user gen_op_lswx_user | |
2476 | +#define gen_op_lswx_le_64_kernel gen_op_lswx_kernel | |
2477 | +#define gen_op_lswx_le_64_hypv gen_op_lswx_hypv | |
2461 | 2478 | static GenOpFunc3 *gen_op_lswx[NB_MEM_FUNCS] = { |
2462 | 2479 | GEN_MEM_FUNCS(lswx), |
2463 | 2480 | }; |
2481 | +#define gen_op_stsw_le_raw gen_op_stsw_raw | |
2482 | +#define gen_op_stsw_le_user gen_op_stsw_user | |
2483 | +#define gen_op_stsw_le_kernel gen_op_stsw_kernel | |
2484 | +#define gen_op_stsw_le_hypv gen_op_stsw_hypv | |
2485 | +#define gen_op_stsw_le_64_raw gen_op_stsw_raw | |
2486 | +#define gen_op_stsw_le_64_user gen_op_stsw_user | |
2487 | +#define gen_op_stsw_le_64_kernel gen_op_stsw_kernel | |
2488 | +#define gen_op_stsw_le_64_hypv gen_op_stsw_hypv | |
2464 | 2489 | static GenOpFunc1 *gen_op_stsw[NB_MEM_FUNCS] = { |
2465 | 2490 | GEN_MEM_FUNCS(stsw), |
2466 | 2491 | }; | ... | ... |