Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 1 Nov 2013 19:46:46 +0700
From:      Alexey Dokuchaev <danfe@nsu.ru>
To:        hackers@freebsd.org
Subject:   SSE2 intrinsics: gcc46 vs. clang contradiction
Message-ID:  <20131101124645.GA73456@regency.nsu.ru>

next in thread | raw e-mail | index | archive | help
Hi there,

I've recently encountered a piece of code that uses some SSE2 intrinsics
and builds with gcc46, but not clang: clang can't find _mm_movpi64_epi64(),
while gcc46 defines it in its lib/gcc46/gcc/.../4.6.3/include/emmintrin.h:

  extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  _mm_movpi64_epi64 (__m64 __A)
  {
    return _mm_set_epi64 ((__m64)0LL, __A);
  }

  extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  _mm_set_epi64x (long long __q1, long long __q0)
  {
    return __extension__ (__m128i)(__v2di){ __q0, __q1 };
  }

Now, Clang in /usr/include/clang/3.3/emmintrin.h defines similar function,
but without the `e', _mm_movpi64_pi64():

  static __inline__ __m128i __attribute__((__always_inline__, __nodebug__))
  _mm_movpi64_pi64(__m64 __a)
  {
    return (__m128i){ (long long)__a, 0 };
  }

So what's going on here?  Who is right?  What adds to confusion, in their
manual [1] Intel spells them differently themselves: first, in the table,
it says:

  _mm_movpi64_epi64		Move		MOVDQ2Q
              ^^^^^

Then later, when they describe what it does, it says:

  __m128i _mm_movpi64_pi64(__m64 a)
                      ^^^^
  Moves the 64 bits of a to the lower 64 bits of the result, zeroing the
  upper bits.

Or I'm just being stupid and confusing two different functions?

./danfe

[1] http://software.intel.com/sites/products/documentation/doclib/iss/2013/compiler/cpp-lin/GUID-AFA947A7-8490-443B-9946-C7B16C8E6244.htm



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20131101124645.GA73456>