mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06:00
target/arm: Implement MVE VADD (scalar)
Implement the scalar form of the MVE VADD insn. This takes the scalar operand from a general purpose register. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20210617121628.20116-23-peter.maydell@linaro.org
This commit is contained in:
parent
3854874733
commit
e51896b386
4 changed files with 78 additions and 0 deletions
|
@ -491,6 +491,28 @@ DO_2OP_S(vhsubs, do_vhsub_s)
|
|||
DO_2OP_U(vhsubu, do_vhsub_u)
|
||||
|
||||
|
||||
#define DO_2OP_SCALAR(OP, ESIZE, TYPE, FN) \
|
||||
void HELPER(glue(mve_, OP))(CPUARMState *env, void *vd, void *vn, \
|
||||
uint32_t rm) \
|
||||
{ \
|
||||
TYPE *d = vd, *n = vn; \
|
||||
TYPE m = rm; \
|
||||
uint16_t mask = mve_element_mask(env); \
|
||||
unsigned e; \
|
||||
for (e = 0; e < 16 / ESIZE; e++, mask >>= ESIZE) { \
|
||||
mergemask(&d[H##ESIZE(e)], FN(n[H##ESIZE(e)], m), mask); \
|
||||
} \
|
||||
mve_advance_vpt(env); \
|
||||
}
|
||||
|
||||
/* provide unsigned 2-op scalar helpers for all sizes */
|
||||
#define DO_2OP_SCALAR_U(OP, FN) \
|
||||
DO_2OP_SCALAR(OP##b, 1, uint8_t, FN) \
|
||||
DO_2OP_SCALAR(OP##h, 2, uint16_t, FN) \
|
||||
DO_2OP_SCALAR(OP##w, 4, uint32_t, FN)
|
||||
|
||||
DO_2OP_SCALAR_U(vadd_scalar, DO_ADD)
|
||||
|
||||
/*
|
||||
* Multiply add long dual accumulate ops.
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue