qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] target/loongarch: LL.{W/D} need writes val to dest register after sign extension
@ 2023-02-02  3:16 Song Gao
  2023-02-02  5:51 ` Richard Henderson
  0 siblings, 1 reply; 3+ messages in thread
From: Song Gao @ 2023-02-02  3:16 UTC (permalink / raw)
  To: qemu-devel; +Cc: richard.henderson, maobibo, qiaochong, yangxiaojuan

The Manual 2.2.7.2:
    'The LL.{W/D} instruction retrieves a word/double-word data from
    the specified address of the memory and writes it to the general
    register rd after sign extension.'

Signed-off-by: Song Gao <gaosong@loongson.cn>
---
 target/loongarch/insn_trans/trans_atomic.c.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/loongarch/insn_trans/trans_atomic.c.inc b/target/loongarch/insn_trans/trans_atomic.c.inc
index 6763c1c301..24fea558d6 100644
--- a/target/loongarch/insn_trans/trans_atomic.c.inc
+++ b/target/loongarch/insn_trans/trans_atomic.c.inc
@@ -12,8 +12,8 @@ static bool gen_ll(DisasContext *ctx, arg_rr_i *a, MemOp mop)
     tcg_gen_addi_tl(t0, src1, a->imm);
     tcg_gen_qemu_ld_i64(dest, t0, ctx->mem_idx, mop);
     tcg_gen_st_tl(t0, cpu_env, offsetof(CPULoongArchState, lladdr));
+    gen_set_gpr(a->rd, dest, EXT_SIGN);
     tcg_gen_st_tl(dest, cpu_env, offsetof(CPULoongArchState, llval));
-    gen_set_gpr(a->rd, dest, EXT_NONE);
     tcg_temp_free(t0);
 
     return true;
-- 
2.31.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] target/loongarch: LL.{W/D} need writes val to dest register after sign extension
  2023-02-02  3:16 [PATCH 1/1] target/loongarch: LL.{W/D} need writes val to dest register after sign extension Song Gao
@ 2023-02-02  5:51 ` Richard Henderson
  2023-02-03  7:42   ` gaosong
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Henderson @ 2023-02-02  5:51 UTC (permalink / raw)
  To: Song Gao, qemu-devel; +Cc: maobibo, qiaochong, yangxiaojuan

On 2/1/23 17:16, Song Gao wrote:
> The Manual 2.2.7.2:
>      'The LL.{W/D} instruction retrieves a word/double-word data from
>      the specified address of the memory and writes it to the general
>      register rd after sign extension.'
> 
> Signed-off-by: Song Gao <gaosong@loongson.cn>
> ---
>   target/loongarch/insn_trans/trans_atomic.c.inc | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)

The sign-extension is provided by

TRANS(ll_w, gen_ll, MO_TESL)
                     ^^^^^^^
this.

So what's the issue?


r~

> 
> diff --git a/target/loongarch/insn_trans/trans_atomic.c.inc b/target/loongarch/insn_trans/trans_atomic.c.inc
> index 6763c1c301..24fea558d6 100644
> --- a/target/loongarch/insn_trans/trans_atomic.c.inc
> +++ b/target/loongarch/insn_trans/trans_atomic.c.inc
> @@ -12,8 +12,8 @@ static bool gen_ll(DisasContext *ctx, arg_rr_i *a, MemOp mop)
>       tcg_gen_addi_tl(t0, src1, a->imm);
>       tcg_gen_qemu_ld_i64(dest, t0, ctx->mem_idx, mop);
>       tcg_gen_st_tl(t0, cpu_env, offsetof(CPULoongArchState, lladdr));
> +    gen_set_gpr(a->rd, dest, EXT_SIGN);
>       tcg_gen_st_tl(dest, cpu_env, offsetof(CPULoongArchState, llval));
> -    gen_set_gpr(a->rd, dest, EXT_NONE);
>       tcg_temp_free(t0);
>   
>       return true;



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] target/loongarch: LL.{W/D} need writes val to dest register after sign extension
  2023-02-02  5:51 ` Richard Henderson
@ 2023-02-03  7:42   ` gaosong
  0 siblings, 0 replies; 3+ messages in thread
From: gaosong @ 2023-02-03  7:42 UTC (permalink / raw)
  To: Richard Henderson, qemu-devel; +Cc: maobibo, qiaochong, yangxiaojuan


在 2023/2/2 下午1:51, Richard Henderson 写道:
> On 2/1/23 17:16, Song Gao wrote:
>> The Manual 2.2.7.2:
>>      'The LL.{W/D} instruction retrieves a word/double-word data from
>>      the specified address of the memory and writes it to the general
>>      register rd after sign extension.'
>>
>> Signed-off-by: Song Gao <gaosong@loongson.cn>
>> ---
>>   target/loongarch/insn_trans/trans_atomic.c.inc | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> The sign-extension is provided by
>
> TRANS(ll_w, gen_ll, MO_TESL)
>                     ^^^^^^^
> this.
>
> So what's the issue?
>
Sorry for the late reply.
It's our other code problem,  you can ignore this patch :-)

Thanks
Song Gao
> r~
>
>>
>> diff --git a/target/loongarch/insn_trans/trans_atomic.c.inc 
>> b/target/loongarch/insn_trans/trans_atomic.c.inc
>> index 6763c1c301..24fea558d6 100644
>> --- a/target/loongarch/insn_trans/trans_atomic.c.inc
>> +++ b/target/loongarch/insn_trans/trans_atomic.c.inc
>> @@ -12,8 +12,8 @@ static bool gen_ll(DisasContext *ctx, arg_rr_i *a, 
>> MemOp mop)
>>       tcg_gen_addi_tl(t0, src1, a->imm);
>>       tcg_gen_qemu_ld_i64(dest, t0, ctx->mem_idx, mop);
>>       tcg_gen_st_tl(t0, cpu_env, offsetof(CPULoongArchState, lladdr));
>> +    gen_set_gpr(a->rd, dest, EXT_SIGN);
>>       tcg_gen_st_tl(dest, cpu_env, offsetof(CPULoongArchState, llval));
>> -    gen_set_gpr(a->rd, dest, EXT_NONE);
>>       tcg_temp_free(t0);
>>         return true;



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-02-03  7:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-02  3:16 [PATCH 1/1] target/loongarch: LL.{W/D} need writes val to dest register after sign extension Song Gao
2023-02-02  5:51 ` Richard Henderson
2023-02-03  7:42   ` gaosong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).