[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 08/22] target/loongarch: Add fixed point shift instruction
|
From: |
Song Gao |
|
Subject: |
Re: [PATCH v2 08/22] target/loongarch: Add fixed point shift instruction translation |
|
Date: |
Mon, 26 Jul 2021 19:57:50 +0800 |
|
User-agent: |
Mozilla/5.0 (X11; Linux mips64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 |
Hi, Richard.
On 07/23/2021 08:51 AM, Richard Henderson wrote:
> On 7/20/21 11:53 PM, Song Gao wrote:
>> +/* Fixed point shift operation instruction translation */
>> +static bool trans_sll_w(DisasContext *ctx, arg_sll_w *a)
>> +{
>> + TCGv t0, t1;
>> + TCGv Rd = cpu_gpr[a->rd];
>> +
>> + if (a->rd == 0) {
>> + /* Nop */
>> + return true;
>> + }
>> +
>> + t0 = tcg_temp_new();
>> + t1 = get_gpr(a->rj);
>> +
>> + gen_load_gpr(t0, a->rk);
>> +
>> + tcg_gen_andi_tl(t0, t0, 0x1f);
>> + tcg_gen_shl_tl(t0, t1, t0);
>> + tcg_gen_ext32s_tl(Rd, t0);
>> +
>> + tcg_temp_free(t0);
>> +
>> + return true;
>> +}
>
> Again, you should be using common helper functions for this instead of
> replicating the same pattern 16 times.
>
OK.
Thanks
Song Gao
- [PATCH v2 02/22] target/loongarch: Add CSR registers definition, (continued)
[PATCH v2 08/22] target/loongarch: Add fixed point shift instruction translation, Song Gao, 2021/07/21
[PATCH v2 09/22] target/loongarch: Add fixed point bit instruction translation, Song Gao, 2021/07/21
[PATCH v2 10/22] target/loongarch: Add fixed point load/store instruction translation, Song Gao, 2021/07/21
[PATCH v2 11/22] target/loongarch: Add fixed point atomic instruction translation, Song Gao, 2021/07/21