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


Reply via email to