title: SSE4 inline assembly problems in C++
body: <p>Hello Everyone
  I want to execute an inline assembly instruction that is of the following form </p>
  
  <pre><code>BLENDPD xmm1,xmm2/m128, imm8
  </code></pre>
  
  <p>I am new to inline assembly so i am having some difficulties.
  my code is:</p>
  
  <pre><code>#include&lt;iostream&gt;
  using namespace std;
  int main()
  {
    long long y;
    __asm("blendpd %0,$0xabcd000000001111abcd000000001111,$0x1":
      "=r" (y):
      );
    cout&lt;&lt;y;
    return 0;
  }
  </code></pre>
  
  <p>My first error was getting a 128 bit operand, so i used the long hex number , but still i need the output to be 128 bits since i want 2 be able to print y on the screen. and most of all i know my __asm syntax is wrong but can't figure out were, plus i'm not sure if compiling with Intel or AT&amp;T syntax will make a difference when using the __asm.</p>
  
  <p>Any help is welcome.  Cheers!  =)</p>
  
  <p><strong>Edit:</strong> I now have this version, and am getting an undefined function error.</p>
  
  <pre><code>  #include&lt;iostream&gt;
    #include&lt;emmintrin.h&gt;
    using namespace std;
  
  int main()
  {
  const int mask=5;
  __m128d v2 = _mm_set_pd(1.0, 2.0);
  __m128d v1;
  v1=_mm_blend_pd(v1, v2, mask);
  return 0;
  }
  </code></pre>