diff options
author | Peter Maydell | 2021-06-28 15:58:35 +0200 |
---|---|---|
committer | Peter Maydell | 2021-07-02 12:48:38 +0200 |
commit | 04ea4d3cfd0a21b248ece8eb7a9436a3d9898dd8 (patch) | |
tree | 96c7bb61af69450637772d4ff5c8dd67afabfe94 /target/arm/translate.c | |
parent | target/arm: Implement MVE shifts by immediate (diff) | |
download | qemu-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.c | 30 |
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 */ |