提交 fdd8ec71 编写于 作者: R Richard Henderson

tcg-ppc64: Rename tcg_out_calli to tcg_out_call

Merge the existing tcg_out_call into tcg_out_op.
Signed-off-by: NRichard Henderson <rth@twiddle.net>
上级 00d7a1ac
...@@ -707,7 +707,7 @@ static void tcg_out_b(TCGContext *s, int mask, tcg_insn_unit *target) ...@@ -707,7 +707,7 @@ static void tcg_out_b(TCGContext *s, int mask, tcg_insn_unit *target)
} }
} }
static void tcg_out_calli(TCGContext *s, void *target) static void tcg_out_call(TCGContext *s, tcg_insn_unit *target)
{ {
#ifdef __APPLE__ #ifdef __APPLE__
tcg_out_b(s, LK, target); tcg_out_b(s, LK, target);
...@@ -740,23 +740,6 @@ static void tcg_out_calli(TCGContext *s, void *target) ...@@ -740,23 +740,6 @@ static void tcg_out_calli(TCGContext *s, void *target)
#endif #endif
} }
static void tcg_out_call(TCGContext *s, TCGArg arg, int const_arg)
{
if (const_arg) {
tcg_out_calli(s, (void *)(uintptr_t)arg);
} else {
#ifdef __APPLE__
tcg_out32(s, MTSPR | RS(arg) | LR);
tcg_out32(s, BCLR | BO_ALWAYS | LK);
#else
tcg_out32(s, LD | TAI(TCG_REG_R0, arg, 0));
tcg_out32(s, MTSPR | RA(TCG_REG_R0) | CTR);
tcg_out32(s, LD | TAI(TCG_REG_R2, arg, 8));
tcg_out32(s, BCCTR | BO_ALWAYS | LK);
#endif
}
}
static void tcg_out_mem_long(TCGContext *s, int opi, int opx, TCGReg rt, static void tcg_out_mem_long(TCGContext *s, int opi, int opx, TCGReg rt,
TCGReg base, tcg_target_long offset) TCGReg base, tcg_target_long offset)
{ {
...@@ -971,7 +954,7 @@ static void tcg_out_qemu_ld_slow_path(TCGContext *s, TCGLabelQemuLdst *lb) ...@@ -971,7 +954,7 @@ static void tcg_out_qemu_ld_slow_path(TCGContext *s, TCGLabelQemuLdst *lb)
tcg_out_movi(s, TCG_TYPE_I32, TCG_REG_R5, lb->mem_index); tcg_out_movi(s, TCG_TYPE_I32, TCG_REG_R5, lb->mem_index);
tcg_out32(s, MFSPR | RT(TCG_REG_R6) | LR); tcg_out32(s, MFSPR | RT(TCG_REG_R6) | LR);
tcg_out_calli(s, qemu_ld_helpers[opc & ~MO_SIGN]); tcg_out_call(s, qemu_ld_helpers[opc & ~MO_SIGN]);
if (opc & MO_SIGN) { if (opc & MO_SIGN) {
uint32_t insn = qemu_exts_opc[opc & MO_SIZE]; uint32_t insn = qemu_exts_opc[opc & MO_SIZE];
...@@ -1001,7 +984,7 @@ static void tcg_out_qemu_st_slow_path(TCGContext *s, TCGLabelQemuLdst *lb) ...@@ -1001,7 +984,7 @@ static void tcg_out_qemu_st_slow_path(TCGContext *s, TCGLabelQemuLdst *lb)
tcg_out_movi(s, TCG_TYPE_I32, TCG_REG_R6, lb->mem_index); tcg_out_movi(s, TCG_TYPE_I32, TCG_REG_R6, lb->mem_index);
tcg_out32(s, MFSPR | RT(TCG_REG_R7) | LR); tcg_out32(s, MFSPR | RT(TCG_REG_R7) | LR);
tcg_out_calli(s, qemu_st_helpers[opc]); tcg_out_call(s, qemu_st_helpers[opc]);
tcg_out_b(s, 0, lb->raddr); tcg_out_b(s, 0, lb->raddr);
} }
...@@ -1520,7 +1503,19 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, ...@@ -1520,7 +1503,19 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args,
} }
break; break;
case INDEX_op_call: case INDEX_op_call:
tcg_out_call(s, args[0], const_args[0]); if (const_args[0]) {
tcg_out_call(s, (void *)(uintptr_t)arg);
} else {
#ifdef __APPLE__
tcg_out32(s, MTSPR | RS(arg) | LR);
tcg_out32(s, BCLR | BO_ALWAYS | LK);
#else
tcg_out32(s, LD | TAI(TCG_REG_R0, arg, 0));
tcg_out32(s, MTSPR | RA(TCG_REG_R0) | CTR);
tcg_out32(s, LD | TAI(TCG_REG_R2, arg, 8));
tcg_out32(s, BCCTR | BO_ALWAYS | LK);
#endif
}
break; break;
case INDEX_op_movi_i32: case INDEX_op_movi_i32:
tcg_out_movi(s, TCG_TYPE_I32, args[0], args[1]); tcg_out_movi(s, TCG_TYPE_I32, args[0], args[1]);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册