aboutsummaryrefslogtreecommitdiff
path: root/target/loongarch/disas.c
diff options
context:
space:
mode:
authorSong Gao <gaosong@loongson.cn>2023-05-04 20:27:30 +0800
committerSong Gao <gaosong@loongson.cn>2023-05-06 11:19:45 +0800
commit57b4f1ac18871f2f3323bf6fc88e9ae2a1a5d4ec (patch)
treecfcc68f3e3eba632164e63aeeb30f9fee6dc9a2e /target/loongarch/disas.c
parenta3f3db5cda7bf6edf0fc0c94c3aa450eb79a2185 (diff)
downloadqemu-57b4f1ac18871f2f3323bf6fc88e9ae2a1a5d4ec.zip
qemu-57b4f1ac18871f2f3323bf6fc88e9ae2a1a5d4ec.tar.gz
qemu-57b4f1ac18871f2f3323bf6fc88e9ae2a1a5d4ec.tar.bz2
target/loongarch: Implement vadd/vsub
This patch includes: - VADD.{B/H/W/D/Q}; - VSUB.{B/H/W/D/Q}. Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Song Gao <gaosong@loongson.cn> Message-Id: <20230504122810.4094787-5-gaosong@loongson.cn>
Diffstat (limited to 'target/loongarch/disas.c')
-rw-r--r--target/loongarch/disas.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/target/loongarch/disas.c b/target/loongarch/disas.c
index 2e93e77..a5948d7 100644
--- a/target/loongarch/disas.c
+++ b/target/loongarch/disas.c
@@ -784,3 +784,26 @@ PCADD_INSN(pcaddi)
PCADD_INSN(pcalau12i)
PCADD_INSN(pcaddu12i)
PCADD_INSN(pcaddu18i)
+
+#define INSN_LSX(insn, type) \
+static bool trans_##insn(DisasContext *ctx, arg_##type * a) \
+{ \
+ output_##type(ctx, a, #insn); \
+ return true; \
+}
+
+static void output_vvv(DisasContext *ctx, arg_vvv *a, const char *mnemonic)
+{
+ output(ctx, mnemonic, "v%d, v%d, v%d", a->vd, a->vj, a->vk);
+}
+
+INSN_LSX(vadd_b, vvv)
+INSN_LSX(vadd_h, vvv)
+INSN_LSX(vadd_w, vvv)
+INSN_LSX(vadd_d, vvv)
+INSN_LSX(vadd_q, vvv)
+INSN_LSX(vsub_b, vvv)
+INSN_LSX(vsub_h, vvv)
+INSN_LSX(vsub_w, vvv)
+INSN_LSX(vsub_d, vvv)
+INSN_LSX(vsub_q, vvv)