[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 20/45] target/arm: Implement new VFP fp16 insn VMOVX
From: |
Peter Maydell |
Subject: |
[PATCH v2 20/45] target/arm: Implement new VFP fp16 insn VMOVX |
Date: |
Fri, 28 Aug 2020 19:33:29 +0100 |
The fp16 extension includes a new instruction VMOVX, which copies the
upper 16 bits of a 32-bit source VFP register into the lower 16
bits of the destination and zeroes the high half of the destination.
Implement it.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
---
target/arm/vfp-uncond.decode | 3 +++
target/arm/translate-vfp.c.inc | 25 +++++++++++++++++++++++++
2 files changed, 28 insertions(+)
diff --git a/target/arm/vfp-uncond.decode b/target/arm/vfp-uncond.decode
index 39dc8f6373a..8891ab3d549 100644
--- a/target/arm/vfp-uncond.decode
+++ b/target/arm/vfp-uncond.decode
@@ -75,5 +75,8 @@ VCVT 1111 1110 1.11 11 rm:2 .... 1010 op:1 1.0 .... \
VCVT 1111 1110 1.11 11 rm:2 .... 1011 op:1 1.0 .... \
vm=%vm_dp vd=%vd_sp sz=3
+VMOVX 1111 1110 1.11 0000 .... 1010 01 . 0 .... \
+ vd=%vd_sp vm=%vm_sp
+
VINS 1111 1110 1.11 0000 .... 1010 11 . 0 .... \
vd=%vd_sp vm=%vm_sp
diff --git a/target/arm/translate-vfp.c.inc b/target/arm/translate-vfp.c.inc
index bda3dd25136..4b26156eccc 100644
--- a/target/arm/translate-vfp.c.inc
+++ b/target/arm/translate-vfp.c.inc
@@ -3482,3 +3482,28 @@ static bool trans_VINS(DisasContext *s, arg_VINS *a)
tcg_temp_free_i32(rd);
return true;
}
+
+static bool trans_VMOVX(DisasContext *s, arg_VINS *a)
+{
+ TCGv_i32 rm;
+
+ if (!dc_isar_feature(aa32_fp16_arith, s)) {
+ return false;
+ }
+
+ if (s->vec_len != 0 || s->vec_stride != 0) {
+ return false;
+ }
+
+ if (!vfp_access_check(s)) {
+ return true;
+ }
+
+ /* Set Vd to high half of Vm */
+ rm = tcg_temp_new_i32();
+ neon_load_reg32(rm, a->vm);
+ tcg_gen_shri_i32(rm, rm, 16);
+ neon_store_reg32(rm, a->vd);
+ tcg_temp_free_i32(rm);
+ return true;
+}
--
2.20.1
- Re: [PATCH v2 24/45] target/arm: Implement fp16 for Neon VRECPE, VRSQRTE using gvec, (continued)
[PATCH v2 26/45] target/arm: Implement fp16 for VCEQ, VCGE, VCGT comparisons, Peter Maydell, 2020/08/28
[PATCH v2 25/45] target/arm: Implement fp16 for Neon VABS, VNEG of floats, Peter Maydell, 2020/08/28
[PATCH v2 23/45] target/arm: Implement FP16 for Neon VADD, VSUB, VABD, VMUL, Peter Maydell, 2020/08/28
[PATCH v2 28/45] target/arm: Implement fp16 for Neon VMAX, VMIN, Peter Maydell, 2020/08/28
[PATCH v2 20/45] target/arm: Implement new VFP fp16 insn VMOVX,
Peter Maydell <=
[PATCH v2 27/45] target/arm: Implement fp16 for VACGE, VACGT, Peter Maydell, 2020/08/28
[PATCH v2 29/45] target/arm: Implement fp16 for Neon VMAXNM, VMINNM, Peter Maydell, 2020/08/28
[PATCH v2 31/45] target/arm: Implement fp16 for Neon VFMA, VMFS, Peter Maydell, 2020/08/28
[PATCH v2 30/45] target/arm: Implement fp16 for Neon VMLA, VMLS operations, Peter Maydell, 2020/08/28
[PATCH v2 33/45] target/arm: Implement fp16 for Neon VRECPS, Peter Maydell, 2020/08/28