target/arm: Convert Neon fp VMUL, VMLA, VMLS 3-reg-same insns to decodetree
commit8aa71ead912ca0a9c0d29b74e0976f91952f950a
authorPeter Maydell <peter.maydell@linaro.org>
Tue, 12 May 2020 16:39:00 +0000 (12 17:39 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 14 May 2020 14:03:09 +0000 (14 15:03 +0100)
treea40162ebd8d82659d01673f4553f9d2fc71fc736
parentab978335a56e3618212868fdce3a54217c6e71e6
target/arm: Convert Neon fp VMUL, VMLA, VMLS 3-reg-same insns to decodetree

Convert the Neon integer VMUL, VMLA, and VMLS 3-reg-same inssn to
decodetree.

We don't have a gvec helper for multiply-accumulate, so VMLA and VMLS
need a loop function do_3same_fp().  This takes a reads_vd parameter
to do_3same_fp() which tells it to load the old value into vd before
calling the callback function, in the same way that the do_vfp_3op_sp()
and do_vfp_3op_dp() functions in translate-vfp.inc.c work. (The
only uses in this patch pass reads_vd == true, but later commits
will use reads_vd == false.)

This conversion fixes in passing an underdecoding for VMUL
(originally reported by Fredrik Strupe <fredrik@strupe.net>): bit 1
of the 'size' field must be 0.  The old decoder didn't enforce this,
but the decodetree pattern does.

The gen_VMLA_fp_reg() function performs the addition operation
with the operands in the opposite order to the old decoder:
since Neon sets 'default NaN mode' float32_add operations are
commutative so there is no behaviour difference, but putting
them this way around matches the Arm ARM pseudocode and the
required operation order for the subtraction in gen_VMLS_fp_reg().

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20200512163904.10918-14-peter.maydell@linaro.org
target/arm/neon-dp.decode
target/arm/translate-neon.inc.c
target/arm/translate.c