qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v2 09/22] target/loongarch: Add fixed point bit instruction t


From: Richard Henderson
Subject: Re: [PATCH v2 09/22] target/loongarch: Add fixed point bit instruction translation
Date: Mon, 26 Jul 2021 06:39:02 -1000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0

On 7/26/21 2:22 AM, Song Gao wrote:
Hi, Richard.

On 07/23/2021 09:29 AM, Richard Henderson wrote:
On 7/20/21 11:53 PM, Song Gao wrote:
This patch implement fixed point bit instruction translation.

This includes:
- EXT.W.{B/H}
- CL{O/Z}.{W/D}, CT{O/Z}.{W/D}
- BYTEPICK.{W/D}
- REVB.{2H/4H/2W/D}
- REVH.{2W/D}
- BITREV.{4B/8B}, BITREV.{W/D}
- BSTRINS.{W/D}, BSTRPICK.{W/D}
- MASKEQZ, MASKNEZ

Signed-off-by: Song Gao <gaosong@loongson.cn>
---
   target/loongarch/helper.h     |  10 +
   target/loongarch/insns.decode |  45 +++
   target/loongarch/op_helper.c  | 119 ++++++++
   target/loongarch/trans.inc.c  | 665 
++++++++++++++++++++++++++++++++++++++++++
   4 files changed, 839 insertions(+)

diff --git a/target/loongarch/helper.h b/target/loongarch/helper.h
index 6c7e19b..bbbcc26 100644
--- a/target/loongarch/helper.h
+++ b/target/loongarch/helper.h
@@ -8,3 +8,13 @@
     DEF_HELPER_3(raise_exception_err, noreturn, env, i32, int)
   DEF_HELPER_2(raise_exception, noreturn, env, i32)
+
+DEF_HELPER_2(cto_w, tl, env, tl)
+DEF_HELPER_2(ctz_w, tl, env, tl)
+DEF_HELPER_2(cto_d, tl, env, tl)
+DEF_HELPER_2(ctz_d, tl, env, tl)

The count leading and trailing zero operations are built into tcg.  Count 
leading and trailing one simply needs a NOT operation to convert it to zero.


My understanding is this:
  cto -> NOT operation (tcg_gen_not_tl)  -> ctz,

   is right?

Yes.


r~



reply via email to

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