title: How to code "a[i]=b[c[i]]" on ARM NEON SIMD Intrinsic function
body: <p>I'm trying to translating this C/C++ code to SIMD Intrinsic function.</p>
  
  <pre><code>for(int i=0 ; i &lt; length ; i++)
      A[i] = B[C[i]];
  </code></pre>
  
  <p>I can translate below code (C/C++)</p>
  
  <pre><code>for(int i=0 ; i &lt; length ; i++)
      A[i] = B[i];
  </code></pre>
  
  <p>to SIMD code (using Intrinsic function)</p>
  
  <pre><code>for(int i=0 ; i &lt; length-16 ; i+=16) {
      uint8x16_t v0 = vld1q_u8(A+i);
      vst1q_u8(A+i, v0);
  }
  </code></pre>
  
  <p>I know that keyword is interleaving to solve this problem. But i can't find solution.</p>
  
  <p>Thanks.</p>
  
  <p><strong>Edit</strong><br>
  <code>For more information</code></p>
  
  <pre><code>unsigned char A [32] = {0,}; // Output Array
  unsigned char B [20] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20}; // An array with values to pass to A Array
  unsigned int C [32] = {19,15,11,10,5,3,6,4,5,19,10,14,16,14,8,9,10,20,11,1, 0, 3, 5, 19, 20, 11, 13, 9, 30, 31, 7}; // An array with the index information of the B array.
  </code></pre>
  
  <p>Is there any Intrinsic function that can make the following code form?</p>
  
  <pre><code>int length = 32;
  For (int i = 0; i &lt; length-8; i+=8)
  {
      Uint8x8_t v_idx = vld1_u8 (C + i);
      Uint8x8_t v = func (A, v_idx); // func (uint8_t, uint32x4_t)
      vst1_u8(C+i, v);
  }
  </code></pre>
  
  <p>Will output <code>20, 16, 12, 11, 6, 4, 7, 5, 6, 6, 20, 11, 15, 17, 15, 9, 10, 11, 21, 12, 2, 1, 4, 6, 20, 21, 12, 14, 10, 31, 32, 8</code></p>
  
  <p><strong>[Note]</strong><br>
  A and B are uint8_t * types because they are images with values between 0 and 255, and C is a uint32_t * type because they are indexed by B index.</p>