mirror of
https://github.com/qemu/qemu.git
synced 2024-11-25 20:03:37 +08:00
tcg: Fix prototypes for tcg_out_vec_op and tcg_out_op
There are two different versions of prototype for tcg_out_op and tcg_out_vec_op functions: 1) using const TCGArg *args and const int *const_args arguments 2) using const TCGArg args[TCG_MAX_OP_ARGS] and const int const_args[TCG_MAX_OP_ARGS] aguments. This duality causes warnings on GCC 11 and prevents build using --enable-werror. As second version provides more information, unify functions prototypes to this variant. Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com> Message-Id: <20210312121418.139093-1-mrezanin@redhat.com> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
98f9b467b0
commit
5e8892db93
@ -2286,7 +2286,8 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc,
|
|||||||
|
|
||||||
static void tcg_out_vec_op(TCGContext *s, TCGOpcode opc,
|
static void tcg_out_vec_op(TCGContext *s, TCGOpcode opc,
|
||||||
unsigned vecl, unsigned vece,
|
unsigned vecl, unsigned vece,
|
||||||
const TCGArg *args, const int *const_args)
|
const TCGArg args[TCG_MAX_OP_ARGS],
|
||||||
|
const int const_args[TCG_MAX_OP_ARGS])
|
||||||
{
|
{
|
||||||
static const AArch64Insn cmp_vec_insn[16] = {
|
static const AArch64Insn cmp_vec_insn[16] = {
|
||||||
[TCG_COND_EQ] = I3616_CMEQ,
|
[TCG_COND_EQ] = I3616_CMEQ,
|
||||||
|
@ -2177,7 +2177,8 @@ static void tcg_out_qemu_st(TCGContext *s, const TCGArg *args, bool is64)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static inline void tcg_out_op(TCGContext *s, TCGOpcode opc,
|
static inline void tcg_out_op(TCGContext *s, TCGOpcode opc,
|
||||||
const TCGArg *args, const int *const_args)
|
const TCGArg args[TCG_MAX_OP_ARGS],
|
||||||
|
const int const_args[TCG_MAX_OP_ARGS])
|
||||||
{
|
{
|
||||||
TCGArg a0, a1, a2;
|
TCGArg a0, a1, a2;
|
||||||
int c, const_a2, vexop, rexw = 0;
|
int c, const_a2, vexop, rexw = 0;
|
||||||
@ -2613,7 +2614,8 @@ static inline void tcg_out_op(TCGContext *s, TCGOpcode opc,
|
|||||||
|
|
||||||
static void tcg_out_vec_op(TCGContext *s, TCGOpcode opc,
|
static void tcg_out_vec_op(TCGContext *s, TCGOpcode opc,
|
||||||
unsigned vecl, unsigned vece,
|
unsigned vecl, unsigned vece,
|
||||||
const TCGArg *args, const int *const_args)
|
const TCGArg args[TCG_MAX_OP_ARGS],
|
||||||
|
const int const_args[TCG_MAX_OP_ARGS])
|
||||||
{
|
{
|
||||||
static int const add_insn[4] = {
|
static int const add_insn[4] = {
|
||||||
OPC_PADDB, OPC_PADDW, OPC_PADDD, OPC_PADDQ
|
OPC_PADDB, OPC_PADDW, OPC_PADDD, OPC_PADDQ
|
||||||
|
@ -1651,7 +1651,8 @@ static void tcg_out_clz(TCGContext *s, MIPSInsn opcv2, MIPSInsn opcv6,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static inline void tcg_out_op(TCGContext *s, TCGOpcode opc,
|
static inline void tcg_out_op(TCGContext *s, TCGOpcode opc,
|
||||||
const TCGArg *args, const int *const_args)
|
const TCGArg args[TCG_MAX_OP_ARGS],
|
||||||
|
const int const_args[TCG_MAX_OP_ARGS])
|
||||||
{
|
{
|
||||||
MIPSInsn i1, i2;
|
MIPSInsn i1, i2;
|
||||||
TCGArg a0, a1, a2;
|
TCGArg a0, a1, a2;
|
||||||
|
@ -2319,8 +2319,9 @@ static void tcg_target_qemu_prologue(TCGContext *s)
|
|||||||
tcg_out32(s, BCLR | BO_ALWAYS);
|
tcg_out32(s, BCLR | BO_ALWAYS);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args,
|
static void tcg_out_op(TCGContext *s, TCGOpcode opc,
|
||||||
const int *const_args)
|
const TCGArg args[TCG_MAX_OP_ARGS],
|
||||||
|
const int const_args[TCG_MAX_OP_ARGS])
|
||||||
{
|
{
|
||||||
TCGArg a0, a1, a2;
|
TCGArg a0, a1, a2;
|
||||||
int c;
|
int c;
|
||||||
@ -3115,7 +3116,8 @@ static bool tcg_out_dupm_vec(TCGContext *s, TCGType type, unsigned vece,
|
|||||||
|
|
||||||
static void tcg_out_vec_op(TCGContext *s, TCGOpcode opc,
|
static void tcg_out_vec_op(TCGContext *s, TCGOpcode opc,
|
||||||
unsigned vecl, unsigned vece,
|
unsigned vecl, unsigned vece,
|
||||||
const TCGArg *args, const int *const_args)
|
const TCGArg args[TCG_MAX_OP_ARGS],
|
||||||
|
const int const_args[TCG_MAX_OP_ARGS])
|
||||||
{
|
{
|
||||||
static const uint32_t
|
static const uint32_t
|
||||||
add_op[4] = { VADDUBM, VADDUHM, VADDUWM, VADDUDM },
|
add_op[4] = { VADDUBM, VADDUHM, VADDUWM, VADDUDM },
|
||||||
|
@ -1212,7 +1212,8 @@ static void tcg_out_qemu_st(TCGContext *s, const TCGArg *args, bool is_64)
|
|||||||
static const tcg_insn_unit *tb_ret_addr;
|
static const tcg_insn_unit *tb_ret_addr;
|
||||||
|
|
||||||
static void tcg_out_op(TCGContext *s, TCGOpcode opc,
|
static void tcg_out_op(TCGContext *s, TCGOpcode opc,
|
||||||
const TCGArg *args, const int *const_args)
|
const TCGArg args[TCG_MAX_OP_ARGS],
|
||||||
|
const int const_args[TCG_MAX_OP_ARGS])
|
||||||
{
|
{
|
||||||
TCGArg a0 = args[0];
|
TCGArg a0 = args[0];
|
||||||
TCGArg a1 = args[1];
|
TCGArg a1 = args[1];
|
||||||
|
@ -1705,7 +1705,8 @@ static void tcg_out_qemu_st(TCGContext* s, TCGReg data_reg, TCGReg addr_reg,
|
|||||||
case glue(glue(INDEX_op_,x),_i64)
|
case glue(glue(INDEX_op_,x),_i64)
|
||||||
|
|
||||||
static inline void tcg_out_op(TCGContext *s, TCGOpcode opc,
|
static inline void tcg_out_op(TCGContext *s, TCGOpcode opc,
|
||||||
const TCGArg *args, const int *const_args)
|
const TCGArg args[TCG_MAX_OP_ARGS],
|
||||||
|
const int const_args[TCG_MAX_OP_ARGS])
|
||||||
{
|
{
|
||||||
S390Opcode op, op2;
|
S390Opcode op, op2;
|
||||||
TCGArg a0, a1, a2;
|
TCGArg a0, a1, a2;
|
||||||
|
19
tcg/tcg.c
19
tcg/tcg.c
@ -107,8 +107,9 @@ static void tcg_out_ld(TCGContext *s, TCGType type, TCGReg ret, TCGReg arg1,
|
|||||||
static bool tcg_out_mov(TCGContext *s, TCGType type, TCGReg ret, TCGReg arg);
|
static bool tcg_out_mov(TCGContext *s, TCGType type, TCGReg ret, TCGReg arg);
|
||||||
static void tcg_out_movi(TCGContext *s, TCGType type,
|
static void tcg_out_movi(TCGContext *s, TCGType type,
|
||||||
TCGReg ret, tcg_target_long arg);
|
TCGReg ret, tcg_target_long arg);
|
||||||
static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args,
|
static void tcg_out_op(TCGContext *s, TCGOpcode opc,
|
||||||
const int *const_args);
|
const TCGArg args[TCG_MAX_OP_ARGS],
|
||||||
|
const int const_args[TCG_MAX_OP_ARGS]);
|
||||||
#if TCG_TARGET_MAYBE_vec
|
#if TCG_TARGET_MAYBE_vec
|
||||||
static bool tcg_out_dup_vec(TCGContext *s, TCGType type, unsigned vece,
|
static bool tcg_out_dup_vec(TCGContext *s, TCGType type, unsigned vece,
|
||||||
TCGReg dst, TCGReg src);
|
TCGReg dst, TCGReg src);
|
||||||
@ -116,9 +117,10 @@ static bool tcg_out_dupm_vec(TCGContext *s, TCGType type, unsigned vece,
|
|||||||
TCGReg dst, TCGReg base, intptr_t offset);
|
TCGReg dst, TCGReg base, intptr_t offset);
|
||||||
static void tcg_out_dupi_vec(TCGContext *s, TCGType type, unsigned vece,
|
static void tcg_out_dupi_vec(TCGContext *s, TCGType type, unsigned vece,
|
||||||
TCGReg dst, int64_t arg);
|
TCGReg dst, int64_t arg);
|
||||||
static void tcg_out_vec_op(TCGContext *s, TCGOpcode opc, unsigned vecl,
|
static void tcg_out_vec_op(TCGContext *s, TCGOpcode opc,
|
||||||
unsigned vece, const TCGArg *args,
|
unsigned vecl, unsigned vece,
|
||||||
const int *const_args);
|
const TCGArg args[TCG_MAX_OP_ARGS],
|
||||||
|
const int const_args[TCG_MAX_OP_ARGS]);
|
||||||
#else
|
#else
|
||||||
static inline bool tcg_out_dup_vec(TCGContext *s, TCGType type, unsigned vece,
|
static inline bool tcg_out_dup_vec(TCGContext *s, TCGType type, unsigned vece,
|
||||||
TCGReg dst, TCGReg src)
|
TCGReg dst, TCGReg src)
|
||||||
@ -135,9 +137,10 @@ static inline void tcg_out_dupi_vec(TCGContext *s, TCGType type, unsigned vece,
|
|||||||
{
|
{
|
||||||
g_assert_not_reached();
|
g_assert_not_reached();
|
||||||
}
|
}
|
||||||
static inline void tcg_out_vec_op(TCGContext *s, TCGOpcode opc, unsigned vecl,
|
static inline void tcg_out_vec_op(TCGContext *s, TCGOpcode opc,
|
||||||
unsigned vece, const TCGArg *args,
|
unsigned vecl, unsigned vece,
|
||||||
const int *const_args)
|
const TCGArg args[TCG_MAX_OP_ARGS],
|
||||||
|
const int const_args[TCG_MAX_OP_ARGS])
|
||||||
{
|
{
|
||||||
g_assert_not_reached();
|
g_assert_not_reached();
|
||||||
}
|
}
|
||||||
|
@ -613,8 +613,9 @@ static inline void tcg_out_call(TCGContext *s, const tcg_insn_unit *arg)
|
|||||||
# define CASE_64(x)
|
# define CASE_64(x)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args,
|
static void tcg_out_op(TCGContext *s, TCGOpcode opc,
|
||||||
const int *const_args)
|
const TCGArg args[TCG_MAX_OP_ARGS],
|
||||||
|
const int const_args[TCG_MAX_OP_ARGS])
|
||||||
{
|
{
|
||||||
switch (opc) {
|
switch (opc) {
|
||||||
case INDEX_op_exit_tb:
|
case INDEX_op_exit_tb:
|
||||||
|
Loading…
Reference in New Issue
Block a user