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 | 170 | void helper_ld_asi(int asi, int size, int sign) |
171 | 171 | { |
172 | 172 | uint32_t ret = 0; |
173 | + uint64_t tmp; | |
173 | 174 | #ifdef DEBUG_MXCC |
174 | 175 | uint32_t last_T0 = T0; |
175 | 176 | #endif |
... | ... | @@ -244,8 +245,9 @@ void helper_ld_asi(int asi, int size, int sign) |
244 | 245 | ret = ldl_code(T0 & ~3); |
245 | 246 | break; |
246 | 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 | 251 | break; |
250 | 252 | } |
251 | 253 | break; |
... | ... | @@ -262,8 +264,9 @@ void helper_ld_asi(int asi, int size, int sign) |
262 | 264 | ret = ldl_user(T0 & ~3); |
263 | 265 | break; |
264 | 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 | 270 | break; |
268 | 271 | } |
269 | 272 | break; |
... | ... | @@ -280,8 +283,9 @@ void helper_ld_asi(int asi, int size, int sign) |
280 | 283 | ret = ldl_kernel(T0 & ~3); |
281 | 284 | break; |
282 | 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 | 289 | break; |
286 | 290 | } |
287 | 291 | break; |
... | ... | @@ -303,8 +307,9 @@ void helper_ld_asi(int asi, int size, int sign) |
303 | 307 | ret = ldl_phys(T0 & ~3); |
304 | 308 | break; |
305 | 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 | 313 | break; |
309 | 314 | } |
310 | 315 | break; |
... | ... | @@ -325,10 +330,10 @@ void helper_ld_asi(int asi, int size, int sign) |
325 | 330 | | ((target_phys_addr_t)(asi & 0xf) << 32)); |
326 | 331 | break; |
327 | 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 | 334 | | ((target_phys_addr_t)(asi & 0xf) << 32)); |
335 | + ret = tmp >> 32; | |
336 | + T0 = tmp & 0xffffffff; | |
332 | 337 | break; |
333 | 338 | } |
334 | 339 | break; |
... | ... | @@ -515,8 +520,7 @@ void helper_st_asi(int asi, int size) |
515 | 520 | stl_user(T0 & ~3, T1); |
516 | 521 | break; |
517 | 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 | 524 | break; |
521 | 525 | } |
522 | 526 | break; |
... | ... | @@ -533,8 +537,7 @@ void helper_st_asi(int asi, int size) |
533 | 537 | stl_kernel(T0 & ~3, T1); |
534 | 538 | break; |
535 | 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 | 541 | break; |
539 | 542 | } |
540 | 543 | break; |
... | ... | @@ -591,8 +594,7 @@ void helper_st_asi(int asi, int size) |
591 | 594 | stl_phys(T0 & ~3, T1); |
592 | 595 | break; |
593 | 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 | 598 | break; |
597 | 599 | } |
598 | 600 | } |
... | ... | @@ -615,10 +617,9 @@ void helper_st_asi(int asi, int size) |
615 | 617 | | ((target_phys_addr_t)(asi & 0xf) << 32), T1); |
616 | 618 | break; |
617 | 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 | 623 | break; |
623 | 624 | } |
624 | 625 | } | ... | ... |
target-sparc/op_mem.h
... | ... | @@ -36,8 +36,9 @@ SPARC_ST_OP(sth, stw); |
36 | 36 | |
37 | 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 | 44 | void OPPROTO glue(op_ldstub, MEMSUFFIX)(void) |
... | ... | @@ -55,8 +56,11 @@ void OPPROTO glue(op_swap, MEMSUFFIX)(void) |
55 | 56 | |
56 | 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 | 66 | /*** Floating-point store ***/ | ... | ... |