> -----Original Message----- > From: Alessandro Di Federico <ale.q...@rev.ng> > Sent: Saturday, June 19, 2021 3:37 AM > To: qemu-devel@nongnu.org > Cc: Taylor Simpson <tsimp...@quicinc.com>; Brian Cain > <bc...@quicinc.com>; bab...@rev.ng; ni...@rev.ng; phi...@redhat.com; > richard.hender...@linaro.org; Alessandro Di Federico <a...@rev.ng> > Subject: [PATCH v5 06/14] target/hexagon: introduce new helper functions > > From: Niccolò Izzo <ni...@rev.ng> > > These helpers will be employed by the idef-parser generated code. > > Signed-off-by: Alessandro Di Federico <a...@rev.ng> > Signed-off-by: Niccolò Izzo <ni...@rev.ng> > --- > target/hexagon/genptr.c | 163 > ++++++++++++++++++++++++++++++++++++---- > target/hexagon/genptr.h | 23 ++++++ > target/hexagon/macros.h | 9 +++ > 3 files changed, 180 insertions(+), 15 deletions(-) > > diff --git a/target/hexagon/genptr.c b/target/hexagon/genptr.c index > 6f2816f6e2..cf45c28f58 100644 > --- a/target/hexagon/genptr.c
> +++ b/target/hexagon/genptr.c > +void gen_fbrev(TCGv result, TCGv src) > +{ > + TCGv lo = tcg_temp_new(); > + TCGv tmp1 = tcg_temp_new(); > + TCGv tmp2 = tcg_temp_new(); > + > + /* Bit reversal of low 16 bits */ > + tcg_gen_extract_tl(lo, src, 0, 16); > + tcg_gen_andi_tl(tmp1, lo, 0xaaaa); > + tcg_gen_shri_tl(tmp1, tmp1, 1); > + tcg_gen_andi_tl(tmp2, lo, 0x5555); > + tcg_gen_shli_tl(tmp2, tmp2, 1); > + tcg_gen_or_tl(lo, tmp1, tmp2); > + tcg_gen_andi_tl(tmp1, lo, 0xcccc); > + tcg_gen_shri_tl(tmp1, tmp1, 2); > + tcg_gen_andi_tl(tmp2, lo, 0x3333); > + tcg_gen_shli_tl(tmp2, tmp2, 2); > + tcg_gen_or_tl(lo, tmp1, tmp2); > + tcg_gen_andi_tl(tmp1, lo, 0xf0f0); > + tcg_gen_shri_tl(tmp1, tmp1, 4); > + tcg_gen_andi_tl(tmp2, lo, 0x0f0f); > + tcg_gen_shli_tl(tmp2, tmp2, 4); > + tcg_gen_or_tl(lo, tmp1, tmp2); > + tcg_gen_bswap16_tl(lo, lo); > + > + /* Final tweaks */ > + tcg_gen_deposit_tl(result, src, lo, 0, 16); > + tcg_gen_or_tl(result, result, lo); > + > + tcg_temp_free(lo); > + tcg_temp_free(tmp1); > + tcg_temp_free(tmp2); > +} Remove this function and call gen_helper_fbrev instead. This was feedback from Richard Henderson on one of my previous patch series. Thanks, Taylor