r336355 - [X86] Fix some vector cmp builtins - TRUE/FALSE predicates

Gabor Buella via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 5 07:26:56 PDT 2018


Author: gbuella
Date: Thu Jul  5 07:26:56 2018
New Revision: 336355

URL: http://llvm.org/viewvc/llvm-project?rev=336355&view=rev
Log:
[X86] Fix some vector cmp builtins - TRUE/FALSE predicates

This patch removes on optimization used with the TRUE/FALSE
predicates, as was suggested in https://reviews.llvm.org/D45616
for r335339.
The optimization was buggy, since r335339 used it also
for *_mask builtins, without actually applying the mask -- the
mask argument was just ignored.

Reviewers: craig.topper, uriel.k, RKSimon, andrew.w.kaylor, spatel, scanon, efriedma

Reviewed By: spatel

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


Modified:
    cfe/trunk/lib/CodeGen/CGBuiltin.cpp
    cfe/trunk/test/CodeGen/avx-builtins.c
    cfe/trunk/test/CodeGen/avx512f-builtins.c
    cfe/trunk/test/CodeGen/avx512vl-builtins.c

Modified: cfe/trunk/lib/CodeGen/CGBuiltin.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGBuiltin.cpp?rev=336355&r1=336354&r2=336355&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGBuiltin.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGBuiltin.cpp Thu Jul  5 07:26:56 2018
@@ -10158,43 +10158,38 @@ Value *CodeGenFunction::EmitX86BuiltinEx
     // e.g. both _CMP_GT_OS & _CMP_GT_OQ are translated to FCMP_OGT.
     FCmpInst::Predicate Pred;
     switch (CC) {
-    case 0x00: Pred = FCmpInst::FCMP_OEQ; break;
-    case 0x01: Pred = FCmpInst::FCMP_OLT; break;
-    case 0x02: Pred = FCmpInst::FCMP_OLE; break;
-    case 0x03: Pred = FCmpInst::FCMP_UNO; break;
-    case 0x04: Pred = FCmpInst::FCMP_UNE; break;
-    case 0x05: Pred = FCmpInst::FCMP_UGE; break;
-    case 0x06: Pred = FCmpInst::FCMP_UGT; break;
-    case 0x07: Pred = FCmpInst::FCMP_ORD; break;
-    case 0x08: Pred = FCmpInst::FCMP_UEQ; break;
-    case 0x09: Pred = FCmpInst::FCMP_ULT; break;
-    case 0x0a: Pred = FCmpInst::FCMP_ULE; break;
-    case 0x0c: Pred = FCmpInst::FCMP_ONE; break;
-    case 0x0d: Pred = FCmpInst::FCMP_OGE; break;
-    case 0x0e: Pred = FCmpInst::FCMP_OGT; break;
-    case 0x10: Pred = FCmpInst::FCMP_OEQ; break;
-    case 0x11: Pred = FCmpInst::FCMP_OLT; break;
-    case 0x12: Pred = FCmpInst::FCMP_OLE; break;
-    case 0x13: Pred = FCmpInst::FCMP_UNO; break;
-    case 0x14: Pred = FCmpInst::FCMP_UNE; break;
-    case 0x15: Pred = FCmpInst::FCMP_UGE; break;
-    case 0x16: Pred = FCmpInst::FCMP_UGT; break;
-    case 0x17: Pred = FCmpInst::FCMP_ORD; break;
-    case 0x18: Pred = FCmpInst::FCMP_UEQ; break;
-    case 0x19: Pred = FCmpInst::FCMP_ULT; break;
-    case 0x1a: Pred = FCmpInst::FCMP_ULE; break;
-    case 0x1c: Pred = FCmpInst::FCMP_ONE; break;
-    case 0x1d: Pred = FCmpInst::FCMP_OGE; break;
-    case 0x1e: Pred = FCmpInst::FCMP_OGT; break;
-    // _CMP_TRUE_UQ, _CMP_TRUE_US produce -1,-1... vector
-    // on any input and _CMP_FALSE_OQ, _CMP_FALSE_OS produce 0, 0...
-    case 0x0b: // FALSE_OQ
-    case 0x1b: // FALSE_OS
-      return llvm::Constant::getNullValue(ConvertType(E->getType()));
-    case 0x0f: // TRUE_UQ
-    case 0x1f: // TRUE_US
-      return llvm::Constant::getAllOnesValue(ConvertType(E->getType()));
-
+    case 0x00: Pred = FCmpInst::FCMP_OEQ;   break;
+    case 0x01: Pred = FCmpInst::FCMP_OLT;   break;
+    case 0x02: Pred = FCmpInst::FCMP_OLE;   break;
+    case 0x03: Pred = FCmpInst::FCMP_UNO;   break;
+    case 0x04: Pred = FCmpInst::FCMP_UNE;   break;
+    case 0x05: Pred = FCmpInst::FCMP_UGE;   break;
+    case 0x06: Pred = FCmpInst::FCMP_UGT;   break;
+    case 0x07: Pred = FCmpInst::FCMP_ORD;   break;
+    case 0x08: Pred = FCmpInst::FCMP_UEQ;   break;
+    case 0x09: Pred = FCmpInst::FCMP_ULT;   break;
+    case 0x0a: Pred = FCmpInst::FCMP_ULE;   break;
+    case 0x0b: Pred = FCmpInst::FCMP_FALSE; break;
+    case 0x0c: Pred = FCmpInst::FCMP_ONE;   break;
+    case 0x0d: Pred = FCmpInst::FCMP_OGE;   break;
+    case 0x0e: Pred = FCmpInst::FCMP_OGT;   break;
+    case 0x0f: Pred = FCmpInst::FCMP_TRUE;  break;
+    case 0x10: Pred = FCmpInst::FCMP_OEQ;   break;
+    case 0x11: Pred = FCmpInst::FCMP_OLT;   break;
+    case 0x12: Pred = FCmpInst::FCMP_OLE;   break;
+    case 0x13: Pred = FCmpInst::FCMP_UNO;   break;
+    case 0x14: Pred = FCmpInst::FCMP_UNE;   break;
+    case 0x15: Pred = FCmpInst::FCMP_UGE;   break;
+    case 0x16: Pred = FCmpInst::FCMP_UGT;   break;
+    case 0x17: Pred = FCmpInst::FCMP_ORD;   break;
+    case 0x18: Pred = FCmpInst::FCMP_UEQ;   break;
+    case 0x19: Pred = FCmpInst::FCMP_ULT;   break;
+    case 0x1a: Pred = FCmpInst::FCMP_ULE;   break;
+    case 0x1b: Pred = FCmpInst::FCMP_FALSE; break;
+    case 0x1c: Pred = FCmpInst::FCMP_ONE;   break;
+    case 0x1d: Pred = FCmpInst::FCMP_OGE;   break;
+    case 0x1e: Pred = FCmpInst::FCMP_OGT;   break;
+    case 0x1f: Pred = FCmpInst::FCMP_TRUE;  break;
     default: llvm_unreachable("Unhandled CC");
     }
 

