[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v15 16/33] target-tilegx: Handle most bit manipu
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH v15 16/33] target-tilegx: Handle most bit manipulation instructions |
Date: |
Fri, 4 Sep 2015 17:51:47 +0100 |
On 3 September 2015 at 02:31, Richard Henderson <address@hidden> wrote:
> The crc instructions are omitted from this set.
>
> Signed-off-by: Richard Henderson <address@hidden>
> ---
> target-tilegx/helper.c | 23 ++++++++++++++++
> target-tilegx/helper.h | 2 ++
> target-tilegx/translate.c | 68
> ++++++++++++++++++++++++++++++++++++++++++++++-
> 3 files changed, 92 insertions(+), 1 deletion(-)
>
> diff --git a/target-tilegx/helper.c b/target-tilegx/helper.c
> index 5b37a8c..9a73edc 100644
> --- a/target-tilegx/helper.c
> +++ b/target-tilegx/helper.c
> @@ -40,6 +40,29 @@ uint64_t helper_cnttz(uint64_t arg)
> return ctz64(arg);
> }
>
> +uint64_t helper_pcnt(uint64_t arg)
> +{
> + return ctpop64(arg);
> +}
> +
> +uint64_t helper_revbits(uint64_t arg)
> +{
> + /* Assign the correct byte position. */
> + arg = bswap64(arg);
> +
> + /* Assign the correct nibble position. */
> + arg = ((arg & 0xf0f0f0f0f0f0f0f0ULL) >> 4)
> + | ((arg & 0x0f0f0f0f0f0f0f0fULL) << 4);
> +
> + /* Assign the correct bit position. */
> + arg = ((arg & 0x8888888888888888ULL) >> 3)
> + | ((arg & 0x4444444444444444ULL) >> 1)
> + | ((arg & 0x2222222222222222ULL) << 1)
> + | ((arg & 0x1111111111111111ULL) << 3);
> +
> + return arg;
> +}
I guess we can create the bitops.h utility function later if you insist...
> +/* Shift the 128-bit value TSRCA:TSRCD riht by the number of bytes
"right"
> + specified by the bottom 3 bits of TSRCB, and set TDEST to the
> + low 64 bits of the resulting value. */
> +static void gen_dblalign(TCGv tdest, TCGv tsrcd, TCGv tsrca, TCGv tsrcb)
Otherwise
Reviewed-by: Peter Maydell <address@hidden>
thanks
-- PMM
- [Qemu-devel] [PATCH v15 05/33] target-tilegx: Modify opcode_tilegx.h to fit QEMU usage, (continued)
- [Qemu-devel] [PATCH v15 05/33] target-tilegx: Modify opcode_tilegx.h to fit QEMU usage, Richard Henderson, 2015/09/02
- [Qemu-devel] [PATCH v15 08/33] target-tilegx: Add special register information from Tilera Corporation, Richard Henderson, 2015/09/02
- [Qemu-devel] [PATCH v15 04/33] target-tilegx: Add opcode basic implementation from Tilera Corporation, Richard Henderson, 2015/09/02
- [Qemu-devel] [PATCH v15 09/33] target-tilegx: Add cpu basic features for linux-user, Richard Henderson, 2015/09/02
- [Qemu-devel] [PATCH v15 13/33] target-tilegx: Add TILE-Gx building files, Richard Henderson, 2015/09/02
- [Qemu-devel] [PATCH v15 10/33] target-tilegx: Add several helpers for instructions translation, Richard Henderson, 2015/09/02
- [Qemu-devel] [PATCH v15 14/33] target-tilegx: Handle simple logical operations, Richard Henderson, 2015/09/02
- [Qemu-devel] [PATCH v15 12/33] target-tilegx: Generate SEGV properly, Richard Henderson, 2015/09/02
- [Qemu-devel] [PATCH v15 16/33] target-tilegx: Handle most bit manipulation instructions, Richard Henderson, 2015/09/02
- Re: [Qemu-devel] [PATCH v15 16/33] target-tilegx: Handle most bit manipulation instructions,
Peter Maydell <=
- [Qemu-devel] [PATCH v15 15/33] target-tilegx: Handle arithmetic instructions, Richard Henderson, 2015/09/02
- [Qemu-devel] [PATCH v15 17/33] target-tilegx: Handle basic load and store instructions, Richard Henderson, 2015/09/02
- [Qemu-devel] [PATCH v15 11/33] target-tilegx: Framework for decoding bundles, Richard Henderson, 2015/09/02
- [Qemu-devel] [PATCH v15 18/33] target-tilegx: Handle post-increment load and store instructions, Richard Henderson, 2015/09/02
- [Qemu-devel] [PATCH v15 19/33] target-tilegx: Handle unconditional jump instructions, Richard Henderson, 2015/09/02
- [Qemu-devel] [PATCH v15 20/33] target-tilegx: Handle conditional branch instructions, Richard Henderson, 2015/09/02
- [Qemu-devel] [PATCH v15 25/33] target-tilegx: Handle conditional move instructions, Richard Henderson, 2015/09/02
- [Qemu-devel] [PATCH v15 21/33] target-tilegx: Handle comparison instructions, Richard Henderson, 2015/09/02
- [Qemu-devel] [PATCH v15 22/33] target-tilegx: Implement system and memory management instructions, Richard Henderson, 2015/09/02