title: converting from int to (16-bit) __m128i
body: <p>I have the following code as a part of a program, but when I compile it I get the following error: </p>
  
  <pre><code>cannot convert ‘int’ to ‘__m128i {aka __vector(2) long long int}’ in assignment
  </code></pre>
  
  <p>Where the code is:</p>
  
  <pre><code>int t;
  int s;
  __m128i *array;
  __m128i vector;
  
  posix_memalign ((void **) &amp;array, BYTE_ALIGNMENT, n * m * sizeof(__m128i) );
  
  int l=0;
  for (int i=0; i&lt;n; i++)
  {
    for (int j=0; j&lt;m; j++)
    {
      array[l] = (condition) ? t : s;   // fill the array elements with s or t 
      l++;
    }
  }
  vector = _mm_load_si128( &amp;array[index]);
  </code></pre>
  
  <p>The problem is in this line</p>
  
  <pre><code>array[l] = (condition) ? t : s;
  </code></pre>
  
  <p>I have found the instruction <code>__m128i _mm_cvtsi32_si128(int a)</code> but unfortunately, it is used for 32-bits elements only, while I have  16-bit elements (vector of size 8).</p>