[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 11/22] target/loongarch: Add fixed point atomic instructio
From: |
Song Gao |
Subject: |
Re: [PATCH v2 11/22] target/loongarch: Add fixed point atomic instruction translation |
Date: |
Mon, 26 Jul 2021 20:25:54 +0800 |
User-agent: |
Mozilla/5.0 (X11; Linux mips64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 |
Hi, Richard.
On 07/23/2021 09:49 AM, Richard Henderson wrote:
> On 7/20/21 11:53 PM, Song Gao wrote:
>> +#define TRANS_AM_W(name, op) \
>> +static bool trans_ ## name(DisasContext *ctx, arg_ ## name * a) \
>> +{ \
>> + TCGv addr, val, ret; \
>> + TCGv Rd = cpu_gpr[a->rd]; \
>> + int mem_idx = ctx->mem_idx; \
>> + \
>> + if (a->rd == 0) { \
>> + return true; \
>> + } \
>> + if ((a->rd != 0) && ((a->rj == a->rd) || (a->rk == a->rd))) { \
>> + printf("%s: warning, register equal\n", __func__); \
>> + return false; \
>> + } \
>> + \
>> + addr = get_gpr(a->rj); \
>> + val = get_gpr(a->rk); \
>> + ret = tcg_temp_new(); \
>> + \
>> + tcg_gen_atomic_##op##_tl(ret, addr, val, mem_idx, MO_TESL | \
>> + ctx->default_tcg_memop_mask); \
>> + tcg_gen_mov_tl(Rd, ret); \
>> + \
>> + tcg_temp_free(ret); \
>> + \
>> + return true; \
>> +}
>
> No printf. Use a common routine instead of macros.
>
OK.
Thanks
Song Gao.
>
> r~
- Re: [PATCH v2 09/22] target/loongarch: Add fixed point bit instruction translation, (continued)
[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
[PATCH v2 12/22] target/loongarch: Add fixed point extra instruction translation, Song Gao, 2021/07/21
[PATCH v2 13/22] target/loongarch: Add floating point arithmetic instruction translation, Song Gao, 2021/07/21