提交 a9751609 编写于 作者: R Richard Henderson 提交者: Aurelien Jarno

tcg: Name the opcode enumeration.

Give the enumeration formed from tcg-opc.h a name: TCGOpcode.
Use that enumeration type instead of "int" whereever appropriate.
Signed-off-by: NRichard Henderson <rth@twiddle.net>
Signed-off-by: NAurelien Jarno <aurelien@aurel32.net>
上级 a63b5829
...@@ -1247,7 +1247,7 @@ static inline void tcg_out_qemu_st(TCGContext *s, int cond, ...@@ -1247,7 +1247,7 @@ static inline void tcg_out_qemu_st(TCGContext *s, int cond,
static uint8_t *tb_ret_addr; static uint8_t *tb_ret_addr;
static inline void tcg_out_op(TCGContext *s, int opc, static inline void tcg_out_op(TCGContext *s, TCGOpcode opc,
const TCGArg *args, const int *const_args) const TCGArg *args, const int *const_args)
{ {
int c; int c;
......
...@@ -723,7 +723,7 @@ static void tcg_out_qemu_st(TCGContext *s, const TCGArg *args, int opc) ...@@ -723,7 +723,7 @@ static void tcg_out_qemu_st(TCGContext *s, const TCGArg *args, int opc)
#endif #endif
} }
static inline void tcg_out_op(TCGContext *s, int opc, const TCGArg *args, static inline void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args,
const int *const_args) const int *const_args)
{ {
int c; int c;
......
...@@ -968,7 +968,7 @@ static void tcg_out_qemu_st(TCGContext *s, const TCGArg *args, ...@@ -968,7 +968,7 @@ static void tcg_out_qemu_st(TCGContext *s, const TCGArg *args,
#endif #endif
} }
static inline void tcg_out_op(TCGContext *s, int opc, static inline void tcg_out_op(TCGContext *s, TCGOpcode opc,
const TCGArg *args, const int *const_args) const TCGArg *args, const int *const_args)
{ {
int c; int c;
......
...@@ -1088,7 +1088,7 @@ static void tcg_out_qemu_st(TCGContext *s, const TCGArg *args, ...@@ -1088,7 +1088,7 @@ static void tcg_out_qemu_st(TCGContext *s, const TCGArg *args,
#endif #endif
} }
static inline void tcg_out_op(TCGContext *s, int opc, static inline void tcg_out_op(TCGContext *s, TCGOpcode opc,
const TCGArg *args, const int *const_args) const TCGArg *args, const int *const_args)
{ {
switch(opc) { switch(opc) {
......
...@@ -1292,7 +1292,7 @@ void ppc_tb_set_jmp_target (unsigned long jmp_addr, unsigned long addr) ...@@ -1292,7 +1292,7 @@ void ppc_tb_set_jmp_target (unsigned long jmp_addr, unsigned long addr)
flush_icache_range(jmp_addr, jmp_addr + patch_size); flush_icache_range(jmp_addr, jmp_addr + patch_size);
} }
static void tcg_out_op(TCGContext *s, int opc, const TCGArg *args, static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args,
const int *const_args) const int *const_args)
{ {
switch (opc) { switch (opc) {
......
...@@ -1201,7 +1201,7 @@ void ppc_tb_set_jmp_target (unsigned long jmp_addr, unsigned long addr) ...@@ -1201,7 +1201,7 @@ void ppc_tb_set_jmp_target (unsigned long jmp_addr, unsigned long addr)
flush_icache_range (jmp_addr, jmp_addr + patch_size); flush_icache_range (jmp_addr, jmp_addr + patch_size);
} }
static void tcg_out_op (TCGContext *s, int opc, const TCGArg *args, static void tcg_out_op (TCGContext *s, TCGOpcode opc, const TCGArg *args,
const int *const_args) const int *const_args)
{ {
int c; int c;
......
...@@ -78,7 +78,7 @@ static inline void tcg_out_st(TCGContext *s, TCGType type, int arg, ...@@ -78,7 +78,7 @@ static inline void tcg_out_st(TCGContext *s, TCGType type, int arg,
tcg_abort(); tcg_abort();
} }
static inline void tcg_out_op(TCGContext *s, int opc, static inline void tcg_out_op(TCGContext *s, TCGOpcode opc,
const TCGArg *args, const int *const_args) const TCGArg *args, const int *const_args)
{ {
tcg_abort(); tcg_abort();
......
...@@ -1119,7 +1119,7 @@ static void tcg_out_qemu_st(TCGContext *s, const TCGArg *args, ...@@ -1119,7 +1119,7 @@ static void tcg_out_qemu_st(TCGContext *s, const TCGArg *args,
#endif #endif
} }
static inline void tcg_out_op(TCGContext *s, int opc, const TCGArg *args, static inline void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args,
const int *const_args) const int *const_args)
{ {
int c; int c;
......
...@@ -25,60 +25,60 @@ ...@@ -25,60 +25,60 @@
int gen_new_label(void); int gen_new_label(void);
static inline void tcg_gen_op1_i32(int opc, TCGv_i32 arg1) static inline void tcg_gen_op1_i32(TCGOpcode opc, TCGv_i32 arg1)
{ {
*gen_opc_ptr++ = opc; *gen_opc_ptr++ = opc;
*gen_opparam_ptr++ = GET_TCGV_I32(arg1); *gen_opparam_ptr++ = GET_TCGV_I32(arg1);
} }
static inline void tcg_gen_op1_i64(int opc, TCGv_i64 arg1) static inline void tcg_gen_op1_i64(TCGOpcode opc, TCGv_i64 arg1)
{ {
*gen_opc_ptr++ = opc; *gen_opc_ptr++ = opc;
*gen_opparam_ptr++ = GET_TCGV_I64(arg1); *gen_opparam_ptr++ = GET_TCGV_I64(arg1);
} }
static inline void tcg_gen_op1i(int opc, TCGArg arg1) static inline void tcg_gen_op1i(TCGOpcode opc, TCGArg arg1)
{ {
*gen_opc_ptr++ = opc; *gen_opc_ptr++ = opc;
*gen_opparam_ptr++ = arg1; *gen_opparam_ptr++ = arg1;
} }
static inline void tcg_gen_op2_i32(int opc, TCGv_i32 arg1, TCGv_i32 arg2) static inline void tcg_gen_op2_i32(TCGOpcode opc, TCGv_i32 arg1, TCGv_i32 arg2)
{ {
*gen_opc_ptr++ = opc; *gen_opc_ptr++ = opc;
*gen_opparam_ptr++ = GET_TCGV_I32(arg1); *gen_opparam_ptr++ = GET_TCGV_I32(arg1);
*gen_opparam_ptr++ = GET_TCGV_I32(arg2); *gen_opparam_ptr++ = GET_TCGV_I32(arg2);
} }
static inline void tcg_gen_op2_i64(int opc, TCGv_i64 arg1, TCGv_i64 arg2) static inline void tcg_gen_op2_i64(TCGOpcode opc, TCGv_i64 arg1, TCGv_i64 arg2)
{ {
*gen_opc_ptr++ = opc; *gen_opc_ptr++ = opc;
*gen_opparam_ptr++ = GET_TCGV_I64(arg1); *gen_opparam_ptr++ = GET_TCGV_I64(arg1);
*gen_opparam_ptr++ = GET_TCGV_I64(arg2); *gen_opparam_ptr++ = GET_TCGV_I64(arg2);
} }
static inline void tcg_gen_op2i_i32(int opc, TCGv_i32 arg1, TCGArg arg2) static inline void tcg_gen_op2i_i32(TCGOpcode opc, TCGv_i32 arg1, TCGArg arg2)
{ {
*gen_opc_ptr++ = opc; *gen_opc_ptr++ = opc;
*gen_opparam_ptr++ = GET_TCGV_I32(arg1); *gen_opparam_ptr++ = GET_TCGV_I32(arg1);
*gen_opparam_ptr++ = arg2; *gen_opparam_ptr++ = arg2;
} }
static inline void tcg_gen_op2i_i64(int opc, TCGv_i64 arg1, TCGArg arg2) static inline void tcg_gen_op2i_i64(TCGOpcode opc, TCGv_i64 arg1, TCGArg arg2)
{ {
*gen_opc_ptr++ = opc; *gen_opc_ptr++ = opc;
*gen_opparam_ptr++ = GET_TCGV_I64(arg1); *gen_opparam_ptr++ = GET_TCGV_I64(arg1);
*gen_opparam_ptr++ = arg2; *gen_opparam_ptr++ = arg2;
} }
static inline void tcg_gen_op2ii(int opc, TCGArg arg1, TCGArg arg2) static inline void tcg_gen_op2ii(TCGOpcode opc, TCGArg arg1, TCGArg arg2)
{ {
*gen_opc_ptr++ = opc; *gen_opc_ptr++ = opc;
*gen_opparam_ptr++ = arg1; *gen_opparam_ptr++ = arg1;
*gen_opparam_ptr++ = arg2; *gen_opparam_ptr++ = arg2;
} }
static inline void tcg_gen_op3_i32(int opc, TCGv_i32 arg1, TCGv_i32 arg2, static inline void tcg_gen_op3_i32(TCGOpcode opc, TCGv_i32 arg1, TCGv_i32 arg2,
TCGv_i32 arg3) TCGv_i32 arg3)
{ {
*gen_opc_ptr++ = opc; *gen_opc_ptr++ = opc;
...@@ -87,7 +87,7 @@ static inline void tcg_gen_op3_i32(int opc, TCGv_i32 arg1, TCGv_i32 arg2, ...@@ -87,7 +87,7 @@ static inline void tcg_gen_op3_i32(int opc, TCGv_i32 arg1, TCGv_i32 arg2,
*gen_opparam_ptr++ = GET_TCGV_I32(arg3); *gen_opparam_ptr++ = GET_TCGV_I32(arg3);
} }
static inline void tcg_gen_op3_i64(int opc, TCGv_i64 arg1, TCGv_i64 arg2, static inline void tcg_gen_op3_i64(TCGOpcode opc, TCGv_i64 arg1, TCGv_i64 arg2,
TCGv_i64 arg3) TCGv_i64 arg3)
{ {
*gen_opc_ptr++ = opc; *gen_opc_ptr++ = opc;
...@@ -96,8 +96,8 @@ static inline void tcg_gen_op3_i64(int opc, TCGv_i64 arg1, TCGv_i64 arg2, ...@@ -96,8 +96,8 @@ static inline void tcg_gen_op3_i64(int opc, TCGv_i64 arg1, TCGv_i64 arg2,
*gen_opparam_ptr++ = GET_TCGV_I64(arg3); *gen_opparam_ptr++ = GET_TCGV_I64(arg3);
} }
static inline void tcg_gen_op3i_i32(int opc, TCGv_i32 arg1, TCGv_i32 arg2, static inline void tcg_gen_op3i_i32(TCGOpcode opc, TCGv_i32 arg1,
TCGArg arg3) TCGv_i32 arg2, TCGArg arg3)
{ {
*gen_opc_ptr++ = opc; *gen_opc_ptr++ = opc;
*gen_opparam_ptr++ = GET_TCGV_I32(arg1); *gen_opparam_ptr++ = GET_TCGV_I32(arg1);
...@@ -105,8 +105,8 @@ static inline void tcg_gen_op3i_i32(int opc, TCGv_i32 arg1, TCGv_i32 arg2, ...@@ -105,8 +105,8 @@ static inline void tcg_gen_op3i_i32(int opc, TCGv_i32 arg1, TCGv_i32 arg2,
*gen_opparam_ptr++ = arg3; *gen_opparam_ptr++ = arg3;
} }
static inline void tcg_gen_op3i_i64(int opc, TCGv_i64 arg1, TCGv_i64 arg2, static inline void tcg_gen_op3i_i64(TCGOpcode opc, TCGv_i64 arg1,
TCGArg arg3) TCGv_i64 arg2, TCGArg arg3)
{ {
*gen_opc_ptr++ = opc; *gen_opc_ptr++ = opc;
*gen_opparam_ptr++ = GET_TCGV_I64(arg1); *gen_opparam_ptr++ = GET_TCGV_I64(arg1);
...@@ -114,8 +114,8 @@ static inline void tcg_gen_op3i_i64(int opc, TCGv_i64 arg1, TCGv_i64 arg2, ...@@ -114,8 +114,8 @@ static inline void tcg_gen_op3i_i64(int opc, TCGv_i64 arg1, TCGv_i64 arg2,
*gen_opparam_ptr++ = arg3; *gen_opparam_ptr++ = arg3;
} }
static inline void tcg_gen_ldst_op_i32(int opc, TCGv_i32 val, TCGv_ptr base, static inline void tcg_gen_ldst_op_i32(TCGOpcode opc, TCGv_i32 val,
TCGArg offset) TCGv_ptr base, TCGArg offset)
{ {
*gen_opc_ptr++ = opc; *gen_opc_ptr++ = opc;
*gen_opparam_ptr++ = GET_TCGV_I32(val); *gen_opparam_ptr++ = GET_TCGV_I32(val);
...@@ -123,8 +123,8 @@ static inline void tcg_gen_ldst_op_i32(int opc, TCGv_i32 val, TCGv_ptr base, ...@@ -123,8 +123,8 @@ static inline void tcg_gen_ldst_op_i32(int opc, TCGv_i32 val, TCGv_ptr base,
*gen_opparam_ptr++ = offset; *gen_opparam_ptr++ = offset;
} }
static inline void tcg_gen_ldst_op_i64(int opc, TCGv_i64 val, TCGv_ptr base, static inline void tcg_gen_ldst_op_i64(TCGOpcode opc, TCGv_i64 val,
TCGArg offset) TCGv_ptr base, TCGArg offset)
{ {
*gen_opc_ptr++ = opc; *gen_opc_ptr++ = opc;
*gen_opparam_ptr++ = GET_TCGV_I64(val); *gen_opparam_ptr++ = GET_TCGV_I64(val);
...@@ -132,8 +132,8 @@ static inline void tcg_gen_ldst_op_i64(int opc, TCGv_i64 val, TCGv_ptr base, ...@@ -132,8 +132,8 @@ static inline void tcg_gen_ldst_op_i64(int opc, TCGv_i64 val, TCGv_ptr base,
*gen_opparam_ptr++ = offset; *gen_opparam_ptr++ = offset;
} }
static inline void tcg_gen_qemu_ldst_op_i64_i32(int opc, TCGv_i64 val, TCGv_i32 addr, static inline void tcg_gen_qemu_ldst_op_i64_i32(TCGOpcode opc, TCGv_i64 val,
TCGArg mem_index) TCGv_i32 addr, TCGArg mem_index)
{ {
*gen_opc_ptr++ = opc; *gen_opc_ptr++ = opc;
*gen_opparam_ptr++ = GET_TCGV_I64(val); *gen_opparam_ptr++ = GET_TCGV_I64(val);
...@@ -141,8 +141,8 @@ static inline void tcg_gen_qemu_ldst_op_i64_i32(int opc, TCGv_i64 val, TCGv_i32 ...@@ -141,8 +141,8 @@ static inline void tcg_gen_qemu_ldst_op_i64_i32(int opc, TCGv_i64 val, TCGv_i32
*gen_opparam_ptr++ = mem_index; *gen_opparam_ptr++ = mem_index;
} }
static inline void tcg_gen_qemu_ldst_op_i64_i64(int opc, TCGv_i64 val, TCGv_i64 addr, static inline void tcg_gen_qemu_ldst_op_i64_i64(TCGOpcode opc, TCGv_i64 val,
TCGArg mem_index) TCGv_i64 addr, TCGArg mem_index)
{ {
*gen_opc_ptr++ = opc; *gen_opc_ptr++ = opc;
*gen_opparam_ptr++ = GET_TCGV_I64(val); *gen_opparam_ptr++ = GET_TCGV_I64(val);
...@@ -150,7 +150,7 @@ static inline void tcg_gen_qemu_ldst_op_i64_i64(int opc, TCGv_i64 val, TCGv_i64 ...@@ -150,7 +150,7 @@ static inline void tcg_gen_qemu_ldst_op_i64_i64(int opc, TCGv_i64 val, TCGv_i64
*gen_opparam_ptr++ = mem_index; *gen_opparam_ptr++ = mem_index;
} }
static inline void tcg_gen_op4_i32(int opc, TCGv_i32 arg1, TCGv_i32 arg2, static inline void tcg_gen_op4_i32(TCGOpcode opc, TCGv_i32 arg1, TCGv_i32 arg2,
TCGv_i32 arg3, TCGv_i32 arg4) TCGv_i32 arg3, TCGv_i32 arg4)
{ {
*gen_opc_ptr++ = opc; *gen_opc_ptr++ = opc;
...@@ -160,7 +160,7 @@ static inline void tcg_gen_op4_i32(int opc, TCGv_i32 arg1, TCGv_i32 arg2, ...@@ -160,7 +160,7 @@ static inline void tcg_gen_op4_i32(int opc, TCGv_i32 arg1, TCGv_i32 arg2,
*gen_opparam_ptr++ = GET_TCGV_I32(arg4); *gen_opparam_ptr++ = GET_TCGV_I32(arg4);
} }
static inline void tcg_gen_op4_i64(int opc, TCGv_i64 arg1, TCGv_i64 arg2, static inline void tcg_gen_op4_i64(TCGOpcode opc, TCGv_i64 arg1, TCGv_i64 arg2,
TCGv_i64 arg3, TCGv_i64 arg4) TCGv_i64 arg3, TCGv_i64 arg4)
{ {
*gen_opc_ptr++ = opc; *gen_opc_ptr++ = opc;
...@@ -170,7 +170,7 @@ static inline void tcg_gen_op4_i64(int opc, TCGv_i64 arg1, TCGv_i64 arg2, ...@@ -170,7 +170,7 @@ static inline void tcg_gen_op4_i64(int opc, TCGv_i64 arg1, TCGv_i64 arg2,
*gen_opparam_ptr++ = GET_TCGV_I64(arg4); *gen_opparam_ptr++ = GET_TCGV_I64(arg4);
} }
static inline void tcg_gen_op4i_i32(int opc, TCGv_i32 arg1, TCGv_i32 arg2, static inline void tcg_gen_op4i_i32(TCGOpcode opc, TCGv_i32 arg1, TCGv_i32 arg2,
TCGv_i32 arg3, TCGArg arg4) TCGv_i32 arg3, TCGArg arg4)
{ {
*gen_opc_ptr++ = opc; *gen_opc_ptr++ = opc;
...@@ -180,7 +180,7 @@ static inline void tcg_gen_op4i_i32(int opc, TCGv_i32 arg1, TCGv_i32 arg2, ...@@ -180,7 +180,7 @@ static inline void tcg_gen_op4i_i32(int opc, TCGv_i32 arg1, TCGv_i32 arg2,
*gen_opparam_ptr++ = arg4; *gen_opparam_ptr++ = arg4;
} }
static inline void tcg_gen_op4i_i64(int opc, TCGv_i64 arg1, TCGv_i64 arg2, static inline void tcg_gen_op4i_i64(TCGOpcode opc, TCGv_i64 arg1, TCGv_i64 arg2,
TCGv_i64 arg3, TCGArg arg4) TCGv_i64 arg3, TCGArg arg4)
{ {
*gen_opc_ptr++ = opc; *gen_opc_ptr++ = opc;
...@@ -190,7 +190,7 @@ static inline void tcg_gen_op4i_i64(int opc, TCGv_i64 arg1, TCGv_i64 arg2, ...@@ -190,7 +190,7 @@ static inline void tcg_gen_op4i_i64(int opc, TCGv_i64 arg1, TCGv_i64 arg2,
*gen_opparam_ptr++ = arg4; *gen_opparam_ptr++ = arg4;
} }
static inline void tcg_gen_op4ii_i32(int opc, TCGv_i32 arg1, TCGv_i32 arg2, static inline void tcg_gen_op4ii_i32(TCGOpcode opc, TCGv_i32 arg1, TCGv_i32 arg2,
TCGArg arg3, TCGArg arg4) TCGArg arg3, TCGArg arg4)
{ {
*gen_opc_ptr++ = opc; *gen_opc_ptr++ = opc;
...@@ -200,7 +200,7 @@ static inline void tcg_gen_op4ii_i32(int opc, TCGv_i32 arg1, TCGv_i32 arg2, ...@@ -200,7 +200,7 @@ static inline void tcg_gen_op4ii_i32(int opc, TCGv_i32 arg1, TCGv_i32 arg2,
*gen_opparam_ptr++ = arg4; *gen_opparam_ptr++ = arg4;
} }
static inline void tcg_gen_op4ii_i64(int opc, TCGv_i64 arg1, TCGv_i64 arg2, static inline void tcg_gen_op4ii_i64(TCGOpcode opc, TCGv_i64 arg1, TCGv_i64 arg2,
TCGArg arg3, TCGArg arg4) TCGArg arg3, TCGArg arg4)
{ {
*gen_opc_ptr++ = opc; *gen_opc_ptr++ = opc;
...@@ -210,7 +210,7 @@ static inline void tcg_gen_op4ii_i64(int opc, TCGv_i64 arg1, TCGv_i64 arg2, ...@@ -210,7 +210,7 @@ static inline void tcg_gen_op4ii_i64(int opc, TCGv_i64 arg1, TCGv_i64 arg2,
*gen_opparam_ptr++ = arg4; *gen_opparam_ptr++ = arg4;
} }
static inline void tcg_gen_op5_i32(int opc, TCGv_i32 arg1, TCGv_i32 arg2, static inline void tcg_gen_op5_i32(TCGOpcode opc, TCGv_i32 arg1, TCGv_i32 arg2,
TCGv_i32 arg3, TCGv_i32 arg4, TCGv_i32 arg5) TCGv_i32 arg3, TCGv_i32 arg4, TCGv_i32 arg5)
{ {
*gen_opc_ptr++ = opc; *gen_opc_ptr++ = opc;
...@@ -221,7 +221,7 @@ static inline void tcg_gen_op5_i32(int opc, TCGv_i32 arg1, TCGv_i32 arg2, ...@@ -221,7 +221,7 @@ static inline void tcg_gen_op5_i32(int opc, TCGv_i32 arg1, TCGv_i32 arg2,
*gen_opparam_ptr++ = GET_TCGV_I32(arg5); *gen_opparam_ptr++ = GET_TCGV_I32(arg5);
} }
static inline void tcg_gen_op5_i64(int opc, TCGv_i64 arg1, TCGv_i64 arg2, static inline void tcg_gen_op5_i64(TCGOpcode opc, TCGv_i64 arg1, TCGv_i64 arg2,
TCGv_i64 arg3, TCGv_i64 arg4, TCGv_i64 arg5) TCGv_i64 arg3, TCGv_i64 arg4, TCGv_i64 arg5)
{ {
*gen_opc_ptr++ = opc; *gen_opc_ptr++ = opc;
...@@ -232,7 +232,7 @@ static inline void tcg_gen_op5_i64(int opc, TCGv_i64 arg1, TCGv_i64 arg2, ...@@ -232,7 +232,7 @@ static inline void tcg_gen_op5_i64(int opc, TCGv_i64 arg1, TCGv_i64 arg2,
*gen_opparam_ptr++ = GET_TCGV_I64(arg5); *gen_opparam_ptr++ = GET_TCGV_I64(arg5);
} }
static inline void tcg_gen_op5i_i32(int opc, TCGv_i32 arg1, TCGv_i32 arg2, static inline void tcg_gen_op5i_i32(TCGOpcode opc, TCGv_i32 arg1, TCGv_i32 arg2,
TCGv_i32 arg3, TCGv_i32 arg4, TCGArg arg5) TCGv_i32 arg3, TCGv_i32 arg4, TCGArg arg5)
{ {
*gen_opc_ptr++ = opc; *gen_opc_ptr++ = opc;
...@@ -243,7 +243,7 @@ static inline void tcg_gen_op5i_i32(int opc, TCGv_i32 arg1, TCGv_i32 arg2, ...@@ -243,7 +243,7 @@ static inline void tcg_gen_op5i_i32(int opc, TCGv_i32 arg1, TCGv_i32 arg2,
*gen_opparam_ptr++ = arg5; *gen_opparam_ptr++ = arg5;
} }
static inline void tcg_gen_op5i_i64(int opc, TCGv_i64 arg1, TCGv_i64 arg2, static inline void tcg_gen_op5i_i64(TCGOpcode opc, TCGv_i64 arg1, TCGv_i64 arg2,
TCGv_i64 arg3, TCGv_i64 arg4, TCGArg arg5) TCGv_i64 arg3, TCGv_i64 arg4, TCGArg arg5)
{ {
*gen_opc_ptr++ = opc; *gen_opc_ptr++ = opc;
...@@ -254,7 +254,7 @@ static inline void tcg_gen_op5i_i64(int opc, TCGv_i64 arg1, TCGv_i64 arg2, ...@@ -254,7 +254,7 @@ static inline void tcg_gen_op5i_i64(int opc, TCGv_i64 arg1, TCGv_i64 arg2,
*gen_opparam_ptr++ = arg5; *gen_opparam_ptr++ = arg5;
} }
static inline void tcg_gen_op6_i32(int opc, TCGv_i32 arg1, TCGv_i32 arg2, static inline void tcg_gen_op6_i32(TCGOpcode opc, TCGv_i32 arg1, TCGv_i32 arg2,
TCGv_i32 arg3, TCGv_i32 arg4, TCGv_i32 arg5, TCGv_i32 arg3, TCGv_i32 arg4, TCGv_i32 arg5,
TCGv_i32 arg6) TCGv_i32 arg6)
{ {
...@@ -267,7 +267,7 @@ static inline void tcg_gen_op6_i32(int opc, TCGv_i32 arg1, TCGv_i32 arg2, ...@@ -267,7 +267,7 @@ static inline void tcg_gen_op6_i32(int opc, TCGv_i32 arg1, TCGv_i32 arg2,
*gen_opparam_ptr++ = GET_TCGV_I32(arg6); *gen_opparam_ptr++ = GET_TCGV_I32(arg6);
} }
static inline void tcg_gen_op6_i64(int opc, TCGv_i64 arg1, TCGv_i64 arg2, static inline void tcg_gen_op6_i64(TCGOpcode opc, TCGv_i64 arg1, TCGv_i64 arg2,
TCGv_i64 arg3, TCGv_i64 arg4, TCGv_i64 arg5, TCGv_i64 arg3, TCGv_i64 arg4, TCGv_i64 arg5,
TCGv_i64 arg6) TCGv_i64 arg6)
{ {
...@@ -280,7 +280,7 @@ static inline void tcg_gen_op6_i64(int opc, TCGv_i64 arg1, TCGv_i64 arg2, ...@@ -280,7 +280,7 @@ static inline void tcg_gen_op6_i64(int opc, TCGv_i64 arg1, TCGv_i64 arg2,
*gen_opparam_ptr++ = GET_TCGV_I64(arg6); *gen_opparam_ptr++ = GET_TCGV_I64(arg6);
} }
static inline void tcg_gen_op6i_i32(int opc, TCGv_i32 arg1, TCGv_i32 arg2, static inline void tcg_gen_op6i_i32(TCGOpcode opc, TCGv_i32 arg1, TCGv_i32 arg2,
TCGv_i32 arg3, TCGv_i32 arg4, TCGv_i32 arg3, TCGv_i32 arg4,
TCGv_i32 arg5, TCGArg arg6) TCGv_i32 arg5, TCGArg arg6)
{ {
...@@ -293,7 +293,7 @@ static inline void tcg_gen_op6i_i32(int opc, TCGv_i32 arg1, TCGv_i32 arg2, ...@@ -293,7 +293,7 @@ static inline void tcg_gen_op6i_i32(int opc, TCGv_i32 arg1, TCGv_i32 arg2,
*gen_opparam_ptr++ = arg6; *gen_opparam_ptr++ = arg6;
} }
static inline void tcg_gen_op6i_i64(int opc, TCGv_i64 arg1, TCGv_i64 arg2, static inline void tcg_gen_op6i_i64(TCGOpcode opc, TCGv_i64 arg1, TCGv_i64 arg2,
TCGv_i64 arg3, TCGv_i64 arg4, TCGv_i64 arg3, TCGv_i64 arg4,
TCGv_i64 arg5, TCGArg arg6) TCGv_i64 arg5, TCGArg arg6)
{ {
...@@ -306,9 +306,9 @@ static inline void tcg_gen_op6i_i64(int opc, TCGv_i64 arg1, TCGv_i64 arg2, ...@@ -306,9 +306,9 @@ static inline void tcg_gen_op6i_i64(int opc, TCGv_i64 arg1, TCGv_i64 arg2,
*gen_opparam_ptr++ = arg6; *gen_opparam_ptr++ = arg6;
} }
static inline void tcg_gen_op6ii_i32(int opc, TCGv_i32 arg1, TCGv_i32 arg2, static inline void tcg_gen_op6ii_i32(TCGOpcode opc, TCGv_i32 arg1,
TCGv_i32 arg3, TCGv_i32 arg4, TCGArg arg5, TCGv_i32 arg2, TCGv_i32 arg3,
TCGArg arg6) TCGv_i32 arg4, TCGArg arg5, TCGArg arg6)
{ {
*gen_opc_ptr++ = opc; *gen_opc_ptr++ = opc;
*gen_opparam_ptr++ = GET_TCGV_I32(arg1); *gen_opparam_ptr++ = GET_TCGV_I32(arg1);
...@@ -319,9 +319,9 @@ static inline void tcg_gen_op6ii_i32(int opc, TCGv_i32 arg1, TCGv_i32 arg2, ...@@ -319,9 +319,9 @@ static inline void tcg_gen_op6ii_i32(int opc, TCGv_i32 arg1, TCGv_i32 arg2,
*gen_opparam_ptr++ = arg6; *gen_opparam_ptr++ = arg6;
} }
static inline void tcg_gen_op6ii_i64(int opc, TCGv_i64 arg1, TCGv_i64 arg2, static inline void tcg_gen_op6ii_i64(TCGOpcode opc, TCGv_i64 arg1,
TCGv_i64 arg3, TCGv_i64 arg4, TCGArg arg5, TCGv_i64 arg2, TCGv_i64 arg3,
TCGArg arg6) TCGv_i64 arg4, TCGArg arg5, TCGArg arg6)
{ {
*gen_opc_ptr++ = opc; *gen_opc_ptr++ = opc;
*gen_opparam_ptr++ = GET_TCGV_I64(arg1); *gen_opparam_ptr++ = GET_TCGV_I64(arg1);
......
...@@ -793,7 +793,8 @@ void tcg_dump_ops(TCGContext *s, FILE *outfile) ...@@ -793,7 +793,8 @@ void tcg_dump_ops(TCGContext *s, FILE *outfile)
const uint16_t *opc_ptr; const uint16_t *opc_ptr;
const TCGArg *args; const TCGArg *args;
TCGArg arg; TCGArg arg;
int c, i, k, nb_oargs, nb_iargs, nb_cargs, first_insn; TCGOpcode c;
int i, k, nb_oargs, nb_iargs, nb_cargs, first_insn;
const TCGOpDef *def; const TCGOpDef *def;
char buf[128]; char buf[128];
...@@ -980,13 +981,13 @@ static void sort_constraints(TCGOpDef *def, int start, int n) ...@@ -980,13 +981,13 @@ static void sort_constraints(TCGOpDef *def, int start, int n)
void tcg_add_target_add_op_defs(const TCGTargetOpDef *tdefs) void tcg_add_target_add_op_defs(const TCGTargetOpDef *tdefs)
{ {
int op; TCGOpcode op;
TCGOpDef *def; TCGOpDef *def;
const char *ct_str; const char *ct_str;
int i, nb_args; int i, nb_args;
for(;;) { for(;;) {
if (tdefs->op < 0) if (tdefs->op == (TCGOpcode)-1)
break; break;
op = tdefs->op; op = tdefs->op;
assert(op >= 0 && op < NB_OPS); assert(op >= 0 && op < NB_OPS);
...@@ -1056,15 +1057,27 @@ void tcg_add_target_add_op_defs(const TCGTargetOpDef *tdefs) ...@@ -1056,15 +1057,27 @@ void tcg_add_target_add_op_defs(const TCGTargetOpDef *tdefs)
} }
#if defined(CONFIG_DEBUG_TCG) #if defined(CONFIG_DEBUG_TCG)
i = 0;
for (op = 0; op < ARRAY_SIZE(tcg_op_defs); op++) { for (op = 0; op < ARRAY_SIZE(tcg_op_defs); op++) {
if (op < INDEX_op_call || op == INDEX_op_debug_insn_start) { if (op < INDEX_op_call || op == INDEX_op_debug_insn_start) {
/* Wrong entry in op definitions? */ /* Wrong entry in op definitions? */
assert(!tcg_op_defs[op].used); if (tcg_op_defs[op].used) {
fprintf(stderr, "Invalid op definition for %s\n",
tcg_op_defs[op].name);
i = 1;
}
} else { } else {
/* Missing entry in op definitions? */ /* Missing entry in op definitions? */
assert(tcg_op_defs[op].used); if (!tcg_op_defs[op].used) {
fprintf(stderr, "Missing op definition for %s\n",
tcg_op_defs[op].name);
i = 1;
}
} }
} }
if (i == 1) {
tcg_abort();
}
#endif #endif
} }
...@@ -1116,7 +1129,8 @@ static inline void tcg_la_bb_end(TCGContext *s, uint8_t *dead_temps) ...@@ -1116,7 +1129,8 @@ static inline void tcg_la_bb_end(TCGContext *s, uint8_t *dead_temps)
temporaries are removed. */ temporaries are removed. */
static void tcg_liveness_analysis(TCGContext *s) static void tcg_liveness_analysis(TCGContext *s)
{ {
int i, op_index, op, nb_args, nb_iargs, nb_oargs, arg, nb_ops; int i, op_index, nb_args, nb_iargs, nb_oargs, arg, nb_ops;
TCGOpcode op;
TCGArg *args; TCGArg *args;
const TCGOpDef *def; const TCGOpDef *def;
uint8_t *dead_temps; uint8_t *dead_temps;
...@@ -1557,7 +1571,7 @@ static void tcg_reg_alloc_mov(TCGContext *s, const TCGOpDef *def, ...@@ -1557,7 +1571,7 @@ static void tcg_reg_alloc_mov(TCGContext *s, const TCGOpDef *def,
} }
static void tcg_reg_alloc_op(TCGContext *s, static void tcg_reg_alloc_op(TCGContext *s,
const TCGOpDef *def, int opc, const TCGOpDef *def, TCGOpcode opc,
const TCGArg *args, const TCGArg *args,
unsigned int dead_iargs) unsigned int dead_iargs)
{ {
...@@ -1724,7 +1738,7 @@ static void tcg_reg_alloc_op(TCGContext *s, ...@@ -1724,7 +1738,7 @@ static void tcg_reg_alloc_op(TCGContext *s,
#endif #endif
static int tcg_reg_alloc_call(TCGContext *s, const TCGOpDef *def, static int tcg_reg_alloc_call(TCGContext *s, const TCGOpDef *def,
int opc, const TCGArg *args, TCGOpcode opc, const TCGArg *args,
unsigned int dead_iargs) unsigned int dead_iargs)
{ {
int nb_iargs, nb_oargs, flags, nb_regs, i, reg, nb_params; int nb_iargs, nb_oargs, flags, nb_regs, i, reg, nb_params;
...@@ -1921,7 +1935,8 @@ static void dump_op_count(void) ...@@ -1921,7 +1935,8 @@ static void dump_op_count(void)
static inline int tcg_gen_code_common(TCGContext *s, uint8_t *gen_code_buf, static inline int tcg_gen_code_common(TCGContext *s, uint8_t *gen_code_buf,
long search_pc) long search_pc)
{ {
int opc, op_index; TCGOpcode opc;
int op_index;
const TCGOpDef *def; const TCGOpDef *def;
unsigned int dead_iargs; unsigned int dead_iargs;
const TCGArg *args; const TCGArg *args;
......
...@@ -47,12 +47,12 @@ typedef uint64_t TCGRegSet; ...@@ -47,12 +47,12 @@ typedef uint64_t TCGRegSet;
#error unsupported #error unsupported
#endif #endif
enum { typedef enum TCGOpcode {
#define DEF(s, n, copy_size) INDEX_op_ ## s, #define DEF(s, n, copy_size) INDEX_op_ ## s,
#include "tcg-opc.h" #include "tcg-opc.h"
#undef DEF #undef DEF
NB_OPS, NB_OPS,
}; } TCGOpcode;
#define tcg_regset_clear(d) (d) = 0 #define tcg_regset_clear(d) (d) = 0
#define tcg_regset_set(d, s) (d) = (s) #define tcg_regset_set(d, s) (d) = (s)
...@@ -418,7 +418,7 @@ typedef struct TCGOpDef { ...@@ -418,7 +418,7 @@ typedef struct TCGOpDef {
} TCGOpDef; } TCGOpDef;
typedef struct TCGTargetOpDef { typedef struct TCGTargetOpDef {
int op; TCGOpcode op;
const char *args_ct_str[TCG_MAX_OP_ARGS]; const char *args_ct_str[TCG_MAX_OP_ARGS];
} TCGTargetOpDef; } TCGTargetOpDef;
......
...@@ -903,7 +903,7 @@ static void tcg_out_qemu_st(TCGContext *s, const TCGArg *args, ...@@ -903,7 +903,7 @@ static void tcg_out_qemu_st(TCGContext *s, const TCGArg *args,
#endif #endif
} }
static inline void tcg_out_op(TCGContext *s, int opc, const TCGArg *args, static inline void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args,
const int *const_args) const int *const_args)
{ {
int c; int c;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册