| Thread Tools | Search this thread |
|---|
| goodbyte | January 27, 2007 12:06 AM PST Problems with inlining array constructors | ||||
I am having some performance issues with constructors for array elements, and wonder if there is any easy fix I've missed. I have made following test case: #include <xmmintrin.h> union sse_t { __m128 ps; float f; inline sse_t() {} inline sse_t(__m128 x): ps(x) {} }; struct sse_soa_t { #if 1 sse_t t[3]; #else sse_t a, b, c; #endif // 0 }; int main(int argc, const char *argp) { sse_soa_t x; return 0; } When compiled with -O2 -ip -ipo on a P4 with icpcbin (ICC) 9.1 20061103 I can see a call to __cxa_vec_ctor in the assembly output, but if "#if 1" is changed to "#if 0" all references to sse_soa_t is optimized out. __cxa_vec_ctor invokes the sse_t::sse_t() constructor through a function pointer, and this kills performance in my application. Is there any easy way around this? | |||||
|
|||||||||||||
|
|||||||||||||
| 4474 users have contributed to 23996 threads and 69823 posts to date. |
|---|
| In the past 24 hours, we have 38 new thread(s) 119 new posts(s), and 163 new user(s). In the past 3 days, the most popular thread for everyone has been Catastrophic error The most posts were made to Why does my .exe only use 50-80% CPU when executing? The post with the most views is You can report them here if Please welcome our newest member Udaysimha Mysore (Intel) |