> -----Original Message----- > From: Richard Henderson <richard.hender...@linaro.org> > Sent: Friday, August 28, 2020 7:58 PM > To: Taylor Simpson <tsimp...@quicinc.com>; qemu-devel@nongnu.org > Cc: phi...@redhat.com; laur...@vivier.eu; riku.voi...@iki.fi; > aleksandar.m.m...@gmail.com; a...@rev.ng > Subject: Re: [RFC PATCH v3 29/34] Hexagon (target/hexagon) TCG > generation > > On 8/18/20 8:50 AM, Taylor Simpson wrote: > > +/* Fill in the table with NULLs because not all the opcodes have > DEF_QEMU */ > > +semantic_insn_t opcode_genptr[] = { > > +#define OPCODE(X) NULL > > +#include "opcodes_def_generated.h" > > + NULL > > +#undef OPCODE > > +}; > > + > > +/* This function overwrites the NULL entries where we have a DEF_QEMU > */ > > +void init_genptr(void) > > +{ > > +#define DEF_TCG_FUNC(TAG, GENFN) \ > > + opcode_genptr[TAG] = generate_##TAG; > > +#include "tcg_funcs_generated.h" > > +#undef DEF_TCG_FUNC > > +} > > Just size the array properly to start. > > const semantic_insn_t opcode_genptr[XX_LAST_OPCODE] = { > > #define DEF_TCG_FUNC(TAG, GENFN) \ > [TAG] = generate_##TAG, > #include "tcg_funcs_generated.h" > > };
OK