Skip to content

Commit

Permalink
target-ppc: convert external load/store instructions to TCG
Browse files Browse the repository at this point in the history
Signed-off-by: Aurelien Jarno <[email protected]>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5831 c046a42c-6fe2-441c-8c8c-71466251a162
  • Loading branch information
aurel32 committed Nov 30, 2008
1 parent cf360a3 commit fa407c0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 144 deletions.
16 changes: 0 additions & 16 deletions target-ppc/op.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,22 +257,6 @@ void OPPROTO op_srli_T1 (void)
RETURN();
}

/* Load and store */
#define MEMSUFFIX _raw
#include "op_helper.h"
#include "op_mem.h"
#if !defined(CONFIG_USER_ONLY)
#define MEMSUFFIX _user
#include "op_helper.h"
#include "op_mem.h"
#define MEMSUFFIX _kernel
#include "op_helper.h"
#include "op_mem.h"
#define MEMSUFFIX _hypv
#include "op_helper.h"
#include "op_mem.h"
#endif

/* Return from interrupt */
#if !defined(CONFIG_USER_ONLY)
void OPPROTO op_rfi (void)
Expand Down
80 changes: 0 additions & 80 deletions target-ppc/op_mem.h

This file was deleted.

61 changes: 13 additions & 48 deletions target-ppc/translate.c
Original file line number Diff line number Diff line change
Expand Up @@ -2490,37 +2490,6 @@ static always_inline void gen_check_align (DisasContext *ctx, TCGv EA, int mask)
tcg_temp_free(t0);
}

#if defined(TARGET_PPC64)
#define _GEN_MEM_FUNCS(name, mode) \
&gen_op_##name##_##mode, \
&gen_op_##name##_le_##mode, \
&gen_op_##name##_64_##mode, \
&gen_op_##name##_le_64_##mode
#else
#define _GEN_MEM_FUNCS(name, mode) \
&gen_op_##name##_##mode, \
&gen_op_##name##_le_##mode
#endif
#if defined(CONFIG_USER_ONLY)
#if defined(TARGET_PPC64)
#define NB_MEM_FUNCS 4
#else
#define NB_MEM_FUNCS 2
#endif
#define GEN_MEM_FUNCS(name) \
_GEN_MEM_FUNCS(name, raw)
#else
#if defined(TARGET_PPC64)
#define NB_MEM_FUNCS 12
#else
#define NB_MEM_FUNCS 6
#endif
#define GEN_MEM_FUNCS(name) \
_GEN_MEM_FUNCS(name, user), \
_GEN_MEM_FUNCS(name, kernel), \
_GEN_MEM_FUNCS(name, hypv)
#endif

/*** Integer load ***/
#if defined(TARGET_PPC64)
#define GEN_QEMU_LD_PPC64(width) \
Expand Down Expand Up @@ -4427,32 +4396,28 @@ GEN_HANDLER(slbie, 0x1F, 0x12, 0x0D, 0x03FF0001, PPC_SLBI)

/*** External control ***/
/* Optional: */
#define op_eciwx() (*gen_op_eciwx[ctx->mem_idx])()
#define op_ecowx() (*gen_op_ecowx[ctx->mem_idx])()
static GenOpFunc *gen_op_eciwx[NB_MEM_FUNCS] = {
GEN_MEM_FUNCS(eciwx),
};
static GenOpFunc *gen_op_ecowx[NB_MEM_FUNCS] = {
GEN_MEM_FUNCS(ecowx),
};

/* eciwx */
GEN_HANDLER(eciwx, 0x1F, 0x16, 0x0D, 0x00000001, PPC_EXTERN)
{
/* Should check EAR[E] & alignment ! */
/* Should check EAR[E] ! */
TCGv t0 = tcg_temp_new();
gen_set_access_type(ACCESS_RES);
gen_addr_reg_index(cpu_T[0], ctx);
op_eciwx();
tcg_gen_mov_tl(cpu_gpr[rD(ctx->opcode)], cpu_T[0]);
gen_addr_reg_index(t0, ctx);
gen_check_align(ctx, t0, 0x03);
gen_qemu_ld32u(cpu_gpr[rD(ctx->opcode)], t0, ctx->mem_idx);
tcg_temp_free(t0);
}

/* ecowx */
GEN_HANDLER(ecowx, 0x1F, 0x16, 0x09, 0x00000001, PPC_EXTERN)
{
/* Should check EAR[E] & alignment ! */
gen_addr_reg_index(cpu_T[0], ctx);
tcg_gen_mov_tl(cpu_T[1], cpu_gpr[rS(ctx->opcode)]);
op_ecowx();
/* Should check EAR[E] ! */
TCGv t0 = tcg_temp_new();
gen_set_access_type(ACCESS_RES);
gen_addr_reg_index(t0, ctx);
gen_check_align(ctx, t0, 0x03);
gen_qemu_st32(cpu_gpr[rD(ctx->opcode)], t0, ctx->mem_idx);
tcg_temp_free(t0);
}

/* PowerPC 601 specific instructions */
Expand Down

0 comments on commit fa407c0

Please sign in to comment.