Loading...
You are not logged-in Login/Register





  • Posts   Search Threads
  • Pourya_ShirazianNovember 10, 2011 12:57 PM PST   
    Rotate shift in AVX and SSE

    I need to shift values in a simd register and replace from left or right. Basically I have an array like {4,5,4,5} in SSE or {4,5,4,5,4,5,4,5} in AVX and need to convert them to {5,4,5,4} or {5,4,5,4,5,4,5,4}. I need the solution to work with both SSE and AVX instruction sets.


    Pourya Shirazian

    sirridaNovember 10, 2011 10:39 PM PST
    Rate
     
    Rotate shift in AVX and SSE

    Do you mean data dependent rotation (i.e. different rotation of each subword) or a cyclically exchange of the subwords.
    A solution of the first problem is sketched on my site or with AVX2 (Intel proposal: 2 times VPSLLV* or VPSRLV* and one POR) or XOP (AMD Bulldozer: VPROT*) commands.
    The second problem is easily solved by the commands SHUFPS, SHUFPD, PSHUFD, PSHUFB and PALIGNR; unfortunately these commands are somewhat limited for YMM usage because of their missing cross-lane operations.

    More at http://programming.sirrida.de

    jimdempseyatthecoveNovember 12, 2011 1:27 PM PST
    Rate
     
    Rotate shift in AVX and SSE

    I need to shift values in a simd register and replace from left or right. Basically I have an array like {4,5,4,5} in SSE or {4,5,4,5,4,5,4,5} in AVX and need to convert them to {5,4,5,4} or {5,4,5,4,5,4,5,4}. I need the solution to work with both SSE and AVX instruction sets.

     
    If I take you literally that the only numbers are:

    {4,5,4,5} in SSE or {4,5,4,5,4,5,4,5} in AVX, then pxor with
    {1,1,1,1} in SSE or {1,1,1,1,1,1,1,1} in AVX, to convert to
    {5,4,5,4} in SSE or  {5,4,5,4,5,4,5,4} in AVX.

    xor again with same number sequence to convert back from
    {5,4,5,4} in SSE or  {5,4,5,4,5,4,5,4} in AVX to
    {4,5,4,5} in SSE or {4,5,4,5,4,5,4,5} in AVX.

    Jim Dempsey



    Blog: The Parallel Void
    www.quickthreadprogramming.com

Forum jump:  

Intel Software Network Forums Statistics

17,025 users have contributed to 48,317 threads and 172,754 posts to date.

In the past 24 hours, we have 9 new thread(s) 56 new posts(s), and 52 new user(s).

In the past 3 days, the most popular thread for everyone has been How to manage rounding by IVF ?? The most posts were made to Most likely, the issue is that The post with the most views is Optimalization of sine function\'s taylor expansion

Please welcome our newest member redfruit83


For more complete information about compiler optimizations, see our Optimization Notice.