]> granicus.if.org Git - clang/commitdiff
[x86] Adding support for some missing intrinsics: _mm512_cvtsi512_si32
authorPengfei Wang <pengfei.wang@intel.com>
Thu, 29 Aug 2019 06:18:34 +0000 (06:18 +0000)
committerPengfei Wang <pengfei.wang@intel.com>
Thu, 29 Aug 2019 06:18:34 +0000 (06:18 +0000)
Summary:
Adding support for some missing intrinsics:
_mm512_cvtsi512_si32

Reviewers: craig.topper, pengfei, LuoYuanke, spatel, RKSimon

Reviewed By: craig.topper

Subscribers: llvm-commits

Patch by Bing Yu (yubing)

Differential Revision: https://reviews.llvm.org/D66785

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

lib/Headers/avx512fintrin.h
test/CodeGen/avx512f-builtins.c

index 132761f9ef5c2c01ed4222eac115c5da93dfa1c4..5748c1ea6e5c429ebccdb56c695f303c8a7dd1e5 100644 (file)
@@ -9659,6 +9659,23 @@ _mm512_mask_reduce_min_ps(__mmask16 __M, __m512 __V) {
 }
 #undef _mm512_mask_reduce_operator
 
+/// Moves the least significant 32 bits of a vector of [16 x i32] to a
+///    32-bit signed integer value.
+///
+/// \headerfile <x86intrin.h>
+///
+/// This intrinsic corresponds to the <c> VMOVD / MOVD </c> instruction.
+///
+/// \param __A
+///    A vector of [16 x i32]. The least significant 32 bits are moved to the
+///    destination.
+/// \returns A 32-bit signed integer containing the moved value.
+static __inline__ int __DEFAULT_FN_ATTRS512
+_mm512_cvtsi512_si32(__m512i __A) {
+  __v16si __b = (__v16si)__A;
+  return __b[0];
+}
+
 #undef __DEFAULT_FN_ATTRS512
 #undef __DEFAULT_FN_ATTRS128
 #undef __DEFAULT_FN_ATTRS
index c9fbb4f4cbd978d7a6c6c20532d035d46944601b..aaf3157c08b9a49527d44f18e4a4bcd53e3b5bb9 100644 (file)
@@ -4762,6 +4762,12 @@ unsigned test_mm_cvtsd_u32(__m128d __A) {
   return _mm_cvtsd_u32(__A); 
 }
 
+int test_mm512_cvtsi512_si32(__m512i a) {
+  // CHECK-LABEL: test_mm512_cvtsi512_si32
+  // CHECK: %{{.*}} = extractelement <16 x i32> %{{.*}}, i32 0
+  return _mm512_cvtsi512_si32(a);
+}
+
 #ifdef __x86_64__
 unsigned long long test_mm_cvt_roundsd_u64(__m128d __A) {
   // CHECK-LABEL: @test_mm_cvt_roundsd_u64