Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7956 Discussions

how to align array of floats to 128 bit in intel 4.5

eltalkhawy
Beginner
406 Views
how to align array of floats to 128 bit in intel 4.5
0 Kudos
3 Replies
Intel_C_Intel
Employee
406 Views
Dear eltalkhawy
A 16-byte alignment can be enforced as follows, but I don't even remember if we
supported this in 4.5 already. Please consider upgrading.
__declspec(align(16)) float myfloats[100];
0 Kudos
eltalkhawy
Beginner
406 Views
the compiler doesn't recognize the statment
0 Kudos
Intel_C_Intel
Employee
406 Views

Dear eltalkhawy,

I was already afraid that feature does not go back all the way to 4.5. If you are unwilling to usemore recent compilers, you can always write your own dynamic memory allocation that forces a16-byte alignment at runtime. Will that work for you? By the way, giving some details on what exactly you are trying to achieve with the alignment mayhelp usto give more useful advice.

Aart Bik
http://www.aartbik.com/

0 Kudos
Reply