tcg: Pass type and flags to tcg_target_op_def

Allow the backend to make constraint choices based on more parameters.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
Richard Henderson 2025-01-03 11:19:19 -08:00
parent 07ffd5b219
commit 6323b3639c
11 changed files with 22 additions and 12 deletions

View file

@ -2962,7 +2962,8 @@ void tcg_expand_vec_op(TCGOpcode opc, TCGType type, unsigned vece,
} }
} }
static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op) static TCGConstraintSetIndex
tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags)
{ {
switch (op) { switch (op) {
case INDEX_op_goto_ptr: case INDEX_op_goto_ptr:

View file

@ -2124,7 +2124,8 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc,
} }
} }
static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op) static TCGConstraintSetIndex
tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags)
{ {
switch (op) { switch (op) {
case INDEX_op_goto_ptr: case INDEX_op_goto_ptr:

View file

@ -3627,7 +3627,8 @@ static void tcg_out_vec_op(TCGContext *s, TCGOpcode opc,
} }
} }
static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op) static TCGConstraintSetIndex
tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags)
{ {
switch (op) { switch (op) {
case INDEX_op_goto_ptr: case INDEX_op_goto_ptr:

View file

@ -2191,7 +2191,8 @@ void tcg_expand_vec_op(TCGOpcode opc, TCGType type, unsigned vece,
g_assert_not_reached(); g_assert_not_reached();
} }
static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op) static TCGConstraintSetIndex
tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags)
{ {
switch (op) { switch (op) {
case INDEX_op_goto_ptr: case INDEX_op_goto_ptr:

View file

@ -2151,7 +2151,8 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc,
} }
} }
static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op) static TCGConstraintSetIndex
tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags)
{ {
switch (op) { switch (op) {
case INDEX_op_goto_ptr: case INDEX_op_goto_ptr:

View file

@ -4140,7 +4140,8 @@ void tcg_expand_vec_op(TCGOpcode opc, TCGType type, unsigned vece,
va_end(va); va_end(va);
} }
static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op) static TCGConstraintSetIndex
tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags)
{ {
switch (op) { switch (op) {
case INDEX_op_goto_ptr: case INDEX_op_goto_ptr:

View file

@ -2583,7 +2583,8 @@ int tcg_can_emit_vec_op(TCGOpcode opc, TCGType type, unsigned vece)
} }
} }
static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op) static TCGConstraintSetIndex
tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags)
{ {
switch (op) { switch (op) {
case INDEX_op_goto_ptr: case INDEX_op_goto_ptr:

View file

@ -3207,7 +3207,8 @@ void tcg_expand_vec_op(TCGOpcode opc, TCGType type, unsigned vece,
va_end(va); va_end(va);
} }
static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op) static TCGConstraintSetIndex
tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags)
{ {
switch (op) { switch (op) {
case INDEX_op_goto_ptr: case INDEX_op_goto_ptr:

View file

@ -1532,7 +1532,8 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc,
} }
} }
static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op) static TCGConstraintSetIndex
tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags)
{ {
switch (op) { switch (op) {
case INDEX_op_goto_ptr: case INDEX_op_goto_ptr:

View file

@ -866,7 +866,7 @@ typedef enum {
#include "tcg-target-con-set.h" #include "tcg-target-con-set.h"
} TCGConstraintSetIndex; } TCGConstraintSetIndex;
static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode); static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode, TCGType, unsigned);
#undef C_O0_I1 #undef C_O0_I1
#undef C_O0_I2 #undef C_O0_I2
@ -3375,7 +3375,7 @@ static const TCGArgConstraint *opcode_args_ct(const TCGOp *op)
return empty_cts; return empty_cts;
} }
con_set = tcg_target_op_def(op->opc); con_set = tcg_target_op_def(op->opc, TCGOP_TYPE(op), TCGOP_FLAGS(op));
tcg_debug_assert(con_set >= 0 && con_set < ARRAY_SIZE(constraint_sets)); tcg_debug_assert(con_set >= 0 && con_set < ARRAY_SIZE(constraint_sets));
/* The constraint arguments must match TCGOpcode arguments. */ /* The constraint arguments must match TCGOpcode arguments. */

View file

@ -36,7 +36,8 @@
#endif #endif
#define TCG_TARGET_CALL_RET_I128 TCG_CALL_RET_NORMAL #define TCG_TARGET_CALL_RET_I128 TCG_CALL_RET_NORMAL
static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op) static TCGConstraintSetIndex
tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags)
{ {
switch (op) { switch (op) {
case INDEX_op_goto_ptr: case INDEX_op_goto_ptr: