tcg: Massage process_op_defs()
In preparation of introducing paired registers, massage a bit process_op_defs()'s switch case. Signed-off-by: Richard Henderson <richard.henderson@linaro.org> [PMD: Split from bigger patch, 1/3] Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20221219220925.79218-2-philmd@linaro.org>
This commit is contained in:
parent
568e010b89
commit
8940ea0d32
61
tcg/tcg.c
61
tcg/tcg.c
@ -2012,7 +2012,7 @@ static void process_op_defs(TCGContext *s)
|
|||||||
for (op = 0; op < NB_OPS; op++) {
|
for (op = 0; op < NB_OPS; op++) {
|
||||||
TCGOpDef *def = &tcg_op_defs[op];
|
TCGOpDef *def = &tcg_op_defs[op];
|
||||||
const TCGTargetOpDef *tdefs;
|
const TCGTargetOpDef *tdefs;
|
||||||
int i, nb_args;
|
int i, o, nb_args;
|
||||||
|
|
||||||
if (def->flags & TCG_OPF_NOT_PRESENT) {
|
if (def->flags & TCG_OPF_NOT_PRESENT) {
|
||||||
continue;
|
continue;
|
||||||
@ -2034,53 +2034,60 @@ static void process_op_defs(TCGContext *s)
|
|||||||
|
|
||||||
for (i = 0; i < nb_args; i++) {
|
for (i = 0; i < nb_args; i++) {
|
||||||
const char *ct_str = tdefs->args_ct_str[i];
|
const char *ct_str = tdefs->args_ct_str[i];
|
||||||
|
bool input_p = i >= def->nb_oargs;
|
||||||
|
|
||||||
/* Incomplete TCGTargetOpDef entry. */
|
/* Incomplete TCGTargetOpDef entry. */
|
||||||
tcg_debug_assert(ct_str != NULL);
|
tcg_debug_assert(ct_str != NULL);
|
||||||
|
|
||||||
while (*ct_str != '\0') {
|
switch (*ct_str) {
|
||||||
switch(*ct_str) {
|
case '0' ... '9':
|
||||||
case '0' ... '9':
|
o = *ct_str - '0';
|
||||||
{
|
tcg_debug_assert(input_p);
|
||||||
int oarg = *ct_str - '0';
|
tcg_debug_assert(o < def->nb_oargs);
|
||||||
tcg_debug_assert(ct_str == tdefs->args_ct_str[i]);
|
tcg_debug_assert(def->args_ct[o].regs != 0);
|
||||||
tcg_debug_assert(oarg < def->nb_oargs);
|
tcg_debug_assert(!def->args_ct[o].oalias);
|
||||||
tcg_debug_assert(def->args_ct[oarg].regs != 0);
|
def->args_ct[i] = def->args_ct[o];
|
||||||
def->args_ct[i] = def->args_ct[oarg];
|
/* The output sets oalias. */
|
||||||
/* The output sets oalias. */
|
def->args_ct[o].oalias = 1;
|
||||||
def->args_ct[oarg].oalias = true;
|
def->args_ct[o].alias_index = i;
|
||||||
def->args_ct[oarg].alias_index = i;
|
/* The input sets ialias. */
|
||||||
/* The input sets ialias. */
|
def->args_ct[i].ialias = 1;
|
||||||
def->args_ct[i].ialias = true;
|
def->args_ct[i].alias_index = o;
|
||||||
def->args_ct[i].alias_index = oarg;
|
tcg_debug_assert(ct_str[1] == '\0');
|
||||||
}
|
continue;
|
||||||
ct_str++;
|
|
||||||
break;
|
case '&':
|
||||||
case '&':
|
tcg_debug_assert(!input_p);
|
||||||
def->args_ct[i].newreg = true;
|
def->args_ct[i].newreg = true;
|
||||||
ct_str++;
|
ct_str++;
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
do {
|
||||||
|
switch (*ct_str) {
|
||||||
case 'i':
|
case 'i':
|
||||||
def->args_ct[i].ct |= TCG_CT_CONST;
|
def->args_ct[i].ct |= TCG_CT_CONST;
|
||||||
ct_str++;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* Include all of the target-specific constraints. */
|
/* Include all of the target-specific constraints. */
|
||||||
|
|
||||||
#undef CONST
|
#undef CONST
|
||||||
#define CONST(CASE, MASK) \
|
#define CONST(CASE, MASK) \
|
||||||
case CASE: def->args_ct[i].ct |= MASK; ct_str++; break;
|
case CASE: def->args_ct[i].ct |= MASK; break;
|
||||||
#define REGS(CASE, MASK) \
|
#define REGS(CASE, MASK) \
|
||||||
case CASE: def->args_ct[i].regs |= MASK; ct_str++; break;
|
case CASE: def->args_ct[i].regs |= MASK; break;
|
||||||
|
|
||||||
#include "tcg-target-con-str.h"
|
#include "tcg-target-con-str.h"
|
||||||
|
|
||||||
#undef REGS
|
#undef REGS
|
||||||
#undef CONST
|
#undef CONST
|
||||||
default:
|
default:
|
||||||
|
case '0' ... '9':
|
||||||
|
case '&':
|
||||||
/* Typo in TCGTargetOpDef constraint. */
|
/* Typo in TCGTargetOpDef constraint. */
|
||||||
g_assert_not_reached();
|
g_assert_not_reached();
|
||||||
}
|
}
|
||||||
}
|
} while (*++ct_str != '\0');
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TCGTargetOpDef entry with too much information? */
|
/* TCGTargetOpDef entry with too much information? */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user