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 <gaos...@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~