Add alternate names for x86 SIMD intrinsics. These aren't as common, but show
up enough to be worth supporting properly. Fixes PR7674.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109086 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Headers/xmmintrin.h b/lib/Headers/xmmintrin.h
index 75e06b5..f0d252c 100644
--- a/lib/Headers/xmmintrin.h
+++ b/lib/Headers/xmmintrin.h
@@ -416,6 +416,12 @@
   return (__m64)__builtin_ia32_cvtps2pi(a);
 }
 
+static __inline__ __m64 __attribute__((__always_inline__, __nodebug__))
+_mm_cvt_ps2pi(__m128 a)
+{
+  return _mm_cvtps_pi32(a);
+}
+
 static __inline__ int __attribute__((__always_inline__, __nodebug__))
 _mm_cvttss_si32(__m128 a)
 {
@@ -440,6 +446,12 @@
   return (__m64)__builtin_ia32_cvttps2pi(a);
 }
 
+static __inline__ __m64 __attribute__((__always_inline__, __nodebug__))
+_mm_cvtt_ps2pi(__m128 a)
+{
+  return _mm_cvttps_pi32(a);
+}
+
 static __inline__ __m128 __attribute__((__always_inline__, __nodebug__))
 _mm_cvtsi32_ss(__m128 a, int b)
 {
@@ -447,6 +459,12 @@
   return a;
 }
 
+static __inline__ __m128 __attribute__((__always_inline__, __nodebug__))
+_mm_cvtt_si2ss(__m128 a, int b)
+{
+  return _mm_cvtsi32_ss(a, b);
+}
+
 #ifdef __x86_64__
 
 static __inline__ __m128 __attribute__((__always_inline__, __nodebug__))
@@ -464,6 +482,12 @@
   return __builtin_ia32_cvtpi2ps(a, (__v2si)b);
 }
 
+static __inline__ __m128 __attribute__((__always_inline__, __nodebug__))
+_mm_cvtt_pi2ps(__m128 a, __m64 b)
+{
+  return _mm_cvtpi32_ps(a, b);
+}
+
 static __inline__ float __attribute__((__always_inline__, __nodebug__))
 _mm_cvtss_f32(__m128 a)
 {
@@ -590,6 +614,12 @@
 }
 
 static __inline__ void __attribute__((__always_inline__, __nodebug__))
+_mm_store_ps1(float *p, __m128 a)
+{
+    return _mm_store1_ps(p, a);
+}
+
+static __inline__ void __attribute__((__always_inline__, __nodebug__))
 _mm_store_ps(float *p, __m128 a)
 {
   *(__m128 *)p = a;
@@ -908,6 +938,23 @@
   (row3) = _mm_movehl_ps(tmp3, tmp1); \
 } while (0)
 
+/* Aliases for compatibility. */
+#define _m_pextrw _mm_extract_pi16
+#define _m_pinsrw _mm_insert_pi16
+#define _m_pmaxsw _mm_max_pi16
+#define _m_pmaxub _mm_max_pu8
+#define _m_pminsw _mm_min_pi16
+#define _m_pminub _mm_min_pu8
+#define _m_pmovmskb _mm_movemask_pi8
+#define _m_pmulhuw _mm_mulhi_pu16
+#define _m_pshufw _mm_shuffle_pi16
+#define _m_maskmovq _mm_maskmove_si64
+#define _m_pavgb _mm_avg_pu8
+#define _m_pavgw _mm_avg_pu16
+#define _m_psadbw _mm_sad_pu8
+#define _m_ _mm_
+#define _m_ _mm_
+
 /* Ugly hack for backwards-compatibility (compatible with gcc) */
 #ifdef __SSE2__
 #include <emmintrin.h>