]> granicus.if.org Git - clang/commitdiff
[X86] Add more intrinsics to match icc.
authorCraig Topper <craig.topper@intel.com>
Sat, 20 Oct 2018 19:28:52 +0000 (19:28 +0000)
committerCraig Topper <craig.topper@intel.com>
Sat, 20 Oct 2018 19:28:52 +0000 (19:28 +0000)
This adds
_mm_loadu_epi8, _mm256_loadu_epi8, _mm512_loadu_epi8
_mm_loadu_epi16, _mm256_loadu_epi16, _mm512_loadu_epi16
_mm_storeu_epi8, _mm256_storeu_epi8, _mm512_storeu_epi8
_mm_storeu_epi16, _mm256_storeu_epi16, _mm512_storeu_epi16

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344862 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Headers/avx512bwintrin.h
lib/Headers/avx512vlbwintrin.h
test/CodeGen/avx512bw-builtins.c
test/CodeGen/avx512vl-builtins.c
test/CodeGen/avx512vlbw-builtins.c

index bff5b975c13236b19399e31db9b03b28a8491ea2..a90a255376c04a25712ee4bc33169c4193357208 100644 (file)
@@ -1747,6 +1747,15 @@ _mm512_kunpackw (__mmask32 __A, __mmask32 __B)
                 (__mmask32) __B);
 }
 
+static __inline __m512i __DEFAULT_FN_ATTRS512
+_mm512_loadu_epi16 (void const *__P)
+{
+  struct __loadu_epi16 {
+    __m512i __v;
+  } __attribute__((__packed__, __may_alias__));
+  return ((struct __loadu_epi16*)__P)->__v;
+}
+
 static __inline__ __m512i __DEFAULT_FN_ATTRS512
 _mm512_mask_loadu_epi16 (__m512i __W, __mmask32 __U, void const *__P)
 {
@@ -1764,6 +1773,15 @@ _mm512_maskz_loadu_epi16 (__mmask32 __U, void const *__P)
                  (__mmask32) __U);
 }
 
+static __inline __m512i __DEFAULT_FN_ATTRS512
+_mm512_loadu_epi8 (void const *__P)
+{
+  struct __loadu_epi8 {
+    __m512i __v;
+  } __attribute__((__packed__, __may_alias__));
+  return ((struct __loadu_epi8*)__P)->__v;
+}
+
 static __inline__ __m512i __DEFAULT_FN_ATTRS512
 _mm512_mask_loadu_epi8 (__m512i __W, __mmask64 __U, void const *__P)
 {
@@ -1780,6 +1798,16 @@ _mm512_maskz_loadu_epi8 (__mmask64 __U, void const *__P)
                  _mm512_setzero_si512 (),
                  (__mmask64) __U);
 }
+
+static __inline void __DEFAULT_FN_ATTRS512
+_mm512_storeu_epi16 (void *__P, __m512i __A)
+{
+  struct __storeu_epi16 {
+    __m512i __v;
+  } __attribute__((__packed__, __may_alias__));
+  ((struct __storeu_epi16*)__P)->__v = __A;
+}
+
 static __inline__ void __DEFAULT_FN_ATTRS512
 _mm512_mask_storeu_epi16 (void *__P, __mmask32 __U, __m512i __A)
 {
@@ -1788,6 +1816,15 @@ _mm512_mask_storeu_epi16 (void *__P, __mmask32 __U, __m512i __A)
              (__mmask32) __U);
 }
 
+static __inline void __DEFAULT_FN_ATTRS512
+_mm512_storeu_epi8 (void *__P, __m512i __A)
+{
+  struct __storeu_epi8 {
+    __m512i __v;
+  } __attribute__((__packed__, __may_alias__));
+  ((struct __storeu_epi8*)__P)->__v = __A;
+}
+
 static __inline__ void __DEFAULT_FN_ATTRS512
 _mm512_mask_storeu_epi8 (void *__P, __mmask64 __U, __m512i __A)
 {
index 1b038dd04df65e755b7f3a1e43fe2e48d4df756c..87e0023e8b74eea920bf72ff9b72efb34c41a95e 100644 (file)
@@ -2297,6 +2297,15 @@ _mm256_maskz_set1_epi8 (__mmask32 __M, char __A)
                                               (__v32qi) _mm256_setzero_si256());
 }
 
