On Sun, Nov 5, 2017 at 3:43 PM, Max Filippov <jcmvb...@gmail.com> wrote:
>> however I think this can be simplified in 1 instr on target supporting
>> deposit32:
>>
>>     tcg_gen_deposit_i32(cpu_R[arg[0]], cpu_R[arg[1]], cpu_R[arg[0]], 16, 16)
>
> arg[1] is an immediate argument, not a register index, so probably not.

Oh, I've got it, replace cpu_R[arg[1]] with a temporary:

TCGv_i32 c = tcg_const_i32(arg[1]);
tcg_gen_deposit_i32(cpu_R[arg[0]], c, cpu_R[arg[0]], 16, 16);
tcg_temp_free(c);

-- 
Thanks.
-- Max

Reply via email to