sp-mishra / jitasm

Automatically exported from code.google.com/p/jitasm
0 stars 0 forks source link

Failed to compile test on mac #8

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Can't compile test code on Mac(SnowLeopard).
(revision 186)

g++ -fno-operator-names -I../ -m32 -march=i686 -mmmx -msse -msse2 -o test.o -c 
test.cpp
test.cpp: In function ‘int main()’:
test.cpp:680: warning: format ‘%d’ expects type ‘int’, but argument 2 
has type ‘size_t’
test.cpp:680: warning: format ‘%d’ expects type ‘int’, but argument 3 
has type ‘size_t’
/var/folders/6g/6gpoHXNrH8ygI21qZX4ceU+++TI/-Tmp-//cc2e9eDF.s:28027:FATAL:Symbol

__ZN6jitasm6detail24calling_convention_cdecl10ResultInfoIU8__vectorxEENS0_7ArgIn
foEv already 
defined.
make: *** [test.o] Error 1

Original issue reported on code.google.com by syoyofuj...@gmail.com on 4 Apr 2010 at 3:13

GoogleCodeExporter commented 9 years ago
It seems compiler bug because cannot compile the following code on Mac:

#include <mmintrin.h>
#include <emmintrin.h>

__m64 add(__m64 a, __m64 b) {
    return _mm_add_pi16(a, b);
}

__m128i add(__m128i a, __m128i b) {
    return _mm_add_epi16(a, b);
}

void main()
{
    __m64 c = add(_mm_set1_pi16(1), _mm_set1_pi16(2));
    __m128i d = add(_mm_set1_epi16(1), _mm_set1_epi16(2));
}

/var/folders/p2/p2yA31fKHeuNjlgjLPNIkk+++TI/-Tmp-//cc8XKpHE.s:22:FATAL:Symbol 
__Z3addU8__vectorxS_ already defined.

The mangle name of __m64 should be U8__vectori but this compiler outputs 
U8__vectorx. 
U8__vectorx is the mangle name of __m128i.

Original comment by aki.yamasaki on 7 Apr 2010 at 11:24

GoogleCodeExporter commented 9 years ago
There is no way to fix this problem. I fixed to avoid the test of __m64 on Mac 
OS X.

Original comment by aki.yamasaki on 9 Apr 2010 at 9:08