Commit e909ec2f11550804d1a6c16ffa0e50acc4c1c077
1 parent
8f577d3d
Use ldq and stq for 8 byte accesses (original patch by Robert Reif)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3405 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
2 changed files
with
30 additions
and
25 deletions
target-sparc/op_helper.c
@@ -170,6 +170,7 @@ static void dump_mxcc(CPUState *env) | @@ -170,6 +170,7 @@ static void dump_mxcc(CPUState *env) | ||
170 | void helper_ld_asi(int asi, int size, int sign) | 170 | void helper_ld_asi(int asi, int size, int sign) |
171 | { | 171 | { |
172 | uint32_t ret = 0; | 172 | uint32_t ret = 0; |
173 | + uint64_t tmp; | ||
173 | #ifdef DEBUG_MXCC | 174 | #ifdef DEBUG_MXCC |
174 | uint32_t last_T0 = T0; | 175 | uint32_t last_T0 = T0; |
175 | #endif | 176 | #endif |
@@ -244,8 +245,9 @@ void helper_ld_asi(int asi, int size, int sign) | @@ -244,8 +245,9 @@ void helper_ld_asi(int asi, int size, int sign) | ||
244 | ret = ldl_code(T0 & ~3); | 245 | ret = ldl_code(T0 & ~3); |
245 | break; | 246 | break; |
246 | case 8: | 247 | case 8: |
247 | - ret = ldl_code(T0 & ~3); | ||
248 | - T0 = ldl_code((T0 + 4) & ~3); | 248 | + tmp = ldq_code(T0 & ~7); |
249 | + ret = tmp >> 32; | ||
250 | + T0 = tmp & 0xffffffff; | ||
249 | break; | 251 | break; |
250 | } | 252 | } |
251 | break; | 253 | break; |
@@ -262,8 +264,9 @@ void helper_ld_asi(int asi, int size, int sign) | @@ -262,8 +264,9 @@ void helper_ld_asi(int asi, int size, int sign) | ||
262 | ret = ldl_user(T0 & ~3); | 264 | ret = ldl_user(T0 & ~3); |
263 | break; | 265 | break; |
264 | case 8: | 266 | case 8: |
265 | - ret = ldl_user(T0 & ~3); | ||
266 | - T0 = ldl_user((T0 + 4) & ~3); | 267 | + tmp = ldq_user(T0 & ~7); |
268 | + ret = tmp >> 32; | ||
269 | + T0 = tmp & 0xffffffff; | ||
267 | break; | 270 | break; |
268 | } | 271 | } |
269 | break; | 272 | break; |
@@ -280,8 +283,9 @@ void helper_ld_asi(int asi, int size, int sign) | @@ -280,8 +283,9 @@ void helper_ld_asi(int asi, int size, int sign) | ||
280 | ret = ldl_kernel(T0 & ~3); | 283 | ret = ldl_kernel(T0 & ~3); |
281 | break; | 284 | break; |
282 | case 8: | 285 | case 8: |
283 | - ret = ldl_kernel(T0 & ~3); | ||
284 | - T0 = ldl_kernel((T0 + 4) & ~3); | 286 | + tmp = ldq_kernel(T0 & ~7); |
287 | + ret = tmp >> 32; | ||
288 | + T0 = tmp & 0xffffffff; | ||
285 | break; | 289 | break; |
286 | } | 290 | } |
287 | break; | 291 | break; |
@@ -303,8 +307,9 @@ void helper_ld_asi(int asi, int size, int sign) | @@ -303,8 +307,9 @@ void helper_ld_asi(int asi, int size, int sign) | ||
303 | ret = ldl_phys(T0 & ~3); | 307 | ret = ldl_phys(T0 & ~3); |
304 | break; | 308 | break; |
305 | case 8: | 309 | case 8: |
306 | - ret = ldl_phys(T0 & ~3); | ||
307 | - T0 = ldl_phys((T0 + 4) & ~3); | 310 | + tmp = ldq_phys(T0 & ~7); |
311 | + ret = tmp >> 32; | ||
312 | + T0 = tmp & 0xffffffff; | ||
308 | break; | 313 | break; |
309 | } | 314 | } |
310 | break; | 315 | break; |
@@ -325,10 +330,10 @@ void helper_ld_asi(int asi, int size, int sign) | @@ -325,10 +330,10 @@ void helper_ld_asi(int asi, int size, int sign) | ||
325 | | ((target_phys_addr_t)(asi & 0xf) << 32)); | 330 | | ((target_phys_addr_t)(asi & 0xf) << 32)); |
326 | break; | 331 | break; |
327 | case 8: | 332 | case 8: |
328 | - ret = ldl_phys((target_phys_addr_t)(T0 & ~3) | ||
329 | - | ((target_phys_addr_t)(asi & 0xf) << 32)); | ||
330 | - T0 = ldl_phys((target_phys_addr_t)((T0 + 4) & ~3) | 333 | + tmp = ldq_phys((target_phys_addr_t)(T0 & ~7) |
331 | | ((target_phys_addr_t)(asi & 0xf) << 32)); | 334 | | ((target_phys_addr_t)(asi & 0xf) << 32)); |
335 | + ret = tmp >> 32; | ||
336 | + T0 = tmp & 0xffffffff; | ||
332 | break; | 337 | break; |
333 | } | 338 | } |
334 | break; | 339 | break; |
@@ -515,8 +520,7 @@ void helper_st_asi(int asi, int size) | @@ -515,8 +520,7 @@ void helper_st_asi(int asi, int size) | ||
515 | stl_user(T0 & ~3, T1); | 520 | stl_user(T0 & ~3, T1); |
516 | break; | 521 | break; |
517 | case 8: | 522 | case 8: |
518 | - stl_user(T0 & ~3, T1); | ||
519 | - stl_user((T0 + 4) & ~3, T2); | 523 | + stq_user(T0 & ~7, ((uint64_t)T1 << 32) | T2); |
520 | break; | 524 | break; |
521 | } | 525 | } |
522 | break; | 526 | break; |
@@ -533,8 +537,7 @@ void helper_st_asi(int asi, int size) | @@ -533,8 +537,7 @@ void helper_st_asi(int asi, int size) | ||
533 | stl_kernel(T0 & ~3, T1); | 537 | stl_kernel(T0 & ~3, T1); |
534 | break; | 538 | break; |
535 | case 8: | 539 | case 8: |
536 | - stl_kernel(T0 & ~3, T1); | ||
537 | - stl_kernel((T0 + 4) & ~3, T2); | 540 | + stq_kernel(T0 & ~7, ((uint64_t)T1 << 32) | T2); |
538 | break; | 541 | break; |
539 | } | 542 | } |
540 | break; | 543 | break; |
@@ -591,8 +594,7 @@ void helper_st_asi(int asi, int size) | @@ -591,8 +594,7 @@ void helper_st_asi(int asi, int size) | ||
591 | stl_phys(T0 & ~3, T1); | 594 | stl_phys(T0 & ~3, T1); |
592 | break; | 595 | break; |
593 | case 8: | 596 | case 8: |
594 | - stl_phys(T0 & ~3, T1); | ||
595 | - stl_phys((T0 + 4) & ~3, T2); | 597 | + stq_phys(T0 & ~7, ((uint64_t)T1 << 32) | T2); |
596 | break; | 598 | break; |
597 | } | 599 | } |
598 | } | 600 | } |
@@ -615,10 +617,9 @@ void helper_st_asi(int asi, int size) | @@ -615,10 +617,9 @@ void helper_st_asi(int asi, int size) | ||
615 | | ((target_phys_addr_t)(asi & 0xf) << 32), T1); | 617 | | ((target_phys_addr_t)(asi & 0xf) << 32), T1); |
616 | break; | 618 | break; |
617 | case 8: | 619 | case 8: |
618 | - stl_phys((target_phys_addr_t)(T0 & ~3) | ||
619 | - | ((target_phys_addr_t)(asi & 0xf) << 32), T1); | ||
620 | - stl_phys((target_phys_addr_t)((T0 + 4) & ~3) | ||
621 | - | ((target_phys_addr_t)(asi & 0xf) << 32), T2); | 620 | + stq_phys((target_phys_addr_t)(T0 & ~7) |
621 | + | ((target_phys_addr_t)(asi & 0xf) << 32), | ||
622 | + ((uint64_t)T1 << 32) | T2); | ||
622 | break; | 623 | break; |
623 | } | 624 | } |
624 | } | 625 | } |
target-sparc/op_mem.h
@@ -36,8 +36,9 @@ SPARC_ST_OP(sth, stw); | @@ -36,8 +36,9 @@ SPARC_ST_OP(sth, stw); | ||
36 | 36 | ||
37 | void OPPROTO glue(op_std, MEMSUFFIX)(void) | 37 | void OPPROTO glue(op_std, MEMSUFFIX)(void) |
38 | { | 38 | { |
39 | - glue(stl, MEMSUFFIX)(ADDR(T0), T1); | ||
40 | - glue(stl, MEMSUFFIX)((ADDR(T0 + 4)), T2); | 39 | + uint64_t tmp = ((uint64_t)T1 << 32) | (uint64_t)(T2 & 0xffffffff); |
40 | + | ||
41 | + glue(stq, MEMSUFFIX)(ADDR(T0), tmp); | ||
41 | } | 42 | } |
42 | 43 | ||
43 | void OPPROTO glue(op_ldstub, MEMSUFFIX)(void) | 44 | void OPPROTO glue(op_ldstub, MEMSUFFIX)(void) |
@@ -55,8 +56,11 @@ void OPPROTO glue(op_swap, MEMSUFFIX)(void) | @@ -55,8 +56,11 @@ void OPPROTO glue(op_swap, MEMSUFFIX)(void) | ||
55 | 56 | ||
56 | void OPPROTO glue(op_ldd, MEMSUFFIX)(void) | 57 | void OPPROTO glue(op_ldd, MEMSUFFIX)(void) |
57 | { | 58 | { |
58 | - T1 = glue(ldl, MEMSUFFIX)(ADDR(T0)); | ||
59 | - T0 = glue(ldl, MEMSUFFIX)((ADDR(T0 + 4))); | 59 | + uint64_t tmp; |
60 | + | ||
61 | + tmp = glue(ldq, MEMSUFFIX)(ADDR(T0)); | ||
62 | + T1 = tmp >> 32; | ||
63 | + T0 = tmp & 0xffffffff; | ||
60 | } | 64 | } |
61 | 65 | ||
62 | /*** Floating-point store ***/ | 66 | /*** Floating-point store ***/ |