Forum > Linux
5.21 source compilable with ICC anywhere?
maverick:
--- Quote from: Josef W. Segur on 20 Jun 2007, 12:38:45 am ---You are indeed welcome here.
The origin of AKfoldSSE was Alex's 6.x SSE2 folding routine, but I adapted it to my folding scheme sometime last year. The .cpp file should be in the 2.4 sources Optimizer directory.
All intrinsics I've used have been per Intel instruction set documentation, they should work with the Intel compiler. Simon and Crunch3r have been able to take what I've written and tested with DevC++/MinGW and get it working with their Intel builds fairly quickly. But I think they have moved to very recent versions of the Intel tools.
Joe
--- End quote ---
Thank you! But actually ICC rejects some of the intrinsics. They don't seem 100% compatible. So we need to use intrinsics modified for ICC.(why aren't they compatible?). The problem is incompatibility of argument types. For example
--- Code: ---vector/analyzeFuncs_sse.cpp(803): error: argument of type "x86_m128={__m128}" is incompatible with parameter of type "__m128"
s = _mm_add_ps(s, SS2);
^
vector/analyzeFuncs_sse.cpp(803): error: argument of type "const_float4" is incompatible with parameter of type "__m128"
s = _mm_add_ps(s, SS2);
^
vector/analyzeFuncs_sse.cpp(803): error: a value of type "__m128" cannot be assigned to an entity of type "x86_m128={__m128}"
s = _mm_add_ps(s, SS2);
^
--- End code ---
I don't see anything wrong and I'm at a loss, but once solved, it will be easy.
Thanks in advance.
[edit]
I made a small test program as follows:
--- Code: ---#define __SSE__
#define __MMX__
#include <xmmintrin.h>
__m128 a,b,c;
void
func(){
a = _mm_add_ps(b,c);
}
--- End code ---
g++ gives a lot of errors, while ICC compiles this w/o any errors (output code is as expected).....ICC looks generous.
Josef W. Segur:
--- Quote from: maverick on 20 Jun 2007, 06:09:08 pm ---...
The problem is incompatibility of argument types. For example
--- Code: ---vector/analyzeFuncs_sse.cpp(803): error: argument of type "x86_m128={__m128}" is incompatible with parameter of type "__m128"
s = _mm_add_ps(s, SS2);
^
vector/analyzeFuncs_sse.cpp(803): error: argument of type "const_float4" is incompatible with parameter of type "__m128"
s = _mm_add_ps(s, SS2);
^
vector/analyzeFuncs_sse.cpp(803): error: a value of type "__m128" cannot be assigned to an entity of type "x86_m128={__m128}"
s = _mm_add_ps(s, SS2);
^
--- End code ---
I don't see anything wrong and I'm at a loss, but once solved, it will be easy.
Thanks in advance.
...
--- End quote ---
The x86_m128 type shouldn't be in use in that module, it looks like xmmintrin.h isn't being included at the top of x86_ops.h so __m128 is being replaced by x86_m128 at the bottom. For a Linux build, the sah_config.h file should have a line
#define HAVE_XMMINTRIN_H 1
That line was added June 1, but changes in that file aren't showing on the [seti_cvs] list, the most recent is June 18. I suppose that's because the file should be auto-generated rather than manually edited.
I don't know if that will resolve the issue with const_float4 types. Those are Eric's method of ensuring that the compiler won't generate SSE initialization code for vector constants, running SSE before entry to main() and crashing on systems which don't have SSE. If they continue to be a problem, maybe copying those constants as is done in analyzeFuncs_x86_64.cpp will be necessary, but I'd try casting them first.
Joe
maverick:
--- Quote from: Josef W. Segur on 20 Jun 2007, 11:24:42 pm ---
The x86_m128 type shouldn't be in use in that module, it looks like xmmintrin.h isn't being included at the top of x86_ops.h so __m128 is being replaced by x86_m128 at the bottom. For a Linux build, the sah_config.h file should have a line
#define HAVE_XMMINTRIN_H 1
That line was added June 1, but changes in that file aren't showing on the [seti_cvs] list, the most recent is June 18. I suppose that's because the file should be auto-generated rather than manually edited.
I don't know if that will resolve the issue with const_float4 types. Those are Eric's method of ensuring that the compiler won't generate SSE initialization code for vector constants, running SSE before entry to main() and crashing on systems which don't have SSE. If they continue to be a problem, maybe copying those constants as is done in analyzeFuncs_x86_64.cpp will be necessary, but I'd try casting them first.
Joe
--- End quote ---
Hi Joe,
Thank you for the hint. but defining "#define HAVE_XMMINTRIN_H 1" and "#include <xmmintrin.h> near the top of x86_ops.h doesn't work. So I may need to try casting, but if so, there are a LOT of these codes....sigh. I wonder how others avoid this.
[edit]
somehow, casting doesn't work, either....
--- Code: ---vector/analyzeFuncs_sse.cpp(803): error: argument of type "x86_m128={__m128}" is incompatible with parameter of type "__m128"
s = (__m128)_mm_add_ps((__m128)s, (__m128)SS2);
^
vector/analyzeFuncs_sse.cpp(803): error: argument of type "x86_m128={__m128}" is incompatible with parameter of type "__m128"
s = (__m128)_mm_add_ps((__m128)s, (__m128)SS2);
^
vector/analyzeFuncs_sse.cpp(803): error: type of cast must be integral or enum
s = (__m128)_mm_add_ps((__m128)s, (__m128)SS2);
^
--- End code ---
Josef W. Segur:
One thing I didn't consider was that if xmmintrin.h wasn't included you'd be seeing errors on the intrinsic functions as well as their arguments.
If you haven't tried it already, just comment out those 3 lines at the end of x86_ops.h which make the preprocessor rewrite __m128 to x86_m128 in the project source. It seems that has to be what's causing the problem, technically #ifndef only works for preprocessor macro definitions and maybe Intel has implemented __m128 in some other way.
If that helps we can think about rewriting the conditional more compatibly.
&nbqp; Joe
maverick:
Hi Joe,
Thanks! That's it. I didn't see the last part! I fixed like:
--- Code: ---#ifndef __INTEL_COMPILER
#ifndef __m128d
#define __m128d x86_m128d
#endif
#ifndef __m128i
#define __m128i x86_m128i
#endif
#ifndef __m128
#define __m128 x86_m128
#endif
--- End code ---
Now I got other errors...
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version