summaryrefslogtreecommitdiffstats
path: root/target/arm/translate.c
diff options
context:
space:
mode:
authorPeter Maydell2021-06-28 15:58:35 +0200
committerPeter Maydell2021-07-02 12:48:38 +0200
commit04ea4d3cfd0a21b248ece8eb7a9436a3d9898dd8 (patch)
tree96c7bb61af69450637772d4ff5c8dd67afabfe94 /target/arm/translate.c
parenttarget/arm: Implement MVE shifts by immediate (diff)
downloadqemu-04ea4d3cfd0a21b248ece8eb7a9436a3d9898dd8.tar.gz
qemu-04ea4d3cfd0a21b248ece8eb7a9436a3d9898dd8.tar.xz
qemu-04ea4d3cfd0a21b248ece8eb7a9436a3d9898dd8.zip
target/arm: Implement MVE shifts by register
Implement the MVE shifts by register, which perform shifts on a single general-purpose register. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20210628135835.6690-19-peter.maydell@linaro.org
Diffstat (limited to 'target/arm/translate.c')
-rw-r--r--target/arm/translate.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/target/arm/translate.c b/target/arm/translate.c
index e38619b571..28e478927d 100644
--- a/target/arm/translate.c
+++ b/target/arm/translate.c
@@ -5925,6 +5925,36 @@ static bool trans_UQSHL_ri(DisasContext *s, arg_mve_sh_ri *a)
return do_mve_sh_ri(s, a, gen_mve_uqshl);
}
+static bool do_mve_sh_rr(DisasContext *s, arg_mve_sh_rr *a, ShiftFn *fn)
+{
+ if (!arm_dc_feature(s, ARM_FEATURE_V8_1M)) {
+ /* Decode falls through to ORR/MOV UNPREDICTABLE handling */
+ return false;
+ }
+ if (!dc_isar_feature(aa32_mve, s) ||
+ !arm_dc_feature(s, ARM_FEATURE_M_MAIN) ||
+ a->rda == 13 || a->rda == 15 || a->rm == 13 || a->rm == 15 ||
+ a->rm == a->rda) {
+ /* These rda/rm cases are UNPREDICTABLE; we choose to UNDEF */
+ unallocated_encoding(s);
+ return true;
+ }
+
+ /* The helper takes care of the sign-extension of the low 8 bits of Rm */
+ fn(cpu_R[a->rda], cpu_env, cpu_R[a->rda], cpu_R[a->rm]);
+ return true;
+}
+
+static bool trans_SQRSHR_rr(DisasContext *s, arg_mve_sh_rr *a)
+{
+ return do_mve_sh_rr(s, a, gen_helper_mve_sqrshr);
+}
+
+static bool trans_UQRSHL_rr(DisasContext *s, arg_mve_sh_rr *a)
+{
+ return do_mve_sh_rr(s, a, gen_helper_mve_uqrshl);
+}
+
/*
* Multiply and multiply accumulate
*/