r256122 - [X86] Add missing m64/int64 conversions

Michael Kuperstein via cfe-commits cfe-commits at lists.llvm.org
Sun Dec 20 04:37:18 PST 2015


Author: mkuper
Date: Sun Dec 20 06:37:18 2015
New Revision: 256122

URL: http://llvm.org/viewvc/llvm-project?rev=256122&view=rev
Log:
[X86] Add missing m64/int64 conversions

Define the 64-bit equivalents of _m_to_int and _m_from_int.

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


Modified:
    cfe/trunk/lib/Headers/mmintrin.h
    cfe/trunk/test/CodeGen/mmx-builtins.c

Modified: cfe/trunk/lib/Headers/mmintrin.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/mmintrin.h?rev=256122&r1=256121&r2=256122&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/mmintrin.h (original)
+++ cfe/trunk/lib/Headers/mmintrin.h Sun Dec 20 06:37:18 2015
@@ -443,7 +443,9 @@ _mm_setr_pi8(char __b0, char __b1, char
 /* 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

Modified: cfe/trunk/test/CodeGen/mmx-builtins.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/mmx-builtins.c?rev=256122&r1=256121&r2=256122&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/mmx-builtins.c (original)
+++ cfe/trunk/test/CodeGen/mmx-builtins.c Sun Dec 20 06:37:18 2015
@@ -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




More information about the cfe-commits mailing list