[cfe-commits] r97904 - /cfe/trunk/lib/Headers/smmintrin.h

Chris Lattner clattner at apple.com
Sat Mar 6 22:35:41 PST 2010


On Mar 6, 2010, at 10:29 PM, Eric Christopher wrote:

> Author: echristo
> Date: Sun Mar  7 00:29:09 2010
> New Revision: 97904
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=97904&view=rev
> Log:
> Add load hint instruction intrinsic.

Nice,

> /* Type defines.  */
> typedef double __v2df __attribute__ ((__vector_size__ (16)));
> +typedef long long __v2di __attribute__ ((__vector_size__ (16)));

The pattern used in xmmintrin.h is to put these typedefs inside the function that uses them, e.g.:

static inline __m128 __attribute__((__always_inline__, __nodebug__))
_mm_andnot_ps(__m128 a, __m128 b)
{
  typedef int __v4si __attribute__((__vector_size__(16)));
  return (__m128)(~(__v4si)a & (__v4si)b);
}

-Chris

> 
> /* SSE4 Rounding macros. */
> #define _MM_FROUND_TO_NEAREST_INT    0x00
> @@ -122,6 +123,13 @@
> #define _mm_dp_ps(X, Y, M) __builtin_ia32_dpps ((X), (Y), (M))
> #define _mm_dp_pd(X, Y, M) __builtin_ia32_dppd ((X), (Y), (M))
> 
> +/* SSE4 Streaming Load Hint Instruction.  */
> +static inline  __m128i __attribute__((__always_inline__, __nodebug__))
> +_mm_stream_load_si128 (__m128i *__V)
> +{
> +  return (__m128i) __builtin_ia32_movntdqa ((__v2di *) __V);
> +}
> +
> #endif /* __SSE4_1__ */
> 
> #endif /* _SMMINTRIN_H */
> 
> 
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits





More information about the cfe-commits mailing list