[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH RESEND v5 33/57] target/loognarch: Implement xvldi
From: |
Song Gao |
Subject: |
[PATCH RESEND v5 33/57] target/loognarch: Implement xvldi |
Date: |
Thu, 7 Sep 2023 16:31:34 +0800 |
This patch includes:
- XVLDI.
Signed-off-by: Song Gao <gaosong@loongson.cn>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
---
target/loongarch/insns.decode | 2 ++
target/loongarch/disas.c | 7 +++++++
target/loongarch/insn_trans/trans_vec.c.inc | 13 ++++++-------
3 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/target/loongarch/insns.decode b/target/loongarch/insns.decode
index 6a161d6d20..edaa756395 100644
--- a/target/loongarch/insns.decode
+++ b/target/loongarch/insns.decode
@@ -1605,6 +1605,8 @@ xvmskltz_d 0111 01101001 11000 10011 ..... .....
@vv
xvmskgez_b 0111 01101001 11000 10100 ..... ..... @vv
xvmsknz_b 0111 01101001 11000 11000 ..... ..... @vv
+xvldi 0111 01111110 00 ............. ..... @v_i13
+
xvreplgr2vr_b 0111 01101001 11110 00000 ..... ..... @vr
xvreplgr2vr_h 0111 01101001 11110 00001 ..... ..... @vr
xvreplgr2vr_w 0111 01101001 11110 00010 ..... ..... @vr
diff --git a/target/loongarch/disas.c b/target/loongarch/disas.c
index 05710098ad..3f6fbeddd7 100644
--- a/target/loongarch/disas.c
+++ b/target/loongarch/disas.c
@@ -1703,6 +1703,11 @@ static bool trans_##insn(DisasContext *ctx, arg_##type *
a) \
return true; \
}
+static void output_v_i_x(DisasContext *ctx, arg_v_i *a, const char *mnemonic)
+{
+ output(ctx, mnemonic, "x%d, 0x%x", a->vd, a->imm);
+}
+
static void output_vvv_x(DisasContext *ctx, arg_vvv * a, const char *mnemonic)
{
output(ctx, mnemonic, "x%d, x%d, x%d", a->vd, a->vj, a->vk);
@@ -2022,6 +2027,8 @@ INSN_LASX(xvmskltz_d, vv)
INSN_LASX(xvmskgez_b, vv)
INSN_LASX(xvmsknz_b, vv)
+INSN_LASX(xvldi, v_i)
+
INSN_LASX(xvreplgr2vr_b, vr)
INSN_LASX(xvreplgr2vr_h, vr)
INSN_LASX(xvreplgr2vr_w, vr)
diff --git a/target/loongarch/insn_trans/trans_vec.c.inc
b/target/loongarch/insn_trans/trans_vec.c.inc
index b889b6c966..5dc7fdb47e 100644
--- a/target/loongarch/insn_trans/trans_vec.c.inc
+++ b/target/loongarch/insn_trans/trans_vec.c.inc
@@ -3606,16 +3606,12 @@ static uint64_t vldi_get_value(DisasContext *ctx,
uint32_t imm)
return data;
}
-static bool trans_vldi(DisasContext *ctx, arg_vldi *a)
+static bool gen_vldi(DisasContext *ctx, arg_vldi *a, uint32_t oprsz)
{
int sel, vece;
uint64_t value;
- if (!avail_LSX(ctx)) {
- return false;
- }
-
- if (!check_vec(ctx, 16)) {
+ if (!check_vec(ctx, oprsz)) {
return true;
}
@@ -3629,11 +3625,14 @@ static bool trans_vldi(DisasContext *ctx, arg_vldi *a)
vece = (a->imm >> 10) & 0x3;
}
- tcg_gen_gvec_dup_i64(vece, vec_full_offset(a->vd), 16, ctx->vl/8,
+ tcg_gen_gvec_dup_i64(vece, vec_full_offset(a->vd), oprsz, ctx->vl/8,
tcg_constant_i64(value));
return true;
}
+TRANS(vldi, LSX, gen_vldi, 16)
+TRANS(xvldi, LASX, gen_vldi, 32)
+
TRANS(vand_v, LSX, gvec_vvv, MO_64, tcg_gen_gvec_and)
TRANS(vor_v, LSX, gvec_vvv, MO_64, tcg_gen_gvec_or)
TRANS(vxor_v, LSX, gvec_vvv, MO_64, tcg_gen_gvec_xor)
--
2.39.1
- [PATCH RESEND v5 17/57] target/loongarch: Implement xvneg, (continued)
- [PATCH RESEND v5 17/57] target/loongarch: Implement xvneg, Song Gao, 2023/09/07
- [PATCH RESEND v5 25/57] target/loongarch: Implement xvmul/xvmuh/xvmulw{ev/od}, Song Gao, 2023/09/07
- [PATCH RESEND v5 27/57] target/loongarch; Implement xvdiv/xvmod, Song Gao, 2023/09/07
- [PATCH RESEND v5 28/57] target/loongarch: Implement xvsat, Song Gao, 2023/09/07
- [PATCH RESEND v5 29/57] target/loongarch: Implement xvexth, Song Gao, 2023/09/07
- [PATCH RESEND v5 30/57] target/loongarch: Implement vext2xv, Song Gao, 2023/09/07
- [PATCH RESEND v5 32/57] target/loongarch: Implement xvmskltz/xvmskgez/xvmsknz, Song Gao, 2023/09/07
- [PATCH RESEND v5 37/57] target/loongarch: Implement xvsrlr xvsrar, Song Gao, 2023/09/07
- [PATCH RESEND v5 36/57] target/loongarch: Implement xvsllwil xvextl, Song Gao, 2023/09/07
- [PATCH RESEND v5 33/57] target/loognarch: Implement xvldi,
Song Gao <=
- [PATCH RESEND v5 35/57] target/loongarch: Implement xvsll xvsrl xvsra xvrotr, Song Gao, 2023/09/07
- [PATCH RESEND v5 34/57] target/loongarch: Implement LASX logic instructions, Song Gao, 2023/09/07
- [PATCH RESEND v5 39/57] target/loongarch: Implement xvsrlrn xvsrarn, Song Gao, 2023/09/07
- [PATCH RESEND v5 38/57] target/loongarch: Implement xvsrln xvsran, Song Gao, 2023/09/07
- [PATCH RESEND v5 42/57] target/loongarch: Implement xvclo xvclz, Song Gao, 2023/09/07
- [PATCH RESEND v5 46/57] target/loongarch: Implement LASX fpu arith instructions, Song Gao, 2023/09/07
- [PATCH RESEND v5 41/57] target/loongarch: Implement xvssrlrn xvssrarn, Song Gao, 2023/09/07
- [PATCH RESEND v5 40/57] target/loongarch: Implement xvssrln xvssran, Song Gao, 2023/09/07