[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [PATCH v5 06/14] target/hexagon: introduce new helper functions
From: |
Taylor Simpson |
Subject: |
RE: [PATCH v5 06/14] target/hexagon: introduce new helper functions |
Date: |
Wed, 23 Jun 2021 12:05:00 +0000 |
> -----Original Message-----
> From: Alessandro Di Federico <ale.qemu@rev.ng>
> Sent: Saturday, June 19, 2021 3:37 AM
> To: qemu-devel@nongnu.org
> Cc: Taylor Simpson <tsimpson@quicinc.com>; Brian Cain
> <bcain@quicinc.com>; babush@rev.ng; nizzo@rev.ng; philmd@redhat.com;
> richard.henderson@linaro.org; Alessandro Di Federico <ale@rev.ng>
> Subject: [PATCH v5 06/14] target/hexagon: introduce new helper functions
>
> From: Niccolò Izzo <nizzo@rev.ng>
>
> These helpers will be employed by the idef-parser generated code.
>
> Signed-off-by: Alessandro Di Federico <ale@rev.ng>
> Signed-off-by: Niccolò Izzo <nizzo@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
- [PATCH v5 00/14] target/hexagon: introduce idef-parser, Alessandro Di Federico, 2021/06/19
- [PATCH v5 01/14] tcg: expose TCGCond manipulation routines, Alessandro Di Federico, 2021/06/19
- [PATCH v5 05/14] target/hexagon: make helper functions non-static, Alessandro Di Federico, 2021/06/19
- [PATCH v5 04/14] target/hexagon: make slot number an unsigned, Alessandro Di Federico, 2021/06/19
- [PATCH v5 06/14] target/hexagon: introduce new helper functions, Alessandro Di Federico, 2021/06/19
- [PATCH v5 02/14] target/hexagon: update MAINTAINERS for idef-parser, Alessandro Di Federico, 2021/06/19
- [PATCH v5 07/14] target/hexagon: expose next PC in DisasContext, Alessandro Di Federico, 2021/06/19
- [PATCH v5 08/14] target/hexagon: prepare input for the idef-parser, Alessandro Di Federico, 2021/06/19
- [PATCH v5 09/14] target/hexagon: import lexer for idef-parser, Alessandro Di Federico, 2021/06/19
- [PATCH v5 03/14] target/hexagon: import README for idef-parser, Alessandro Di Federico, 2021/06/19