diff options
author | j_mayer <j_mayer@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-09-19 04:34:09 +0000 |
---|---|---|
committer | j_mayer <j_mayer@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-09-19 04:34:09 +0000 |
commit | 8b67546f65bb3de81ac4cbe02460ec99c0ec6229 (patch) | |
tree | b38429cdf23b573df58ad4f2278c03af0e344d06 /target-ppc | |
parent | 7ec93196fae7d07a8ba7cf226a3daef2c3144acc (diff) |
More PowerPC target cleanups:
- remove unuseful historical macros and definitions
- fix comments (bugs and cosmetics)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3185 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-ppc')
-rw-r--r-- | target-ppc/cpu.h | 23 | ||||
-rw-r--r-- | target-ppc/op_helper_mem.h | 50 |
2 files changed, 35 insertions, 38 deletions
diff --git a/target-ppc/cpu.h b/target-ppc/cpu.h index 75aefb051b..8b3fb03600 100644 --- a/target-ppc/cpu.h +++ b/target-ppc/cpu.h @@ -30,7 +30,7 @@ typedef uint64_t ppc_gpr_t; #define REGX "%016" PRIx64 #define TARGET_PAGE_BITS 12 #elif defined(TARGET_PPCEMB) -/* e500v2 have 36 bits physical address space */ +/* BookE have 36 bits physical address space */ #define TARGET_PHYS_ADDR_BITS 64 /* GPR are 64 bits: used by vector extension */ typedef uint64_t ppc_gpr_t; @@ -388,19 +388,19 @@ enum { PPC_64_BRIDGE = 0x0000000004000000ULL, /* BookE (embedded) PowerPC specification */ PPC_BOOKE = 0x0000000008000000ULL, - /* eieio */ + /* eieio */ PPC_MEM_EIEIO = 0x0000000010000000ULL, - /* e500 vector instructions */ + /* e500 vector instructions */ PPC_E500_VECTOR = 0x0000000020000000ULL, - /* PowerPC 4xx dedicated instructions */ + /* PowerPC 4xx dedicated instructions */ PPC_4xx_COMMON = 0x0000000040000000ULL, - /* PowerPC 2.03 specification extensions */ + /* PowerPC 2.03 specification extensions */ PPC_203 = 0x0000000080000000ULL, - /* PowerPC 2.03 SPE extension */ + /* PowerPC 2.03 SPE extension */ PPC_SPE = 0x0000000100000000ULL, - /* PowerPC 2.03 SPE floating-point extension */ + /* PowerPC 2.03 SPE floating-point extension */ PPC_SPEFPU = 0x0000000200000000ULL, - /* SLB management */ + /* SLB management */ PPC_SLBI = 0x0000000400000000ULL, }; @@ -917,8 +917,6 @@ int ppc_dcr_write (ppc_dcr_t *dcr_env, int dcrn, target_ulong val); /*****************************************************************************/ /* Registers definitions */ -#define ugpr(n) (env->gpr[n]) - #define XER_SO 31 #define XER_OV 30 #define XER_CA 29 @@ -1315,7 +1313,6 @@ enum { /* may change privilege level */ #define EXCP_BRANCH 0x11001 /* branch instruction */ #define EXCP_SYSCALL_USER 0x12000 /* System call in user mode only */ -#define EXCP_INTERRUPT_CRITICAL 0x13000 /* critical IRQ */ /* Error codes */ enum { @@ -1350,8 +1347,8 @@ enum { EXCP_INVAL_FP = 0x04, /* Unimplemented mandatory fp instr */ /* Privileged instruction */ EXCP_PRIV = 0x30, - EXCP_PRIV_OPC = 0x01, - EXCP_PRIV_REG = 0x02, + EXCP_PRIV_OPC = 0x01, /* Privileged operation exception */ + EXCP_PRIV_REG = 0x02, /* Privileged register exception */ /* Trap */ EXCP_TRAP = 0x40, }; diff --git a/target-ppc/op_helper_mem.h b/target-ppc/op_helper_mem.h index 1ca5971de3..e8cca09e92 100644 --- a/target-ppc/op_helper_mem.h +++ b/target-ppc/op_helper_mem.h @@ -37,7 +37,7 @@ static inline void glue(st32r, MEMSUFFIX) (target_ulong EA, target_ulong data) void glue(do_lmw, MEMSUFFIX) (int dst) { for (; dst < 32; dst++, T0 += 4) { - ugpr(dst) = glue(ldl, MEMSUFFIX)((uint32_t)T0); + env->gpr[dst] = glue(ldl, MEMSUFFIX)((uint32_t)T0); } } @@ -45,7 +45,7 @@ void glue(do_lmw, MEMSUFFIX) (int dst) void glue(do_lmw_64, MEMSUFFIX) (int dst) { for (; dst < 32; dst++, T0 += 4) { - ugpr(dst) = glue(ldl, MEMSUFFIX)((uint64_t)T0); + env->gpr[dst] = glue(ldl, MEMSUFFIX)((uint64_t)T0); } } #endif @@ -53,7 +53,7 @@ void glue(do_lmw_64, MEMSUFFIX) (int dst) void glue(do_stmw, MEMSUFFIX) (int src) { for (; src < 32; src++, T0 += 4) { - glue(stl, MEMSUFFIX)((uint32_t)T0, ugpr(src)); + glue(stl, MEMSUFFIX)((uint32_t)T0, env->gpr[src]); } } @@ -61,7 +61,7 @@ void glue(do_stmw, MEMSUFFIX) (int src) void glue(do_stmw_64, MEMSUFFIX) (int src) { for (; src < 32; src++, T0 += 4) { - glue(stl, MEMSUFFIX)((uint64_t)T0, ugpr(src)); + glue(stl, MEMSUFFIX)((uint64_t)T0, env->gpr[src]); } } #endif @@ -69,7 +69,7 @@ void glue(do_stmw_64, MEMSUFFIX) (int src) void glue(do_lmw_le, MEMSUFFIX) (int dst) { for (; dst < 32; dst++, T0 += 4) { - ugpr(dst) = glue(ld32r, MEMSUFFIX)((uint32_t)T0); + env->gpr[dst] = glue(ld32r, MEMSUFFIX)((uint32_t)T0); } } @@ -77,7 +77,7 @@ void glue(do_lmw_le, MEMSUFFIX) (int dst) void glue(do_lmw_le_64, MEMSUFFIX) (int dst) { for (; dst < 32; dst++, T0 += 4) { - ugpr(dst) = glue(ld32r, MEMSUFFIX)((uint64_t)T0); + env->gpr[dst] = glue(ld32r, MEMSUFFIX)((uint64_t)T0); } } #endif @@ -85,7 +85,7 @@ void glue(do_lmw_le_64, MEMSUFFIX) (int dst) void glue(do_stmw_le, MEMSUFFIX) (int src) { for (; src < 32; src++, T0 += 4) { - glue(st32r, MEMSUFFIX)((uint32_t)T0, ugpr(src)); + glue(st32r, MEMSUFFIX)((uint32_t)T0, env->gpr[src]); } } @@ -93,7 +93,7 @@ void glue(do_stmw_le, MEMSUFFIX) (int src) void glue(do_stmw_le_64, MEMSUFFIX) (int src) { for (; src < 32; src++, T0 += 4) { - glue(st32r, MEMSUFFIX)((uint64_t)T0, ugpr(src)); + glue(st32r, MEMSUFFIX)((uint64_t)T0, env->gpr[src]); } } #endif @@ -104,7 +104,7 @@ void glue(do_lsw, MEMSUFFIX) (int dst) int sh; for (; T1 > 3; T1 -= 4, T0 += 4) { - ugpr(dst++) = glue(ldl, MEMSUFFIX)((uint32_t)T0); + env->gpr[dst++] = glue(ldl, MEMSUFFIX)((uint32_t)T0); if (unlikely(dst == 32)) dst = 0; } @@ -113,7 +113,7 @@ void glue(do_lsw, MEMSUFFIX) (int dst) for (sh = 24; T1 > 0; T1--, T0++, sh -= 8) { tmp |= glue(ldub, MEMSUFFIX)((uint32_t)T0) << sh; } - ugpr(dst) = tmp; + env->gpr[dst] = tmp; } } @@ -124,7 +124,7 @@ void glue(do_lsw_64, MEMSUFFIX) (int dst) int sh; for (; T1 > 3; T1 -= 4, T0 += 4) { - ugpr(dst++) = glue(ldl, MEMSUFFIX)((uint64_t)T0); + env->gpr[dst++] = glue(ldl, MEMSUFFIX)((uint64_t)T0); if (unlikely(dst == 32)) dst = 0; } @@ -133,7 +133,7 @@ void glue(do_lsw_64, MEMSUFFIX) (int dst) for (sh = 24; T1 > 0; T1--, T0++, sh -= 8) { tmp |= glue(ldub, MEMSUFFIX)((uint64_t)T0) << sh; } - ugpr(dst) = tmp; + env->gpr[dst] = tmp; } } #endif @@ -143,13 +143,13 @@ void glue(do_stsw, MEMSUFFIX) (int src) int sh; for (; T1 > 3; T1 -= 4, T0 += 4) { - glue(stl, MEMSUFFIX)((uint32_t)T0, ugpr(src++)); + glue(stl, MEMSUFFIX)((uint32_t)T0, env->gpr[src++]); if (unlikely(src == 32)) src = 0; } if (unlikely(T1 != 0)) { for (sh = 24; T1 > 0; T1--, T0++, sh -= 8) - glue(stb, MEMSUFFIX)((uint32_t)T0, (ugpr(src) >> sh) & 0xFF); + glue(stb, MEMSUFFIX)((uint32_t)T0, (env->gpr[src] >> sh) & 0xFF); } } @@ -159,13 +159,13 @@ void glue(do_stsw_64, MEMSUFFIX) (int src) int sh; for (; T1 > 3; T1 -= 4, T0 += 4) { - glue(stl, MEMSUFFIX)((uint64_t)T0, ugpr(src++)); + glue(stl, MEMSUFFIX)((uint64_t)T0, env->gpr[src++]); if (unlikely(src == 32)) src = 0; } if (unlikely(T1 != 0)) { for (sh = 24; T1 > 0; T1--, T0++, sh -= 8) - glue(stb, MEMSUFFIX)((uint64_t)T0, (ugpr(src) >> sh) & 0xFF); + glue(stb, MEMSUFFIX)((uint64_t)T0, (env->gpr[src] >> sh) & 0xFF); } } #endif @@ -176,7 +176,7 @@ void glue(do_lsw_le, MEMSUFFIX) (int dst) int sh; for (; T1 > 3; T1 -= 4, T0 += 4) { - ugpr(dst++) = glue(ld32r, MEMSUFFIX)((uint32_t)T0); + env->gpr[dst++] = glue(ld32r, MEMSUFFIX)((uint32_t)T0); if (unlikely(dst == 32)) dst = 0; } @@ -185,7 +185,7 @@ void glue(do_lsw_le, MEMSUFFIX) (int dst) for (sh = 0; T1 > 0; T1--, T0++, sh += 8) { tmp |= glue(ldub, MEMSUFFIX)((uint32_t)T0) << sh; } - ugpr(dst) = tmp; + env->gpr[dst] = tmp; } } @@ -196,7 +196,7 @@ void glue(do_lsw_le_64, MEMSUFFIX) (int dst) int sh; for (; T1 > 3; T1 -= 4, T0 += 4) { - ugpr(dst++) = glue(ld32r, MEMSUFFIX)((uint64_t)T0); + env->gpr[dst++] = glue(ld32r, MEMSUFFIX)((uint64_t)T0); if (unlikely(dst == 32)) dst = 0; } @@ -205,7 +205,7 @@ void glue(do_lsw_le_64, MEMSUFFIX) (int dst) for (sh = 0; T1 > 0; T1--, T0++, sh += 8) { tmp |= glue(ldub, MEMSUFFIX)((uint64_t)T0) << sh; } - ugpr(dst) = tmp; + env->gpr[dst] = tmp; } } #endif @@ -215,13 +215,13 @@ void glue(do_stsw_le, MEMSUFFIX) (int src) int sh; for (; T1 > 3; T1 -= 4, T0 += 4) { - glue(st32r, MEMSUFFIX)((uint32_t)T0, ugpr(src++)); + glue(st32r, MEMSUFFIX)((uint32_t)T0, env->gpr[src++]); if (unlikely(src == 32)) src = 0; } if (unlikely(T1 != 0)) { for (sh = 0; T1 > 0; T1--, T0++, sh += 8) - glue(stb, MEMSUFFIX)((uint32_t)T0, (ugpr(src) >> sh) & 0xFF); + glue(stb, MEMSUFFIX)((uint32_t)T0, (env->gpr[src] >> sh) & 0xFF); } } @@ -231,13 +231,13 @@ void glue(do_stsw_le_64, MEMSUFFIX) (int src) int sh; for (; T1 > 3; T1 -= 4, T0 += 4) { - glue(st32r, MEMSUFFIX)((uint64_t)T0, ugpr(src++)); + glue(st32r, MEMSUFFIX)((uint64_t)T0, env->gpr[src++]); if (unlikely(src == 32)) src = 0; } if (unlikely(T1 != 0)) { for (sh = 0; T1 > 0; T1--, T0++, sh += 8) - glue(stb, MEMSUFFIX)((uint64_t)T0, (ugpr(src) >> sh) & 0xFF); + glue(stb, MEMSUFFIX)((uint64_t)T0, (env->gpr[src] >> sh) & 0xFF); } } #endif @@ -283,7 +283,7 @@ void glue(do_POWER_lscbx, MEMSUFFIX) (int dest, int ra, int rb) c = glue(ldub, MEMSUFFIX)((uint32_t)T0++); /* ra (if not 0) and rb are never modified */ if (likely(reg != rb && (ra == 0 || reg != ra))) { - ugpr(reg) = (ugpr(reg) & ~(0xFF << d)) | (c << d); + env->gpr[reg] = (env->gpr[reg] & ~(0xFF << d)) | (c << d); } if (unlikely(c == T2)) break; |