__attribute__((mode(TI))) for intel compilers

__attribute__((mode(TI))) for intel compilers

I was trying to compile a code where I have:

typedef int int128_t __attribute__((mode(TI)));

typedef unsigned int uint128_t __attribute__((mode(TI)));
Is there anyway to fix this, usingsomething like
#ifdef __INTEL_COMPILER && __x86_64
so it's compilable with icc?
Thank you in advance

5 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Until you get a better answer, I think icc supports only the __m128 and __u128 data types for 128-bit objects. I suppose the __INTEL_COMPILER and __SSE2__ predefined macros might be used for conditional compilation to decide which syntax to use. I noticed that __SSE2__ is available in gcc and Open64 C compilers.

I don't mind to assume SSE2 and 64bits.

Could you tell me how would you rewrite those lines to use those data types?

I wasn't the one who coded this part and I really don't know much about this kind of stuff.

Best Reply

No one can guess the extent of modifications required to make this change without seeing the source code. This is a typical consequence of using extensions supported by only a few compilers.
At the point of the definition you would simply replace the special gcc data type by one of those present in xmmintrin.h .
#if defined(__INTEL_COMPILER) && defined(__SSE2__)
#include "xmmintrin.h"
__m128 definitions
#elif defined(__GNUC__)
int128_t definitions
take care of other platforms

xmmintrin.h should be supported by your gcc as well, since you are compiling for x86_64 (you would need -march=pentium4 or such for it to work in 32-bit mode).

I would hate to maintain code which makes a wholesale replacement of int types by compiler-dependent types. icc should support int64_t, in case that helps.

Thank you very much

Leave a Comment

Please sign in to add a comment. Not a member? Join today