On Wed, Sep 15, 2010 at 2:17 PM, Ruben Van Boxem
<[email protected]> wrote:
> 2010/9/15 Ozkan Sezer <[email protected]>
>>
>> How does the preprocessed source look like for those lines?
>>
>
>  Attached is the preprocessed source generated by this command:
>
>> x86_64-w64-mingw32-gcc -DHAVE_CONFIG_H -I.
>> -I../../src/mingw-w64/mingw-w64-crt  -m32
>> -I../../src/mingw-w64/mingw-w64-crt/include -D_CRTBLD   -pipe -std=gnu99
>> -Wall -Wextra -Wformat -Wstrict-aliasing -Wshadow -Wpacked -Winline
>> -Wimplicit-function-declaration -Wmissing-noreturn -Wmissing-prototypes
>> -flto -mtune=core2 -MT intrincs/lib32_libmingwex_a-inbyte.o -MD -MP -MF
>> intrincs/.deps/lib32_libmingwex_a-inbyte.Tpo -c -o
>> intrincs/lib32_libmingwex_a-inbyte.o `test -f 'intrincs/inbyte.c' || echo
>> '../../src/mingw-w64/mingw-w64-crt/'`intrincs/inbyte.c
>
> Ruben
>
>

Hrmph, the compile command line doesn't have any -O options, meaning
that __OPTIMIZE__ is not defined.  See xmmintrin.h provided by gcc:

#ifdef __OPTIMIZE__
extern __inline __m64 __attribute__((__gnu_inline__,
__always_inline__, __artificial__))
_mm_insert_pi16 (__m64 const __A, int const __D, int const __N)
{
  return (__m64) __builtin_ia32_vec_set_v4hi ((__v4hi)__A, __D, __N);
}

extern __inline __m64 __attribute__((__gnu_inline__,
__always_inline__, __artificial__))
_m_pinsrw (__m64 const __A, int const __D, int const __N)
{
  return _mm_insert_pi16 (__A, __D, __N);
}
#else
#define _mm_insert_pi16(A, D, N)                                \
  ((__m64) __builtin_ia32_vec_set_v4hi ((__v4hi)(__m64)(A),     \
                                        (int)(D), (int)(N)))

#define _m_pinsrw(A, D, N) _mm_insert_pi16(A, D, N)
#endif

Since __OPTIMIZE__ is not defined, the macro version is in effect and it is
messing up things.  In the end, lines 510 and 517 of intrin.h, which are :

__MACHINEX86X_NOX64(__m64 _m_pinsrw(__m64,int,int))

... and
__MACHINEX86X_NOX64(__m64 _m_pshufw(__m64,int))

... get translated into:
__m64 ((__m64) __builtin_ia32_vec_set_v4hi ((__v4hi)(__m64)(__m64),
(int)(int), (int)(int)));

... and:
__m64 ((__m64) __builtin_ia32_pshufw ((__v4hi)(__m64)(__m64), (int)(int)));

... and the compiler rightfully screams.

Adding Kai to the CC list.

--
O.S.

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to