#if !defined(TARGET_PPC64)
+ 10*4 + 22*5 /* SPE GPRh */
#endif
+ + 10*4 + 22*5 /* FPR */
+ 2*(10*6 + 22*7) /* AVRh, AVRl */];
static TCGv cpu_gpr[32];
#if !defined(TARGET_PPC64)
static TCGv cpu_gprh[32];
#endif
+static TCGv cpu_fpr[32];
static TCGv cpu_avrh[32], cpu_avrl[32];
/* dyngen register indexes */
#else
static TCGv cpu_T64[3];
#endif
+static TCGv cpu_FT[3];
static TCGv cpu_AVRh[3], cpu_AVRl[3];
#include "gen-icount.h"
TCG_AREG0, offsetof(CPUState, t2_64),
"T2_64");
#endif
+
+ cpu_FT[0] = tcg_global_mem_new(TCG_TYPE_I64, TCG_AREG0,
+ offsetof(CPUState, ft0), "FT0");
+ cpu_FT[1] = tcg_global_mem_new(TCG_TYPE_I64, TCG_AREG0,
+ offsetof(CPUState, ft1), "FT1");
+ cpu_FT[2] = tcg_global_mem_new(TCG_TYPE_I64, TCG_AREG0,
+ offsetof(CPUState, ft2), "FT2");
+
cpu_AVRh[0] = tcg_global_mem_new(TCG_TYPE_I64, TCG_AREG0,
offsetof(CPUState, avr0.u64[0]), "AVR0H");
cpu_AVRl[0] = tcg_global_mem_new(TCG_TYPE_I64, TCG_AREG0,
p += (i < 10) ? 4 : 5;
#endif
+ sprintf(p, "fp%d", i);
+ cpu_fpr[i] = tcg_global_mem_new(TCG_TYPE_I64, TCG_AREG0,
+ offsetof(CPUState, fpr[i]), p);
+
sprintf(p, "avr%dH", i);
cpu_avrh[i] = tcg_global_mem_new(TCG_TYPE_I64, TCG_AREG0,
offsetof(CPUState, avr[i].u64[0]), p);
GEN8(gen_op_store_T1_crf, gen_op_store_T1_crf_crf);
#endif
-/* floating point registers moves */
-GEN32(gen_op_load_fpr_FT0, gen_op_load_fpr_FT0_fpr);
-GEN32(gen_op_load_fpr_FT1, gen_op_load_fpr_FT1_fpr);
-GEN32(gen_op_load_fpr_FT2, gen_op_load_fpr_FT2_fpr);
-GEN32(gen_op_store_FT0_fpr, gen_op_store_FT0_fpr_fpr);
-GEN32(gen_op_store_FT1_fpr, gen_op_store_FT1_fpr_fpr);
-#if 0 // unused
-GEN32(gen_op_store_FT2_fpr, gen_op_store_FT2_fpr_fpr);
-#endif
-
/* internal defines */
typedef struct DisasContext {
struct TranslationBlock *tb;
GEN_EXCP_NO_FP(ctx); \
return; \
} \
- gen_op_load_fpr_FT0(rA(ctx->opcode)); \
- gen_op_load_fpr_FT1(rC(ctx->opcode)); \
- gen_op_load_fpr_FT2(rB(ctx->opcode)); \
+ tcg_gen_mov_i64(cpu_FT[0], cpu_fpr[rA(ctx->opcode)]); \
+ tcg_gen_mov_i64(cpu_FT[1], cpu_fpr[rC(ctx->opcode)]); \
+ tcg_gen_mov_i64(cpu_FT[2], cpu_fpr[rB(ctx->opcode)]); \
gen_reset_fpstatus(); \
gen_op_f##op(); \
if (isfloat) { \
gen_op_frsp(); \
} \
- gen_op_store_FT0_fpr(rD(ctx->opcode)); \
+ tcg_gen_mov_i64(cpu_fpr[rD(ctx->opcode)], cpu_FT[0]); \
gen_compute_fprf(set_fprf, Rc(ctx->opcode) != 0); \
}
GEN_EXCP_NO_FP(ctx); \
return; \
} \
- gen_op_load_fpr_FT0(rA(ctx->opcode)); \
- gen_op_load_fpr_FT1(rB(ctx->opcode)); \
+ tcg_gen_mov_i64(cpu_FT[0], cpu_fpr[rA(ctx->opcode)]); \
+ tcg_gen_mov_i64(cpu_FT[1], cpu_fpr[rB(ctx->opcode)]); \
gen_reset_fpstatus(); \
gen_op_f##op(); \
if (isfloat) { \
gen_op_frsp(); \
} \
- gen_op_store_FT0_fpr(rD(ctx->opcode)); \
+ tcg_gen_mov_i64(cpu_fpr[rD(ctx->opcode)], cpu_FT[0]); \
gen_compute_fprf(set_fprf, Rc(ctx->opcode) != 0); \
}
#define GEN_FLOAT_AB(name, op2, inval, set_fprf, type) \
GEN_EXCP_NO_FP(ctx); \
return; \
} \
- gen_op_load_fpr_FT0(rA(ctx->opcode)); \
- gen_op_load_fpr_FT1(rC(ctx->opcode)); \
+ tcg_gen_mov_i64(cpu_FT[0], cpu_fpr[rA(ctx->opcode)]); \
+ tcg_gen_mov_i64(cpu_FT[1], cpu_fpr[rC(ctx->opcode)]); \
gen_reset_fpstatus(); \
gen_op_f##op(); \
if (isfloat) { \
gen_op_frsp(); \
} \
- gen_op_store_FT0_fpr(rD(ctx->opcode)); \
+ tcg_gen_mov_i64(cpu_fpr[rD(ctx->opcode)], cpu_FT[0]); \
gen_compute_fprf(set_fprf, Rc(ctx->opcode) != 0); \
}
#define GEN_FLOAT_AC(name, op2, inval, set_fprf, type) \
GEN_EXCP_NO_FP(ctx); \
return; \
} \
- gen_op_load_fpr_FT0(rB(ctx->opcode)); \
+ tcg_gen_mov_i64(cpu_FT[0], cpu_fpr[rB(ctx->opcode)]); \
gen_reset_fpstatus(); \
gen_op_f##name(); \
- gen_op_store_FT0_fpr(rD(ctx->opcode)); \
+ tcg_gen_mov_i64(cpu_fpr[rD(ctx->opcode)], cpu_FT[0]); \
gen_compute_fprf(set_fprf, Rc(ctx->opcode) != 0); \
}
GEN_EXCP_NO_FP(ctx); \
return; \
} \
- gen_op_load_fpr_FT0(rB(ctx->opcode)); \
+ tcg_gen_mov_i64(cpu_FT[0], cpu_fpr[rB(ctx->opcode)]); \
gen_reset_fpstatus(); \
gen_op_f##name(); \
- gen_op_store_FT0_fpr(rD(ctx->opcode)); \
+ tcg_gen_mov_i64(cpu_fpr[rD(ctx->opcode)], cpu_FT[0]); \
gen_compute_fprf(set_fprf, Rc(ctx->opcode) != 0); \
}
GEN_EXCP_NO_FP(ctx);
return;
}
- gen_op_load_fpr_FT0(rB(ctx->opcode));
+ tcg_gen_mov_i64(cpu_FT[0], cpu_fpr[rB(ctx->opcode)]);
gen_reset_fpstatus();
gen_op_fsqrt();
- gen_op_store_FT0_fpr(rD(ctx->opcode));
+ tcg_gen_mov_i64(cpu_fpr[rD(ctx->opcode)], cpu_FT[0]);
gen_compute_fprf(1, Rc(ctx->opcode) != 0);
}
GEN_EXCP_NO_FP(ctx);
return;
}
- gen_op_load_fpr_FT0(rB(ctx->opcode));
+ tcg_gen_mov_i64(cpu_FT[0], cpu_fpr[rB(ctx->opcode)]);
gen_reset_fpstatus();
gen_op_fsqrt();
gen_op_frsp();
- gen_op_store_FT0_fpr(rD(ctx->opcode));
+ tcg_gen_mov_i64(cpu_fpr[rD(ctx->opcode)], cpu_FT[0]);
gen_compute_fprf(1, Rc(ctx->opcode) != 0);
}
GEN_EXCP_NO_FP(ctx);
return;
}
- gen_op_load_fpr_FT0(rA(ctx->opcode));
- gen_op_load_fpr_FT1(rB(ctx->opcode));
+ tcg_gen_mov_i64(cpu_FT[0], cpu_fpr[rA(ctx->opcode)]);
+ tcg_gen_mov_i64(cpu_FT[1], cpu_fpr[rB(ctx->opcode)]);
gen_reset_fpstatus();
gen_op_fcmpo();
gen_op_store_T0_crf(crfD(ctx->opcode));
GEN_EXCP_NO_FP(ctx);
return;
}
- gen_op_load_fpr_FT0(rA(ctx->opcode));
- gen_op_load_fpr_FT1(rB(ctx->opcode));
+ tcg_gen_mov_i64(cpu_FT[0], cpu_fpr[rA(ctx->opcode)]);
+ tcg_gen_mov_i64(cpu_FT[1], cpu_fpr[rB(ctx->opcode)]);
gen_reset_fpstatus();
gen_op_fcmpu();
gen_op_store_T0_crf(crfD(ctx->opcode));
GEN_EXCP_NO_FP(ctx);
return;
}
- gen_op_load_fpr_FT0(rB(ctx->opcode));
- gen_op_store_FT0_fpr(rD(ctx->opcode));
+ tcg_gen_mov_i64(cpu_FT[0], cpu_fpr[rB(ctx->opcode)]);
+ tcg_gen_mov_i64(cpu_fpr[rD(ctx->opcode)], cpu_FT[0]);
gen_compute_fprf(0, Rc(ctx->opcode) != 0);
}
gen_optimize_fprf();
gen_reset_fpstatus();
gen_op_load_fpscr_FT0();
- gen_op_store_FT0_fpr(rD(ctx->opcode));
+ tcg_gen_mov_i64(cpu_fpr[rD(ctx->opcode)], cpu_FT[0]);
gen_compute_fprf(0, Rc(ctx->opcode) != 0);
}
return;
}
gen_optimize_fprf();
- gen_op_load_fpr_FT0(rB(ctx->opcode));
+ tcg_gen_mov_i64(cpu_FT[0], cpu_fpr[rB(ctx->opcode)]);
gen_reset_fpstatus();
gen_op_store_fpscr(FM(ctx->opcode));
if (unlikely(Rc(ctx->opcode) != 0)) {
} \
gen_addr_imm_index(ctx, 0); \
op_ldst(l##width); \
- gen_op_store_FT0_fpr(rD(ctx->opcode)); \
+ tcg_gen_mov_i64(cpu_fpr[rD(ctx->opcode)], cpu_FT[0]); \
}
#define GEN_LDUF(width, opc, type) \
} \
gen_addr_imm_index(ctx, 0); \
op_ldst(l##width); \
- gen_op_store_FT0_fpr(rD(ctx->opcode)); \
+ tcg_gen_mov_i64(cpu_fpr[rD(ctx->opcode)], cpu_FT[0]); \
tcg_gen_mov_tl(cpu_gpr[rA(ctx->opcode)], cpu_T[0]); \
}
} \
gen_addr_reg_index(ctx); \
op_ldst(l##width); \
- gen_op_store_FT0_fpr(rD(ctx->opcode)); \
+ tcg_gen_mov_i64(cpu_fpr[rD(ctx->opcode)], cpu_FT[0]); \
tcg_gen_mov_tl(cpu_gpr[rA(ctx->opcode)], cpu_T[0]); \
}
} \
gen_addr_reg_index(ctx); \
op_ldst(l##width); \
- gen_op_store_FT0_fpr(rD(ctx->opcode)); \
+ tcg_gen_mov_i64(cpu_fpr[rD(ctx->opcode)], cpu_FT[0]); \
}
#define GEN_LDFS(width, op, type) \
return; \
} \
gen_addr_imm_index(ctx, 0); \
- gen_op_load_fpr_FT0(rS(ctx->opcode)); \
+ tcg_gen_mov_i64(cpu_FT[0], cpu_fpr[rS(ctx->opcode)]); \
op_ldst(st##width); \
}
return; \
} \
gen_addr_imm_index(ctx, 0); \
- gen_op_load_fpr_FT0(rS(ctx->opcode)); \
+ tcg_gen_mov_i64(cpu_FT[0], cpu_fpr[rS(ctx->opcode)]); \
op_ldst(st##width); \
tcg_gen_mov_tl(cpu_gpr[rA(ctx->opcode)], cpu_T[0]); \
}
return; \
} \
gen_addr_reg_index(ctx); \
- gen_op_load_fpr_FT0(rS(ctx->opcode)); \
+ tcg_gen_mov_i64(cpu_FT[0], cpu_fpr[rS(ctx->opcode)]); \
op_ldst(st##width); \
tcg_gen_mov_tl(cpu_gpr[rA(ctx->opcode)], cpu_T[0]); \
}
return; \
} \
gen_addr_reg_index(ctx); \
- gen_op_load_fpr_FT0(rS(ctx->opcode)); \
+ tcg_gen_mov_i64(cpu_FT[0], cpu_fpr[rS(ctx->opcode)]); \
op_ldst(st##width); \
}
gen_update_nip(ctx, ctx->nip - 4);
gen_addr_imm_index(ctx, 0);
op_POWER2_lfq();
- gen_op_store_FT0_fpr(rD(ctx->opcode));
- gen_op_store_FT1_fpr(rD(ctx->opcode) + 1);
+ tcg_gen_mov_i64(cpu_fpr[rD(ctx->opcode)], cpu_FT[0]);
+ tcg_gen_mov_i64(cpu_fpr[rD(ctx->opcode) + 1], cpu_FT[1]);
}
/* lfqu */
gen_update_nip(ctx, ctx->nip - 4);
gen_addr_imm_index(ctx, 0);
op_POWER2_lfq();
- gen_op_store_FT0_fpr(rD(ctx->opcode));
- gen_op_store_FT1_fpr(rD(ctx->opcode) + 1);
+ tcg_gen_mov_i64(cpu_fpr[rD(ctx->opcode)], cpu_FT[0]);
+ tcg_gen_mov_i64(cpu_fpr[rD(ctx->opcode) + 1], cpu_FT[1]);
if (ra != 0)
tcg_gen_mov_tl(cpu_gpr[ra], cpu_T[0]);
}
gen_update_nip(ctx, ctx->nip - 4);
gen_addr_reg_index(ctx);
op_POWER2_lfq();
- gen_op_store_FT0_fpr(rD(ctx->opcode));
- gen_op_store_FT1_fpr(rD(ctx->opcode) + 1);
+ tcg_gen_mov_i64(cpu_fpr[rD(ctx->opcode)], cpu_FT[0]);
+ tcg_gen_mov_i64(cpu_fpr[rD(ctx->opcode) + 1], cpu_FT[1]);
if (ra != 0)
tcg_gen_mov_tl(cpu_gpr[ra], cpu_T[0]);
}
gen_update_nip(ctx, ctx->nip - 4);
gen_addr_reg_index(ctx);
op_POWER2_lfq();
- gen_op_store_FT0_fpr(rD(ctx->opcode));
- gen_op_store_FT1_fpr(rD(ctx->opcode) + 1);
+ tcg_gen_mov_i64(cpu_fpr[rD(ctx->opcode)], cpu_FT[0]);
+ tcg_gen_mov_i64(cpu_fpr[rD(ctx->opcode) + 1], cpu_FT[1]);
}
/* stfq */
/* NIP cannot be restored if the memory exception comes from an helper */
gen_update_nip(ctx, ctx->nip - 4);
gen_addr_imm_index(ctx, 0);
- gen_op_load_fpr_FT0(rS(ctx->opcode));
- gen_op_load_fpr_FT1(rS(ctx->opcode) + 1);
+ tcg_gen_mov_i64(cpu_FT[0], cpu_fpr[rS(ctx->opcode)]);
+ tcg_gen_mov_i64(cpu_FT[1], cpu_fpr[rS(ctx->opcode) + 1]);
op_POWER2_stfq();
}
/* NIP cannot be restored if the memory exception comes from an helper */
gen_update_nip(ctx, ctx->nip - 4);
gen_addr_imm_index(ctx, 0);
- gen_op_load_fpr_FT0(rS(ctx->opcode));
- gen_op_load_fpr_FT1(rS(ctx->opcode) + 1);
+ tcg_gen_mov_i64(cpu_FT[0], cpu_fpr[rS(ctx->opcode)]);
+ tcg_gen_mov_i64(cpu_FT[1], cpu_fpr[rS(ctx->opcode) + 1]);
op_POWER2_stfq();
if (ra != 0)
tcg_gen_mov_tl(cpu_gpr[ra], cpu_T[0]);
/* NIP cannot be restored if the memory exception comes from an helper */
gen_update_nip(ctx, ctx->nip - 4);
gen_addr_reg_index(ctx);
- gen_op_load_fpr_FT0(rS(ctx->opcode));
- gen_op_load_fpr_FT1(rS(ctx->opcode) + 1);
+ tcg_gen_mov_i64(cpu_FT[0], cpu_fpr[rS(ctx->opcode)]);
+ tcg_gen_mov_i64(cpu_FT[1], cpu_fpr[rS(ctx->opcode) + 1]);
op_POWER2_stfq();
if (ra != 0)
tcg_gen_mov_tl(cpu_gpr[ra], cpu_T[0]);
/* NIP cannot be restored if the memory exception comes from an helper */
gen_update_nip(ctx, ctx->nip - 4);
gen_addr_reg_index(ctx);
- gen_op_load_fpr_FT0(rS(ctx->opcode));
- gen_op_load_fpr_FT1(rS(ctx->opcode) + 1);
+ tcg_gen_mov_i64(cpu_FT[0], cpu_fpr[rS(ctx->opcode)]);
+ tcg_gen_mov_i64(cpu_FT[1], cpu_fpr[rS(ctx->opcode) + 1]);
op_POWER2_stfq();
}