title: SSE (SIMD extensions) support in gcc
body: <p>I see a code as below: </p>
  
  <pre><code>#include "stdio.h"
  
  #define VECTOR_SIZE         4
  typedef float v4sf __attribute__ ((vector_size(sizeof(float)*VECTOR_SIZE))); 
   // vector of four single floats
  
  typedef union f4vector
  {
      v4sf    v;
      float   f[VECTOR_SIZE];
  } f4vector;
  
  void print_vector (f4vector *v)
  {
      printf("%f,%f,%f,%f\n", v-&gt;f[0], v-&gt;f[1], v-&gt;f[2], v-&gt;f[3]);
  }
  
  int main()
  {
      union f4vector a, b, c;
  
      a.v = (v4sf){1.2, 2.3, 3.4, 4.5};
      b.v = (v4sf){5., 6., 7., 8.};
      c.v = a.v + b.v;
  
      print_vector(&amp;a);
      print_vector(&amp;b);
      print_vector(&amp;c);
  }
  </code></pre>
  
  <p>This code builds fine and works expectedly using gcc (it's inbuild SSE / MMX extensions and vector data types. this code is doing a SIMD vector addition using 4 single floats.</p>
  
  <p>I want to understand in detail what does each keyword/function call on this typedef line means and does:</p>
  
  <pre><code>typedef float v4sf __attribute__ ((vector_size(sizeof(float)*VECTOR_SIZE))); 
  </code></pre>
  
  <p>What is the vector_size() function return; </p>
  
  <p>What is the <code>__attribute__</code> keyword for</p>
  
  <p>Here is the float data type being type defined to vfsf type?</p>
  
  <p>I understand the rest part.</p>
  
  <p>thanks,</p>
  
  <p>-AD</p>