[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 18/22] target/loongarch: Add branch instruction translatio
|
From: |
Song Gao |
|
Subject: |
Re: [PATCH v2 18/22] target/loongarch: Add branch instruction translation |
|
Date: |
Tue, 27 Jul 2021 16:07:53 +0800 |
|
User-agent: |
Mozilla/5.0 (X11; Linux mips64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 |
Hi, Richard.
On 07/23/2021 02:38 PM, Richard Henderson wrote:
> On 7/20/21 11:53 PM, Song Gao wrote:
>> +/* Branch Instructions translation */
>> +static bool trans_beqz(DisasContext *ctx, arg_beqz *a)
>> +{
>> + TCGv t0, t1;
>> + int bcond_flag = 0;
>> +
>> + t0 = tcg_temp_new();
>> + t1 = tcg_const_i64(0);
>> +
>> + if (a->rj != 0) {
>> + gen_load_gpr(t0, a->rj);
>> + bcond_flag = 1;
>> + }
>> +
>> + if (bcond_flag == 0) {
>> + ctx->hflags |= LOONGARCH_HFLAG_B;
>> + } else {
>> + tcg_gen_setcond_tl(TCG_COND_EQ, bcond, t0, t1);
>> + ctx->hflags |= LOONGARCH_HFLAG_BC;
>> + }
>> + ctx->btarget = ctx->base.pc_next + (a->offs21 << 2);
>> +
>> + tcg_temp_free(t0);
>> + tcg_temp_free(t1);
>> +
>> + return true;
>> +}
>
> Drop all of the branch delay slot stuff.
> Use a common routine and pass in the TCGCond.
>
OK>
> r~
Thanks
Song Gao.
- Re: [PATCH v2 15/22] target/loongarch: Add floating point conversion instruction translation, (continued)
- [PATCH v2 14/22] target/loongarch: Add floating point comparison instruction translation, Song Gao, 2021/07/21
- [PATCH v2 16/22] target/loongarch: Add floating point move instruction translation, Song Gao, 2021/07/21
- [PATCH v2 18/22] target/loongarch: Add branch instruction translation, Song Gao, 2021/07/21
- [PATCH v2 17/22] target/loongarch: Add floating point load/store instruction translation, Song Gao, 2021/07/21
- [PATCH v2 19/22] target/loongarch: Add disassembler, Song Gao, 2021/07/21
- [PATCH v2 22/22] target/loongarch: Add target build suport, Song Gao, 2021/07/21
- [PATCH v2 20/22] LoongArch Linux User Emulation, Song Gao, 2021/07/21
- [PATCH v2 21/22] configs: Add loongarch linux-user config, Song Gao, 2021/07/21
- [PATCH v2 05/22] target/loongarch: Add memory management support, Song Gao, 2021/07/21