+static __inline __m128i __DEFAULT_FN_ATTRS128
+_mm_loadu_epi16 (void const *__P)
+{
+  struct __loadu_epi16 {
+    __m128i __v;
+  } __attribute__((__packed__, __may_alias__));
+  return ((struct __loadu_epi16*)__P)->__v;
+}
+
 static __inline__ __m128i __DEFAULT_FN_ATTRS128
 _mm_mask_loadu_epi16 (__m128i __W, __mmask8 __U, void const *__P)
 {
@@ -2314,6 +2323,15 @@ _mm_maskz_loadu_epi16 (__mmask8 __U, void const *__P)
                  (__mmask8) __U);
 }
 
+static __inline __m256i __DEFAULT_FN_ATTRS256
+_mm256_loadu_epi16 (void const *__P)
+{
+  struct __loadu_epi16 {
+    __m256i __v;
+  } __attribute__((__packed__, __may_alias__));
+  return ((struct __loadu_epi16*)__P)->__v;
+}
+
 static __inline__ __m256i __DEFAULT_FN_ATTRS256
 _mm256_mask_loadu_epi16 (__m256i __W, __mmask16 __U, void const *__P)
 {
@@ -2331,6 +2349,15 @@ _mm256_maskz_loadu_epi16 (__mmask16 __U, void const *__P)
                  (__mmask16) __U);
 }
 
+static __inline __m128i __DEFAULT_FN_ATTRS128
+_mm_loadu_epi8 (void const *__P)
+{
+  struct __loadu_epi8 {
+    __m128i __v;
+  } __attribute__((__packed__, __may_alias__));
+  return ((struct __loadu_epi8*)__P)->__v;
+}
+
 static __inline__ __m128i __DEFAULT_FN_ATTRS128
 _mm_mask_loadu_epi8 (__m128i __W, __mmask16 __U, void const *__P)
 {
@@ -2348,6 +2375,15 @@ _mm_maskz_loadu_epi8 (__mmask16 __U, void const *__P)
                  (__mmask16) __U);
 }
 
+static __inline __m256i __DEFAULT_FN_ATTRS256
+_mm256_loadu_epi8 (void const *__P)
+{
+  struct __loadu_epi8 {
+    __m256i __v;
+  } __attribute__((__packed__, __may_alias__));
+  return ((struct __loadu_epi8*)__P)->__v;
+}
+
 static __inline__ __m256i __DEFAULT_FN_ATTRS256
 _mm256_mask_loadu_epi8 (__m256i __W, __mmask32 __U, void const *__P)
 {
@@ -2364,7 +2400,17 @@ _mm256_maskz_loadu_epi8 (__mmask32 __U, void const *__P)
                  _mm256_setzero_si256 (),
                  (__mmask32) __U);
 }
-static __inline__ void __DEFAULT_FN_ATTRS256
+
+static __inline void __DEFAULT_FN_ATTRS128
+_mm_storeu_epi16 (void *__P, __m128i __A)
+{
+  struct __storeu_epi16 {
+    __m128i __v;
+  } __attribute__((__packed__, __may_alias__));
+  ((struct __storeu_epi16*)__P)->__v = __A;
+}
+
+static __inline__ void __DEFAULT_FN_ATTRS128
 _mm_mask_storeu_epi16 (void *__P, __mmask8 __U, __m128i __A)
 {
   __builtin_ia32_storedquhi128_mask ((__v8hi *) __P,
@@ -2372,6 +2418,15 @@ _mm_mask_storeu_epi16 (void *__P, __mmask8 __U, __m128i __A)
              (__mmask8) __U);
 }
 
+static __inline void __DEFAULT_FN_ATTRS256
+_mm256_storeu_epi16 (void *__P, __m256i __A)
+{
+  struct __storeu_epi16 {
+    __m256i __v;
+  } __attribute__((__packed__, __may_alias__));
+  ((struct __storeu_epi16*)__P)->__v = __A;
+}
+
 static __inline__ void __DEFAULT_FN_ATTRS256
 _mm256_mask_storeu_epi16 (void *__P, __mmask16 __U, __m256i __A)
 {
@@ -2380,6 +2435,15 @@ _mm256_mask_storeu_epi16 (void *__P, __mmask16 __U, __m256i __A)
              (__mmask16) __U);
 }
 
+static __inline void __DEFAULT_FN_ATTRS128
+_mm_storeu_epi8 (void *__P, __m128i __A)
+{
+  struct __storeu_epi8 {
+    __m128i __v;
+  } __attribute__((__packed__, __may_alias__));
+  ((struct __storeu_epi8*)__P)->__v = __A;
+}
+
 static __inline__ void __DEFAULT_FN_ATTRS128
 _mm_mask_storeu_epi8 (void *__P, __mmask16 __U, __m128i __A)
 {
@@ -2388,6 +2452,15 @@ _mm_mask_storeu_epi8 (void *__P, __mmask16 __U, __m128i __A)
              (__mmask16) __U);
 }
 
