0
votes

The question is related to ARM NEON intrinsics. Iam using ARM neon intrinsics for FIR implementation. I want to reorder a quadword vector data. For example, There are four 32 bit elements in a Neon register - say, Q0 - which is of size 128 bit.

A3 A2 A1 A0

I want to reorder Q0 as A0 A1 A2 A3.

Is there any option to do this?

1

1 Answers

3
votes

Reading http://gcc.gnu.org/onlinedocs/gcc/ARM-NEON-Intrinsics.html together with the ARM infocenter, I think the following would do what you ask:

    uint32x2_t dvec_h = vget_high_u32(qvec);
    uint32x2_t dvec_l = vget_low_u32(qvec);

    dvec_h = vrev64_u32(dvec_h);
    dvec_l = vrev64_u32(dvec_l);

    qvec = vcombine_u32(dvec_h, dvec_l);

In assembly, this could be written simply as:

    VSWP      d0, d1
    VREV64.32 q0, q0