[X86] Add missing m64/int64 conversions
authorMichael Kuperstein <michael.m.kuperstein@intel.com>
Sun, 20 Dec 2015 12:37:18 +0000 (12:37 +0000)
committerMichael Kuperstein <michael.m.kuperstein@intel.com>
Sun, 20 Dec 2015 12:37:18 +0000 (12:37 +0000)
Define the 64-bit equivalents of _m_to_int and _m_from_int.

Differential Revision: http://reviews.llvm.org/D15572

llvm-svn: 256122

clang/lib/Headers/mmintrin.h
clang/test/CodeGen/mmx-builtins.c

index 1a9eb10..162cb1a 100644 (file)
@@ -443,7 +443,9 @@ _mm_setr_pi8(char __b0, char __b1, char __b2, char __b3, char __b4, char __b5,
 /* Aliases for compatibility. */
 #define _m_empty _mm_empty
 #define _m_from_int _mm_cvtsi32_si64
+#define _m_from_int64 _mm_cvtsi64_m64
 #define _m_to_int _mm_cvtsi64_si32
+#define _m_to_int64 _mm_cvtm64_si64
 #define _m_packsswb _mm_packs_pi16
 #define _m_packssdw _mm_packs_pi32
 #define _m_packuswb _mm_packs_pu16
index a694685..44d1ea4 100644 (file)
@@ -223,6 +223,12 @@ __m64 test_m_from_int(int a) {
   return _m_from_int(a);
 }
 
+__m64 test_m_from_int64(long long a) {
+  // CHECK-LABEL: test_m_from_int64
+  // CHECK: bitcast
+  return _m_from_int64(a);
+}
+
 __m64 test_mm_hadd_pi16(__m64 a, __m64 b) {
   // CHECK-LABEL: test_mm_hadd_pi16
   // CHECK: call x86_mmx @llvm.x86.ssse3.phadd.w
@@ -553,6 +559,12 @@ int test_m_to_int(__m64 a) {
   return _m_to_int(a);
 }
 
+long long test_m_to_int64(__m64 a) {
+  // CHECK-LABEL: test_m_to_int64
+  // CHECK: bitcast
+  return _m_to_int64(a);
+}
+
 __m64 test_mm_unpackhi_pi8(__m64 a, __m64 b) {
   // CHECK-LABEL: test_mm_unpackhi_pi8
   // CHECK: call x86_mmx @llvm.x86.mmx.punpckhbw