Skip to content

Instantly share code, notes, and snippets.

@embed
Created October 2, 2010 16:14
Show Gist options
  • Save embed/607764 to your computer and use it in GitHub Desktop.
Save embed/607764 to your computer and use it in GitHub Desktop.
Gcc Vektör
#include<stdio.h>
union vint{
int __attribute__((vector_size(16))) v;
int b[4];
};
int main()
{
int arr[]={1,2,3,4,5,6,7,8};
int __attribute__((vector_size(16))) *a,*b;
union vint c;
a=arr;
b=arr+4;
c.v= *a + *b;
printf("%d %d %d %d\n",c.b[0],c.b[1],c.b[2],c.b[3] );
printf("size=%d",sizeof(c));
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment