typedef float v4sf __attribute__ ((mode(V4SF)));
This is in GCC. Anyone knows the equivalence syntax?
VS 2010 will show __attribute__ has no storage class of this type, and mode is not defined.
I searched on the Internet and it said
Equivalent to
__attribute__( aligned( size ) )in GCCIt is helpful
for former unix developers or people writing code that works on
multiple platforms that in GCC you achieve the same results using
attribute( aligned( … ) )See here for more information:
http://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/Type-Attributes.html#Type-Attributes
The full GCC code is here: http://pastebin.com/bKkTTmH1
If you’re looking for the alignment directive in VC++ it’s
__declspec(align(16)). (or whatever you want the alignment to be)And example usage is this:
http://msdn.microsoft.com/en-us/library/83ythb65.aspx
Note that both
attribute(in GCC) and__declspec(in VC++) are compiler-specific extensions.EDIT :
Now that I take a second look at the code, it’s gonna take more work than just replacing the
__attribute__line with the VC++ equivalent to get it to compile in VC++.VC++ doesn’t have any if these macros/functions that you are using:
__builtin_ia32_xorps__builtin_ia32_loadups__builtin_ia32_mulps__builtin_ia32_addps__builtin_ia32_storeupsYou’re better off just replacing all of those with SSE intrinsics – which will work on both GCC and VC++.
Here’s the code converted to intrinsics: