This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Neon reg to ARM reg data transfer

Note: This was originally posted on 30th July 2009 at http://forums.arm.com

I m transferring data from neon register to arm register, which is very costly.
i.e., it takes each vmov.32 r6,do[2] takes around 13 to 18 cycles.
This is proving to be very costly for a function which runs for many times.

Can anyone please suggest a way out of this???

Thanks in advance for any help..... :)
  • Note: This was originally posted on 31st July 2009 at http://forums.arm.com

    Thanks !!
    So one option wud b if possible convert all arm involved operations to Neon operations.........
  • Note: This was originally posted on 3rd August 2009 at http://forums.arm.com

    Thanks !!!!
  • Note: This was originally posted on 13th August 2009 at http://forums.arm.com

    Hi guys,
                               I found a way out of this. There were some 16 such instructions(neon to arm transfer instructions) in my function. So accounting for some 208 cycles per call, (latency for vmov.u32 r6,d26[0] = 14).And this function was getting called some 20  thousand times. It was eating up lot of time.
                             But i had a opportunity in it. Interleaving 14 independent instructions in between.

    code was something like this:
                         vmov.32 r6,d[0]
             - instrns which use r6-
             - instrn-
             - instrn-
             - instrn-   ........
            
          vmov.32 r6,d[0]
             - instrns which use r6-
             - instrn-
             - instrn-
             - instrn-   ..........
                   ................etc
    So looking at the code structure, an option left is interleave. Take out the instructions which use the immediate result of r6 and insert them just before next neon to arm transfer instrn. This is assuming that the instrns in between are independent. This gave a gain of around 4%.

    Thanks a lot for your help!!!!!!!
  • Note: This was originally posted on 31st July 2009 at http://forums.arm.com

    You might find example Cortex-A8-optimized code useful, such as this:
    [url="http://www.arm.com/products/multimedia/openmax/"]http://www.arm.com/products/multimedia/openmax/[/url]
  • Note: This was originally posted on 30th July 2009 at http://forums.arm.com

    You cannot reduce the NEON-ARM or ARM-NEON register move costs - these are caused by the microarchitecture of the NEON unit for the Cortex-A8.

    One of the key parts of vectorizing for the Neon unit is to try and minimize the interaction between the main ARM pipeline and the NEON unit - pushing relatively large blocks of code through the NEON without too much dependence on what is happening on the ARM-pipeline. Any interaction is fairly time consuming as you have noted, but for many common tasks such a media CODECs the need for interaction is actually quite low.

    It is worth noting that the NEON unit has its own load store hardware so the NEON code can make its own memory accesses, and does *not* need the ARM to load data for it (this then has to be vmov'd in to the NEON which is slow).