summaryrefslogtreecommitdiffstats
path: root/target/arm/translate-mve.c
diff options
context:
space:
mode:
authorPeter Maydell2021-06-17 14:15:54 +0200
committerPeter Maydell2021-06-21 18:12:50 +0200
commitab59362fca0c23fbd21daceb78d6b2966fbf9793 (patch)
tree02154d0f82e9f8b5a778763c3d83f4bb351b5cad /target/arm/translate-mve.c
parenttcg: Make gen_dup_i32/i64() public as tcg_gen_dup_i32/i64 (diff)
downloadqemu-ab59362fca0c23fbd21daceb78d6b2966fbf9793.tar.gz
qemu-ab59362fca0c23fbd21daceb78d6b2966fbf9793.tar.xz
qemu-ab59362fca0c23fbd21daceb78d6b2966fbf9793.zip
target/arm: Implement MVE VDUP
Implement the MVE VDUP insn, which duplicates a value from a general-purpose register into every lane of a vector register (subject to predication). Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20210617121628.20116-11-peter.maydell@linaro.org
Diffstat (limited to 'target/arm/translate-mve.c')
-rw-r--r--target/arm/translate-mve.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/target/arm/translate-mve.c b/target/arm/translate-mve.c
index ad2e4af284..3714be7f8d 100644
--- a/target/arm/translate-mve.c
+++ b/target/arm/translate-mve.c
@@ -162,6 +162,33 @@ DO_VLDST_WIDE_NARROW(VLDSTB_H, vldrb_sh, vldrb_uh, vstrb_h)
DO_VLDST_WIDE_NARROW(VLDSTB_W, vldrb_sw, vldrb_uw, vstrb_w)
DO_VLDST_WIDE_NARROW(VLDSTH_W, vldrh_sw, vldrh_uw, vstrh_w)
+static bool trans_VDUP(DisasContext *s, arg_VDUP *a)
+{
+ TCGv_ptr qd;
+ TCGv_i32 rt;
+
+ if (!dc_isar_feature(aa32_mve, s) ||
+ !mve_check_qreg_bank(s, a->qd)) {
+ return false;
+ }
+ if (a->rt == 13 || a->rt == 15) {
+ /* UNPREDICTABLE; we choose to UNDEF */
+ return false;
+ }
+ if (!mve_eci_check(s) || !vfp_access_check(s)) {
+ return true;
+ }
+
+ qd = mve_qreg_ptr(a->qd);
+ rt = load_reg(s, a->rt);
+ tcg_gen_dup_i32(a->size, rt, rt);
+ gen_helper_mve_vdup(cpu_env, qd, rt);
+ tcg_temp_free_ptr(qd);
+ tcg_temp_free_i32(rt);
+ mve_update_eci(s);
+ return true;
+}
+
static bool do_1op(DisasContext *s, arg_1op *a, MVEGenOneOpFn fn)
{
TCGv_ptr qd, qm;