Modified: cfe/trunk/test/CodeGen/avx-builtins.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/avx-builtins.c?rev=336355&r1=336354&r2=336355&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/avx-builtins.c (original)
+++ cfe/trunk/test/CodeGen/avx-builtins.c Thu Jul  5 07:26:56 2018
@@ -280,8 +280,7 @@ __m256d test_mm256_cmp_pd_ngt_us(__m256d
 
 __m256d test_mm256_cmp_pd_false_oq(__m256d a, __m256d b) {
   // CHECK-LABEL: test_mm256_cmp_pd_false_oq
-  // CHECK-NOT: call
-  // CHECK: ret <4 x double> zeroinitializer
+  // CHECK: fcmp false <4 x double> %{{.*}}, %{{.*}}
   return _mm256_cmp_pd(a, b, _CMP_FALSE_OQ);
 }
 
@@ -305,8 +304,7 @@ __m256d test_mm256_cmp_pd_gt_os(__m256d
 
 __m256d test_mm256_cmp_pd_true_uq(__m256d a, __m256d b) {
   // CHECK-LABEL: test_mm256_cmp_pd_true_uq
-  // CHECK-NOT: call
-  // CHECK: ret <4 x double> <double 0xFFFFFFFFFFFFFFFF, double 0xFFFFFFFFFFFFFFFF, double 0xFFFFFFFFFFFFFFFF, double 0xFFFFFFFFFFFFFFFF>
+  // CHECK: fcmp true <4 x double> %{{.*}}, %{{.*}}
   return _mm256_cmp_pd(a, b, _CMP_TRUE_UQ);
 }
 
@@ -378,8 +376,7 @@ __m256d test_mm256_cmp_pd_ngt_uq(__m256d
 
 __m256d test_mm256_cmp_pd_false_os(__m256d a, __m256d b) {
   // CHECK-LABEL: test_mm256_cmp_pd_false_os
-  // CHECK-NOT: call
-  // CHECK: ret <4 x double> zeroinitializer
+  // CHECK: fcmp false <4 x double> %{{.*}}, %{{.*}}
   return _mm256_cmp_pd(a, b, _CMP_FALSE_OS);
 }
 
@@ -403,8 +400,7 @@ __m256d test_mm256_cmp_pd_gt_oq(__m256d
 
 __m256d test_mm256_cmp_pd_true_us(__m256d a, __m256d b) {
   // CHECK-LABEL: test_mm256_cmp_pd_true_us
-  // CHECK-NOT: call
-  // CHECK: ret <4 x double> <double 0xFFFFFFFFFFFFFFFF, double 0xFFFFFFFFFFFFFFFF, double 0xFFFFFFFFFFFFFFFF, double 0xFFFFFFFFFFFFFFFF>
+  // CHECK: fcmp true <4 x double> %{{.*}}, %{{.*}}
   return _mm256_cmp_pd(a, b, _CMP_TRUE_US);
 }
 
@@ -476,8 +472,7 @@ __m256 test_mm256_cmp_ps_ngt_us(__m256 a
 
 __m256 test_mm256_cmp_ps_false_oq(__m256 a, __m256 b) {
   // CHECK-LABEL: test_mm256_cmp_ps_false_oq
-  // CHECK-NOT: call
-  // CHECK: ret <8 x float> zeroinitializer
+  // CHECK: fcmp false <8 x float> %{{.*}}, %{{.*}}
   return _mm256_cmp_ps(a, b, _CMP_FALSE_OQ);
 }
 
@@ -501,8 +496,7 @@ __m256 test_mm256_cmp_ps_gt_os(__m256 a,
 
 __m256 test_mm256_cmp_ps_true_uq(__m256 a, __m256 b) {
   // CHECK-LABEL: test_mm256_cmp_ps_true_uq
-  // CHECK-NOT: call
-  // CHECK: ret <8 x float> <float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000>
+  // CHECK: fcmp true <8 x float> %{{.*}}, %{{.*}}
   return _mm256_cmp_ps(a, b, _CMP_TRUE_UQ);
 }
 
@@ -574,8 +568,7 @@ __m256 test_mm256_cmp_ps_ngt_uq(__m256 a
 
 __m256 test_mm256_cmp_ps_false_os(__m256 a, __m256 b) {
   // CHECK-LABEL: test_mm256_cmp_ps_false_os
-  // CHECK-NOT: call
-  // CHECK: ret <8 x float> zeroinitializer
+  // CHECK: fcmp false <8 x float> %{{.*}}, %{{.*}}
   return _mm256_cmp_ps(a, b, _CMP_FALSE_OS);
 }
 
@@ -599,8 +592,7 @@ __m256 test_mm256_cmp_ps_gt_oq(__m256 a,
 
 __m256 test_mm256_cmp_ps_true_us(__m256 a, __m256 b) {
   // CHECK-LABEL: test_mm256_cmp_ps_true_us
-  // CHECK-NOT: call
-  // CHECK: ret <8 x float> <float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000>
+  // CHECK: fcmp true <8 x float> %{{.*}}, %{{.*}}
   return _mm256_cmp_ps(a, b, _CMP_TRUE_US);
 }
 
@@ -672,8 +664,7 @@ __m128d test_mm_cmp_pd_ngt_us(__m128d a,
 
 __m128d test_mm_cmp_pd_false_oq(__m128d a, __m128d b) {
   // CHECK-LABEL: test_mm_cmp_pd_false_oq
-  // CHECK-NOT: call
-  // CHECK: ret <2 x double> zeroinitializer
+  // CHECK: fcmp false <2 x double> %{{.*}}, %{{.*}}
   return _mm_cmp_pd(a, b, _CMP_FALSE_OQ);
 }
 
@@ -697,8 +688,7 @@ __m128d test_mm_cmp_pd_gt_os(__m128d a,
 
 __m128d test_mm_cmp_pd_true_uq(__m128d a, __m128d b) {
   // CHECK-LABEL: test_mm_cmp_pd_true_uq
-  // CHECK-NOT: call
-  // CHECK: ret <2 x double> <double 0xFFFFFFFFFFFFFFFF, double 0xFFFFFFFFFFFFFFFF>
+  // CHECK: fcmp true <2 x double> %{{.*}}, %{{.*}}
   return _mm_cmp_pd(a, b, _CMP_TRUE_UQ);
 }
 
@@ -770,8 +760,7 @@ __m128d test_mm_cmp_pd_ngt_uq(__m128d a,
 
 __m128d test_mm_cmp_pd_false_os(__m128d a, __m128d b) {
   // CHECK-LABEL: test_mm_cmp_pd_false_os
-  // CHECK-NOT: call
-  // CHECK: ret <2 x double> zeroinitializer
+  // CHECK: fcmp false <2 x double> %{{.*}}, %{{.*}}
   return _mm_cmp_pd(a, b, _CMP_FALSE_OS);
 }
 
@@ -795,8 +784,7 @@ __m128d test_mm_cmp_pd_gt_oq(__m128d a,
 
 __m128d test_mm_cmp_pd_true_us(__m128d a, __m128d b) {
   // CHECK-LABEL: test_mm_cmp_pd_true_us
-  // CHECK-NOT: call
-  // CHECK: ret <2 x double> <double 0xFFFFFFFFFFFFFFFF, double 0xFFFFFFFFFFFFFFFF>
+  // CHECK: fcmp true <2 x double> %{{.*}}, %{{.*}}
   return _mm_cmp_pd(a, b, _CMP_TRUE_US);
 }
 
@@ -868,8 +856,7 @@ __m128 test_mm_cmp_ps_ngt_us(__m128 a, _
 
 __m128 test_mm_cmp_ps_false_oq(__m128 a, __m128 b) {
   // CHECK-LABEL: test_mm_cmp_ps_false_oq
-  // CHECK-NOT: call
-  // CHECK: ret <4 x float> zeroinitializer
+  // CHECK: fcmp false <4 x float> %{{.*}}, %{{.*}}
   return _mm_cmp_ps(a, b, _CMP_FALSE_OQ);
 }
 
@@ -893,8 +880,7 @@ __m128 test_mm_cmp_ps_gt_os(__m128 a, __
 
 __m128 test_mm_cmp_ps_true_uq(__m128 a, __m128 b) {
   // CHECK-LABEL: test_mm_cmp_ps_true_uq
-  // CHECK-NOT: call
-  // CHECK: ret <4 x float> <float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000>
+  // CHECK: fcmp true <4 x float> %{{.*}}, %{{.*}}
   return _mm_cmp_ps(a, b, _CMP_TRUE_UQ);
 }
 
@@ -966,8 +952,7 @@ __m128 test_mm_cmp_ps_ngt_uq(__m128 a, _
 
 __m128 test_mm_cmp_ps_false_os(__m128 a, __m128 b) {
   // CHECK-LABEL: test_mm_cmp_ps_false_os
-  // CHECK-NOT: call
-  // CHECK: ret <4 x float> zeroinitializer
+  // CHECK: fcmp false <4 x float> %{{.*}}, %{{.*}}
   return _mm_cmp_ps(a, b, _CMP_FALSE_OS);
 }
 
@@ -991,8 +976,7 @@ __m128 test_mm_cmp_ps_gt_oq(__m128 a, __
 
 __m128 test_mm_cmp_ps_true_us(__m128 a, __m128 b) {
   // CHECK-LABEL: test_mm_cmp_ps_true_us
-  // CHECK-NOT: call
-  // CHECK: ret <4 x float> <float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000>
+  // CHECK: fcmp true <4 x float> %{{.*}}, %{{.*}}
   return _mm_cmp_ps(a, b, _CMP_TRUE_US);
 }
 

Modified: cfe/trunk/test/CodeGen/avx512f-builtins.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/avx512f-builtins.c?rev=336355&r1=336354&r2=336355&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/avx512f-builtins.c (original)
+++ cfe/trunk/test/CodeGen/avx512f-builtins.c Thu Jul  5 07:26:56 2018
@@ -1358,8 +1358,7 @@ __mmask16 test_mm512_cmp_ps_mask_ngt_us(
 
 __mmask16 test_mm512_cmp_ps_mask_false_oq(__m512 a, __m512 b) {
   // CHECK-LABEL: test_mm512_cmp_ps_mask_false_oq
-  // CHECK-NOT: call
-  // CHECK: ret i16 0
+  // CHECK: fcmp false <16 x float> %{{.*}}, %{{.*}}
   return _mm512_cmp_ps_mask(a, b, _CMP_FALSE_OQ);
 }
 
@@ -1383,8 +1382,7 @@ __mmask16 test_mm512_cmp_ps_mask_gt_os(_
 
 __mmask16 test_mm512_cmp_ps_mask_true_uq(__m512 a, __m512 b) {
   // CHECK-LABEL: test_mm512_cmp_ps_mask_true_uq
-  // CHECK-NOT: call
-  // CHECK: ret i16 -1
+  // CHECK: fcmp true <16 x float> %{{.*}}, %{{.*}}
   return _mm512_cmp_ps_mask(a, b, _CMP_TRUE_UQ);
 }
 
@@ -1456,8 +1454,7 @@ __mmask16 test_mm512_cmp_ps_mask_ngt_uq(
 
 __mmask16 test_mm512_cmp_ps_mask_false_os(__m512 a, __m512 b) {
   // CHECK-LABEL: test_mm512_cmp_ps_mask_false_os
-  // CHECK-NOT: call
-  // CHECK: ret i16 0
+  // CHECK: fcmp false <16 x float> %{{.*}}, %{{.*}}
   return _mm512_cmp_ps_mask(a, b, _CMP_FALSE_OS);
 }
 
@@ -1481,8 +1478,7 @@ __mmask16 test_mm512_cmp_ps_mask_gt_oq(_
 
 __mmask16 test_mm512_cmp_ps_mask_true_us(__m512 a, __m512 b) {
   // CHECK-LABEL: test_mm512_cmp_ps_mask_true_us
-  // CHECK-NOT: call
-  // CHECK: ret i16 -1
+  // CHECK: fcmp true <16 x float> %{{.*}}, %{{.*}}
   return _mm512_cmp_ps_mask(a, b, _CMP_TRUE_US);
 }
 
@@ -1565,8 +1561,8 @@ __mmask16 test_mm512_mask_cmp_ps_mask_ng
 
 __mmask16 test_mm512_mask_cmp_ps_mask_false_oq(__mmask16 m, __m512 a, __m512 b) {
   // CHECK-LABEL: test_mm512_mask_cmp_ps_mask_false_oq
-  // CHECK-NOT: call
-  // CHECK: ret i16 0
+  // CHECK: [[CMP:%.*]] = fcmp false <16 x float> %{{.*}}, %{{.*}}
+  // CHECK: and <16 x i1> [[CMP]], {{.*}}
   return _mm512_mask_cmp_ps_mask(m, a, b, _CMP_FALSE_OQ);
 }
 
@@ -1593,7 +1589,8 @@ __mmask16 test_mm512_mask_cmp_ps_mask_gt
 
 __mmask16 test_mm512_mask_cmp_ps_mask_true_uq(__mmask16 m, __m512 a, __m512 b) {
   // CHECK-LABEL: test_mm512_mask_cmp_ps_mask_true_uq
-  // FIXME
+  // CHECK: [[CMP:%.*]] = fcmp true <16 x float> %{{.*}}, %{{.*}}
+  // CHECK: and <16 x i1> [[CMP]], {{.*}}
   return _mm512_mask_cmp_ps_mask(m, a, b, _CMP_TRUE_UQ);
 }
 
@@ -1676,8 +1673,8 @@ __mmask16 test_mm512_mask_cmp_ps_mask_ng
 
 __mmask16 test_mm512_mask_cmp_ps_mask_false_os(__mmask16 m, __m512 a, __m512 b) {
   // CHECK-LABEL: test_mm512_mask_cmp_ps_mask_false_os
-  // CHECK-NOT: call
-  // CHECK: ret i16 0
+  // CHECK: [[CMP:%.*]] = fcmp false <16 x float> %{{.*}}, %{{.*}}
+  // CHECK: and <16 x i1> [[CMP]], {{.*}}
   return _mm512_mask_cmp_ps_mask(m, a, b, _CMP_FALSE_OS);
 }
 
@@ -1704,7 +1701,8 @@ __mmask16 test_mm512_mask_cmp_ps_mask_gt
 
 __mmask16 test_mm512_mask_cmp_ps_mask_true_us(__mmask16 m, __m512 a, __m512 b) {
   // CHECK-LABEL: test_mm512_mask_cmp_ps_mask_true_us
-  // FIXME
+  // CHECK: [[CMP:%.*]] = fcmp true <16 x float> %{{.*}}, %{{.*}}
+  // CHECK: and <16 x i1> [[CMP]], {{.*}}
   return _mm512_mask_cmp_ps_mask(m, a, b, _CMP_TRUE_US);
 }
 
@@ -1789,8 +1787,7 @@ __mmask8 test_mm512_cmp_pd_mask_ngt_us(_
 
 __mmask8 test_mm512_cmp_pd_mask_false_oq(__m512d a, __m512d b) {
   // CHECK-LABEL: test_mm512_cmp_pd_mask_false_oq
-  // CHECK-NOT: call
-  // CHECK: ret i8 0
+  // CHECK: fcmp false <8 x double> %{{.*}}, %{{.*}}
   return _mm512_cmp_pd_mask(a, b, _CMP_FALSE_OQ);
 }
 
@@ -1814,8 +1811,7 @@ __mmask8 test_mm512_cmp_pd_mask_gt_os(__
 
 __mmask8 test_mm512_cmp_pd_mask_true_uq(__m512d a, __m512d b) {
   // CHECK-LABEL: test_mm512_cmp_pd_mask_true_uq
-  // CHECK-NOT: call
-  // CHECK: ret i8 -1
+  // CHECK: fcmp true <8 x double> %{{.*}}, %{{.*}}
   return _mm512_cmp_pd_mask(a, b, _CMP_TRUE_UQ);
 }
 
@@ -1887,8 +1883,7 @@ __mmask8 test_mm512_cmp_pd_mask_ngt_uq(_
 
 __mmask8 test_mm512_cmp_pd_mask_false_os(__m512d a, __m512d b) {
   // CHECK-LABEL: test_mm512_cmp_pd_mask_false_os
-  // CHECK-NOT: call
-  // CHECK: ret i8 0
+  // CHECK: fcmp false <8 x double> %{{.*}}, %{{.*}}
   return _mm512_cmp_pd_mask(a, b, _CMP_FALSE_OS);
 }
 
@@ -1912,8 +1907,7 @@ __mmask8 test_mm512_cmp_pd_mask_gt_oq(__
 
 __mmask8 test_mm512_cmp_pd_mask_true_us(__m512d a, __m512d b) {
   // CHECK-LABEL: test_mm512_cmp_pd_mask_true_us
-  // CHECK-NOT: call
-  // CHECK: ret i8 -1
+  // CHECK: fcmp true <8 x double> %{{.*}}, %{{.*}}
   return _mm512_cmp_pd_mask(a, b, _CMP_TRUE_US);
 }
 
@@ -1996,8 +1990,8 @@ __mmask8 test_mm512_mask_cmp_pd_mask_ngt
 
 __mmask8 test_mm512_mask_cmp_pd_mask_false_oq(__mmask8 m, __m512d a, __m512d b) {
   // CHECK-LABEL: test_mm512_mask_cmp_pd_mask_false_oq
-  // CHECK-NOT: call
-  // CHECK: ret i8 0
+  // CHECK: [[CMP:%.*]] = fcmp false <8 x double> %{{.*}}, %{{.*}}
+  // CHECK: and <8 x i1> [[CMP]], {{.*}}
   return _mm512_mask_cmp_pd_mask(m, a, b, _CMP_FALSE_OQ);
 }
 
@@ -2024,7 +2018,8 @@ __mmask8 test_mm512_mask_cmp_pd_mask_gt_
 
 __mmask8 test_mm512_mask_cmp_pd_mask_true_uq(__mmask8 m, __m512d a, __m512d b) {
   // CHECK-LABEL: test_mm512_mask_cmp_pd_mask_true_uq
-  // FIXME
+  // CHECK: [[CMP:%.*]] = fcmp true <8 x double> %{{.*}}, %{{.*}}
+  // CHECK: and <8 x i1> [[CMP]], {{.*}}
   return _mm512_mask_cmp_pd_mask(m, a, b, _CMP_TRUE_UQ);
 }
 
@@ -2107,8 +2102,8 @@ __mmask8 test_mm512_mask_cmp_pd_mask_ngt
 
 __mmask8 test_mm512_mask_cmp_pd_mask_false_os(__mmask8 m, __m512d a, __m512d b) {
   // CHECK-LABEL: test_mm512_mask_cmp_pd_mask_false_os
-  // CHECK-NOT: call
-  // CHECK: ret i8 0
+  // CHECK: [[CMP:%.*]] = fcmp false <8 x double> %{{.*}}, %{{.*}}
+  // CHECK: and <8 x i1> [[CMP]], {{.*}}
   return _mm512_mask_cmp_pd_mask(m, a, b, _CMP_FALSE_OS);
 }
 
@@ -2135,7 +2130,8 @@ __mmask8 test_mm512_mask_cmp_pd_mask_gt_
 
 __mmask8 test_mm512_mask_cmp_pd_mask_true_us(__mmask8 m, __m512d a, __m512d b) {
   // CHECK-LABEL: test_mm512_mask_cmp_pd_mask_true_us
-  // FIXME
+  // CHECK: [[CMP:%.*]] = fcmp true <8 x double> %{{.*}}, %{{.*}}
+  // CHECK: and <8 x i1> [[CMP]], {{.*}}
   return _mm512_mask_cmp_pd_mask(m, a, b, _CMP_TRUE_US);
 }
 

Modified: cfe/trunk/test/CodeGen/avx512vl-builtins.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/avx512vl-builtins.c?rev=336355&r1=336354&r2=336355&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/avx512vl-builtins.c (original)
+++ cfe/trunk/test/CodeGen/avx512vl-builtins.c Thu Jul  5 07:26:56 2018
@@ -1139,8 +1139,7 @@ __mmask8 test_mm256_cmp_ps_mask_ngt_us(_
 
 __mmask8 test_mm256_cmp_ps_mask_false_oq(__m256 a, __m256 b) {
   // CHECK-LABEL: test_mm256_cmp_ps_mask_false_oq
-  // CHECK-NOT: call
-  // CHECK: ret i8 0
+  // CHECK: fcmp false <8 x float> %{{.*}}, %{{.*}}
   return _mm256_cmp_ps_mask(a, b, _CMP_FALSE_OQ);
 }
 
@@ -1164,8 +1163,7 @@ __mmask8 test_mm256_cmp_ps_mask_gt_os(__
 
 __mmask8 test_mm256_cmp_ps_mask_true_uq(__m256 a, __m256 b) {
   // CHECK-LABEL: test_mm256_cmp_ps_mask_true_uq
-  // CHECK-NOT: call
-  // CHECK: ret i8 -1
+  // CHECK: fcmp true <8 x float> %{{.*}}, %{{.*}}
   return _mm256_cmp_ps_mask(a, b, _CMP_TRUE_UQ);
 }
 
@@ -1237,8 +1235,7 @@ __mmask8 test_mm256_cmp_ps_mask_ngt_uq(_
 
 __mmask8 test_mm256_cmp_ps_mask_false_os(__m256 a, __m256 b) {
   // CHECK-LABEL: test_mm256_cmp_ps_mask_false_os
-  // CHECK-NOT: call
-  // CHECK: ret i8 0
+  // CHECK: fcmp false <8 x float> %{{.*}}, %{{.*}}
   return _mm256_cmp_ps_mask(a, b, _CMP_FALSE_OS);
 }
 
@@ -1262,8 +1259,7 @@ __mmask8 test_mm256_cmp_ps_mask_gt_oq(__
 
 __mmask8 test_mm256_cmp_ps_mask_true_us(__m256 a, __m256 b) {
   // CHECK-LABEL: test_mm256_cmp_ps_mask_true_us
-  // CHECK-NOT: call
-  // CHECK: ret i8 -1
+  // CHECK: fcmp true <8 x float> %{{.*}}, %{{.*}}
   return _mm256_cmp_ps_mask(a, b, _CMP_TRUE_US);
 }
 
@@ -1346,8 +1342,8 @@ __mmask8 test_mm256_mask_cmp_ps_mask_ngt
 
 __mmask8 test_mm256_mask_cmp_ps_mask_false_oq(__mmask8 m, __m256 a, __m256 b) {
   // CHECK-LABEL: test_mm256_mask_cmp_ps_mask_false_oq
-  // CHECK-NOT: call
-  // CHECK: ret i8 0
+  // CHECK: [[CMP:%.*]] = fcmp false <8 x float> %{{.*}}, %{{.*}}
+  // CHECK: and <8 x i1> [[CMP]], {{.*}}
   return _mm256_mask_cmp_ps_mask(m, a, b, _CMP_FALSE_OQ);
 }
 
@@ -1374,7 +1370,8 @@ __mmask8 test_mm256_mask_cmp_ps_mask_gt_
 
 __mmask8 test_mm256_mask_cmp_ps_mask_true_uq(__mmask8 m, __m256 a, __m256 b) {
   // CHECK-LABEL: test_mm256_mask_cmp_ps_mask_true_uq
-  // FIXME
+  // CHECK: [[CMP:%.*]] = fcmp true <8 x float> %{{.*}}, %{{.*}}
+  // CHECK: and <8 x i1> [[CMP]], {{.*}}
   return _mm256_mask_cmp_ps_mask(m, a, b, _CMP_TRUE_UQ);
 }
 
@@ -1457,8 +1454,8 @@ __mmask8 test_mm256_mask_cmp_ps_mask_ngt
 
 __mmask8 test_mm256_mask_cmp_ps_mask_false_os(__mmask8 m, __m256 a, __m256 b) {
   // CHECK-LABEL: test_mm256_mask_cmp_ps_mask_false_os
-  // CHECK-NOT: call
-  // CHECK: ret i8 0
+  // CHECK: [[CMP:%.*]] = fcmp false <8 x float> %{{.*}}, %{{.*}}
+  // CHECK: and <8 x i1> [[CMP]], {{.*}}
   return _mm256_mask_cmp_ps_mask(m, a, b, _CMP_FALSE_OS);
 }
 
@@ -1485,7 +1482,8 @@ __mmask8 test_mm256_mask_cmp_ps_mask_gt_
 
 __mmask8 test_mm256_mask_cmp_ps_mask_true_us(__mmask8 m, __m256 a, __m256 b) {
   // CHECK-LABEL: test_mm256_mask_cmp_ps_mask_true_us
-  // FIXME
+  // CHECK: [[CMP:%.*]] = fcmp true <8 x float> %{{.*}}, %{{.*}}
+  // CHECK: and <8 x i1> [[CMP]], {{.*}}
   return _mm256_mask_cmp_ps_mask(m, a, b, _CMP_TRUE_US);
 }
 
@@ -1557,8 +1555,7 @@ __mmask8 test_mm256_cmp_pd_mask_ngt_us(_
 
 __mmask8 test_mm256_cmp_pd_mask_false_oq(__m256d a, __m256d b) {
   // CHECK-LABEL: test_mm256_cmp_pd_mask_false_oq
-  // CHECK-NOT: call
-  // CHECK: ret i8 0
+  // CHECK: fcmp false <4 x double> %{{.*}}, %{{.*}}
   return _mm256_cmp_pd_mask(a, b, _CMP_FALSE_OQ);
 }
 
@@ -1582,8 +1579,7 @@ __mmask8 test_mm256_cmp_pd_mask_gt_os(__
 
 __mmask8 test_mm256_cmp_pd_mask_true_uq(__m256d a, __m256d b) {
   // CHECK-LABEL: test_mm256_cmp_pd_mask_true_uq
-  // CHECK-NOT: call
-  // CHECK: ret i8 -1
+  // CHECK: fcmp true <4 x double> %{{.*}}, %{{.*}}
   return _mm256_cmp_pd_mask(a, b, _CMP_TRUE_UQ);
 }
 
@@ -1655,8 +1651,7 @@ __mmask8 test_mm256_cmp_pd_mask_ngt_uq(_
 
 __mmask8 test_mm256_cmp_pd_mask_false_os(__m256d a, __m256d b) {
   // CHECK-LABEL: test_mm256_cmp_pd_mask_false_os
-  // CHECK-NOT: call
-  // CHECK: ret i8 0
+  // CHECK: fcmp false <4 x double> %{{.*}}, %{{.*}}
   return _mm256_cmp_pd_mask(a, b, _CMP_FALSE_OS);
 }
 
@@ -1680,8 +1675,7 @@ __mmask8 test_mm256_cmp_pd_mask_gt_oq(__
 
 __mmask8 test_mm256_cmp_pd_mask_true_us(__m256d a, __m256d b) {
   // CHECK-LABEL: test_mm256_cmp_pd_mask_true_us
-  // CHECK-NOT: call
-  // CHECK: ret i8 -1
+  // CHECK: fcmp true <4 x double> %{{.*}}, %{{.*}}
   return _mm256_cmp_pd_mask(a, b, _CMP_TRUE_US);
 }
 
@@ -1764,8 +1758,8 @@ __mmask8 test_mm256_mask_cmp_pd_mask_ngt
 
 __mmask8 test_mm256_mask_cmp_pd_mask_false_oq(__mmask8 m, __m256d a, __m256d b) {
   // CHECK-LABEL: test_mm256_mask_cmp_pd_mask_false_oq
-  // CHECK-NOT: call
-  // CHECK: ret i8 0
+  // CHECK: [[CMP:%.*]] = fcmp false <4 x double> %{{.*}}, %{{.*}}
+  // CHECK: and <4 x i1> [[CMP]], {{.*}}
   return _mm256_mask_cmp_pd_mask(m, a, b, _CMP_FALSE_OQ);
 }
 
@@ -1792,7 +1786,8 @@ __mmask8 test_mm256_mask_cmp_pd_mask_gt_
 
 __mmask8 test_mm256_mask_cmp_pd_mask_true_uq(__mmask8 m, __m256d a, __m256d b) {
   // CHECK-LABEL: test_mm256_mask_cmp_pd_mask_true_uq
-  // FIXME
+  // CHECK: [[CMP:%.*]] = fcmp true <4 x double> %{{.*}}, %{{.*}}
+  // CHECK: and <4 x i1> [[CMP]], {{.*}}
   return _mm256_mask_cmp_pd_mask(m, a, b, _CMP_TRUE_UQ);
 }
 
@@ -1875,8 +1870,8 @@ __mmask8 test_mm256_mask_cmp_pd_mask_ngt
 
 __mmask8 test_mm256_mask_cmp_pd_mask_false_os(__mmask8 m, __m256d a, __m256d b) {
   // CHECK-LABEL: test_mm256_mask_cmp_pd_mask_false_os
-  // CHECK-NOT: call
-  // CHECK: ret i8 0
+  // CHECK: [[CMP:%.*]] = fcmp false <4 x double> %{{.*}}, %{{.*}}
+  // CHECK: and <4 x i1> [[CMP]], {{.*}}
   return _mm256_mask_cmp_pd_mask(m, a, b, _CMP_FALSE_OS);
 }
 
@@ -1903,7 +1898,8 @@ __mmask8 test_mm256_mask_cmp_pd_mask_gt_
 
 __mmask8 test_mm256_mask_cmp_pd_mask_true_us(__mmask8 m, __m256d a, __m256d b) {
   // CHECK-LABEL: test_mm256_mask_cmp_pd_mask_true_us
-  // FIXME
+  // CHECK: [[CMP:%.*]] = fcmp true <4 x double> %{{.*}}, %{{.*}}
+  // CHECK: and <4 x i1> [[CMP]], {{.*}}
   return _mm256_mask_cmp_pd_mask(m, a, b, _CMP_TRUE_US);
 }
 
@@ -1975,8 +1971,7 @@ __mmask8 test_mm_cmp_ps_mask_ngt_us(__m1
 
 __mmask8 test_mm_cmp_ps_mask_false_oq(__m128 a, __m128 b) {
   // CHECK-LABEL: test_mm_cmp_ps_mask_false_oq
-  // CHECK-NOT: call
-  // CHECK: ret i8 0
+  // CHECK: fcmp false <4 x float> %{{.*}}, %{{.*}}
   return _mm_cmp_ps_mask(a, b, _CMP_FALSE_OQ);
 }
 
@@ -2000,8 +1995,7 @@ __mmask8 test_mm_cmp_ps_mask_gt_os(__m12
 
 __mmask8 test_mm_cmp_ps_mask_true_uq(__m128 a, __m128 b) {
   // CHECK-LABEL: test_mm_cmp_ps_mask_true_uq
-  // CHECK-NOT: call
-  // CHECK: ret i8 -1
+  // CHECK: fcmp true <4 x float> %{{.*}}, %{{.*}}
   return _mm_cmp_ps_mask(a, b, _CMP_TRUE_UQ);
 }
 
@@ -2073,8 +2067,7 @@ __mmask8 test_mm_cmp_ps_mask_ngt_uq(__m1
 
 __mmask8 test_mm_cmp_ps_mask_false_os(__m128 a, __m128 b) {
   // CHECK-LABEL: test_mm_cmp_ps_mask_false_os
-  // CHECK-NOT: call
-  // CHECK: ret i8 0
+  // CHECK: fcmp false <4 x float> %{{.*}}, %{{.*}}
   return _mm_cmp_ps_mask(a, b, _CMP_FALSE_OS);
 }
 
@@ -2098,8 +2091,7 @@ __mmask8 test_mm_cmp_ps_mask_gt_oq(__m12
 
 __mmask8 test_mm_cmp_ps_mask_true_us(__m128 a, __m128 b) {
   // CHECK-LABEL: test_mm_cmp_ps_mask_true_us
-  // CHECK-NOT: call
-  // CHECK: ret i8 -1
+  // CHECK: fcmp true <4 x float> %{{.*}}, %{{.*}}
   return _mm_cmp_ps_mask(a, b, _CMP_TRUE_US);
 }
 
@@ -2182,8 +2174,8 @@ __mmask8 test_mm_mask_cmp_ps_mask_ngt_us
 
 __mmask8 test_mm_mask_cmp_ps_mask_false_oq(__mmask8 m, __m128 a, __m128 b) {
   // CHECK-LABEL: test_mm_mask_cmp_ps_mask_false_oq
-  // CHECK-NOT: call
-  // CHECK: ret i8 0
+  // CHECK: [[CMP:%.*]] = fcmp false <4 x float> %{{.*}}, %{{.*}}
+  // CHECK: and <4 x i1> [[CMP]], {{.*}}
   return _mm_mask_cmp_ps_mask(m, a, b, _CMP_FALSE_OQ);
 }
 
@@ -2210,7 +2202,8 @@ __mmask8 test_mm_mask_cmp_ps_mask_gt_os(
 
 __mmask8 test_mm_mask_cmp_ps_mask_true_uq(__mmask8 m, __m128 a, __m128 b) {
   // CHECK-LABEL: test_mm_mask_cmp_ps_mask_true_uq
-  // FIXME
+  // CHECK: [[CMP:%.*]] = fcmp true <4 x float> %{{.*}}, %{{.*}}
+  // CHECK: and <4 x i1> [[CMP]], {{.*}}
   return _mm_mask_cmp_ps_mask(m, a, b, _CMP_TRUE_UQ);
 }
 
@@ -2293,8 +2286,8 @@ __mmask8 test_mm_mask_cmp_ps_mask_ngt_uq
 
 __mmask8 test_mm_mask_cmp_ps_mask_false_os(__mmask8 m, __m128 a, __m128 b) {
   // CHECK-LABEL: test_mm_mask_cmp_ps_mask_false_os
-  // CHECK-NOT: call
-  // CHECK: ret i8 0
+  // CHECK: [[CMP:%.*]] = fcmp false <4 x float> %{{.*}}, %{{.*}}
+  // CHECK: and <4 x i1> [[CMP]], {{.*}}
   return _mm_mask_cmp_ps_mask(m, a, b, _CMP_FALSE_OS);
 }
 
@@ -2321,7 +2314,8 @@ __mmask8 test_mm_mask_cmp_ps_mask_gt_oq(
 
 __mmask8 test_mm_mask_cmp_ps_mask_true_us(__mmask8 m, __m128 a, __m128 b) {
   // CHECK-LABEL: test_mm_mask_cmp_ps_mask_true_us
-  // FIXME
+  // CHECK: [[CMP:%.*]] = fcmp true <4 x float> %{{.*}}, %{{.*}}
+  // CHECK: and <4 x i1> [[CMP]], {{.*}}
   return _mm_mask_cmp_ps_mask(m, a, b, _CMP_TRUE_US);
 }
 
@@ -2393,8 +2387,7 @@ __mmask8 test_mm_cmp_pd_mask_ngt_us(__m1
 
 __mmask8 test_mm_cmp_pd_mask_false_oq(__m128d a, __m128d b) {
   // CHECK-LABEL: test_mm_cmp_pd_mask_false_oq
-  // CHECK-NOT: call
-  // CHECK: ret i8 0
+  // CHECK: fcmp false <2 x double> %{{.*}}, %{{.*}}
   return _mm_cmp_pd_mask(a, b, _CMP_FALSE_OQ);
 }
 
@@ -2418,8 +2411,7 @@ __mmask8 test_mm_cmp_pd_mask_gt_os(__m12
 
 __mmask8 test_mm_cmp_pd_mask_true_uq(__m128d a, __m128d b) {
   // CHECK-LABEL: test_mm_cmp_pd_mask_true_uq
-  // CHECK-NOT: call
-  // CHECK: ret i8 -1
+  // CHECK: fcmp true <2 x double> %{{.*}}, %{{.*}}
   return _mm_cmp_pd_mask(a, b, _CMP_TRUE_UQ);
 }
 
@@ -2491,8 +2483,7 @@ __mmask8 test_mm_cmp_pd_mask_ngt_uq(__m1
 
 __mmask8 test_mm_cmp_pd_mask_false_os(__m128d a, __m128d b) {
   // CHECK-LABEL: test_mm_cmp_pd_mask_false_os
-  // CHECK-NOT: call
-  // CHECK: ret i8 0
+  // CHECK: fcmp false <2 x double> %{{.*}}, %{{.*}}
   return _mm_cmp_pd_mask(a, b, _CMP_FALSE_OS);
 }
 
@@ -2516,8 +2507,7 @@ __mmask8 test_mm_cmp_pd_mask_gt_oq(__m12
 
 __mmask8 test_mm_cmp_pd_mask_true_us(__m128d a, __m128d b) {
   // CHECK-LABEL: test_mm_cmp_pd_mask_true_us
-  // CHECK-NOT: call
-  // CHECK: ret i8 -1
+  // CHECK: fcmp true <2 x double> %{{.*}}, %{{.*}}
   return _mm_cmp_pd_mask(a, b, _CMP_TRUE_US);
 }
 
@@ -2600,8 +2590,8 @@ __mmask8 test_mm_mask_cmp_pd_mask_ngt_us
 
 __mmask8 test_mm_mask_cmp_pd_mask_false_oq(__mmask8 m, __m128d a, __m128d b) {
   // CHECK-LABEL: test_mm_mask_cmp_pd_mask_false_oq
-  // CHECK-NOT: call
-  // CHECK: ret i8 0
+  // CHECK: [[CMP:%.*]] = fcmp false <2 x double> %{{.*}}, %{{.*}}
+  // CHECK: and <2 x i1> [[CMP]], {{.*}}
   return _mm_mask_cmp_pd_mask(m, a, b, _CMP_FALSE_OQ);
 }
 
@@ -2628,7 +2618,8 @@ __mmask8 test_mm_mask_cmp_pd_mask_gt_os(
 
 __mmask8 test_mm_mask_cmp_pd_mask_true_uq(__mmask8 m, __m128d a, __m128d b) {
   // CHECK-LABEL: test_mm_mask_cmp_pd_mask_true_uq
-  // FIXME
+  // CHECK: [[CMP:%.*]] = fcmp true <2 x double> %{{.*}}, %{{.*}}
+  // CHECK: and <2 x i1> [[CMP]], {{.*}}
   return _mm_mask_cmp_pd_mask(m, a, b, _CMP_TRUE_UQ);
 }
 
@@ -2711,8 +2702,8 @@ __mmask8 test_mm_mask_cmp_pd_mask_ngt_uq
 
 __mmask8 test_mm_mask_cmp_pd_mask_false_os(__mmask8 m, __m128d a, __m128d b) {
   // CHECK-LABEL: test_mm_mask_cmp_pd_mask_false_os
-  // CHECK-NOT: call
-  // CHECK: ret i8 0
+  // CHECK: [[CMP:%.*]] = fcmp false <2 x double> %{{.*}}, %{{.*}}
+  // CHECK: and <2 x i1> [[CMP]], {{.*}}
   return _mm_mask_cmp_pd_mask(m, a, b, _CMP_FALSE_OS);
 }
 
@@ -2739,7 +2730,8 @@ __mmask8 test_mm_mask_cmp_pd_mask_gt_oq(
 
 __mmask8 test_mm_mask_cmp_pd_mask_true_us(__mmask8 m, __m128d a, __m128d b) {
   // CHECK-LABEL: test_mm_mask_cmp_pd_mask_true_us
-  // FIXME
+  // CHECK: [[CMP:%.*]] = fcmp true <2 x double> %{{.*}}, %{{.*}}
+  // CHECK: and <2 x i1> [[CMP]], {{.*}}
   return _mm_mask_cmp_pd_mask(m, a, b, _CMP_TRUE_US);
 }
 




More information about the cfe-commits mailing list