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