qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 5/5] target-tricore: Add instructions of RC opco


From: Richard Henderson
Subject: Re: [Qemu-devel] [PATCH 5/5] target-tricore: Add instructions of RC opcode format
Date: Wed, 29 Oct 2014 19:56:12 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0

On 10/29/2014 06:22 AM, Bastian Koppelmann wrote:
> +    } else if (shift_count > 0) {
> +        low = tcg_temp_new();
> +        high = tcg_temp_new();
> +
> +        tcg_gen_andi_tl(low, r1, 0xffff);
> +        tcg_gen_andi_tl(high, r1, 0xffff0000);
> +        tcg_gen_shli_tl(low, low, shift_count);
> +        tcg_gen_shli_tl(ret, high, shift_count);
> +        tcg_gen_deposit_tl(ret, ret, low, 0, 16);

You don't need to mask low here,

> +
> +        tcg_temp_free(low);
> +        tcg_temp_free(high);
> +    } else {
> +        low = tcg_temp_new();
> +        high = tcg_temp_new();
> +
> +        tcg_gen_ext16s_tl(low, r1);
> +        tcg_gen_andi_tl(high, r1, 0xffff0000);
> +        tcg_gen_sari_tl(low, low, -shift_count);
> +        tcg_gen_sari_tl(ret, high, -shift_count);
> +        tcg_gen_deposit_tl(ret, ret, low, 0, 16);

Or high here, since the deposit takes care of that, and you're shifting away
from the mask.


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]