Commit f4efd1660326ee85023c980abc533143dee8228d
1 parent
f48f3ede
Revert incorrect part of r4574 to avoid unaligned traps with i386 target
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5209 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
0 additions
and
38 deletions
cpu-all.h
@@ -233,15 +233,6 @@ static inline int lduw_le_p(void *ptr) | @@ -233,15 +233,6 @@ static inline int lduw_le_p(void *ptr) | ||
233 | int val; | 233 | int val; |
234 | __asm__ __volatile__ ("lhbrx %0,0,%1" : "=r" (val) : "r" (ptr)); | 234 | __asm__ __volatile__ ("lhbrx %0,0,%1" : "=r" (val) : "r" (ptr)); |
235 | return val; | 235 | return val; |
236 | -#elif defined(__sparc__) | ||
237 | -#ifndef ASI_PRIMARY_LITTLE | ||
238 | -#define ASI_PRIMARY_LITTLE 0x88 | ||
239 | -#endif | ||
240 | - | ||
241 | - int val; | ||
242 | - __asm__ __volatile__ ("lduha [%1] %2, %0" : "=r" (val) : "r" (ptr), | ||
243 | - "i" (ASI_PRIMARY_LITTLE)); | ||
244 | - return val; | ||
245 | #else | 236 | #else |
246 | uint8_t *p = ptr; | 237 | uint8_t *p = ptr; |
247 | return p[0] | (p[1] << 8); | 238 | return p[0] | (p[1] << 8); |
@@ -254,11 +245,6 @@ static inline int ldsw_le_p(void *ptr) | @@ -254,11 +245,6 @@ static inline int ldsw_le_p(void *ptr) | ||
254 | int val; | 245 | int val; |
255 | __asm__ __volatile__ ("lhbrx %0,0,%1" : "=r" (val) : "r" (ptr)); | 246 | __asm__ __volatile__ ("lhbrx %0,0,%1" : "=r" (val) : "r" (ptr)); |
256 | return (int16_t)val; | 247 | return (int16_t)val; |
257 | -#elif defined(__sparc__) | ||
258 | - int val; | ||
259 | - __asm__ __volatile__ ("ldsha [%1] %2, %0" : "=r" (val) : "r" (ptr), | ||
260 | - "i" (ASI_PRIMARY_LITTLE)); | ||
261 | - return val; | ||
262 | #else | 248 | #else |
263 | uint8_t *p = ptr; | 249 | uint8_t *p = ptr; |
264 | return (int16_t)(p[0] | (p[1] << 8)); | 250 | return (int16_t)(p[0] | (p[1] << 8)); |
@@ -271,11 +257,6 @@ static inline int ldl_le_p(void *ptr) | @@ -271,11 +257,6 @@ static inline int ldl_le_p(void *ptr) | ||
271 | int val; | 257 | int val; |
272 | __asm__ __volatile__ ("lwbrx %0,0,%1" : "=r" (val) : "r" (ptr)); | 258 | __asm__ __volatile__ ("lwbrx %0,0,%1" : "=r" (val) : "r" (ptr)); |
273 | return val; | 259 | return val; |
274 | -#elif defined(__sparc__) | ||
275 | - int val; | ||
276 | - __asm__ __volatile__ ("lduwa [%1] %2, %0" : "=r" (val) : "r" (ptr), | ||
277 | - "i" (ASI_PRIMARY_LITTLE)); | ||
278 | - return val; | ||
279 | #else | 260 | #else |
280 | uint8_t *p = ptr; | 261 | uint8_t *p = ptr; |
281 | return p[0] | (p[1] << 8) | (p[2] << 16) | (p[3] << 24); | 262 | return p[0] | (p[1] << 8) | (p[2] << 16) | (p[3] << 24); |
@@ -284,27 +265,17 @@ static inline int ldl_le_p(void *ptr) | @@ -284,27 +265,17 @@ static inline int ldl_le_p(void *ptr) | ||
284 | 265 | ||
285 | static inline uint64_t ldq_le_p(void *ptr) | 266 | static inline uint64_t ldq_le_p(void *ptr) |
286 | { | 267 | { |
287 | -#if defined(__sparc__) | ||
288 | - uint64_t val; | ||
289 | - __asm__ __volatile__ ("ldxa [%1] %2, %0" : "=r" (val) : "r" (ptr), | ||
290 | - "i" (ASI_PRIMARY_LITTLE)); | ||
291 | - return val; | ||
292 | -#else | ||
293 | uint8_t *p = ptr; | 268 | uint8_t *p = ptr; |
294 | uint32_t v1, v2; | 269 | uint32_t v1, v2; |
295 | v1 = ldl_le_p(p); | 270 | v1 = ldl_le_p(p); |
296 | v2 = ldl_le_p(p + 4); | 271 | v2 = ldl_le_p(p + 4); |
297 | return v1 | ((uint64_t)v2 << 32); | 272 | return v1 | ((uint64_t)v2 << 32); |
298 | -#endif | ||
299 | } | 273 | } |
300 | 274 | ||
301 | static inline void stw_le_p(void *ptr, int v) | 275 | static inline void stw_le_p(void *ptr, int v) |
302 | { | 276 | { |
303 | #ifdef __powerpc__ | 277 | #ifdef __powerpc__ |
304 | __asm__ __volatile__ ("sthbrx %1,0,%2" : "=m" (*(uint16_t *)ptr) : "r" (v), "r" (ptr)); | 278 | __asm__ __volatile__ ("sthbrx %1,0,%2" : "=m" (*(uint16_t *)ptr) : "r" (v), "r" (ptr)); |
305 | -#elif defined(__sparc__) | ||
306 | - __asm__ __volatile__ ("stha %1, [%2] %3" : "=m" (*(uint16_t *)ptr) : "r" (v), | ||
307 | - "r" (ptr), "i" (ASI_PRIMARY_LITTLE)); | ||
308 | #else | 279 | #else |
309 | uint8_t *p = ptr; | 280 | uint8_t *p = ptr; |
310 | p[0] = v; | 281 | p[0] = v; |
@@ -316,9 +287,6 @@ static inline void stl_le_p(void *ptr, int v) | @@ -316,9 +287,6 @@ static inline void stl_le_p(void *ptr, int v) | ||
316 | { | 287 | { |
317 | #ifdef __powerpc__ | 288 | #ifdef __powerpc__ |
318 | __asm__ __volatile__ ("stwbrx %1,0,%2" : "=m" (*(uint32_t *)ptr) : "r" (v), "r" (ptr)); | 289 | __asm__ __volatile__ ("stwbrx %1,0,%2" : "=m" (*(uint32_t *)ptr) : "r" (v), "r" (ptr)); |
319 | -#elif defined(__sparc__) | ||
320 | - __asm__ __volatile__ ("stwa %1, [%2] %3" : "=m" (*(uint32_t *)ptr) : "r" (v), | ||
321 | - "r" (ptr), "i" (ASI_PRIMARY_LITTLE)); | ||
322 | #else | 290 | #else |
323 | uint8_t *p = ptr; | 291 | uint8_t *p = ptr; |
324 | p[0] = v; | 292 | p[0] = v; |
@@ -330,15 +298,9 @@ static inline void stl_le_p(void *ptr, int v) | @@ -330,15 +298,9 @@ static inline void stl_le_p(void *ptr, int v) | ||
330 | 298 | ||
331 | static inline void stq_le_p(void *ptr, uint64_t v) | 299 | static inline void stq_le_p(void *ptr, uint64_t v) |
332 | { | 300 | { |
333 | -#if defined(__sparc__) | ||
334 | - __asm__ __volatile__ ("stxa %1, [%2] %3" : "=m" (*(uint64_t *)ptr) : "r" (v), | ||
335 | - "r" (ptr), "i" (ASI_PRIMARY_LITTLE)); | ||
336 | -#undef ASI_PRIMARY_LITTLE | ||
337 | -#else | ||
338 | uint8_t *p = ptr; | 301 | uint8_t *p = ptr; |
339 | stl_le_p(p, (uint32_t)v); | 302 | stl_le_p(p, (uint32_t)v); |
340 | stl_le_p(p + 4, v >> 32); | 303 | stl_le_p(p + 4, v >> 32); |
341 | -#endif | ||
342 | } | 304 | } |
343 | 305 | ||
344 | /* float access */ | 306 | /* float access */ |