summaryrefslogtreecommitdiff
path: root/tcg/tcg-op.h
diff options
context:
space:
mode:
authorRichard Henderson <rth@twiddle.net>2014-03-22 20:06:52 -0700
committerRichard Henderson <rth@twiddle.net>2014-05-12 11:13:12 -0700
commitcf066674280c65a9e035eca073ce3a05887af502 (patch)
treef2dce1a27d384289713798b12e5fe455209ef43a /tcg/tcg-op.h
parentdddbb2e1e3f8137d7e3f1faf9758c66cca0c94ea (diff)
downloadqemu-cf066674280c65a9e035eca073ce3a05887af502.tar.gz
tcg: Make call address a constant parameter
Avoid allocating a tcg temporary to hold the constant address, and instead place it directly into the op_call arguments. At the same time, convert to the newly introduced tcg_out_call backend function, rather than invoking tcg_out_op for the call. Signed-off-by: Richard Henderson <rth@twiddle.net>
Diffstat (limited to 'tcg/tcg-op.h')
-rw-r--r--tcg/tcg-op.h16
1 files changed, 3 insertions, 13 deletions
diff --git a/tcg/tcg-op.h b/tcg/tcg-op.h
index 6dbbb38838..bdd0139482 100644
--- a/tcg/tcg-op.h
+++ b/tcg/tcg-op.h
@@ -390,11 +390,7 @@ static inline int tcg_gen_sizemask(int n, int is_64bit, int is_signed)
static inline void tcg_gen_helperN(void *func, int flags, int sizemask,
TCGArg ret, int nargs, TCGArg *args)
{
- TCGv_ptr fn;
- fn = tcg_const_ptr(func);
- tcg_gen_callN(&tcg_ctx, fn, flags, sizemask, ret,
- nargs, args);
- tcg_temp_free_ptr(fn);
+ tcg_gen_callN(&tcg_ctx, func, flags, sizemask, ret, nargs, args);
}
/* Note: Both tcg_gen_helper32() and tcg_gen_helper64() are currently
@@ -405,29 +401,23 @@ static inline void tcg_gen_helperN(void *func, int flags, int sizemask,
static inline void tcg_gen_helper32(void *func, int sizemask, TCGv_i32 ret,
TCGv_i32 a, TCGv_i32 b)
{
- TCGv_ptr fn;
TCGArg args[2];
- fn = tcg_const_ptr(func);
args[0] = GET_TCGV_I32(a);
args[1] = GET_TCGV_I32(b);
- tcg_gen_callN(&tcg_ctx, fn,
+ tcg_gen_callN(&tcg_ctx, func,
TCG_CALL_NO_READ_GLOBALS | TCG_CALL_NO_SIDE_EFFECTS,
sizemask, GET_TCGV_I32(ret), 2, args);
- tcg_temp_free_ptr(fn);
}
static inline void tcg_gen_helper64(void *func, int sizemask, TCGv_i64 ret,
TCGv_i64 a, TCGv_i64 b)
{
- TCGv_ptr fn;
TCGArg args[2];
- fn = tcg_const_ptr(func);
args[0] = GET_TCGV_I64(a);
args[1] = GET_TCGV_I64(b);
- tcg_gen_callN(&tcg_ctx, fn,
+ tcg_gen_callN(&tcg_ctx, func,
TCG_CALL_NO_READ_GLOBALS | TCG_CALL_NO_SIDE_EFFECTS,
sizemask, GET_TCGV_I64(ret), 2, args);
- tcg_temp_free_ptr(fn);
}
/* 32 bit ops */