On 8/18/20 8:50 AM, Taylor Simpson wrote: > +#define DECL_REG(NAME, NUM, X, OFF) \ > + TCGv NAME = tcg_temp_local_new(); \ > + int NUM = REGNO(X) + OFF > + > +#define DECL_REG_WRITABLE(NAME, NUM, X, OFF) \ > + TCGv NAME = tcg_temp_local_new(); \ > + int NUM = REGNO(X) + OFF; \ > + do { \ > + int is_predicated = GET_ATTRIB(insn->opcode, A_CONDEXEC); \ > + if (is_predicated && !is_preloaded(ctx, NUM)) { \ > + tcg_gen_mov_tl(hex_new_value[NUM], hex_gpr[NUM]); \ > + } \ > + } while (0) > +/* > + * For read-only temps, avoid allocating and freeing > + */ > +#define DECL_REG_READONLY(NAME, NUM, X, OFF) \ > + TCGv NAME; \ > + int NUM = REGNO(X) + OFF > + > +#define DECL_RREG_d(NAME, NUM, X, OFF) \ > + DECL_REG_WRITABLE(NAME, NUM, X, OFF) > +#define DECL_RREG_e(NAME, NUM, X, OFF) \ > + DECL_REG(NAME, NUM, X, OFF)
Is there a good reason for all these macros? Why not just bake this knowledge into gen_tcg_funcs.py? Seems like it would be just a couple of functions... At present, both this and the intermediary files are unreadable. One has to pass genptr.c through -E and indent to see what's going on. r~