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