[llvm] r317020 - [X86][AVX512] Split AVX512F and AVX512BW bool-vector bitcast tests
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 31 11:41:48 PDT 2017
Author: rksimon
Date: Tue Oct 31 11:41:48 2017
New Revision: 317020
URL: http://llvm.org/viewvc/llvm-project?rev=317020&view=rev
Log:
[X86][AVX512] Split AVX512F and AVX512BW bool-vector bitcast tests
Modified:
llvm/trunk/test/CodeGen/X86/bitcast-and-setcc-128.ll
llvm/trunk/test/CodeGen/X86/bitcast-and-setcc-256.ll
llvm/trunk/test/CodeGen/X86/bitcast-setcc-128.ll
llvm/trunk/test/CodeGen/X86/bitcast-setcc-256.ll
Modified: llvm/trunk/test/CodeGen/X86/bitcast-and-setcc-128.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/bitcast-and-setcc-128.ll?rev=317020&r1=317019&r2=317020&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/bitcast-and-setcc-128.ll (original)
+++ llvm/trunk/test/CodeGen/X86/bitcast-and-setcc-128.ll Tue Oct 31 11:41:48 2017
@@ -3,7 +3,8 @@
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+ssse3 | FileCheck %s --check-prefixes=SSE2-SSSE3,SSSE3
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx | FileCheck %s --check-prefixes=AVX12,AVX1
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx2 | FileCheck %s --check-prefixes=AVX12,AVX2
-; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512f,+avx512vl,+avx512bw | FileCheck %s --check-prefixes=AVX512
+; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512f,+avx512vl | FileCheck %s --check-prefixes=AVX512 --check-prefixes=AVX512F
+; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512f,+avx512vl,+avx512bw | FileCheck %s --check-prefixes=AVX512 --check-prefixes=AVX512BW
define i8 @v8i16(<8 x i16> %a, <8 x i16> %b, <8 x i16> %c, <8 x i16> %d) {
; SSE2-SSSE3-LABEL: v8i16:
@@ -26,13 +27,28 @@ define i8 @v8i16(<8 x i16> %a, <8 x i16>
; AVX12-NEXT: # kill: %AL<def> %AL<kill> %EAX<kill>
; AVX12-NEXT: ret{{[l|q]}}
;
-; AVX512-LABEL: v8i16:
-; AVX512: # BB#0:
-; AVX512-NEXT: vpcmpgtw %xmm1, %xmm0, %k1
-; AVX512-NEXT: vpcmpgtw %xmm3, %xmm2, %k0 {%k1}
-; AVX512-NEXT: kmovd %k0, %eax
-; AVX512-NEXT: # kill: %AL<def> %AL<kill> %EAX<kill>
-; AVX512-NEXT: ret{{[l|q]}}
+; AVX512F-LABEL: v8i16:
+; AVX512F: # BB#0:
+; AVX512F-NEXT: vpcmpgtw %xmm1, %xmm0, %xmm0
+; AVX512F-NEXT: vpmovsxwq %xmm0, %zmm0
+; AVX512F-NEXT: vpsllq $63, %zmm0, %zmm0
+; AVX512F-NEXT: vptestmq %zmm0, %zmm0, %k1
+; AVX512F-NEXT: vpcmpgtw %xmm3, %xmm2, %xmm0
+; AVX512F-NEXT: vpmovsxwq %xmm0, %zmm0
+; AVX512F-NEXT: vpsllq $63, %zmm0, %zmm0
+; AVX512F-NEXT: vptestmq %zmm0, %zmm0, %k0 {%k1}
+; AVX512F-NEXT: kmovw %k0, %eax
+; AVX512F-NEXT: # kill: %AL<def> %AL<kill> %EAX<kill>
+; AVX512F-NEXT: vzeroupper
+; AVX512F-NEXT: ret{{[l|q]}}
+;
+; AVX512BW-LABEL: v8i16:
+; AVX512BW: # BB#0:
+; AVX512BW-NEXT: vpcmpgtw %xmm1, %xmm0, %k1
+; AVX512BW-NEXT: vpcmpgtw %xmm3, %xmm2, %k0 {%k1}
+; AVX512BW-NEXT: kmovd %k0, %eax
+; AVX512BW-NEXT: # kill: %AL<def> %AL<kill> %EAX<kill>
+; AVX512BW-NEXT: ret{{[l|q]}}
%x0 = icmp sgt <8 x i16> %a, %b
%x1 = icmp sgt <8 x i16> %c, %d
%y = and <8 x i1> %x0, %x1
@@ -59,14 +75,23 @@ define i4 @v4i32(<4 x i32> %a, <4 x i32>
; AVX12-NEXT: # kill: %AL<def> %AL<kill> %EAX<kill>
; AVX12-NEXT: ret{{[l|q]}}
;
-; AVX512-LABEL: v4i32:
-; AVX512: # BB#0:
-; AVX512-NEXT: vpcmpgtd %xmm1, %xmm0, %k1
-; AVX512-NEXT: vpcmpgtd %xmm3, %xmm2, %k0 {%k1}
-; AVX512-NEXT: kmovd %k0, %eax
-; AVX512-NEXT: movb %al, -{{[0-9]+}}(%rsp)
-; AVX512-NEXT: movb -{{[0-9]+}}(%rsp), %al
-; AVX512-NEXT: ret{{[l|q]}}
+; AVX512F-LABEL: v4i32:
+; AVX512F: # BB#0:
+; AVX512F-NEXT: vpcmpgtd %xmm1, %xmm0, %k1
+; AVX512F-NEXT: vpcmpgtd %xmm3, %xmm2, %k0 {%k1}
+; AVX512F-NEXT: kmovw %k0, %eax
+; AVX512F-NEXT: movb %al, -{{[0-9]+}}(%rsp)
+; AVX512F-NEXT: movb -{{[0-9]+}}(%rsp), %al
+; AVX512F-NEXT: ret{{[l|q]}}
+;
+; AVX512BW-LABEL: v4i32:
+; AVX512BW: # BB#0:
+; AVX512BW-NEXT: vpcmpgtd %xmm1, %xmm0, %k1
+; AVX512BW-NEXT: vpcmpgtd %xmm3, %xmm2, %k0 {%k1}
+; AVX512BW-NEXT: kmovd %k0, %eax
+; AVX512BW-NEXT: movb %al, -{{[0-9]+}}(%rsp)
+; AVX512BW-NEXT: movb -{{[0-9]+}}(%rsp), %al
+; AVX512BW-NEXT: ret{{[l|q]}}
%x0 = icmp sgt <4 x i32> %a, %b
%x1 = icmp sgt <4 x i32> %c, %d
%y = and <4 x i1> %x0, %x1
@@ -93,14 +118,23 @@ define i4 @v4f32(<4 x float> %a, <4 x fl
; AVX12-NEXT: # kill: %AL<def> %AL<kill> %EAX<kill>
; AVX12-NEXT: ret{{[l|q]}}
;
-; AVX512-LABEL: v4f32:
-; AVX512: # BB#0:
-; AVX512-NEXT: vcmpltps %xmm0, %xmm1, %k1
-; AVX512-NEXT: vcmpltps %xmm2, %xmm3, %k0 {%k1}
-; AVX512-NEXT: kmovd %k0, %eax
-; AVX512-NEXT: movb %al, -{{[0-9]+}}(%rsp)
-; AVX512-NEXT: movb -{{[0-9]+}}(%rsp), %al
-; AVX512-NEXT: ret{{[l|q]}}
+; AVX512F-LABEL: v4f32:
+; AVX512F: # BB#0:
+; AVX512F-NEXT: vcmpltps %xmm0, %xmm1, %k1
+; AVX512F-NEXT: vcmpltps %xmm2, %xmm3, %k0 {%k1}
+; AVX512F-NEXT: kmovw %k0, %eax
+; AVX512F-NEXT: movb %al, -{{[0-9]+}}(%rsp)
+; AVX512F-NEXT: movb -{{[0-9]+}}(%rsp), %al
+; AVX512F-NEXT: ret{{[l|q]}}
+;
+; AVX512BW-LABEL: v4f32:
+; AVX512BW: # BB#0:
+; AVX512BW-NEXT: vcmpltps %xmm0, %xmm1, %k1
+; AVX512BW-NEXT: vcmpltps %xmm2, %xmm3, %k0 {%k1}
+; AVX512BW-NEXT: kmovd %k0, %eax
+; AVX512BW-NEXT: movb %al, -{{[0-9]+}}(%rsp)
+; AVX512BW-NEXT: movb -{{[0-9]+}}(%rsp), %al
+; AVX512BW-NEXT: ret{{[l|q]}}
%x0 = fcmp ogt <4 x float> %a, %b
%x1 = fcmp ogt <4 x float> %c, %d
%y = and <4 x i1> %x0, %x1
@@ -127,13 +161,28 @@ define i16 @v16i8(<16 x i8> %a, <16 x i8
; AVX12-NEXT: # kill: %AX<def> %AX<kill> %EAX<kill>
; AVX12-NEXT: ret{{[l|q]}}
;
-; AVX512-LABEL: v16i8:
-; AVX512: # BB#0:
-; AVX512-NEXT: vpcmpgtb %xmm1, %xmm0, %k1
-; AVX512-NEXT: vpcmpgtb %xmm3, %xmm2, %k0 {%k1}
-; AVX512-NEXT: kmovd %k0, %eax
-; AVX512-NEXT: # kill: %AX<def> %AX<kill> %EAX<kill>
-; AVX512-NEXT: ret{{[l|q]}}
+; AVX512F-LABEL: v16i8:
+; AVX512F: # BB#0:
+; AVX512F-NEXT: vpcmpgtb %xmm1, %xmm0, %xmm0
+; AVX512F-NEXT: vpmovsxbd %xmm0, %zmm0
+; AVX512F-NEXT: vpslld $31, %zmm0, %zmm0
+; AVX512F-NEXT: vptestmd %zmm0, %zmm0, %k1
+; AVX512F-NEXT: vpcmpgtb %xmm3, %xmm2, %xmm0
+; AVX512F-NEXT: vpmovsxbd %xmm0, %zmm0
+; AVX512F-NEXT: vpslld $31, %zmm0, %zmm0
+; AVX512F-NEXT: vptestmd %zmm0, %zmm0, %k0 {%k1}
+; AVX512F-NEXT: kmovw %k0, %eax
+; AVX512F-NEXT: # kill: %AX<def> %AX<kill> %EAX<kill>
+; AVX512F-NEXT: vzeroupper
+; AVX512F-NEXT: ret{{[l|q]}}
+;
+; AVX512BW-LABEL: v16i8:
+; AVX512BW: # BB#0:
+; AVX512BW-NEXT: vpcmpgtb %xmm1, %xmm0, %k1
+; AVX512BW-NEXT: vpcmpgtb %xmm3, %xmm2, %k0 {%k1}
+; AVX512BW-NEXT: kmovd %k0, %eax
+; AVX512BW-NEXT: # kill: %AX<def> %AX<kill> %EAX<kill>
+; AVX512BW-NEXT: ret{{[l|q]}}
%x0 = icmp sgt <16 x i8> %a, %b
%x1 = icmp sgt <16 x i8> %c, %d
%y = and <16 x i1> %x0, %x1
@@ -256,22 +305,39 @@ define i2 @v2i8(<2 x i8> %a, <2 x i8> %b
; AVX2-NEXT: # kill: %AL<def> %AL<kill> %EAX<kill>
; AVX2-NEXT: ret{{[l|q]}}
;
-; AVX512-LABEL: v2i8:
-; AVX512: # BB#0:
-; AVX512-NEXT: vpsllq $56, %xmm3, %xmm3
-; AVX512-NEXT: vpsraq $56, %xmm3, %xmm3
-; AVX512-NEXT: vpsllq $56, %xmm2, %xmm2
-; AVX512-NEXT: vpsraq $56, %xmm2, %xmm2
-; AVX512-NEXT: vpsllq $56, %xmm1, %xmm1
-; AVX512-NEXT: vpsraq $56, %xmm1, %xmm1
-; AVX512-NEXT: vpsllq $56, %xmm0, %xmm0
-; AVX512-NEXT: vpsraq $56, %xmm0, %xmm0
-; AVX512-NEXT: vpcmpgtq %xmm1, %xmm0, %k1
-; AVX512-NEXT: vpcmpgtq %xmm3, %xmm2, %k0 {%k1}
-; AVX512-NEXT: kmovd %k0, %eax
-; AVX512-NEXT: movb %al, -{{[0-9]+}}(%rsp)
-; AVX512-NEXT: movb -{{[0-9]+}}(%rsp), %al
-; AVX512-NEXT: ret{{[l|q]}}
+; AVX512F-LABEL: v2i8:
+; AVX512F: # BB#0:
+; AVX512F-NEXT: vpsllq $56, %xmm3, %xmm3
+; AVX512F-NEXT: vpsraq $56, %xmm3, %xmm3
+; AVX512F-NEXT: vpsllq $56, %xmm2, %xmm2
+; AVX512F-NEXT: vpsraq $56, %xmm2, %xmm2
+; AVX512F-NEXT: vpsllq $56, %xmm1, %xmm1
+; AVX512F-NEXT: vpsraq $56, %xmm1, %xmm1
+; AVX512F-NEXT: vpsllq $56, %xmm0, %xmm0
+; AVX512F-NEXT: vpsraq $56, %xmm0, %xmm0
+; AVX512F-NEXT: vpcmpgtq %xmm1, %xmm0, %k1
+; AVX512F-NEXT: vpcmpgtq %xmm3, %xmm2, %k0 {%k1}
+; AVX512F-NEXT: kmovw %k0, %eax
+; AVX512F-NEXT: movb %al, -{{[0-9]+}}(%rsp)
+; AVX512F-NEXT: movb -{{[0-9]+}}(%rsp), %al
+; AVX512F-NEXT: ret{{[l|q]}}
+;
+; AVX512BW-LABEL: v2i8:
+; AVX512BW: # BB#0:
+; AVX512BW-NEXT: vpsllq $56, %xmm3, %xmm3
+; AVX512BW-NEXT: vpsraq $56, %xmm3, %xmm3
+; AVX512BW-NEXT: vpsllq $56, %xmm2, %xmm2
+; AVX512BW-NEXT: vpsraq $56, %xmm2, %xmm2
+; AVX512BW-NEXT: vpsllq $56, %xmm1, %xmm1
+; AVX512BW-NEXT: vpsraq $56, %xmm1, %xmm1
+; AVX512BW-NEXT: vpsllq $56, %xmm0, %xmm0
+; AVX512BW-NEXT: vpsraq $56, %xmm0, %xmm0
+; AVX512BW-NEXT: vpcmpgtq %xmm1, %xmm0, %k1
+; AVX512BW-NEXT: vpcmpgtq %xmm3, %xmm2, %k0 {%k1}
+; AVX512BW-NEXT: kmovd %k0, %eax
+; AVX512BW-NEXT: movb %al, -{{[0-9]+}}(%rsp)
+; AVX512BW-NEXT: movb -{{[0-9]+}}(%rsp), %al
+; AVX512BW-NEXT: ret{{[l|q]}}
%x0 = icmp sgt <2 x i8> %a, %b
%x1 = icmp sgt <2 x i8> %c, %d
%y = and <2 x i1> %x0, %x1
@@ -394,22 +460,39 @@ define i2 @v2i16(<2 x i16> %a, <2 x i16>
; AVX2-NEXT: # kill: %AL<def> %AL<kill> %EAX<kill>
; AVX2-NEXT: ret{{[l|q]}}
;
-; AVX512-LABEL: v2i16:
-; AVX512: # BB#0:
-; AVX512-NEXT: vpsllq $48, %xmm3, %xmm3
-; AVX512-NEXT: vpsraq $48, %xmm3, %xmm3
-; AVX512-NEXT: vpsllq $48, %xmm2, %xmm2
-; AVX512-NEXT: vpsraq $48, %xmm2, %xmm2
-; AVX512-NEXT: vpsllq $48, %xmm1, %xmm1
-; AVX512-NEXT: vpsraq $48, %xmm1, %xmm1
-; AVX512-NEXT: vpsllq $48, %xmm0, %xmm0
-; AVX512-NEXT: vpsraq $48, %xmm0, %xmm0
-; AVX512-NEXT: vpcmpgtq %xmm1, %xmm0, %k1
-; AVX512-NEXT: vpcmpgtq %xmm3, %xmm2, %k0 {%k1}
-; AVX512-NEXT: kmovd %k0, %eax
-; AVX512-NEXT: movb %al, -{{[0-9]+}}(%rsp)
-; AVX512-NEXT: movb -{{[0-9]+}}(%rsp), %al
-; AVX512-NEXT: ret{{[l|q]}}
+; AVX512F-LABEL: v2i16:
+; AVX512F: # BB#0:
+; AVX512F-NEXT: vpsllq $48, %xmm3, %xmm3
+; AVX512F-NEXT: vpsraq $48, %xmm3, %xmm3
+; AVX512F-NEXT: vpsllq $48, %xmm2, %xmm2
+; AVX512F-NEXT: vpsraq $48, %xmm2, %xmm2
+; AVX512F-NEXT: vpsllq $48, %xmm1, %xmm1
+; AVX512F-NEXT: vpsraq $48, %xmm1, %xmm1
+; AVX512F-NEXT: vpsllq $48, %xmm0, %xmm0
+; AVX512F-NEXT: vpsraq $48, %xmm0, %xmm0
+; AVX512F-NEXT: vpcmpgtq %xmm1, %xmm0, %k1
+; AVX512F-NEXT: vpcmpgtq %xmm3, %xmm2, %k0 {%k1}
+; AVX512F-NEXT: kmovw %k0, %eax
+; AVX512F-NEXT: movb %al, -{{[0-9]+}}(%rsp)
+; AVX512F-NEXT: movb -{{[0-9]+}}(%rsp), %al
+; AVX512F-NEXT: ret{{[l|q]}}
+;
+; AVX512BW-LABEL: v2i16:
+; AVX512BW: # BB#0:
+; AVX512BW-NEXT: vpsllq $48, %xmm3, %xmm3
+; AVX512BW-NEXT: vpsraq $48, %xmm3, %xmm3
+; AVX512BW-NEXT: vpsllq $48, %xmm2, %xmm2
+; AVX512BW-NEXT: vpsraq $48, %xmm2, %xmm2
+; AVX512BW-NEXT: vpsllq $48, %xmm1, %xmm1
+; AVX512BW-NEXT: vpsraq $48, %xmm1, %xmm1
+; AVX512BW-NEXT: vpsllq $48, %xmm0, %xmm0
+; AVX512BW-NEXT: vpsraq $48, %xmm0, %xmm0
+; AVX512BW-NEXT: vpcmpgtq %xmm1, %xmm0, %k1
+; AVX512BW-NEXT: vpcmpgtq %xmm3, %xmm2, %k0 {%k1}
+; AVX512BW-NEXT: kmovd %k0, %eax
+; AVX512BW-NEXT: movb %al, -{{[0-9]+}}(%rsp)
+; AVX512BW-NEXT: movb -{{[0-9]+}}(%rsp), %al
+; AVX512BW-NEXT: ret{{[l|q]}}
%x0 = icmp sgt <2 x i16> %a, %b
%x1 = icmp sgt <2 x i16> %c, %d
%y = and <2 x i1> %x0, %x1
@@ -516,22 +599,39 @@ define i2 @v2i32(<2 x i32> %a, <2 x i32>
; AVX2-NEXT: # kill: %AL<def> %AL<kill> %EAX<kill>
; AVX2-NEXT: ret{{[l|q]}}
;
-; AVX512-LABEL: v2i32:
-; AVX512: # BB#0:
-; AVX512-NEXT: vpsllq $32, %xmm3, %xmm3
-; AVX512-NEXT: vpsraq $32, %xmm3, %xmm3
-; AVX512-NEXT: vpsllq $32, %xmm2, %xmm2
-; AVX512-NEXT: vpsraq $32, %xmm2, %xmm2
-; AVX512-NEXT: vpsllq $32, %xmm1, %xmm1
-; AVX512-NEXT: vpsraq $32, %xmm1, %xmm1
-; AVX512-NEXT: vpsllq $32, %xmm0, %xmm0
-; AVX512-NEXT: vpsraq $32, %xmm0, %xmm0
-; AVX512-NEXT: vpcmpgtq %xmm1, %xmm0, %k1
-; AVX512-NEXT: vpcmpgtq %xmm3, %xmm2, %k0 {%k1}
-; AVX512-NEXT: kmovd %k0, %eax
-; AVX512-NEXT: movb %al, -{{[0-9]+}}(%rsp)
-; AVX512-NEXT: movb -{{[0-9]+}}(%rsp), %al
-; AVX512-NEXT: ret{{[l|q]}}
+; AVX512F-LABEL: v2i32:
+; AVX512F: # BB#0:
+; AVX512F-NEXT: vpsllq $32, %xmm3, %xmm3
+; AVX512F-NEXT: vpsraq $32, %xmm3, %xmm3
+; AVX512F-NEXT: vpsllq $32, %xmm2, %xmm2
+; AVX512F-NEXT: vpsraq $32, %xmm2, %xmm2
+; AVX512F-NEXT: vpsllq $32, %xmm1, %xmm1
+; AVX512F-NEXT: vpsraq $32, %xmm1, %xmm1
+; AVX512F-NEXT: vpsllq $32, %xmm0, %xmm0
+; AVX512F-NEXT: vpsraq $32, %xmm0, %xmm0
+; AVX512F-NEXT: vpcmpgtq %xmm1, %xmm0, %k1
+; AVX512F-NEXT: vpcmpgtq %xmm3, %xmm2, %k0 {%k1}
+; AVX512F-NEXT: kmovw %k0, %eax
+; AVX512F-NEXT: movb %al, -{{[0-9]+}}(%rsp)
+; AVX512F-NEXT: movb -{{[0-9]+}}(%rsp), %al
+; AVX512F-NEXT: ret{{[l|q]}}
+;
+; AVX512BW-LABEL: v2i32:
+; AVX512BW: # BB#0:
+; AVX512BW-NEXT: vpsllq $32, %xmm3, %xmm3
+; AVX512BW-NEXT: vpsraq $32, %xmm3, %xmm3
+; AVX512BW-NEXT: vpsllq $32, %xmm2, %xmm2
+; AVX512BW-NEXT: vpsraq $32, %xmm2, %xmm2
+; AVX512BW-NEXT: vpsllq $32, %xmm1, %xmm1
+; AVX512BW-NEXT: vpsraq $32, %xmm1, %xmm1
+; AVX512BW-NEXT: vpsllq $32, %xmm0, %xmm0
+; AVX512BW-NEXT: vpsraq $32, %xmm0, %xmm0
+; AVX512BW-NEXT: vpcmpgtq %xmm1, %xmm0, %k1
+; AVX512BW-NEXT: vpcmpgtq %xmm3, %xmm2, %k0 {%k1}
+; AVX512BW-NEXT: kmovd %k0, %eax
+; AVX512BW-NEXT: movb %al, -{{[0-9]+}}(%rsp)
+; AVX512BW-NEXT: movb -{{[0-9]+}}(%rsp), %al
+; AVX512BW-NEXT: ret{{[l|q]}}
%x0 = icmp sgt <2 x i32> %a, %b
%x1 = icmp sgt <2 x i32> %c, %d
%y = and <2 x i1> %x0, %x1
@@ -577,14 +677,23 @@ define i2 @v2i64(<2 x i64> %a, <2 x i64>
; AVX12-NEXT: # kill: %AL<def> %AL<kill> %EAX<kill>
; AVX12-NEXT: ret{{[l|q]}}
;
-; AVX512-LABEL: v2i64:
-; AVX512: # BB#0:
-; AVX512-NEXT: vpcmpgtq %xmm1, %xmm0, %k1
-; AVX512-NEXT: vpcmpgtq %xmm3, %xmm2, %k0 {%k1}
-; AVX512-NEXT: kmovd %k0, %eax
-; AVX512-NEXT: movb %al, -{{[0-9]+}}(%rsp)
-; AVX512-NEXT: movb -{{[0-9]+}}(%rsp), %al
-; AVX512-NEXT: ret{{[l|q]}}
+; AVX512F-LABEL: v2i64:
+; AVX512F: # BB#0:
+; AVX512F-NEXT: vpcmpgtq %xmm1, %xmm0, %k1
+; AVX512F-NEXT: vpcmpgtq %xmm3, %xmm2, %k0 {%k1}
+; AVX512F-NEXT: kmovw %k0, %eax
+; AVX512F-NEXT: movb %al, -{{[0-9]+}}(%rsp)
+; AVX512F-NEXT: movb -{{[0-9]+}}(%rsp), %al
+; AVX512F-NEXT: ret{{[l|q]}}
+;
+; AVX512BW-LABEL: v2i64:
+; AVX512BW: # BB#0:
+; AVX512BW-NEXT: vpcmpgtq %xmm1, %xmm0, %k1
+; AVX512BW-NEXT: vpcmpgtq %xmm3, %xmm2, %k0 {%k1}
+; AVX512BW-NEXT: kmovd %k0, %eax
+; AVX512BW-NEXT: movb %al, -{{[0-9]+}}(%rsp)
+; AVX512BW-NEXT: movb -{{[0-9]+}}(%rsp), %al
+; AVX512BW-NEXT: ret{{[l|q]}}
%x0 = icmp sgt <2 x i64> %a, %b
%x1 = icmp sgt <2 x i64> %c, %d
%y = and <2 x i1> %x0, %x1
@@ -611,14 +720,23 @@ define i2 @v2f64(<2 x double> %a, <2 x d
; AVX12-NEXT: # kill: %AL<def> %AL<kill> %EAX<kill>
; AVX12-NEXT: ret{{[l|q]}}
;
-; AVX512-LABEL: v2f64:
-; AVX512: # BB#0:
-; AVX512-NEXT: vcmpltpd %xmm0, %xmm1, %k1
-; AVX512-NEXT: vcmpltpd %xmm2, %xmm3, %k0 {%k1}
-; AVX512-NEXT: kmovd %k0, %eax
-; AVX512-NEXT: movb %al, -{{[0-9]+}}(%rsp)
-; AVX512-NEXT: movb -{{[0-9]+}}(%rsp), %al
-; AVX512-NEXT: ret{{[l|q]}}
+; AVX512F-LABEL: v2f64:
+; AVX512F: # BB#0:
+; AVX512F-NEXT: vcmpltpd %xmm0, %xmm1, %k1
+; AVX512F-NEXT: vcmpltpd %xmm2, %xmm3, %k0 {%k1}
+; AVX512F-NEXT: kmovw %k0, %eax
+; AVX512F-NEXT: movb %al, -{{[0-9]+}}(%rsp)
+; AVX512F-NEXT: movb -{{[0-9]+}}(%rsp), %al
+; AVX512F-NEXT: ret{{[l|q]}}
+;
+; AVX512BW-LABEL: v2f64:
+; AVX512BW: # BB#0:
+; AVX512BW-NEXT: vcmpltpd %xmm0, %xmm1, %k1
+; AVX512BW-NEXT: vcmpltpd %xmm2, %xmm3, %k0 {%k1}
+; AVX512BW-NEXT: kmovd %k0, %eax
+; AVX512BW-NEXT: movb %al, -{{[0-9]+}}(%rsp)
+; AVX512BW-NEXT: movb -{{[0-9]+}}(%rsp), %al
+; AVX512BW-NEXT: ret{{[l|q]}}
%x0 = fcmp ogt <2 x double> %a, %b
%x1 = fcmp ogt <2 x double> %c, %d
%y = and <2 x i1> %x0, %x1
@@ -661,22 +779,39 @@ define i4 @v4i8(<4 x i8> %a, <4 x i8> %b
; AVX12-NEXT: # kill: %AL<def> %AL<kill> %EAX<kill>
; AVX12-NEXT: ret{{[l|q]}}
;
-; AVX512-LABEL: v4i8:
-; AVX512: # BB#0:
-; AVX512-NEXT: vpslld $24, %xmm3, %xmm3
-; AVX512-NEXT: vpsrad $24, %xmm3, %xmm3
-; AVX512-NEXT: vpslld $24, %xmm2, %xmm2
-; AVX512-NEXT: vpsrad $24, %xmm2, %xmm2
-; AVX512-NEXT: vpslld $24, %xmm1, %xmm1
-; AVX512-NEXT: vpsrad $24, %xmm1, %xmm1
-; AVX512-NEXT: vpslld $24, %xmm0, %xmm0
-; AVX512-NEXT: vpsrad $24, %xmm0, %xmm0
-; AVX512-NEXT: vpcmpgtd %xmm1, %xmm0, %k1
-; AVX512-NEXT: vpcmpgtd %xmm3, %xmm2, %k0 {%k1}
-; AVX512-NEXT: kmovd %k0, %eax
-; AVX512-NEXT: movb %al, -{{[0-9]+}}(%rsp)
-; AVX512-NEXT: movb -{{[0-9]+}}(%rsp), %al
-; AVX512-NEXT: ret{{[l|q]}}
+; AVX512F-LABEL: v4i8:
+; AVX512F: # BB#0:
+; AVX512F-NEXT: vpslld $24, %xmm3, %xmm3
+; AVX512F-NEXT: vpsrad $24, %xmm3, %xmm3
+; AVX512F-NEXT: vpslld $24, %xmm2, %xmm2
+; AVX512F-NEXT: vpsrad $24, %xmm2, %xmm2
+; AVX512F-NEXT: vpslld $24, %xmm1, %xmm1
+; AVX512F-NEXT: vpsrad $24, %xmm1, %xmm1
+; AVX512F-NEXT: vpslld $24, %xmm0, %xmm0
+; AVX512F-NEXT: vpsrad $24, %xmm0, %xmm0
+; AVX512F-NEXT: vpcmpgtd %xmm1, %xmm0, %k1
+; AVX512F-NEXT: vpcmpgtd %xmm3, %xmm2, %k0 {%k1}
+; AVX512F-NEXT: kmovw %k0, %eax
+; AVX512F-NEXT: movb %al, -{{[0-9]+}}(%rsp)
+; AVX512F-NEXT: movb -{{[0-9]+}}(%rsp), %al
+; AVX512F-NEXT: ret{{[l|q]}}
+;
+; AVX512BW-LABEL: v4i8:
+; AVX512BW: # BB#0:
+; AVX512BW-NEXT: vpslld $24, %xmm3, %xmm3
+; AVX512BW-NEXT: vpsrad $24, %xmm3, %xmm3
+; AVX512BW-NEXT: vpslld $24, %xmm2, %xmm2
+; AVX512BW-NEXT: vpsrad $24, %xmm2, %xmm2
+; AVX512BW-NEXT: vpslld $24, %xmm1, %xmm1
+; AVX512BW-NEXT: vpsrad $24, %xmm1, %xmm1
+; AVX512BW-NEXT: vpslld $24, %xmm0, %xmm0
+; AVX512BW-NEXT: vpsrad $24, %xmm0, %xmm0
+; AVX512BW-NEXT: vpcmpgtd %xmm1, %xmm0, %k1
+; AVX512BW-NEXT: vpcmpgtd %xmm3, %xmm2, %k0 {%k1}
+; AVX512BW-NEXT: kmovd %k0, %eax
+; AVX512BW-NEXT: movb %al, -{{[0-9]+}}(%rsp)
+; AVX512BW-NEXT: movb -{{[0-9]+}}(%rsp), %al
+; AVX512BW-NEXT: ret{{[l|q]}}
%x0 = icmp sgt <4 x i8> %a, %b
%x1 = icmp sgt <4 x i8> %c, %d
%y = and <4 x i1> %x0, %x1
@@ -719,22 +854,39 @@ define i4 @v4i16(<4 x i16> %a, <4 x i16>
; AVX12-NEXT: # kill: %AL<def> %AL<kill> %EAX<kill>
; AVX12-NEXT: ret{{[l|q]}}
;
-; AVX512-LABEL: v4i16:
-; AVX512: # BB#0:
-; AVX512-NEXT: vpslld $16, %xmm3, %xmm3
-; AVX512-NEXT: vpsrad $16, %xmm3, %xmm3
-; AVX512-NEXT: vpslld $16, %xmm2, %xmm2
-; AVX512-NEXT: vpsrad $16, %xmm2, %xmm2
-; AVX512-NEXT: vpslld $16, %xmm1, %xmm1
-; AVX512-NEXT: vpsrad $16, %xmm1, %xmm1
-; AVX512-NEXT: vpslld $16, %xmm0, %xmm0
-; AVX512-NEXT: vpsrad $16, %xmm0, %xmm0
-; AVX512-NEXT: vpcmpgtd %xmm1, %xmm0, %k1
-; AVX512-NEXT: vpcmpgtd %xmm3, %xmm2, %k0 {%k1}
-; AVX512-NEXT: kmovd %k0, %eax
-; AVX512-NEXT: movb %al, -{{[0-9]+}}(%rsp)
-; AVX512-NEXT: movb -{{[0-9]+}}(%rsp), %al
-; AVX512-NEXT: ret{{[l|q]}}
+; AVX512F-LABEL: v4i16:
+; AVX512F: # BB#0:
+; AVX512F-NEXT: vpslld $16, %xmm3, %xmm3
+; AVX512F-NEXT: vpsrad $16, %xmm3, %xmm3
+; AVX512F-NEXT: vpslld $16, %xmm2, %xmm2
+; AVX512F-NEXT: vpsrad $16, %xmm2, %xmm2
+; AVX512F-NEXT: vpslld $16, %xmm1, %xmm1
+; AVX512F-NEXT: vpsrad $16, %xmm1, %xmm1
+; AVX512F-NEXT: vpslld $16, %xmm0, %xmm0
+; AVX512F-NEXT: vpsrad $16, %xmm0, %xmm0
+; AVX512F-NEXT: vpcmpgtd %xmm1, %xmm0, %k1
+; AVX512F-NEXT: vpcmpgtd %xmm3, %xmm2, %k0 {%k1}
+; AVX512F-NEXT: kmovw %k0, %eax
+; AVX512F-NEXT: movb %al, -{{[0-9]+}}(%rsp)
+; AVX512F-NEXT: movb -{{[0-9]+}}(%rsp), %al
+; AVX512F-NEXT: ret{{[l|q]}}
+;
+; AVX512BW-LABEL: v4i16:
+; AVX512BW: # BB#0:
+; AVX512BW-NEXT: vpslld $16, %xmm3, %xmm3
+; AVX512BW-NEXT: vpsrad $16, %xmm3, %xmm3
+; AVX512BW-NEXT: vpslld $16, %xmm2, %xmm2
+; AVX512BW-NEXT: vpsrad $16, %xmm2, %xmm2
+; AVX512BW-NEXT: vpslld $16, %xmm1, %xmm1
+; AVX512BW-NEXT: vpsrad $16, %xmm1, %xmm1
+; AVX512BW-NEXT: vpslld $16, %xmm0, %xmm0
+; AVX512BW-NEXT: vpsrad $16, %xmm0, %xmm0
+; AVX512BW-NEXT: vpcmpgtd %xmm1, %xmm0, %k1
+; AVX512BW-NEXT: vpcmpgtd %xmm3, %xmm2, %k0 {%k1}
+; AVX512BW-NEXT: kmovd %k0, %eax
+; AVX512BW-NEXT: movb %al, -{{[0-9]+}}(%rsp)
+; AVX512BW-NEXT: movb -{{[0-9]+}}(%rsp), %al
+; AVX512BW-NEXT: ret{{[l|q]}}
%x0 = icmp sgt <4 x i16> %a, %b
%x1 = icmp sgt <4 x i16> %c, %d
%y = and <4 x i1> %x0, %x1
@@ -779,21 +931,44 @@ define i8 @v8i8(<8 x i8> %a, <8 x i8> %b
; AVX12-NEXT: # kill: %AL<def> %AL<kill> %EAX<kill>
; AVX12-NEXT: ret{{[l|q]}}
;
-; AVX512-LABEL: v8i8:
-; AVX512: # BB#0:
-; AVX512-NEXT: vpsllw $8, %xmm3, %xmm3
-; AVX512-NEXT: vpsraw $8, %xmm3, %xmm3
-; AVX512-NEXT: vpsllw $8, %xmm2, %xmm2
-; AVX512-NEXT: vpsraw $8, %xmm2, %xmm2
-; AVX512-NEXT: vpsllw $8, %xmm1, %xmm1
-; AVX512-NEXT: vpsraw $8, %xmm1, %xmm1
-; AVX512-NEXT: vpsllw $8, %xmm0, %xmm0
-; AVX512-NEXT: vpsraw $8, %xmm0, %xmm0
-; AVX512-NEXT: vpcmpgtw %xmm1, %xmm0, %k1
-; AVX512-NEXT: vpcmpgtw %xmm3, %xmm2, %k0 {%k1}
-; AVX512-NEXT: kmovd %k0, %eax
-; AVX512-NEXT: # kill: %AL<def> %AL<kill> %EAX<kill>
-; AVX512-NEXT: ret{{[l|q]}}
+; AVX512F-LABEL: v8i8:
+; AVX512F: # BB#0:
+; AVX512F-NEXT: vpsllw $8, %xmm3, %xmm3
+; AVX512F-NEXT: vpsraw $8, %xmm3, %xmm3
+; AVX512F-NEXT: vpsllw $8, %xmm2, %xmm2
+; AVX512F-NEXT: vpsraw $8, %xmm2, %xmm2
+; AVX512F-NEXT: vpcmpgtw %xmm3, %xmm2, %xmm2
+; AVX512F-NEXT: vpsllw $8, %xmm1, %xmm1
+; AVX512F-NEXT: vpsraw $8, %xmm1, %xmm1
+; AVX512F-NEXT: vpsllw $8, %xmm0, %xmm0
+; AVX512F-NEXT: vpsraw $8, %xmm0, %xmm0
+; AVX512F-NEXT: vpcmpgtw %xmm1, %xmm0, %xmm0
+; AVX512F-NEXT: vpmovsxwq %xmm0, %zmm0
+; AVX512F-NEXT: vpsllq $63, %zmm0, %zmm0
+; AVX512F-NEXT: vptestmq %zmm0, %zmm0, %k1
+; AVX512F-NEXT: vpmovsxwq %xmm2, %zmm0
+; AVX512F-NEXT: vpsllq $63, %zmm0, %zmm0
+; AVX512F-NEXT: vptestmq %zmm0, %zmm0, %k0 {%k1}
+; AVX512F-NEXT: kmovw %k0, %eax
+; AVX512F-NEXT: # kill: %AL<def> %AL<kill> %EAX<kill>
+; AVX512F-NEXT: vzeroupper
+; AVX512F-NEXT: ret{{[l|q]}}
+;
+; AVX512BW-LABEL: v8i8:
+; AVX512BW: # BB#0:
+; AVX512BW-NEXT: vpsllw $8, %xmm3, %xmm3
+; AVX512BW-NEXT: vpsraw $8, %xmm3, %xmm3
+; AVX512BW-NEXT: vpsllw $8, %xmm2, %xmm2
+; AVX512BW-NEXT: vpsraw $8, %xmm2, %xmm2
+; AVX512BW-NEXT: vpsllw $8, %xmm1, %xmm1
+; AVX512BW-NEXT: vpsraw $8, %xmm1, %xmm1
+; AVX512BW-NEXT: vpsllw $8, %xmm0, %xmm0
+; AVX512BW-NEXT: vpsraw $8, %xmm0, %xmm0
+; AVX512BW-NEXT: vpcmpgtw %xmm1, %xmm0, %k1
+; AVX512BW-NEXT: vpcmpgtw %xmm3, %xmm2, %k0 {%k1}
+; AVX512BW-NEXT: kmovd %k0, %eax
+; AVX512BW-NEXT: # kill: %AL<def> %AL<kill> %EAX<kill>
+; AVX512BW-NEXT: ret{{[l|q]}}
%x0 = icmp sgt <8 x i8> %a, %b
%x1 = icmp sgt <8 x i8> %c, %d
%y = and <8 x i1> %x0, %x1
Modified: llvm/trunk/test/CodeGen/X86/bitcast-and-setcc-256.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/bitcast-and-setcc-256.ll?rev=317020&r1=317019&r2=317020&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/bitcast-and-setcc-256.ll (original)
+++ llvm/trunk/test/CodeGen/X86/bitcast-and-setcc-256.ll Tue Oct 31 11:41:48 2017
@@ -3,7 +3,8 @@
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+SSSE3 | FileCheck %s --check-prefixes=SSE2-SSSE3,SSSE3
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx | FileCheck %s --check-prefixes=AVX12,AVX1
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx2 | FileCheck %s --check-prefixes=AVX12,AVX2
-; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512f,+avx512vl,+avx512bw | FileCheck %s --check-prefix=AVX512
+; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512f,+avx512vl | FileCheck %s --check-prefix=AVX512 --check-prefix=AVX512F
+; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512f,+avx512vl,+avx512bw | FileCheck %s --check-prefix=AVX512 --check-prefix=AVX512BW
define i4 @v4i64(<4 x i64> %a, <4 x i64> %b, <4 x i64> %c, <4 x i64> %d) {
; SSE2-SSSE3-LABEL: v4i64:
@@ -88,15 +89,25 @@ define i4 @v4i64(<4 x i64> %a, <4 x i64>
; AVX2-NEXT: vzeroupper
; AVX2-NEXT: ret{{[l|q]}}
;
-; AVX512-LABEL: v4i64:
-; AVX512: # BB#0:
-; AVX512-NEXT: vpcmpgtq %ymm1, %ymm0, %k1
-; AVX512-NEXT: vpcmpgtq %ymm3, %ymm2, %k0 {%k1}
-; AVX512-NEXT: kmovd %k0, %eax
-; AVX512-NEXT: movb %al, -{{[0-9]+}}(%rsp)
-; AVX512-NEXT: movb -{{[0-9]+}}(%rsp), %al
-; AVX512-NEXT: vzeroupper
-; AVX512-NEXT: ret{{[l|q]}}
+; AVX512F-LABEL: v4i64:
+; AVX512F: # BB#0:
+; AVX512F-NEXT: vpcmpgtq %ymm1, %ymm0, %k1
+; AVX512F-NEXT: vpcmpgtq %ymm3, %ymm2, %k0 {%k1}
+; AVX512F-NEXT: kmovw %k0, %eax
+; AVX512F-NEXT: movb %al, -{{[0-9]+}}(%rsp)
+; AVX512F-NEXT: movb -{{[0-9]+}}(%rsp), %al
+; AVX512F-NEXT: vzeroupper
+; AVX512F-NEXT: ret{{[l|q]}}
+;
+; AVX512BW-LABEL: v4i64:
+; AVX512BW: # BB#0:
+; AVX512BW-NEXT: vpcmpgtq %ymm1, %ymm0, %k1
+; AVX512BW-NEXT: vpcmpgtq %ymm3, %ymm2, %k0 {%k1}
+; AVX512BW-NEXT: kmovd %k0, %eax
+; AVX512BW-NEXT: movb %al, -{{[0-9]+}}(%rsp)
+; AVX512BW-NEXT: movb -{{[0-9]+}}(%rsp), %al
+; AVX512BW-NEXT: vzeroupper
+; AVX512BW-NEXT: ret{{[l|q]}}
%x0 = icmp sgt <4 x i64> %a, %b
%x1 = icmp sgt <4 x i64> %c, %d
%y = and <4 x i1> %x0, %x1
@@ -132,15 +143,25 @@ define i4 @v4f64(<4 x double> %a, <4 x d
; AVX12-NEXT: vzeroupper
; AVX12-NEXT: ret{{[l|q]}}
;
-; AVX512-LABEL: v4f64:
-; AVX512: # BB#0:
-; AVX512-NEXT: vcmpltpd %ymm0, %ymm1, %k1
-; AVX512-NEXT: vcmpltpd %ymm2, %ymm3, %k0 {%k1}
-; AVX512-NEXT: kmovd %k0, %eax
-; AVX512-NEXT: movb %al, -{{[0-9]+}}(%rsp)
-; AVX512-NEXT: movb -{{[0-9]+}}(%rsp), %al
-; AVX512-NEXT: vzeroupper
-; AVX512-NEXT: ret{{[l|q]}}
+; AVX512F-LABEL: v4f64:
+; AVX512F: # BB#0:
+; AVX512F-NEXT: vcmpltpd %ymm0, %ymm1, %k1
+; AVX512F-NEXT: vcmpltpd %ymm2, %ymm3, %k0 {%k1}
+; AVX512F-NEXT: kmovw %k0, %eax
+; AVX512F-NEXT: movb %al, -{{[0-9]+}}(%rsp)
+; AVX512F-NEXT: movb -{{[0-9]+}}(%rsp), %al
+; AVX512F-NEXT: vzeroupper
+; AVX512F-NEXT: ret{{[l|q]}}
+;
+; AVX512BW-LABEL: v4f64:
+; AVX512BW: # BB#0:
+; AVX512BW-NEXT: vcmpltpd %ymm0, %ymm1, %k1
+; AVX512BW-NEXT: vcmpltpd %ymm2, %ymm3, %k0 {%k1}
+; AVX512BW-NEXT: kmovd %k0, %eax
+; AVX512BW-NEXT: movb %al, -{{[0-9]+}}(%rsp)
+; AVX512BW-NEXT: movb -{{[0-9]+}}(%rsp), %al
+; AVX512BW-NEXT: vzeroupper
+; AVX512BW-NEXT: ret{{[l|q]}}
%x0 = fcmp ogt <4 x double> %a, %b
%x1 = fcmp ogt <4 x double> %c, %d
%y = and <4 x i1> %x0, %x1
@@ -194,14 +215,29 @@ define i16 @v16i16(<16 x i16> %a, <16 x
; AVX2-NEXT: vzeroupper
; AVX2-NEXT: ret{{[l|q]}}
;
-; AVX512-LABEL: v16i16:
-; AVX512: # BB#0:
-; AVX512-NEXT: vpcmpgtw %ymm1, %ymm0, %k1
-; AVX512-NEXT: vpcmpgtw %ymm3, %ymm2, %k0 {%k1}
-; AVX512-NEXT: kmovd %k0, %eax
-; AVX512-NEXT: # kill: %AX<def> %AX<kill> %EAX<kill>
-; AVX512-NEXT: vzeroupper
-; AVX512-NEXT: ret{{[l|q]}}
+; AVX512F-LABEL: v16i16:
+; AVX512F: # BB#0:
+; AVX512F-NEXT: vpcmpgtw %ymm1, %ymm0, %ymm0
+; AVX512F-NEXT: vpmovsxwd %ymm0, %zmm0
+; AVX512F-NEXT: vpslld $31, %zmm0, %zmm0
+; AVX512F-NEXT: vptestmd %zmm0, %zmm0, %k1
+; AVX512F-NEXT: vpcmpgtw %ymm3, %ymm2, %ymm0
+; AVX512F-NEXT: vpmovsxwd %ymm0, %zmm0
+; AVX512F-NEXT: vpslld $31, %zmm0, %zmm0
+; AVX512F-NEXT: vptestmd %zmm0, %zmm0, %k0 {%k1}
+; AVX512F-NEXT: kmovw %k0, %eax
+; AVX512F-NEXT: # kill: %AX<def> %AX<kill> %EAX<kill>
+; AVX512F-NEXT: vzeroupper
+; AVX512F-NEXT: ret{{[l|q]}}
+;
+; AVX512BW-LABEL: v16i16:
+; AVX512BW: # BB#0:
+; AVX512BW-NEXT: vpcmpgtw %ymm1, %ymm0, %k1
+; AVX512BW-NEXT: vpcmpgtw %ymm3, %ymm2, %k0 {%k1}
+; AVX512BW-NEXT: kmovd %k0, %eax
+; AVX512BW-NEXT: # kill: %AX<def> %AX<kill> %EAX<kill>
+; AVX512BW-NEXT: vzeroupper
+; AVX512BW-NEXT: ret{{[l|q]}}
%x0 = icmp sgt <16 x i16> %a, %b
%x1 = icmp sgt <16 x i16> %c, %d
%y = and <16 x i1> %x0, %x1
@@ -258,14 +294,23 @@ define i8 @v8i32(<8 x i32> %a, <8 x i32>
; AVX2-NEXT: vzeroupper
; AVX2-NEXT: ret{{[l|q]}}
;
-; AVX512-LABEL: v8i32:
-; AVX512: # BB#0:
-; AVX512-NEXT: vpcmpgtd %ymm1, %ymm0, %k1
-; AVX512-NEXT: vpcmpgtd %ymm3, %ymm2, %k0 {%k1}
-; AVX512-NEXT: kmovd %k0, %eax
-; AVX512-NEXT: # kill: %AL<def> %AL<kill> %EAX<kill>
-; AVX512-NEXT: vzeroupper
-; AVX512-NEXT: ret{{[l|q]}}
+; AVX512F-LABEL: v8i32:
+; AVX512F: # BB#0:
+; AVX512F-NEXT: vpcmpgtd %ymm1, %ymm0, %k1
+; AVX512F-NEXT: vpcmpgtd %ymm3, %ymm2, %k0 {%k1}
+; AVX512F-NEXT: kmovw %k0, %eax
+; AVX512F-NEXT: # kill: %AL<def> %AL<kill> %EAX<kill>
+; AVX512F-NEXT: vzeroupper
+; AVX512F-NEXT: ret{{[l|q]}}
+;
+; AVX512BW-LABEL: v8i32:
+; AVX512BW: # BB#0:
+; AVX512BW-NEXT: vpcmpgtd %ymm1, %ymm0, %k1
+; AVX512BW-NEXT: vpcmpgtd %ymm3, %ymm2, %k0 {%k1}
+; AVX512BW-NEXT: kmovd %k0, %eax
+; AVX512BW-NEXT: # kill: %AL<def> %AL<kill> %EAX<kill>
+; AVX512BW-NEXT: vzeroupper
+; AVX512BW-NEXT: ret{{[l|q]}}
%x0 = icmp sgt <8 x i32> %a, %b
%x1 = icmp sgt <8 x i32> %c, %d
%y = and <8 x i1> %x0, %x1
@@ -303,14 +348,23 @@ define i8 @v8f32(<8 x float> %a, <8 x fl
; AVX12-NEXT: vzeroupper
; AVX12-NEXT: ret{{[l|q]}}
;
-; AVX512-LABEL: v8f32:
-; AVX512: # BB#0:
-; AVX512-NEXT: vcmpltps %ymm0, %ymm1, %k1
-; AVX512-NEXT: vcmpltps %ymm2, %ymm3, %k0 {%k1}
-; AVX512-NEXT: kmovd %k0, %eax
-; AVX512-NEXT: # kill: %AL<def> %AL<kill> %EAX<kill>
-; AVX512-NEXT: vzeroupper
-; AVX512-NEXT: ret{{[l|q]}}
+; AVX512F-LABEL: v8f32:
+; AVX512F: # BB#0:
+; AVX512F-NEXT: vcmpltps %ymm0, %ymm1, %k1
+; AVX512F-NEXT: vcmpltps %ymm2, %ymm3, %k0 {%k1}
+; AVX512F-NEXT: kmovw %k0, %eax
+; AVX512F-NEXT: # kill: %AL<def> %AL<kill> %EAX<kill>
+; AVX512F-NEXT: vzeroupper
+; AVX512F-NEXT: ret{{[l|q]}}
+;
+; AVX512BW-LABEL: v8f32:
+; AVX512BW: # BB#0:
+; AVX512BW-NEXT: vcmpltps %ymm0, %ymm1, %k1
+; AVX512BW-NEXT: vcmpltps %ymm2, %ymm3, %k0 {%k1}
+; AVX512BW-NEXT: kmovd %k0, %eax
+; AVX512BW-NEXT: # kill: %AL<def> %AL<kill> %EAX<kill>
+; AVX512BW-NEXT: vzeroupper
+; AVX512BW-NEXT: ret{{[l|q]}}
%x0 = fcmp ogt <8 x float> %a, %b
%x1 = fcmp ogt <8 x float> %c, %d
%y = and <8 x i1> %x0, %x1
@@ -361,13 +415,40 @@ define i32 @v32i8(<32 x i8> %a, <32 x i8
; AVX2-NEXT: vzeroupper
; AVX2-NEXT: ret{{[l|q]}}
;
-; AVX512-LABEL: v32i8:
-; AVX512: # BB#0:
-; AVX512-NEXT: vpcmpgtb %ymm1, %ymm0, %k1
-; AVX512-NEXT: vpcmpgtb %ymm3, %ymm2, %k0 {%k1}
-; AVX512-NEXT: kmovd %k0, %eax
-; AVX512-NEXT: vzeroupper
-; AVX512-NEXT: ret{{[l|q]}}
+; AVX512F-LABEL: v32i8:
+; AVX512F: # BB#0:
+; AVX512F-NEXT: pushq %rbp
+; AVX512F-NEXT: .cfi_def_cfa_offset 16
+; AVX512F-NEXT: .cfi_offset %rbp, -16
+; AVX512F-NEXT: movq %rsp, %rbp
+; AVX512F-NEXT: .cfi_def_cfa_register %rbp
+; AVX512F-NEXT: andq $-32, %rsp
+; AVX512F-NEXT: subq $32, %rsp
+; AVX512F-NEXT: vpcmpgtb %ymm1, %ymm0, %ymm0
+; AVX512F-NEXT: vpcmpgtb %ymm3, %ymm2, %ymm1
+; AVX512F-NEXT: vpand %ymm1, %ymm0, %ymm0
+; AVX512F-NEXT: vextracti128 $1, %ymm0, %xmm1
+; AVX512F-NEXT: vpmovsxbd %xmm1, %zmm1
+; AVX512F-NEXT: vpslld $31, %zmm1, %zmm1
+; AVX512F-NEXT: vptestmd %zmm1, %zmm1, %k0
+; AVX512F-NEXT: kmovw %k0, {{[0-9]+}}(%rsp)
+; AVX512F-NEXT: vpmovsxbd %xmm0, %zmm0
+; AVX512F-NEXT: vpslld $31, %zmm0, %zmm0
+; AVX512F-NEXT: vptestmd %zmm0, %zmm0, %k0
+; AVX512F-NEXT: kmovw %k0, (%rsp)
+; AVX512F-NEXT: movl (%rsp), %eax
+; AVX512F-NEXT: movq %rbp, %rsp
+; AVX512F-NEXT: popq %rbp
+; AVX512F-NEXT: vzeroupper
+; AVX512F-NEXT: ret{{[l|q]}}
+;
+; AVX512BW-LABEL: v32i8:
+; AVX512BW: # BB#0:
+; AVX512BW-NEXT: vpcmpgtb %ymm1, %ymm0, %k1
+; AVX512BW-NEXT: vpcmpgtb %ymm3, %ymm2, %k0 {%k1}
+; AVX512BW-NEXT: kmovd %k0, %eax
+; AVX512BW-NEXT: vzeroupper
+; AVX512BW-NEXT: ret{{[l|q]}}
%x0 = icmp sgt <32 x i8> %a, %b
%x1 = icmp sgt <32 x i8> %c, %d
%y = and <32 x i1> %x0, %x1
Modified: llvm/trunk/test/CodeGen/X86/bitcast-setcc-128.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/bitcast-setcc-128.ll?rev=317020&r1=317019&r2=317020&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/bitcast-setcc-128.ll (original)
+++ llvm/trunk/test/CodeGen/X86/bitcast-setcc-128.ll Tue Oct 31 11:41:48 2017
@@ -3,7 +3,8 @@
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+ssse3 | FileCheck %s --check-prefixes=SSE2-SSSE3,SSSE3
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx | FileCheck %s --check-prefixes=AVX12,AVX1
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx2 | FileCheck %s --check-prefixes=AVX12,AVX2
-; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512f,+avx512vl,+avx512bw | FileCheck %s --check-prefixes=AVX512
+; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512f,+avx512vl | FileCheck %s --check-prefixes=AVX512 --check-prefixes=AVX512F
+; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512f,+avx512vl,+avx512bw | FileCheck %s --check-prefixes=AVX512 --check-prefixes=AVX512BW
define i8 @v8i16(<8 x i16> %a, <8 x i16> %b) {
; SSE2-SSSE3-LABEL: v8i16:
@@ -22,12 +23,23 @@ define i8 @v8i16(<8 x i16> %a, <8 x i16>
; AVX12-NEXT: # kill: %AL<def> %AL<kill> %EAX<kill>
; AVX12-NEXT: retq
;
-; AVX512-LABEL: v8i16:
-; AVX512: # BB#0:
-; AVX512-NEXT: vpcmpgtw %xmm1, %xmm0, %k0
-; AVX512-NEXT: kmovd %k0, %eax
-; AVX512-NEXT: # kill: %AL<def> %AL<kill> %EAX<kill>
-; AVX512-NEXT: retq
+; AVX512F-LABEL: v8i16:
+; AVX512F: # BB#0:
+; AVX512F-NEXT: vpcmpgtw %xmm1, %xmm0, %xmm0
+; AVX512F-NEXT: vpmovsxwq %xmm0, %zmm0
+; AVX512F-NEXT: vpsllq $63, %zmm0, %zmm0
+; AVX512F-NEXT: vptestmq %zmm0, %zmm0, %k0
+; AVX512F-NEXT: kmovw %k0, %eax
+; AVX512F-NEXT: # kill: %AL<def> %AL<kill> %EAX<kill>
+; AVX512F-NEXT: vzeroupper
+; AVX512F-NEXT: retq
+;
+; AVX512BW-LABEL: v8i16:
+; AVX512BW: # BB#0:
+; AVX512BW-NEXT: vpcmpgtw %xmm1, %xmm0, %k0
+; AVX512BW-NEXT: kmovd %k0, %eax
+; AVX512BW-NEXT: # kill: %AL<def> %AL<kill> %EAX<kill>
+; AVX512BW-NEXT: retq
%x = icmp sgt <8 x i16> %a, %b
%res = bitcast <8 x i1> %x to i8
ret i8 %res
@@ -48,13 +60,21 @@ define i4 @v4i32(<4 x i32> %a, <4 x i32>
; AVX12-NEXT: # kill: %AL<def> %AL<kill> %EAX<kill>
; AVX12-NEXT: retq
;
-; AVX512-LABEL: v4i32:
-; AVX512: # BB#0:
-; AVX512-NEXT: vpcmpgtd %xmm1, %xmm0, %k0
-; AVX512-NEXT: kmovd %k0, %eax
-; AVX512-NEXT: movb %al, -{{[0-9]+}}(%rsp)
-; AVX512-NEXT: movb -{{[0-9]+}}(%rsp), %al
-; AVX512-NEXT: retq
+; AVX512F-LABEL: v4i32:
+; AVX512F: # BB#0:
+; AVX512F-NEXT: vpcmpgtd %xmm1, %xmm0, %k0
+; AVX512F-NEXT: kmovw %k0, %eax
+; AVX512F-NEXT: movb %al, -{{[0-9]+}}(%rsp)
+; AVX512F-NEXT: movb -{{[0-9]+}}(%rsp), %al
+; AVX512F-NEXT: retq
+;
+; AVX512BW-LABEL: v4i32:
+; AVX512BW: # BB#0:
+; AVX512BW-NEXT: vpcmpgtd %xmm1, %xmm0, %k0
+; AVX512BW-NEXT: kmovd %k0, %eax
+; AVX512BW-NEXT: movb %al, -{{[0-9]+}}(%rsp)
+; AVX512BW-NEXT: movb -{{[0-9]+}}(%rsp), %al
+; AVX512BW-NEXT: retq
%x = icmp sgt <4 x i32> %a, %b
%res = bitcast <4 x i1> %x to i4
ret i4 %res
@@ -75,13 +95,21 @@ define i4 @v4f32(<4 x float> %a, <4 x fl
; AVX12-NEXT: # kill: %AL<def> %AL<kill> %EAX<kill>
; AVX12-NEXT: retq
;
-; AVX512-LABEL: v4f32:
-; AVX512: # BB#0:
-; AVX512-NEXT: vcmpltps %xmm0, %xmm1, %k0
-; AVX512-NEXT: kmovd %k0, %eax
-; AVX512-NEXT: movb %al, -{{[0-9]+}}(%rsp)
-; AVX512-NEXT: movb -{{[0-9]+}}(%rsp), %al
-; AVX512-NEXT: retq
+; AVX512F-LABEL: v4f32:
+; AVX512F: # BB#0:
+; AVX512F-NEXT: vcmpltps %xmm0, %xmm1, %k0
+; AVX512F-NEXT: kmovw %k0, %eax
+; AVX512F-NEXT: movb %al, -{{[0-9]+}}(%rsp)
+; AVX512F-NEXT: movb -{{[0-9]+}}(%rsp), %al
+; AVX512F-NEXT: retq
+;
+; AVX512BW-LABEL: v4f32:
+; AVX512BW: # BB#0:
+; AVX512BW-NEXT: vcmpltps %xmm0, %xmm1, %k0
+; AVX512BW-NEXT: kmovd %k0, %eax
+; AVX512BW-NEXT: movb %al, -{{[0-9]+}}(%rsp)
+; AVX512BW-NEXT: movb -{{[0-9]+}}(%rsp), %al
+; AVX512BW-NEXT: retq
%x = fcmp ogt <4 x float> %a, %b
%res = bitcast <4 x i1> %x to i4
ret i4 %res
@@ -102,12 +130,23 @@ define i16 @v16i8(<16 x i8> %a, <16 x i8
; AVX12-NEXT: # kill: %AX<def> %AX<kill> %EAX<kill>
; AVX12-NEXT: retq
;
-; AVX512-LABEL: v16i8:
-; AVX512: # BB#0:
-; AVX512-NEXT: vpcmpgtb %xmm1, %xmm0, %k0
-; AVX512-NEXT: kmovd %k0, %eax
-; AVX512-NEXT: # kill: %AX<def> %AX<kill> %EAX<kill>
-; AVX512-NEXT: retq
+; AVX512F-LABEL: v16i8:
+; AVX512F: # BB#0:
+; AVX512F-NEXT: vpcmpgtb %xmm1, %xmm0, %xmm0
+; AVX512F-NEXT: vpmovsxbd %xmm0, %zmm0
+; AVX512F-NEXT: vpslld $31, %zmm0, %zmm0
+; AVX512F-NEXT: vptestmd %zmm0, %zmm0, %k0
+; AVX512F-NEXT: kmovw %k0, %eax
+; AVX512F-NEXT: # kill: %AX<def> %AX<kill> %EAX<kill>
+; AVX512F-NEXT: vzeroupper
+; AVX512F-NEXT: retq
+;
+; AVX512BW-LABEL: v16i8:
+; AVX512BW: # BB#0:
+; AVX512BW-NEXT: vpcmpgtb %xmm1, %xmm0, %k0
+; AVX512BW-NEXT: kmovd %k0, %eax
+; AVX512BW-NEXT: # kill: %AX<def> %AX<kill> %EAX<kill>
+; AVX512BW-NEXT: retq
%x = icmp sgt <16 x i8> %a, %b
%res = bitcast <16 x i1> %x to i16
ret i16 %res
@@ -179,17 +218,29 @@ define i2 @v2i8(<2 x i8> %a, <2 x i8> %b
; AVX2-NEXT: # kill: %AL<def> %AL<kill> %EAX<kill>
; AVX2-NEXT: retq
;
-; AVX512-LABEL: v2i8:
-; AVX512: # BB#0:
-; AVX512-NEXT: vpsllq $56, %xmm1, %xmm1
-; AVX512-NEXT: vpsraq $56, %xmm1, %xmm1
-; AVX512-NEXT: vpsllq $56, %xmm0, %xmm0
-; AVX512-NEXT: vpsraq $56, %xmm0, %xmm0
-; AVX512-NEXT: vpcmpgtq %xmm1, %xmm0, %k0
-; AVX512-NEXT: kmovd %k0, %eax
-; AVX512-NEXT: movb %al, -{{[0-9]+}}(%rsp)
-; AVX512-NEXT: movb -{{[0-9]+}}(%rsp), %al
-; AVX512-NEXT: retq
+; AVX512F-LABEL: v2i8:
+; AVX512F: # BB#0:
+; AVX512F-NEXT: vpsllq $56, %xmm1, %xmm1
+; AVX512F-NEXT: vpsraq $56, %xmm1, %xmm1
+; AVX512F-NEXT: vpsllq $56, %xmm0, %xmm0
+; AVX512F-NEXT: vpsraq $56, %xmm0, %xmm0
+; AVX512F-NEXT: vpcmpgtq %xmm1, %xmm0, %k0
+; AVX512F-NEXT: kmovw %k0, %eax
+; AVX512F-NEXT: movb %al, -{{[0-9]+}}(%rsp)
+; AVX512F-NEXT: movb -{{[0-9]+}}(%rsp), %al
+; AVX512F-NEXT: retq
+;
+; AVX512BW-LABEL: v2i8:
+; AVX512BW: # BB#0:
+; AVX512BW-NEXT: vpsllq $56, %xmm1, %xmm1
+; AVX512BW-NEXT: vpsraq $56, %xmm1, %xmm1
+; AVX512BW-NEXT: vpsllq $56, %xmm0, %xmm0
+; AVX512BW-NEXT: vpsraq $56, %xmm0, %xmm0
+; AVX512BW-NEXT: vpcmpgtq %xmm1, %xmm0, %k0
+; AVX512BW-NEXT: kmovd %k0, %eax
+; AVX512BW-NEXT: movb %al, -{{[0-9]+}}(%rsp)
+; AVX512BW-NEXT: movb -{{[0-9]+}}(%rsp), %al
+; AVX512BW-NEXT: retq
%x = icmp sgt <2 x i8> %a, %b
%res = bitcast <2 x i1> %x to i2
ret i2 %res
@@ -261,17 +312,29 @@ define i2 @v2i16(<2 x i16> %a, <2 x i16>
; AVX2-NEXT: # kill: %AL<def> %AL<kill> %EAX<kill>
; AVX2-NEXT: retq
;
-; AVX512-LABEL: v2i16:
-; AVX512: # BB#0:
-; AVX512-NEXT: vpsllq $48, %xmm1, %xmm1
-; AVX512-NEXT: vpsraq $48, %xmm1, %xmm1
-; AVX512-NEXT: vpsllq $48, %xmm0, %xmm0
-; AVX512-NEXT: vpsraq $48, %xmm0, %xmm0
-; AVX512-NEXT: vpcmpgtq %xmm1, %xmm0, %k0
-; AVX512-NEXT: kmovd %k0, %eax
-; AVX512-NEXT: movb %al, -{{[0-9]+}}(%rsp)
-; AVX512-NEXT: movb -{{[0-9]+}}(%rsp), %al
-; AVX512-NEXT: retq
+; AVX512F-LABEL: v2i16:
+; AVX512F: # BB#0:
+; AVX512F-NEXT: vpsllq $48, %xmm1, %xmm1
+; AVX512F-NEXT: vpsraq $48, %xmm1, %xmm1
+; AVX512F-NEXT: vpsllq $48, %xmm0, %xmm0
+; AVX512F-NEXT: vpsraq $48, %xmm0, %xmm0
+; AVX512F-NEXT: vpcmpgtq %xmm1, %xmm0, %k0
+; AVX512F-NEXT: kmovw %k0, %eax
+; AVX512F-NEXT: movb %al, -{{[0-9]+}}(%rsp)
+; AVX512F-NEXT: movb -{{[0-9]+}}(%rsp), %al
+; AVX512F-NEXT: retq
+;
+; AVX512BW-LABEL: v2i16:
+; AVX512BW: # BB#0:
+; AVX512BW-NEXT: vpsllq $48, %xmm1, %xmm1
+; AVX512BW-NEXT: vpsraq $48, %xmm1, %xmm1
+; AVX512BW-NEXT: vpsllq $48, %xmm0, %xmm0
+; AVX512BW-NEXT: vpsraq $48, %xmm0, %xmm0
+; AVX512BW-NEXT: vpcmpgtq %xmm1, %xmm0, %k0
+; AVX512BW-NEXT: kmovd %k0, %eax
+; AVX512BW-NEXT: movb %al, -{{[0-9]+}}(%rsp)
+; AVX512BW-NEXT: movb -{{[0-9]+}}(%rsp), %al
+; AVX512BW-NEXT: retq
%x = icmp sgt <2 x i16> %a, %b
%res = bitcast <2 x i1> %x to i2
ret i2 %res
@@ -335,17 +398,29 @@ define i2 @v2i32(<2 x i32> %a, <2 x i32>
; AVX2-NEXT: # kill: %AL<def> %AL<kill> %EAX<kill>
; AVX2-NEXT: retq
;
-; AVX512-LABEL: v2i32:
-; AVX512: # BB#0:
-; AVX512-NEXT: vpsllq $32, %xmm1, %xmm1
-; AVX512-NEXT: vpsraq $32, %xmm1, %xmm1
-; AVX512-NEXT: vpsllq $32, %xmm0, %xmm0
-; AVX512-NEXT: vpsraq $32, %xmm0, %xmm0
-; AVX512-NEXT: vpcmpgtq %xmm1, %xmm0, %k0
-; AVX512-NEXT: kmovd %k0, %eax
-; AVX512-NEXT: movb %al, -{{[0-9]+}}(%rsp)
-; AVX512-NEXT: movb -{{[0-9]+}}(%rsp), %al
-; AVX512-NEXT: retq
+; AVX512F-LABEL: v2i32:
+; AVX512F: # BB#0:
+; AVX512F-NEXT: vpsllq $32, %xmm1, %xmm1
+; AVX512F-NEXT: vpsraq $32, %xmm1, %xmm1
+; AVX512F-NEXT: vpsllq $32, %xmm0, %xmm0
+; AVX512F-NEXT: vpsraq $32, %xmm0, %xmm0
+; AVX512F-NEXT: vpcmpgtq %xmm1, %xmm0, %k0
+; AVX512F-NEXT: kmovw %k0, %eax
+; AVX512F-NEXT: movb %al, -{{[0-9]+}}(%rsp)
+; AVX512F-NEXT: movb -{{[0-9]+}}(%rsp), %al
+; AVX512F-NEXT: retq
+;
+; AVX512BW-LABEL: v2i32:
+; AVX512BW: # BB#0:
+; AVX512BW-NEXT: vpsllq $32, %xmm1, %xmm1
+; AVX512BW-NEXT: vpsraq $32, %xmm1, %xmm1
+; AVX512BW-NEXT: vpsllq $32, %xmm0, %xmm0
+; AVX512BW-NEXT: vpsraq $32, %xmm0, %xmm0
+; AVX512BW-NEXT: vpcmpgtq %xmm1, %xmm0, %k0
+; AVX512BW-NEXT: kmovd %k0, %eax
+; AVX512BW-NEXT: movb %al, -{{[0-9]+}}(%rsp)
+; AVX512BW-NEXT: movb -{{[0-9]+}}(%rsp), %al
+; AVX512BW-NEXT: retq
%x = icmp sgt <2 x i32> %a, %b
%res = bitcast <2 x i1> %x to i2
ret i2 %res
@@ -376,13 +451,21 @@ define i2 @v2i64(<2 x i64> %a, <2 x i64>
; AVX12-NEXT: # kill: %AL<def> %AL<kill> %EAX<kill>
; AVX12-NEXT: retq
;
-; AVX512-LABEL: v2i64:
-; AVX512: # BB#0:
-; AVX512-NEXT: vpcmpgtq %xmm1, %xmm0, %k0
-; AVX512-NEXT: kmovd %k0, %eax
-; AVX512-NEXT: movb %al, -{{[0-9]+}}(%rsp)
-; AVX512-NEXT: movb -{{[0-9]+}}(%rsp), %al
-; AVX512-NEXT: retq
+; AVX512F-LABEL: v2i64:
+; AVX512F: # BB#0:
+; AVX512F-NEXT: vpcmpgtq %xmm1, %xmm0, %k0
+; AVX512F-NEXT: kmovw %k0, %eax
+; AVX512F-NEXT: movb %al, -{{[0-9]+}}(%rsp)
+; AVX512F-NEXT: movb -{{[0-9]+}}(%rsp), %al
+; AVX512F-NEXT: retq
+;
+; AVX512BW-LABEL: v2i64:
+; AVX512BW: # BB#0:
+; AVX512BW-NEXT: vpcmpgtq %xmm1, %xmm0, %k0
+; AVX512BW-NEXT: kmovd %k0, %eax
+; AVX512BW-NEXT: movb %al, -{{[0-9]+}}(%rsp)
+; AVX512BW-NEXT: movb -{{[0-9]+}}(%rsp), %al
+; AVX512BW-NEXT: retq
%x = icmp sgt <2 x i64> %a, %b
%res = bitcast <2 x i1> %x to i2
ret i2 %res
@@ -403,13 +486,21 @@ define i2 @v2f64(<2 x double> %a, <2 x d
; AVX12-NEXT: # kill: %AL<def> %AL<kill> %EAX<kill>
; AVX12-NEXT: retq
;
-; AVX512-LABEL: v2f64:
-; AVX512: # BB#0:
-; AVX512-NEXT: vcmpltpd %xmm0, %xmm1, %k0
-; AVX512-NEXT: kmovd %k0, %eax
-; AVX512-NEXT: movb %al, -{{[0-9]+}}(%rsp)
-; AVX512-NEXT: movb -{{[0-9]+}}(%rsp), %al
-; AVX512-NEXT: retq
+; AVX512F-LABEL: v2f64:
+; AVX512F: # BB#0:
+; AVX512F-NEXT: vcmpltpd %xmm0, %xmm1, %k0
+; AVX512F-NEXT: kmovw %k0, %eax
+; AVX512F-NEXT: movb %al, -{{[0-9]+}}(%rsp)
+; AVX512F-NEXT: movb -{{[0-9]+}}(%rsp), %al
+; AVX512F-NEXT: retq
+;
+; AVX512BW-LABEL: v2f64:
+; AVX512BW: # BB#0:
+; AVX512BW-NEXT: vcmpltpd %xmm0, %xmm1, %k0
+; AVX512BW-NEXT: kmovd %k0, %eax
+; AVX512BW-NEXT: movb %al, -{{[0-9]+}}(%rsp)
+; AVX512BW-NEXT: movb -{{[0-9]+}}(%rsp), %al
+; AVX512BW-NEXT: retq
%x = fcmp ogt <2 x double> %a, %b
%res = bitcast <2 x i1> %x to i2
ret i2 %res
@@ -438,17 +529,29 @@ define i4 @v4i8(<4 x i8> %a, <4 x i8> %b
; AVX12-NEXT: # kill: %AL<def> %AL<kill> %EAX<kill>
; AVX12-NEXT: retq
;
-; AVX512-LABEL: v4i8:
-; AVX512: # BB#0:
-; AVX512-NEXT: vpslld $24, %xmm1, %xmm1
-; AVX512-NEXT: vpsrad $24, %xmm1, %xmm1
-; AVX512-NEXT: vpslld $24, %xmm0, %xmm0
-; AVX512-NEXT: vpsrad $24, %xmm0, %xmm0
-; AVX512-NEXT: vpcmpgtd %xmm1, %xmm0, %k0
-; AVX512-NEXT: kmovd %k0, %eax
-; AVX512-NEXT: movb %al, -{{[0-9]+}}(%rsp)
-; AVX512-NEXT: movb -{{[0-9]+}}(%rsp), %al
-; AVX512-NEXT: retq
+; AVX512F-LABEL: v4i8:
+; AVX512F: # BB#0:
+; AVX512F-NEXT: vpslld $24, %xmm1, %xmm1
+; AVX512F-NEXT: vpsrad $24, %xmm1, %xmm1
+; AVX512F-NEXT: vpslld $24, %xmm0, %xmm0
+; AVX512F-NEXT: vpsrad $24, %xmm0, %xmm0
+; AVX512F-NEXT: vpcmpgtd %xmm1, %xmm0, %k0
+; AVX512F-NEXT: kmovw %k0, %eax
+; AVX512F-NEXT: movb %al, -{{[0-9]+}}(%rsp)
+; AVX512F-NEXT: movb -{{[0-9]+}}(%rsp), %al
+; AVX512F-NEXT: retq
+;
+; AVX512BW-LABEL: v4i8:
+; AVX512BW: # BB#0:
+; AVX512BW-NEXT: vpslld $24, %xmm1, %xmm1
+; AVX512BW-NEXT: vpsrad $24, %xmm1, %xmm1
+; AVX512BW-NEXT: vpslld $24, %xmm0, %xmm0
+; AVX512BW-NEXT: vpsrad $24, %xmm0, %xmm0
+; AVX512BW-NEXT: vpcmpgtd %xmm1, %xmm0, %k0
+; AVX512BW-NEXT: kmovd %k0, %eax
+; AVX512BW-NEXT: movb %al, -{{[0-9]+}}(%rsp)
+; AVX512BW-NEXT: movb -{{[0-9]+}}(%rsp), %al
+; AVX512BW-NEXT: retq
%x = icmp sgt <4 x i8> %a, %b
%res = bitcast <4 x i1> %x to i4
ret i4 %res
@@ -477,17 +580,29 @@ define i4 @v4i16(<4 x i16> %a, <4 x i16>
; AVX12-NEXT: # kill: %AL<def> %AL<kill> %EAX<kill>
; AVX12-NEXT: retq
;
-; AVX512-LABEL: v4i16:
-; AVX512: # BB#0:
-; AVX512-NEXT: vpslld $16, %xmm1, %xmm1
-; AVX512-NEXT: vpsrad $16, %xmm1, %xmm1
-; AVX512-NEXT: vpslld $16, %xmm0, %xmm0
-; AVX512-NEXT: vpsrad $16, %xmm0, %xmm0
-; AVX512-NEXT: vpcmpgtd %xmm1, %xmm0, %k0
-; AVX512-NEXT: kmovd %k0, %eax
-; AVX512-NEXT: movb %al, -{{[0-9]+}}(%rsp)
-; AVX512-NEXT: movb -{{[0-9]+}}(%rsp), %al
-; AVX512-NEXT: retq
+; AVX512F-LABEL: v4i16:
+; AVX512F: # BB#0:
+; AVX512F-NEXT: vpslld $16, %xmm1, %xmm1
+; AVX512F-NEXT: vpsrad $16, %xmm1, %xmm1
+; AVX512F-NEXT: vpslld $16, %xmm0, %xmm0
+; AVX512F-NEXT: vpsrad $16, %xmm0, %xmm0
+; AVX512F-NEXT: vpcmpgtd %xmm1, %xmm0, %k0
+; AVX512F-NEXT: kmovw %k0, %eax
+; AVX512F-NEXT: movb %al, -{{[0-9]+}}(%rsp)
+; AVX512F-NEXT: movb -{{[0-9]+}}(%rsp), %al
+; AVX512F-NEXT: retq
+;
+; AVX512BW-LABEL: v4i16:
+; AVX512BW: # BB#0:
+; AVX512BW-NEXT: vpslld $16, %xmm1, %xmm1
+; AVX512BW-NEXT: vpsrad $16, %xmm1, %xmm1
+; AVX512BW-NEXT: vpslld $16, %xmm0, %xmm0
+; AVX512BW-NEXT: vpsrad $16, %xmm0, %xmm0
+; AVX512BW-NEXT: vpcmpgtd %xmm1, %xmm0, %k0
+; AVX512BW-NEXT: kmovd %k0, %eax
+; AVX512BW-NEXT: movb %al, -{{[0-9]+}}(%rsp)
+; AVX512BW-NEXT: movb -{{[0-9]+}}(%rsp), %al
+; AVX512BW-NEXT: retq
%x = icmp sgt <4 x i16> %a, %b
%res = bitcast <4 x i1> %x to i4
ret i4 %res
@@ -518,16 +633,31 @@ define i8 @v8i8(<8 x i8> %a, <8 x i8> %b
; AVX12-NEXT: # kill: %AL<def> %AL<kill> %EAX<kill>
; AVX12-NEXT: retq
;
-; AVX512-LABEL: v8i8:
-; AVX512: # BB#0:
-; AVX512-NEXT: vpsllw $8, %xmm1, %xmm1
-; AVX512-NEXT: vpsraw $8, %xmm1, %xmm1
-; AVX512-NEXT: vpsllw $8, %xmm0, %xmm0
-; AVX512-NEXT: vpsraw $8, %xmm0, %xmm0
-; AVX512-NEXT: vpcmpgtw %xmm1, %xmm0, %k0
-; AVX512-NEXT: kmovd %k0, %eax
-; AVX512-NEXT: # kill: %AL<def> %AL<kill> %EAX<kill>
-; AVX512-NEXT: retq
+; AVX512F-LABEL: v8i8:
+; AVX512F: # BB#0:
+; AVX512F-NEXT: vpsllw $8, %xmm1, %xmm1
+; AVX512F-NEXT: vpsraw $8, %xmm1, %xmm1
+; AVX512F-NEXT: vpsllw $8, %xmm0, %xmm0
+; AVX512F-NEXT: vpsraw $8, %xmm0, %xmm0
+; AVX512F-NEXT: vpcmpgtw %xmm1, %xmm0, %xmm0
+; AVX512F-NEXT: vpmovsxwq %xmm0, %zmm0
+; AVX512F-NEXT: vpsllq $63, %zmm0, %zmm0
+; AVX512F-NEXT: vptestmq %zmm0, %zmm0, %k0
+; AVX512F-NEXT: kmovw %k0, %eax
+; AVX512F-NEXT: # kill: %AL<def> %AL<kill> %EAX<kill>
+; AVX512F-NEXT: vzeroupper
+; AVX512F-NEXT: retq
+;
+; AVX512BW-LABEL: v8i8:
+; AVX512BW: # BB#0:
+; AVX512BW-NEXT: vpsllw $8, %xmm1, %xmm1
+; AVX512BW-NEXT: vpsraw $8, %xmm1, %xmm1
+; AVX512BW-NEXT: vpsllw $8, %xmm0, %xmm0
+; AVX512BW-NEXT: vpsraw $8, %xmm0, %xmm0
+; AVX512BW-NEXT: vpcmpgtw %xmm1, %xmm0, %k0
+; AVX512BW-NEXT: kmovd %k0, %eax
+; AVX512BW-NEXT: # kill: %AL<def> %AL<kill> %EAX<kill>
+; AVX512BW-NEXT: retq
%x = icmp sgt <8 x i8> %a, %b
%res = bitcast <8 x i1> %x to i8
ret i8 %res
Modified: llvm/trunk/test/CodeGen/X86/bitcast-setcc-256.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/bitcast-setcc-256.ll?rev=317020&r1=317019&r2=317020&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/bitcast-setcc-256.ll (original)
+++ llvm/trunk/test/CodeGen/X86/bitcast-setcc-256.ll Tue Oct 31 11:41:48 2017
@@ -3,7 +3,8 @@
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+SSSE3 | FileCheck %s --check-prefixes=SSE2-SSSE3,SSSE3
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx | FileCheck %s --check-prefixes=AVX12,AVX1
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx2 | FileCheck %s --check-prefixes=AVX12,AVX2
-; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512f,+avx512vl,+avx512bw | FileCheck %s --check-prefix=AVX512
+; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512f,+avx512vl | FileCheck %s --check-prefixes=AVX512 --check-prefixes=AVX512F
+; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512f,+avx512vl,+avx512bw | FileCheck %s --check-prefixes=AVX512 --check-prefixes=AVX512BW
define i16 @v16i16(<16 x i16> %a, <16 x i16> %b) {
; SSE2-SSSE3-LABEL: v16i16:
@@ -37,13 +38,24 @@ define i16 @v16i16(<16 x i16> %a, <16 x
; AVX2-NEXT: vzeroupper
; AVX2-NEXT: retq
;
-; AVX512-LABEL: v16i16:
-; AVX512: # BB#0:
-; AVX512-NEXT: vpcmpgtw %ymm1, %ymm0, %k0
-; AVX512-NEXT: kmovd %k0, %eax
-; AVX512-NEXT: # kill: %AX<def> %AX<kill> %EAX<kill>
-; AVX512-NEXT: vzeroupper
-; AVX512-NEXT: retq
+; AVX512F-LABEL: v16i16:
+; AVX512F: # BB#0:
+; AVX512F-NEXT: vpcmpgtw %ymm1, %ymm0, %ymm0
+; AVX512F-NEXT: vpmovsxwd %ymm0, %zmm0
+; AVX512F-NEXT: vpslld $31, %zmm0, %zmm0
+; AVX512F-NEXT: vptestmd %zmm0, %zmm0, %k0
+; AVX512F-NEXT: kmovw %k0, %eax
+; AVX512F-NEXT: # kill: %AX<def> %AX<kill> %EAX<kill>
+; AVX512F-NEXT: vzeroupper
+; AVX512F-NEXT: retq
+;
+; AVX512BW-LABEL: v16i16:
+; AVX512BW: # BB#0:
+; AVX512BW-NEXT: vpcmpgtw %ymm1, %ymm0, %k0
+; AVX512BW-NEXT: kmovd %k0, %eax
+; AVX512BW-NEXT: # kill: %AX<def> %AX<kill> %EAX<kill>
+; AVX512BW-NEXT: vzeroupper
+; AVX512BW-NEXT: retq
%x = icmp sgt <16 x i16> %a, %b
%res = bitcast <16 x i1> %x to i16
ret i16 %res
@@ -80,13 +92,21 @@ define i8 @v8i32(<8 x i32> %a, <8 x i32>
; AVX2-NEXT: vzeroupper
; AVX2-NEXT: retq
;
-; AVX512-LABEL: v8i32:
-; AVX512: # BB#0:
-; AVX512-NEXT: vpcmpgtd %ymm1, %ymm0, %k0
-; AVX512-NEXT: kmovd %k0, %eax
-; AVX512-NEXT: # kill: %AL<def> %AL<kill> %EAX<kill>
-; AVX512-NEXT: vzeroupper
-; AVX512-NEXT: retq
+; AVX512F-LABEL: v8i32:
+; AVX512F: # BB#0:
+; AVX512F-NEXT: vpcmpgtd %ymm1, %ymm0, %k0
+; AVX512F-NEXT: kmovw %k0, %eax
+; AVX512F-NEXT: # kill: %AL<def> %AL<kill> %EAX<kill>
+; AVX512F-NEXT: vzeroupper
+; AVX512F-NEXT: retq
+;
+; AVX512BW-LABEL: v8i32:
+; AVX512BW: # BB#0:
+; AVX512BW-NEXT: vpcmpgtd %ymm1, %ymm0, %k0
+; AVX512BW-NEXT: kmovd %k0, %eax
+; AVX512BW-NEXT: # kill: %AL<def> %AL<kill> %EAX<kill>
+; AVX512BW-NEXT: vzeroupper
+; AVX512BW-NEXT: retq
%x = icmp sgt <8 x i32> %a, %b
%res = bitcast <8 x i1> %x to i8
ret i8 %res
@@ -111,13 +131,21 @@ define i8 @v8f32(<8 x float> %a, <8 x fl
; AVX12-NEXT: vzeroupper
; AVX12-NEXT: retq
;
-; AVX512-LABEL: v8f32:
-; AVX512: # BB#0:
-; AVX512-NEXT: vcmpltps %ymm0, %ymm1, %k0
-; AVX512-NEXT: kmovd %k0, %eax
-; AVX512-NEXT: # kill: %AL<def> %AL<kill> %EAX<kill>
-; AVX512-NEXT: vzeroupper
-; AVX512-NEXT: retq
+; AVX512F-LABEL: v8f32:
+; AVX512F: # BB#0:
+; AVX512F-NEXT: vcmpltps %ymm0, %ymm1, %k0
+; AVX512F-NEXT: kmovw %k0, %eax
+; AVX512F-NEXT: # kill: %AL<def> %AL<kill> %EAX<kill>
+; AVX512F-NEXT: vzeroupper
+; AVX512F-NEXT: retq
+;
+; AVX512BW-LABEL: v8f32:
+; AVX512BW: # BB#0:
+; AVX512BW-NEXT: vcmpltps %ymm0, %ymm1, %k0
+; AVX512BW-NEXT: kmovd %k0, %eax
+; AVX512BW-NEXT: # kill: %AL<def> %AL<kill> %EAX<kill>
+; AVX512BW-NEXT: vzeroupper
+; AVX512BW-NEXT: retq
%x = fcmp ogt <8 x float> %a, %b
%res = bitcast <8 x i1> %x to i8
ret i8 %res
@@ -154,12 +182,37 @@ define i32 @v32i8(<32 x i8> %a, <32 x i8
; AVX2-NEXT: vzeroupper
; AVX2-NEXT: retq
;
-; AVX512-LABEL: v32i8:
-; AVX512: # BB#0:
-; AVX512-NEXT: vpcmpgtb %ymm1, %ymm0, %k0
-; AVX512-NEXT: kmovd %k0, %eax
-; AVX512-NEXT: vzeroupper
-; AVX512-NEXT: retq
+; AVX512F-LABEL: v32i8:
+; AVX512F: # BB#0:
+; AVX512F-NEXT: pushq %rbp
+; AVX512F-NEXT: .cfi_def_cfa_offset 16
+; AVX512F-NEXT: .cfi_offset %rbp, -16
+; AVX512F-NEXT: movq %rsp, %rbp
+; AVX512F-NEXT: .cfi_def_cfa_register %rbp
+; AVX512F-NEXT: andq $-32, %rsp
+; AVX512F-NEXT: subq $32, %rsp
+; AVX512F-NEXT: vpcmpgtb %ymm1, %ymm0, %ymm0
+; AVX512F-NEXT: vextracti128 $1, %ymm0, %xmm1
+; AVX512F-NEXT: vpmovsxbd %xmm1, %zmm1
+; AVX512F-NEXT: vpslld $31, %zmm1, %zmm1
+; AVX512F-NEXT: vptestmd %zmm1, %zmm1, %k0
+; AVX512F-NEXT: kmovw %k0, {{[0-9]+}}(%rsp)
+; AVX512F-NEXT: vpmovsxbd %xmm0, %zmm0
+; AVX512F-NEXT: vpslld $31, %zmm0, %zmm0
+; AVX512F-NEXT: vptestmd %zmm0, %zmm0, %k0
+; AVX512F-NEXT: kmovw %k0, (%rsp)
+; AVX512F-NEXT: movl (%rsp), %eax
+; AVX512F-NEXT: movq %rbp, %rsp
+; AVX512F-NEXT: popq %rbp
+; AVX512F-NEXT: vzeroupper
+; AVX512F-NEXT: retq
+;
+; AVX512BW-LABEL: v32i8:
+; AVX512BW: # BB#0:
+; AVX512BW-NEXT: vpcmpgtb %ymm1, %ymm0, %k0
+; AVX512BW-NEXT: kmovd %k0, %eax
+; AVX512BW-NEXT: vzeroupper
+; AVX512BW-NEXT: retq
%x = icmp sgt <32 x i8> %a, %b
%res = bitcast <32 x i1> %x to i32
ret i32 %res
@@ -214,14 +267,23 @@ define i4 @v4i64(<4 x i64> %a, <4 x i64>
; AVX2-NEXT: vzeroupper
; AVX2-NEXT: retq
;
-; AVX512-LABEL: v4i64:
-; AVX512: # BB#0:
-; AVX512-NEXT: vpcmpgtq %ymm1, %ymm0, %k0
-; AVX512-NEXT: kmovd %k0, %eax
-; AVX512-NEXT: movb %al, -{{[0-9]+}}(%rsp)
-; AVX512-NEXT: movb -{{[0-9]+}}(%rsp), %al
-; AVX512-NEXT: vzeroupper
-; AVX512-NEXT: retq
+; AVX512F-LABEL: v4i64:
+; AVX512F: # BB#0:
+; AVX512F-NEXT: vpcmpgtq %ymm1, %ymm0, %k0
+; AVX512F-NEXT: kmovw %k0, %eax
+; AVX512F-NEXT: movb %al, -{{[0-9]+}}(%rsp)
+; AVX512F-NEXT: movb -{{[0-9]+}}(%rsp), %al
+; AVX512F-NEXT: vzeroupper
+; AVX512F-NEXT: retq
+;
+; AVX512BW-LABEL: v4i64:
+; AVX512BW: # BB#0:
+; AVX512BW-NEXT: vpcmpgtq %ymm1, %ymm0, %k0
+; AVX512BW-NEXT: kmovd %k0, %eax
+; AVX512BW-NEXT: movb %al, -{{[0-9]+}}(%rsp)
+; AVX512BW-NEXT: movb -{{[0-9]+}}(%rsp), %al
+; AVX512BW-NEXT: vzeroupper
+; AVX512BW-NEXT: retq
%x = icmp sgt <4 x i64> %a, %b
%res = bitcast <4 x i1> %x to i4
ret i4 %res
@@ -245,14 +307,23 @@ define i4 @v4f64(<4 x double> %a, <4 x d
; AVX12-NEXT: vzeroupper
; AVX12-NEXT: retq
;
-; AVX512-LABEL: v4f64:
-; AVX512: # BB#0:
-; AVX512-NEXT: vcmpltpd %ymm0, %ymm1, %k0
-; AVX512-NEXT: kmovd %k0, %eax
-; AVX512-NEXT: movb %al, -{{[0-9]+}}(%rsp)
-; AVX512-NEXT: movb -{{[0-9]+}}(%rsp), %al
-; AVX512-NEXT: vzeroupper
-; AVX512-NEXT: retq
+; AVX512F-LABEL: v4f64:
+; AVX512F: # BB#0:
+; AVX512F-NEXT: vcmpltpd %ymm0, %ymm1, %k0
+; AVX512F-NEXT: kmovw %k0, %eax
+; AVX512F-NEXT: movb %al, -{{[0-9]+}}(%rsp)
+; AVX512F-NEXT: movb -{{[0-9]+}}(%rsp), %al
+; AVX512F-NEXT: vzeroupper
+; AVX512F-NEXT: retq
+;
+; AVX512BW-LABEL: v4f64:
+; AVX512BW: # BB#0:
+; AVX512BW-NEXT: vcmpltpd %ymm0, %ymm1, %k0
+; AVX512BW-NEXT: kmovd %k0, %eax
+; AVX512BW-NEXT: movb %al, -{{[0-9]+}}(%rsp)
+; AVX512BW-NEXT: movb -{{[0-9]+}}(%rsp), %al
+; AVX512BW-NEXT: vzeroupper
+; AVX512BW-NEXT: retq
%x = fcmp ogt <4 x double> %a, %b
%res = bitcast <4 x i1> %x to i4
ret i4 %res
More information about the llvm-commits
mailing list