mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 00:33:55 -06:00
target/arm: Implement MVE VHADD, VHSUB
Implement MVE VHADD and VHSUB insns, which perform an addition or subtraction and then halve the result. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20210617121628.20116-18-peter.maydell@linaro.org
This commit is contained in:
parent
bc67aa8d56
commit
abc48e310c
4 changed files with 48 additions and 0 deletions
|
@ -429,3 +429,28 @@ DO_2OP_U(vminu, DO_MIN)
|
|||
|
||||
DO_2OP_S(vabds, DO_ABD)
|
||||
DO_2OP_U(vabdu, DO_ABD)
|
||||
|
||||
static inline uint32_t do_vhadd_u(uint32_t n, uint32_t m)
|
||||
{
|
||||
return ((uint64_t)n + m) >> 1;
|
||||
}
|
||||
|
||||
static inline int32_t do_vhadd_s(int32_t n, int32_t m)
|
||||
{
|
||||
return ((int64_t)n + m) >> 1;
|
||||
}
|
||||
|
||||
static inline uint32_t do_vhsub_u(uint32_t n, uint32_t m)
|
||||
{
|
||||
return ((uint64_t)n - m) >> 1;
|
||||
}
|
||||
|
||||
static inline int32_t do_vhsub_s(int32_t n, int32_t m)
|
||||
{
|
||||
return ((int64_t)n - m) >> 1;
|
||||
}
|
||||
|
||||
DO_2OP_S(vhadds, do_vhadd_s)
|
||||
DO_2OP_U(vhaddu, do_vhadd_u)
|
||||
DO_2OP_S(vhsubs, do_vhsub_s)
|
||||
DO_2OP_U(vhsubu, do_vhsub_u)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue