mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13:54 -06:00
target/arm: Implement MVE VDUP
Implement the MVE VDUP insn, which duplicates a value from a general-purpose register into every lane of a vector register (subject to predication). Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20210617121628.20116-11-peter.maydell@linaro.org
This commit is contained in:
parent
614dd4f3ba
commit
ab59362fca
4 changed files with 55 additions and 0 deletions
|
@ -246,6 +246,22 @@ static void mergemask_sq(int64_t *d, int64_t r, uint16_t mask)
|
|||
uint64_t *: mergemask_uq, \
|
||||
int64_t *: mergemask_sq)(D, R, M)
|
||||
|
||||
void HELPER(mve_vdup)(CPUARMState *env, void *vd, uint32_t val)
|
||||
{
|
||||
/*
|
||||
* The generated code already replicated an 8 or 16 bit constant
|
||||
* into the 32-bit value, so we only need to write the 32-bit
|
||||
* value to all elements of the Qreg, allowing for predication.
|
||||
*/
|
||||
uint32_t *d = vd;
|
||||
uint16_t mask = mve_element_mask(env);
|
||||
unsigned e;
|
||||
for (e = 0; e < 16 / 4; e++, mask >>= 4) {
|
||||
mergemask(&d[H4(e)], val, mask);
|
||||
}
|
||||
mve_advance_vpt(env);
|
||||
}
|
||||
|
||||
#define DO_1OP(OP, ESIZE, TYPE, FN) \
|
||||
void HELPER(mve_##OP)(CPUARMState *env, void *vd, void *vm) \
|
||||
{ \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue