target/arm: Implement MVE long shifts by immediate
authorPeter Maydell <peter.maydell@linaro.org>
Mon, 28 Jun 2021 13:58:32 +0000 (14:58 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Fri, 2 Jul 2021 10:48:37 +0000 (11:48 +0100)
commitf4ae6c8cbda8d9b21290e9b8ae21b785ca24aace
treee48fada5b87faf37247fafdd739889b5ea6a44f0
parentd43ebd9dc8a268195dcc8219ced96f9e3bdc4050
target/arm: Implement MVE long shifts by immediate

The MVE extension to v8.1M includes some new shift instructions which
sit entirely within the non-coprocessor part of the encoding space
and which operate only on general-purpose registers.  They take up
the space which was previously UNPREDICTABLE MOVS and ORRS encodings
with Rm == 13 or 15.

Implement the long shifts by immediate, which perform shifts on a
pair of general-purpose registers treated as a 64-bit quantity, with
an immediate shift count between 1 and 32.

Awkwardly, because the MOVS and ORRS trans functions do not UNDEF for
the Rm==13,15 case, we need to explicitly emit code to UNDEF for the
cases where v8.1M now requires that.  (Trying to change MOVS and ORRS
is too difficult, because the functions that generate the code are
shared between a dozen different kinds of arithmetic or logical
instruction for all A32, T16 and T32 encodings, and for some insns
and some encodings Rm==13,15 are valid.)

We make the helper functions we need for UQSHLL and SQSHLL take
a 32-bit value which the helper casts to int8_t because we'll need
these helpers also for the shift-by-register insns, where the shift
count might be < 0 or > 32.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20210628135835.6690-16-peter.maydell@linaro.org
target/arm/helper-mve.h
target/arm/mve_helper.c
target/arm/t32.decode
target/arm/translate.c
target/arm/translate.h