mirror of
https://gitlab.com/qemu-project/qemu.git
synced 2026-10-28 14:04:39 +08:00
tcg: Generic expansion of tcg_gen_ld_*
Reviewed-by: Matt Turner <mattst88@gmail.com> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
1 parent
416f1fed56
commit
ef5e519e7e
4 files changed
+20
-18
No files matched your search
@@ -144,7 +144,6 @@ void tcg_gen_ld8u_i32(TCGv_i32 ret, TCGv_ptr arg2, tcg_target_long offset);
|
||||
void tcg_gen_ld8s_i32(TCGv_i32 ret, TCGv_ptr arg2, tcg_target_long offset);
|
||||
void tcg_gen_ld16u_i32(TCGv_i32 ret, TCGv_ptr arg2, tcg_target_long offset);
|
||||
void tcg_gen_ld16s_i32(TCGv_i32 ret, TCGv_ptr arg2, tcg_target_long offset);
|
||||
void tcg_gen_ld_i32(TCGv_i32 ret, TCGv_ptr arg2, tcg_target_long offset);
|
||||
|
||||
void tcg_gen_st8_i32(TCGv_i32 arg1, TCGv_ptr arg2, tcg_target_long offset);
|
||||
void tcg_gen_st16_i32(TCGv_i32 arg1, TCGv_ptr arg2, tcg_target_long offset);
|
||||
@@ -176,7 +175,6 @@ void tcg_gen_ld16u_i64(TCGv_i64 ret, TCGv_ptr arg2, tcg_target_long offset);
|
||||
void tcg_gen_ld16s_i64(TCGv_i64 ret, TCGv_ptr arg2, tcg_target_long offset);
|
||||
void tcg_gen_ld32u_i64(TCGv_i64 ret, TCGv_ptr arg2, tcg_target_long offset);
|
||||
void tcg_gen_ld32s_i64(TCGv_i64 ret, TCGv_ptr arg2, tcg_target_long offset);
|
||||
void tcg_gen_ld_i64(TCGv_i64 ret, TCGv_ptr arg2, tcg_target_long offset);
|
||||
void tcg_gen_st_i64(TCGv_i64 arg1, TCGv_ptr arg2, tcg_target_long offset);
|
||||
|
||||
/* Size changing operations. */
|
||||
@@ -374,10 +372,7 @@ void tcg_gen_stl_vec(TCGv_vec r, TCGv_ptr base, TCGArg offset, TCGType t);
|
||||
TCGv_ptr tcg_constant_ptr_int(intptr_t x);
|
||||
#define tcg_constant_ptr(X) tcg_constant_ptr_int((intptr_t)(X))
|
||||
|
||||
static inline void tcg_gen_ld_ptr(TCGv_ptr r, TCGv_ptr a, intptr_t o)
|
||||
{
|
||||
glue(tcg_gen_ld_,PTR)((NAT)r, a, o);
|
||||
}
|
||||
QEMU_ARG_NONNULL void tcg_gen_ld_ptr(TCGv_ptr r, TCGv_ptr a, intptr_t o);
|
||||
|
||||
static inline void tcg_gen_st_ptr(TCGv_ptr r, TCGv_ptr a, intptr_t o)
|
||||
{
|
||||
|
||||
@@ -31,6 +31,7 @@ DEF2(ext16u, TCGV, TCGV)
|
||||
DEF4(extract, TCGV, TCGV, unsigned, unsigned)
|
||||
DEF4(extract2, TCGV, TCGV, TCGV, unsigned)
|
||||
DEF3(eqv, TCGV, TCGV, TCGV)
|
||||
DEF3(ld, TCGV, TCGv_ptr, tcg_target_long)
|
||||
DEF2(mov, TCGV, TCGV)
|
||||
DEF2(movi, TCGV, TINT)
|
||||
DEF6(movcond, TCGCond, TCGV, TCGV, TCGV, TCGV, TCGV)
|
||||
|
||||
+4
-2
@@ -191,13 +191,15 @@ bool tcg_op_imm_match(TCGOpcode op, TCGType type, tcg_target_ulong imm);
|
||||
#define DEF6(NAME, T1, T2, T3, T4, T5, T6) \
|
||||
QEMU_ARG_NONNULL void glue(tcg_gen_,NAME)(TCGType, T1, T2, T3, T4, T5, T6);
|
||||
|
||||
#define TCGV TCGTemp *
|
||||
#define TINT int64_t
|
||||
#define TCGV TCGTemp *
|
||||
#define TINT int64_t
|
||||
#define TCGv_ptr TCGTemp *
|
||||
|
||||
#include "tcg/tcg-op-def.h.inc"
|
||||
|
||||
#undef TINT
|
||||
#undef TCGV
|
||||
#undef TCGv_ptr
|
||||
|
||||
#undef DEF1
|
||||
#undef DEF2
|
||||
|
||||
+14
-10
@@ -240,11 +240,13 @@ void tcg_gen_plugin_mem_cb(TCGv_i64 addr, unsigned meminfo)
|
||||
|
||||
#define C_TCGv_i32 tcgv_i32_temp
|
||||
#define C_TCGv_i64 tcgv_i64_temp
|
||||
#define C_TCGv_ptr tcgv_ptr_temp
|
||||
#define C_int32_t
|
||||
#define C_int64_t
|
||||
#define C_MemOp
|
||||
#define C_TCGCond
|
||||
#define C_TCGLabelPtr
|
||||
#define C_tcg_target_long
|
||||
#define C_unsigned
|
||||
|
||||
#define TCGV glue(TCGv,TExt)
|
||||
@@ -271,11 +273,13 @@ void tcg_gen_plugin_mem_cb(TCGv_i64 addr, unsigned meminfo)
|
||||
|
||||
#undef C_TCGv_i32
|
||||
#undef C_TCGv_i64
|
||||
#undef C_TCGv_ptr
|
||||
#undef C_int32_t
|
||||
#undef C_int64_t
|
||||
#undef C_MemOp
|
||||
#undef C_TCGCond
|
||||
#undef C_TCGLabelPtr
|
||||
#undef C_tcg_target_long
|
||||
#undef C_unsigned
|
||||
|
||||
#undef DEF1
|
||||
@@ -766,6 +770,11 @@ void tcg_gen_extract2(TCGType type, TCGTemp *dst, TCGTemp *lo, TCGTemp *hi,
|
||||
}
|
||||
}
|
||||
|
||||
void tcg_gen_ld(TCGType type, TCGTemp *dst, TCGTemp *base, tcg_target_long ofs)
|
||||
{
|
||||
tcg_gen_op_tti(INDEX_op_ld, type, dst, base, ofs);
|
||||
}
|
||||
|
||||
void tcg_gen_mov(TCGType type, TCGTemp *dst, TCGTemp *src)
|
||||
{
|
||||
if (src != dst) {
|
||||
@@ -1390,11 +1399,6 @@ void tcg_gen_ld16s_i32(TCGv_i32 ret, TCGv_ptr arg2, tcg_target_long offset)
|
||||
tcg_gen_ldst_op_i32(INDEX_op_ld16s, ret, arg2, offset);
|
||||
}
|
||||
|
||||
void tcg_gen_ld_i32(TCGv_i32 ret, TCGv_ptr arg2, tcg_target_long offset)
|
||||
{
|
||||
tcg_gen_ldst_op_i32(INDEX_op_ld, ret, arg2, offset);
|
||||
}
|
||||
|
||||
void tcg_gen_st8_i32(TCGv_i32 arg1, TCGv_ptr arg2, tcg_target_long offset)
|
||||
{
|
||||
tcg_gen_ldst_op_i32(INDEX_op_st8, arg1, arg2, offset);
|
||||
@@ -1443,11 +1447,6 @@ void tcg_gen_ld32s_i64(TCGv_i64 ret, TCGv_ptr arg2, tcg_target_long offset)
|
||||
tcg_gen_ldst_op_i64(INDEX_op_ld32s, ret, arg2, offset);
|
||||
}
|
||||
|
||||
void tcg_gen_ld_i64(TCGv_i64 ret, TCGv_ptr arg2, tcg_target_long offset)
|
||||
{
|
||||
tcg_gen_ldst_op_i64(INDEX_op_ld, ret, arg2, offset);
|
||||
}
|
||||
|
||||
void tcg_gen_st8_i64(TCGv_i64 arg1, TCGv_ptr arg2, tcg_target_long offset)
|
||||
{
|
||||
tcg_gen_ldst_op_i64(INDEX_op_st8, arg1, arg2, offset);
|
||||
@@ -1865,6 +1864,11 @@ void tcg_gen_movi_ptr(TCGv_ptr d, intptr_t s)
|
||||
tcg_gen_movi(TCG_TYPE_PTR, tcgv_ptr_temp(d), s);
|
||||
}
|
||||
|
||||
void tcg_gen_ld_ptr(TCGv_ptr r, TCGv_ptr a, intptr_t o)
|
||||
{
|
||||
tcg_gen_ld(TCG_TYPE_PTR, tcgv_ptr_temp(r), tcgv_ptr_temp(a), o);
|
||||
}
|
||||
|
||||
void tcg_gen_trunc_i64_ptr(TCGv_ptr r, TCGv_i64 a)
|
||||
{
|
||||
tcg_gen_mov(TCG_TYPE_PTR, tcgv_ptr_temp(r), tcgv_i64_temp(a));
|
||||
|
||||
Reference in new issue
Block a user