[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 19/45] target/arm: Implement new VFP fp16 insn VINS
From: |
Peter Maydell |
Subject: |
[PATCH v2 19/45] target/arm: Implement new VFP fp16 insn VINS |
Date: |
Fri, 28 Aug 2020 19:33:28 +0100 |
The fp16 extension includes a new instruction VINS, which copies the
lower 16 bits of a 32-bit source VFP register into the upper 16 bits
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 | 28 ++++++++++++++++++++++++++++
2 files changed, 31 insertions(+)
diff --git a/target/arm/vfp-uncond.decode b/target/arm/vfp-uncond.decode
index 9615544623a..39dc8f6373a 100644
--- a/target/arm/vfp-uncond.decode
+++ b/target/arm/vfp-uncond.decode
@@ -74,3 +74,6 @@ VCVT 1111 1110 1.11 11 rm:2 .... 1010 op:1 1.0 .... \
vm=%vm_sp vd=%vd_sp sz=2
VCVT 1111 1110 1.11 11 rm:2 .... 1011 op:1 1.0 .... \
vm=%vm_dp vd=%vd_sp sz=3
+
+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 7ce044fa896..bda3dd25136 100644
--- a/target/arm/translate-vfp.c.inc
+++ b/target/arm/translate-vfp.c.inc
@@ -3454,3 +3454,31 @@ static bool trans_NOCP(DisasContext *s, arg_NOCP *a)
return false;
}
+
+static bool trans_VINS(DisasContext *s, arg_VINS *a)
+{
+ TCGv_i32 rd, 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;
+ }
+
+ /* Insert low half of Vm into high half of Vd */
+ rm = tcg_temp_new_i32();
+ rd = tcg_temp_new_i32();
+ neon_load_reg32(rm, a->vm);
+ neon_load_reg32(rd, a->vd);
+ tcg_gen_deposit_i32(rd, rd, rm, 16, 16);
+ neon_store_reg32(rd, a->vd);
+ tcg_temp_free_i32(rm);
+ tcg_temp_free_i32(rd);
+ return true;
+}
--
2.20.1
- [PATCH v2 08/45] target/arm: Implement VFP fp16 for VABS, VNEG, VSQRT, (continued)
- [PATCH v2 08/45] target/arm: Implement VFP fp16 for VABS, VNEG, VSQRT, Peter Maydell, 2020/08/28
- [PATCH v2 12/45] target/arm: Implement VFP fp16 VCVT between float and integer, Peter Maydell, 2020/08/28
- [PATCH v2 13/45] target/arm: Make VFP_CONV_FIX macros take separate float type and float size, Peter Maydell, 2020/08/28
- [PATCH v2 11/45] target/arm: Implement VFP fp16 VLDR and VSTR, Peter Maydell, 2020/08/28
- [PATCH v2 14/45] target/arm: Use macros instead of open-coding fp16 conversion helpers, Peter Maydell, 2020/08/28
- [PATCH v2 15/45] target/arm: Implement VFP fp16 VCVT between float and fixed-point, Peter Maydell, 2020/08/28
- [PATCH v2 16/45] target/arm: Implement VFP vp16 VCVT-with-specified-rounding-mode, Peter Maydell, 2020/08/28
- [PATCH v2 18/45] target/arm: Implement VFP fp16 VRINT*, Peter Maydell, 2020/08/28
- [PATCH v2 21/45] target/arm: Implement VFP fp16 VMOV between gp and halfprec registers, Peter Maydell, 2020/08/28
- [PATCH v2 17/45] target/arm: Implement VFP fp16 VSEL, Peter Maydell, 2020/08/28
- [PATCH v2 19/45] target/arm: Implement new VFP fp16 insn VINS,
Peter Maydell <=
- [PATCH v2 22/45] fpu: Add float16 comparison functions, Peter Maydell, 2020/08/28
- [PATCH v2 24/45] target/arm: Implement fp16 for Neon VRECPE, VRSQRTE using gvec, Peter Maydell, 2020/08/28
- Re: [PATCH v2 24/45] target/arm: Implement fp16 for Neon VRECPE, VRSQRTE using gvec, Richard Henderson, 2020/08/28
- Re: [PATCH v2 24/45] target/arm: Implement fp16 for Neon VRECPE, VRSQRTE using gvec, Peter Maydell, 2020/08/28
- Re: [PATCH v2 24/45] target/arm: Implement fp16 for Neon VRECPE, VRSQRTE using gvec, Richard Henderson, 2020/08/28
- Re: [PATCH v2 24/45] target/arm: Implement fp16 for Neon VRECPE, VRSQRTE using gvec, Peter Maydell, 2020/08/29
- Re: [PATCH v2 24/45] target/arm: Implement fp16 for Neon VRECPE, VRSQRTE using gvec, Richard Henderson, 2020/08/29
[PATCH v2 26/45] target/arm: Implement fp16 for VCEQ, VCGE, VCGT comparisons, Peter Maydell, 2020/08/28