+static __inline void __DEFAULT_FN_ATTRS256
+_mm256_storeu_epi8 (void *__P, __m256i __A)
+{
+  struct __storeu_epi8 {
+    __m256i __v;
+  } __attribute__((__packed__, __may_alias__));
+  ((struct __storeu_epi8*)__P)->__v = __A;
+}
+
 static __inline__ void __DEFAULT_FN_ATTRS256
 _mm256_mask_storeu_epi8 (void *__P, __mmask32 __U, __m256i __A)
 {
index 01476c9e89c546ac47d2564d574d8270bb9d9b71..d22bc7b5a3938bbcaece8411cfd04f7ca53a4e3e 100644 (file)
@@ -2112,6 +2112,13 @@ __mmask32 test_mm512_kunpackw(__m512i __A, __m512i __B, __m512i __C, __m512i __D
   return _mm512_mask_cmpneq_epu16_mask(_mm512_kunpackw(_mm512_cmpneq_epu16_mask(__B, __A),_mm512_cmpneq_epu16_mask(__C, __D)), __E, __F); 
 }
 
+__m512i test_mm512_loadu_epi16 (void *__P)
+{
+  // CHECK-LABEL: @test_mm512_loadu_epi16
+  // CHECK: load <8 x i64>, <8 x i64>* %{{.*}}, align 1{{$}}
+  return _mm512_loadu_epi16 (__P);
+}
+
 __m512i test_mm512_mask_loadu_epi16(__m512i __W, __mmask32 __U, void const *__P) {
   // CHECK-LABEL: @test_mm512_mask_loadu_epi16
   // CHECK: @llvm.masked.load.v32i16.p0v32i16(<32 x i16>* %{{.*}}, i32 1, <32 x i1> %{{.*}}, <32 x i16> %{{.*}})
@@ -2124,6 +2131,13 @@ __m512i test_mm512_maskz_loadu_epi16(__mmask32 __U, void const *__P) {
   return _mm512_maskz_loadu_epi16(__U, __P); 
 }
 
+__m512i test_mm512_loadu_epi8 (void *__P)
+{
+  // CHECK-LABEL: @test_mm512_loadu_epi8
+  // CHECK: load <8 x i64>, <8 x i64>* %{{.*}}, align 1{{$}}
+  return _mm512_loadu_epi8 (__P);
+}
+
 __m512i test_mm512_mask_loadu_epi8(__m512i __W, __mmask64 __U, void const *__P) {
   // CHECK-LABEL: @test_mm512_mask_loadu_epi8
   // CHECK: @llvm.masked.load.v64i8.p0v64i8(<64 x i8>* %{{.*}}, i32 1, <64 x i1> %{{.*}}, <64 x i8> %{{.*}})
@@ -2135,11 +2149,19 @@ __m512i test_mm512_maskz_loadu_epi8(__mmask64 __U, void const *__P) {
   // CHECK: @llvm.masked.load.v64i8.p0v64i8(<64 x i8>* %{{.*}}, i32 1, <64 x i1> %{{.*}}, <64 x i8> %{{.*}})
   return _mm512_maskz_loadu_epi8(__U, __P); 
 }
+
+void test_mm512_storeu_epi16(void *__P, __m512i __A) {
+  // CHECK-LABEL: @test_mm512_storeu_epi16
+  // CHECK: store <8 x i64> %{{.*}}, <8 x i64>* %{{.*}}, align 1{{$}}
+  return _mm512_storeu_epi16(__P, __A); 
+}
+
 void test_mm512_mask_storeu_epi16(void *__P, __mmask32 __U, __m512i __A) {
   // CHECK-LABEL: @test_mm512_mask_storeu_epi16
   // CHECK: @llvm.masked.store.v32i16.p0v32i16(<32 x i16> %{{.*}}, <32 x i16>* %{{.*}}, i32 1, <32 x i1> %{{.*}})
-  return _mm512_mask_storeu_epi16(__P, __U, __A); 
+  return _mm512_mask_storeu_epi16(__P, __U, __A);
 }
+
 __mmask64 test_mm512_test_epi8_mask(__m512i __A, __m512i __B) {
   // CHECK-LABEL: @test_mm512_test_epi8_mask
   // CHECK: and <16 x i32> %{{.*}}, %{{.*}}
@@ -2147,6 +2169,12 @@ __mmask64 test_mm512_test_epi8_mask(__m512i __A, __m512i __B) {
   return _mm512_test_epi8_mask(__A, __B); 
 }
 
+void test_mm512_storeu_epi8(void *__P, __m512i __A) {
+  // CHECK-LABEL: @test_mm512_storeu_epi8
+  // CHECK: store <8 x i64> %{{.*}}, <8 x i64>* %{{.*}}, align 1{{$}}
+  return _mm512_storeu_epi8(__P, __A);
+}
+
 void test_mm512_mask_storeu_epi8(void *__P, __mmask64 __U, __m512i __A) {
   // CHECK-LABEL: @test_mm512_mask_storeu_epi8
   // CHECK: @llvm.masked.store.v64i8.p0v64i8(<64 x i8> %{{.*}}, <64 x i8>* %{{.*}}, i32 1, <64 x i1> %{{.*}})
index 181238600e4cd34c27f149b22254451b74ea34de..57931ca4376329783c084d93cbb588358fbc3e18 100644 (file)
@@ -7052,10 +7052,10 @@ void test_mm256_mask_store_ps(void *__P, __mmask8 __U, __m256 __A) {
   return _mm256_mask_store_ps(__P, __U, __A); 
 }
 
-void test_mm_storeu_epi64(void *__P, __m128i __A) {
-  // CHECK-LABEL: @test_mm_storeu_epi64
-  // CHECK: store <2 x i64> %{{.*}}, <2 x i64>* %{{.*}}, align 1{{$}}
-  return _mm_storeu_epi64(__P, __A);
+void test_mm_storeu_epi64(void *__p, __m128i __a) {
+  // check-label: @test_mm_storeu_epi64
+  // check: store <2 x i64> %{{.*}}, <2 x i64>* %{{.*}}, align 1{{$}}
+  return _mm_storeu_epi64(__p, __a);
 }
 
 void test_mm_mask_storeu_epi64(void *__P, __mmask8 __U, __m128i __A) {
index 06fa935acc52fadea8232b027f250774ab5dd4b5..06a48b5b27f40475913090ae98eaf4182e3e7fae 100644 (file)
@@ -2465,6 +2465,12 @@ __m256i test_mm256_maskz_mov_epi8(__mmask32 __U, __m256i __A) {
   return _mm256_maskz_mov_epi8(__U, __A); 
 }
 
+__m128i test_mm_loadu_epi16(void const *__P) {
+  // CHECK-LABEL: @test_mm_loadu_epi16
+  // CHECK: load <2 x i64>, <2 x i64>* %{{.*}}, align 1{{$}}
+  return _mm_loadu_epi16(__P);
+}
+
 __m128i test_mm_mask_loadu_epi16(__m128i __W, __mmask8 __U, void const *__P) {
   // CHECK-LABEL: @test_mm_mask_loadu_epi16
   // CHECK: @llvm.masked.load.v8i16.p0v8i16(<8 x i16>* %{{.*}}, i32 1, <8 x i1> %{{.*}}, <8 x i16> %{{.*}})
@@ -2477,6 +2483,12 @@ __m128i test_mm_maskz_loadu_epi16(__mmask8 __U, void const *__P) {
   return _mm_maskz_loadu_epi16(__U, __P); 
 }
 
+__m256i test_mm256_loadu_epi16(void const *__P) {
+  // CHECK-LABEL: @test_mm256_loadu_epi16
+  // CHECK: load <4 x i64>, <4 x i64>* %{{.*}}, align 1{{$}}
+  return _mm256_loadu_epi16(__P);
+}
+
 __m256i test_mm256_mask_loadu_epi16(__m256i __W, __mmask16 __U, void const *__P) {
   // CHECK-LABEL: @test_mm256_mask_loadu_epi16
   // CHECK: @llvm.masked.load.v16i16.p0v16i16(<16 x i16>* %{{.*}}, i32 1, <16 x i1> %{{.*}}, <16 x i16> %{{.*}})
@@ -2489,6 +2501,12 @@ __m256i test_mm256_maskz_loadu_epi16(__mmask16 __U, void const *__P) {
   return _mm256_maskz_loadu_epi16(__U, __P); 
 }
 
+__m128i test_mm_loadu_epi8(void const *__P) {
+  // CHECK-LABEL: @test_mm_loadu_epi8
+  // CHECK: load <2 x i64>, <2 x i64>* %{{.*}}, align 1{{$}}
+  return _mm_loadu_epi8(__P);
+}
+
 __m128i test_mm_mask_loadu_epi8(__m128i __W, __mmask16 __U, void const *__P) {
   // CHECK-LABEL: @test_mm_mask_loadu_epi8
   // CHECK: @llvm.masked.load.v16i8.p0v16i8(<16 x i8>* %{{.*}}, i32 1, <16 x i1> %{{.*}}, <16 x i8> %{{.*}})
@@ -2501,6 +2519,12 @@ __m128i test_mm_maskz_loadu_epi8(__mmask16 __U, void const *__P) {
   return _mm_maskz_loadu_epi8(__U, __P); 
 }
 
+__m256i test_mm256_loadu_epi8(void const *__P) {
+  // CHECK-LABEL: @test_mm256_loadu_epi8
+  // CHECK: load <4 x i64>, <4 x i64>* %{{.*}}, align 1{{$}}
+  return _mm256_loadu_epi8(__P);
+}
+
 __m256i test_mm256_mask_loadu_epi8(__m256i __W, __mmask32 __U, void const *__P) {
   // CHECK-LABEL: @test_mm256_mask_loadu_epi8
   // CHECK: @llvm.masked.load.v32i8.p0v32i8(<32 x i8>* %{{.*}}, i32 1, <32 x i1> %{{.*}}, <32 x i8> %{{.*}})
@@ -2513,24 +2537,48 @@ __m256i test_mm256_maskz_loadu_epi8(__mmask32 __U, void const *__P) {
   return _mm256_maskz_loadu_epi8(__U, __P); 
 }
 
+void test_mm_storeu_epi16(void *__p, __m128i __a) {
+  // check-label: @test_mm_storeu_epi16
+  // check: store <2 x i64> %{{.*}}, <2 x i64>* %{{.*}}, align 1{{$}}
+  return _mm_storeu_epi16(__p, __a);
+}
+
 void test_mm_mask_storeu_epi16(void *__P, __mmask8 __U, __m128i __A) {
   // CHECK-LABEL: @test_mm_mask_storeu_epi16
   // CHECK: @llvm.masked.store.v8i16.p0v8i16(<8 x i16> %{{.*}}, <8 x i16>* %{{.*}}, i32 1, <8 x i1> %{{.*}})
   return _mm_mask_storeu_epi16(__P, __U, __A); 
 }
 
+void test_mm256_storeu_epi16(void *__P, __m256i __A) {
+  // CHECK-LABEL: @test_mm256_storeu_epi16
+  // CHECK: store <4 x i64> %{{.*}}, <4 x i64>* %{{.*}}, align 1{{$}}
+  return _mm256_storeu_epi16(__P, __A);
+}
+
 void test_mm256_mask_storeu_epi16(void *__P, __mmask16 __U, __m256i __A) {
   // CHECK-LABEL: @test_mm256_mask_storeu_epi16
   // CHECK: @llvm.masked.store.v16i16.p0v16i16(<16 x i16> %{{.*}}, <16 x i16>* %{{.*}}, i32 1, <16 x i1> %{{.*}})
   return _mm256_mask_storeu_epi16(__P, __U, __A); 
 }
 
+void test_mm_storeu_epi8(void *__p, __m128i __a) {
+  // check-label: @test_mm_storeu_epi8
+  // check: store <2 x i64> %{{.*}}, <2 x i64>* %{{.*}}, align 1{{$}}
+  return _mm_storeu_epi8(__p, __a);
+}
+
 void test_mm_mask_storeu_epi8(void *__P, __mmask16 __U, __m128i __A) {
   // CHECK-LABEL: @test_mm_mask_storeu_epi8
   // CHECK: @llvm.masked.store.v16i8.p0v16i8(<16 x i8> %{{.*}}, <16 x i8>* %{{.*}}, i32 1, <16 x i1> %{{.*}})
   return _mm_mask_storeu_epi8(__P, __U, __A); 
 }
 
+void test_mm256_storeu_epi8(void *__P, __m256i __A) {
+  // CHECK-LABEL: @test_mm256_storeu_epi8
+  // CHECK: store <4 x i64> %{{.*}}, <4 x i64>* %{{.*}}, align 1{{$}}
+  return _mm256_storeu_epi8(__P, __A);
+}
+
 void test_mm256_mask_storeu_epi8(void *__P, __mmask32 __U, __m256i __A) {
   // CHECK-LABEL: @test_mm256_mask_storeu_epi8
   // CHECK: @llvm.masked.store.v32i8.p0v32i8(<32 x i8> %{{.*}}, <32 x i8>* %{{.*}}, i32 1, <32 x i1> %{{.*}})