diff options
author | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2004-01-04 23:26:24 +0000 |
---|---|---|
committer | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2004-01-04 23:26:24 +0000 |
commit | ac9eb0731ad123f8789005978500ac67026188c2 (patch) | |
tree | 46196d5fcd9eba3ecb37b13a401fe4dab9be070d /target-ppc/op_mem.h | |
parent | 9a64fbe4d89751524be0954f87dd514083295e99 (diff) |
suppressed explicit access type and use the exception routine to infer it from the micro operation
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@529 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-ppc/op_mem.h')
-rw-r--r-- | target-ppc/op_mem.h | 74 |
1 files changed, 34 insertions, 40 deletions
diff --git a/target-ppc/op_mem.h b/target-ppc/op_mem.h index 2a50f84f42..e66a1dbe01 100644 --- a/target-ppc/op_mem.h +++ b/target-ppc/op_mem.h @@ -2,68 +2,62 @@ void glue(do_lsw, MEMSUFFIX) (int dst); void glue(do_stsw, MEMSUFFIX) (int src); -/* Internal helpers for sign extension and byte-reverse */ -static inline uint32_t glue(_ld16x, MEMSUFFIX) (void *EA, int type) +static inline uint16_t glue(ld16r, MEMSUFFIX) (void *EA) { - return s_ext16(glue(_lduw, MEMSUFFIX)(EA, type)); -} - -static inline uint16_t glue(_ld16r, MEMSUFFIX) (void *EA, int type) -{ - uint16_t tmp = glue(_lduw, MEMSUFFIX)(EA, type); + uint16_t tmp = glue(lduw, MEMSUFFIX)(EA); return ((tmp & 0xFF00) >> 8) | ((tmp & 0x00FF) << 8); } -static inline uint32_t glue(_ld32r, MEMSUFFIX) (void *EA, int type) +static inline uint32_t glue(ld32r, MEMSUFFIX) (void *EA) { - uint32_t tmp = glue(_ldl, MEMSUFFIX)(EA, type); + uint32_t tmp = glue(ldl, MEMSUFFIX)(EA); return ((tmp & 0xFF000000) >> 24) | ((tmp & 0x00FF0000) >> 8) | ((tmp & 0x0000FF00) << 8) | ((tmp & 0x000000FF) << 24); } -static inline void glue(_st16r, MEMSUFFIX) (void *EA, uint16_t data, int type) +static inline void glue(st16r, MEMSUFFIX) (void *EA, uint16_t data) { uint16_t tmp = ((data & 0xFF00) >> 8) | ((data & 0x00FF) << 8); - glue(_stw, MEMSUFFIX)(EA, tmp, type); + glue(stw, MEMSUFFIX)(EA, tmp); } -static inline void glue(_st32r, MEMSUFFIX) (void *EA, uint32_t data, int type) +static inline void glue(st32r, MEMSUFFIX) (void *EA, uint32_t data) { uint32_t tmp = ((data & 0xFF000000) >> 24) | ((data & 0x00FF0000) >> 8) | ((data & 0x0000FF00) << 8) | ((data & 0x000000FF) << 24); - glue(_stl, MEMSUFFIX)(EA, tmp, type); + glue(stl, MEMSUFFIX)(EA, tmp); } /*** Integer load ***/ #define PPC_LD_OP(name, op) \ PPC_OP(glue(glue(l, name), MEMSUFFIX)) \ { \ - T1 = glue(op, MEMSUFFIX)((void *)T0, ACCESS_INT); \ + T1 = glue(op, MEMSUFFIX)((void *)T0); \ RETURN(); \ } #define PPC_ST_OP(name, op) \ PPC_OP(glue(glue(st, name), MEMSUFFIX)) \ { \ - glue(op, MEMSUFFIX)((void *)T0, T1, ACCESS_INT); \ + glue(op, MEMSUFFIX)((void *)T0, T1); \ RETURN(); \ } -PPC_LD_OP(bz, _ldub); -PPC_LD_OP(ha, _ld16x); -PPC_LD_OP(hz, _lduw); -PPC_LD_OP(wz, _ldl); +PPC_LD_OP(bz, ldub); +PPC_LD_OP(ha, ldsw); +PPC_LD_OP(hz, lduw); +PPC_LD_OP(wz, ldl); /*** Integer store ***/ -PPC_ST_OP(b, _stb); -PPC_ST_OP(h, _stw); -PPC_ST_OP(w, _stl); +PPC_ST_OP(b, stb); +PPC_ST_OP(h, stw); +PPC_ST_OP(w, stl); /*** Integer load and store with byte reverse ***/ -PPC_LD_OP(hbr, _ld16r); -PPC_LD_OP(wbr, _ld32r); -PPC_ST_OP(hbr, _st16r); -PPC_ST_OP(wbr, _st32r); +PPC_LD_OP(hbr, ld16r); +PPC_LD_OP(wbr, ld32r); +PPC_ST_OP(hbr, st16r); +PPC_ST_OP(wbr, st32r); /*** Integer load and store multiple ***/ PPC_OP(glue(lmw, MEMSUFFIX)) @@ -71,7 +65,7 @@ PPC_OP(glue(lmw, MEMSUFFIX)) int dst = PARAM(1); for (; dst < 32; dst++, T0 += 4) { - ugpr(dst) = glue(_ldl, MEMSUFFIX)((void *)T0, ACCESS_INT); + ugpr(dst) = glue(ldl, MEMSUFFIX)((void *)T0); } RETURN(); } @@ -81,7 +75,7 @@ PPC_OP(glue(stmw, MEMSUFFIX)) int src = PARAM(1); for (; src < 32; src++, T0 += 4) { - glue(_stl, MEMSUFFIX)((void *)T0, ugpr(src), ACCESS_INT); + glue(stl, MEMSUFFIX)((void *)T0, ugpr(src)); } RETURN(); } @@ -150,7 +144,7 @@ PPC_OP(glue(stwcx, MEMSUFFIX)) if (regs->reserve != T0) { env->crf[0] = xer_ov; } else { - glue(_stl, MEMSUFFIX)((void *)T0, T1, ACCESS_RES); + glue(stl, MEMSUFFIX)((void *)T0, T1); env->crf[0] = xer_ov | 0x02; } } @@ -160,27 +154,27 @@ PPC_OP(glue(stwcx, MEMSUFFIX)) PPC_OP(glue(dcbz, MEMSUFFIX)) { - glue(_stl, MEMSUFFIX)((void *)(T0 + 0x00), 0, ACCESS_INT); - glue(_stl, MEMSUFFIX)((void *)(T0 + 0x04), 0, ACCESS_INT); - glue(_stl, MEMSUFFIX)((void *)(T0 + 0x08), 0, ACCESS_INT); - glue(_stl, MEMSUFFIX)((void *)(T0 + 0x0C), 0, ACCESS_INT); - glue(_stl, MEMSUFFIX)((void *)(T0 + 0x10), 0, ACCESS_INT); - glue(_stl, MEMSUFFIX)((void *)(T0 + 0x14), 0, ACCESS_INT); - glue(_stl, MEMSUFFIX)((void *)(T0 + 0x18), 0, ACCESS_INT); - glue(_stl, MEMSUFFIX)((void *)(T0 + 0x1C), 0, ACCESS_INT); + glue(stl, MEMSUFFIX)((void *)(T0 + 0x00), 0); + glue(stl, MEMSUFFIX)((void *)(T0 + 0x04), 0); + glue(stl, MEMSUFFIX)((void *)(T0 + 0x08), 0); + glue(stl, MEMSUFFIX)((void *)(T0 + 0x0C), 0); + glue(stl, MEMSUFFIX)((void *)(T0 + 0x10), 0); + glue(stl, MEMSUFFIX)((void *)(T0 + 0x14), 0); + glue(stl, MEMSUFFIX)((void *)(T0 + 0x18), 0); + glue(stl, MEMSUFFIX)((void *)(T0 + 0x1C), 0); RETURN(); } /* External access */ PPC_OP(glue(eciwx, MEMSUFFIX)) { - T1 = glue(_ldl, MEMSUFFIX)((void *)T0, ACCESS_EXT); + T1 = glue(ldl, MEMSUFFIX)((void *)T0); RETURN(); } PPC_OP(glue(ecowx, MEMSUFFIX)) { - glue(_stl, MEMSUFFIX)((void *)T0, T1, ACCESS_EXT); + glue(stl, MEMSUFFIX)((void *)T0, T1); RETURN(); } |