On 07/31/2018 02:58 PM, Richard Henderson wrote:
> On 07/30/2018 12:12 PM, Aleksandar Markovic wrote:
>> + switch (extract32(ctx->opcode, 12, 1)) {
>> + case 0:
>> + /* NM_SHRA_QB */
>> + check_dspr2(ctx);
>> + gen_helper_shra_qb(cpu_gpr[ret], t0, v1_t);
> More unprotected use of cpu_gpr[0].
>
> I think you need some sort of solution that prevents this completely, without
> having to think about it. E.g. global replace cpu_gpr[x] -> read_gpr(ctx, x)
> /
> dest_gpr(ctx, x), where the two functions allocate tcg temporaries on demand.
I forgot to say... and then poison cpu_gpr so that uses cannot creep back into
the codebase. See e.g. include/exec/poison.h.
r~