[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 16/18] target-mips: Use the new extract op
From: |
Yongbok Kim |
Subject: |
Re: [Qemu-devel] [PATCH v2 16/18] target-mips: Use the new extract op |
Date: |
Thu, 27 Oct 2016 13:43:18 +0100 |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 |
On 18/10/2016 16:10, Richard Henderson wrote:
> Use extract for EXT and DEXT.
>
> Signed-off-by: Richard Henderson <address@hidden>
> ---
> target-mips/translate.c | 12 +++++-------
> 1 file changed, 5 insertions(+), 7 deletions(-)
>
> diff --git a/target-mips/translate.c b/target-mips/translate.c
> index d8dde7a..cf79aa4 100644
> --- a/target-mips/translate.c
> +++ b/target-mips/translate.c
> @@ -4484,11 +4484,12 @@ static void gen_bitops (DisasContext *ctx, uint32_t
> opc, int rt,
> if (lsb + msb > 31) {
> goto fail;
> }
> - tcg_gen_shri_tl(t0, t1, lsb);
> if (msb != 31) {
> - tcg_gen_andi_tl(t0, t0, (1U << (msb + 1)) - 1);
> + tcg_gen_extract_tl(t0, t1, lsb, msb + 1);
> } else {
> - tcg_gen_ext32s_tl(t0, t0);
> + /* The two checks together imply that lsb == 0,
> + so this is a simple sign-extension. */
> + tcg_gen_ext32s_tl(t0, t1);
> }
> break;
> #if defined(TARGET_MIPS64)
> @@ -4503,10 +4504,7 @@ static void gen_bitops (DisasContext *ctx, uint32_t
> opc, int rt,
> if (lsb + msb > 63) {
> goto fail;
> }
> - tcg_gen_shri_tl(t0, t1, lsb);
> - if (msb != 63) {
> - tcg_gen_andi_tl(t0, t0, (1ULL << (msb + 1)) - 1);
> - }
> + tcg_gen_extract_tl(t0, t1, lsb, msb + 1);
> break;
> #endif
> case OPC_INS:
>
Reviewed-by: Yongbok Kim <address@hidden>
Regards,
Yongbok
- Re: [Qemu-devel] [PATCH v2 07/18] tcg/i386: Implement field extraction opcodes, (continued)
- [Qemu-devel] [PATCH v2 05/18] tcg/arm: Move isa detection to tcg-target.h, Richard Henderson, 2016/10/18
- [Qemu-devel] [PATCH v2 04/18] tcg/aarch64: Implement field extraction opcodes, Richard Henderson, 2016/10/18
- [Qemu-devel] [PATCH v2 01/18] tcg: Add field extraction primitives, Richard Henderson, 2016/10/18
- [Qemu-devel] [PATCH v2 09/18] tcg/ppc: Implement field extraction opcodes, Richard Henderson, 2016/10/18
- [Qemu-devel] [PATCH v2 06/18] tcg/arm: Implement field extraction opcodes, Richard Henderson, 2016/10/18
- [Qemu-devel] [PATCH v2 10/18] tcg/s390: Expose host facilities to tcg-target.h, Richard Henderson, 2016/10/18
- [Qemu-devel] [PATCH v2 16/18] target-mips: Use the new extract op, Richard Henderson, 2016/10/18
- Re: [Qemu-devel] [PATCH v2 16/18] target-mips: Use the new extract op,
Yongbok Kim <=
- [Qemu-devel] [PATCH v2 14/18] target-arm: Use new deposit and extract ops, Richard Henderson, 2016/10/18
- [Qemu-devel] [PATCH v2 12/18] tcg/s390: Support deposit into zero, Richard Henderson, 2016/10/18
- [Qemu-devel] [PATCH v2 13/18] target-alpha: Use deposit and extract ops, Richard Henderson, 2016/10/18
- [Qemu-devel] [PATCH v2 18/18] target-s390x: Use the new deposit and extract ops, Richard Henderson, 2016/10/18
- [Qemu-devel] [PATCH v2 08/18] tcg/mips: Implement field extraction opcodes, Richard Henderson, 2016/10/18
- [Qemu-devel] [PATCH v2 11/18] tcg/s390: Implement field extraction opcodes, Richard Henderson, 2016/10/18
- [Qemu-devel] [PATCH v2 17/18] target-ppc: Use the new deposit and extract ops, Richard Henderson, 2016/10/18