diff options
author | Richard Henderson <rth@twiddle.net> | 2016-11-18 11:50:59 +0100 |
---|---|---|
committer | Richard Henderson <rth@twiddle.net> | 2017-01-10 08:06:11 -0800 |
commit | 069ea736b50b75fdec99c9b8cc603b97bd98419e (patch) | |
tree | c2d717658df79279163c7c333aa1c4b3e043c1f5 /tcg/tcg.c | |
parent | f69d277ece43c42c7ab0144c2ff05ba740f6706b (diff) |
tcg: Pass the opcode width to target_parse_constraint
This will let us choose how to interpret a given constraint
depending on whether the opcode is 32- or 64-bit. Which will
let us share more constraint combinations between opcodes.
At the same time, change the interface to return the advanced
pointer instead of passing it in/out by reference.
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <rth@twiddle.net>
Diffstat (limited to 'tcg/tcg.c')
-rw-r--r-- | tcg/tcg.c | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -96,7 +96,8 @@ static void tcg_register_jit_int(void *buf, size_t size, __attribute__((unused)); /* Forward declarations for functions declared and used in tcg-target.inc.c. */ -static int target_parse_constraint(TCGArgConstraint *ct, const char **pct_str); +static const char *target_parse_constraint(TCGArgConstraint *ct, + const char *ct_str, TCGType type); static void tcg_out_ld(TCGContext *s, TCGType type, TCGReg ret, TCGReg arg1, intptr_t arg2); static void tcg_out_mov(TCGContext *s, TCGType type, TCGReg ret, TCGReg arg); @@ -1231,7 +1232,8 @@ static void process_op_defs(TCGContext *s) for (op = 0; op < NB_OPS; op++) { TCGOpDef *def = &tcg_op_defs[op]; const TCGTargetOpDef *tdefs; - int i, nb_args, ok; + TCGType type; + int i, nb_args; if (def->flags & TCG_OPF_NOT_PRESENT) { continue; @@ -1246,6 +1248,7 @@ static void process_op_defs(TCGContext *s) /* Missing TCGTargetOpDef entry. */ tcg_debug_assert(tdefs != NULL); + type = (def->flags & TCG_OPF_64BIT ? TCG_TYPE_I64 : TCG_TYPE_I32); for (i = 0; i < nb_args; i++) { const char *ct_str = tdefs->args_ct_str[i]; /* Incomplete TCGTargetOpDef entry. */ @@ -1279,9 +1282,10 @@ static void process_op_defs(TCGContext *s) ct_str++; break; default: - ok = target_parse_constraint(&def->args_ct[i], &ct_str); + ct_str = target_parse_constraint(&def->args_ct[i], + ct_str, type); /* Typo in TCGTargetOpDef constraint. */ - tcg_debug_assert(ok == 0); + tcg_debug_assert(ct_str != NULL); } } } |