qemu-ppc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 11/12] target/loongarch: Use generic hrev64_i32() in REVB.2H


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH 11/12] target/loongarch: Use generic hrev64_i32() in REVB.2H opcode
Date: Tue, 22 Aug 2023 18:11:17 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.14.0

On 22/8/23 15:30, Philippe Mathieu-Daudé wrote:
On 22/8/23 14:52, Philippe Mathieu-Daudé wrote:
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
  target/loongarch/insn_trans/trans_bit.c.inc | 15 +--------------
  1 file changed, 1 insertion(+), 14 deletions(-)

diff --git a/target/loongarch/insn_trans/trans_bit.c.inc b/target/loongarch/insn_trans/trans_bit.c.inc
index c04806dc21..9d564a0999 100644
--- a/target/loongarch/insn_trans/trans_bit.c.inc
+++ b/target/loongarch/insn_trans/trans_bit.c.inc
@@ -111,19 +111,6 @@ static void gen_revb_2w(TCGv dest, TCGv src1)
      tcg_gen_rotri_i64(dest, dest, 32);
  }
-static void gen_revb_2h(TCGv dest, TCGv src1)
-{
-    TCGv mask = tcg_constant_tl(0x00FF00FF);
-    TCGv t0 = tcg_temp_new();
-    TCGv t1 = tcg_temp_new();
-
-    tcg_gen_shri_tl(t0, src1, 8);
-    tcg_gen_and_tl(t0, t0, mask);
-    tcg_gen_and_tl(t1, src1, mask);
-    tcg_gen_shli_tl(t1, t1, 8);

Looking at https://loongson.github.io/LoongArch-Documentation/LoongArch-Vol1-EN.html#_revb_2h4h2wd
the sign extension is missing, so the next line:

-    tcg_gen_or_tl(dest, t0, t1);

should be replaced by smth like:

        tcg_gen_or_tl(t0, t0, t1);
        tcg_gen_ext32s_tl(dest, t0);

-}




reply via email to

[Prev in Thread] Current Thread [Next in Thread]