[PATCH] D21746: [AVX512] Zero extend cmp intrinsic return value.

Igor Breger via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 27 03:55:36 PDT 2016


igorb created this revision.
igorb added reviewers: delena, craig.topper.
igorb added a subscriber: cfe-commits.
igorb set the repository for this revision to rL LLVM.

[AVX512] Zero extend cmp intrinsic return value.

Repository:
  rL LLVM

http://reviews.llvm.org/D21746

Files:
  lib/CodeGen/CGBuiltin.cpp
  test/CodeGen/avx512vl-builtins.c

Index: test/CodeGen/avx512vl-builtins.c
===================================================================
--- test/CodeGen/avx512vl-builtins.c
+++ test/CodeGen/avx512vl-builtins.c
@@ -8,6 +8,7 @@
 __mmask8 test_mm_cmpeq_epu32_mask(__m128i __a, __m128i __b) {
   // CHECK-LABEL: @test_mm_cmpeq_epu32_mask
   // CHECK: icmp eq <4 x i32> %{{.*}}, %{{.*}}
+  // CHECK: shufflevector <4 x i1> %{{.*}}, <4 x i1> zeroinitializer, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 4, i32 4, i32 4>
   return (__mmask8)_mm_cmpeq_epu32_mask(__a, __b);
 }
 
Index: lib/CodeGen/CGBuiltin.cpp
===================================================================
--- lib/CodeGen/CGBuiltin.cpp
+++ lib/CodeGen/CGBuiltin.cpp
@@ -6456,8 +6456,10 @@
       Indices[i] = i;
     for (unsigned i = NumElts; i != 8; ++i)
       Indices[i] = NumElts;
-    Cmp = CGF.Builder.CreateShuffleVector(Cmp, UndefValue::get(Cmp->getType()),
-                                          Indices);
+    Cmp = CGF.Builder.CreateShuffleVector(
+                        Cmp,
+                        llvm::Constant::getNullValue(Cmp->getType()),
+                        Indices);
   }
   return CGF.Builder.CreateBitCast(Cmp,
                                    IntegerType::get(CGF.getLLVMContext(),


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D21746.61953.patch
Type: text/x-patch
Size: 1265 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160627/ade6a89a/attachment.bin>


More information about the cfe-commits mailing list