Hi Taylor, On 2/8/21 6:46 AM, Taylor Simpson wrote: > Include the generated files and set up the data structures > > Signed-off-by: Taylor Simpson <tsimp...@quicinc.com> > --- > target/hexagon/genptr.h | 25 ++++ > target/hexagon/genptr.c | 331 > ++++++++++++++++++++++++++++++++++++++++++++++++ > 2 files changed, 356 insertions(+) > create mode 100644 target/hexagon/genptr.h > create mode 100644 target/hexagon/genptr.c > > diff --git a/target/hexagon/genptr.h b/target/hexagon/genptr.h > new file mode 100644 > index 0000000..c158005 > --- /dev/null > +++ b/target/hexagon/genptr.h > @@ -0,0 +1,25 @@ > +/* > + * Copyright(c) 2019-2021 Qualcomm Innovation Center, Inc. All Rights > Reserved. > + * > + * This program is free software; you can redistribute it and/or modify > + * it under the terms of the GNU General Public License as published by > + * the Free Software Foundation; either version 2 of the License, or > + * (at your option) any later version. > + * > + * This program is distributed in the hope that it will be useful, > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + * GNU General Public License for more details. > + * > + * You should have received a copy of the GNU General Public License > + * along with this program; if not, see <http://www.gnu.org/licenses/>. > + */ > + > +#ifndef HEXAGON_GENPTR_H > +#define HEXAGON_GENPTR_H > + > +#include "insn.h" > + > +extern const SemanticInsn opcode_genptr[]; > + > +#endif > diff --git a/target/hexagon/genptr.c b/target/hexagon/genptr.c > new file mode 100644 > index 0000000..7481f4c > --- /dev/null > +++ b/target/hexagon/genptr.c > @@ -0,0 +1,331 @@ > +/* > + * Copyright(c) 2019-2021 Qualcomm Innovation Center, Inc. All Rights > Reserved. > + * > + * This program is free software; you can redistribute it and/or modify > + * it under the terms of the GNU General Public License as published by > + * the Free Software Foundation; either version 2 of the License, or > + * (at your option) any later version. > + * > + * This program is distributed in the hope that it will be useful, > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + * GNU General Public License for more details. > + * > + * You should have received a copy of the GNU General Public License > + * along with this program; if not, see <http://www.gnu.org/licenses/>. > + */ > + > +#define QEMU_GENERATE
Maybe move this ... > +#include "qemu/osdep.h" > +#include "qemu/log.h" > +#include "cpu.h" > +#include "internal.h" > +#include "tcg/tcg-op.h" > +#include "insn.h" > +#include "opcodes.h" > +#include "translate.h" ... here with a comment: #define QEMU_GENERATE /* Used internally by macros.h */ > +#include "macros.h" and undef? #undef QEMU_GENERATE > +#include "gen_tcg.h" > + > +static inline TCGv gen_read_preg(TCGv pred, uint8_t num) > +{ > + tcg_gen_mov_tl(pred, hex_pred[num]); > + return pred; > +} > + > +static inline void gen_log_predicated_reg_write(int rnum, TCGv val, int slot) > +{ > + TCGv one = tcg_const_tl(1); > + TCGv zero = tcg_const_tl(0); > + TCGv slot_mask = tcg_temp_new(); > + > + tcg_gen_andi_tl(slot_mask, hex_slot_cancelled, 1 << slot); > + tcg_gen_movcond_tl(TCG_COND_EQ, hex_new_value[rnum], slot_mask, zero, > + val, hex_new_value[rnum]); > +#if HEX_DEBUG Can you declare an 'bool hexagon_debug_enabled(void);' eventually inlined, so we can get this code compiled (to avoid bitroting) using if (hexagon_debug_enabled()) { > + /* Do this so HELPER(debug_commit_end) will know */ > + tcg_gen_movcond_tl(TCG_COND_EQ, hex_reg_written[rnum], slot_mask, zero, > + one, hex_reg_written[rnum]); } > +#endif > + > + tcg_temp_free(one); > + tcg_temp_free(zero); > + tcg_temp_free(slot_mask); > +} Otherwise looks good. Regards, Phil.