[llvm] r341171 - [X86] Add -x86-experimental-vector-widening-legalization run line to avx512-cvt.ll
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 31 00:05:36 PDT 2018
Author: ctopper
Date: Fri Aug 31 00:05:36 2018
New Revision: 341171
URL: http://llvm.org/viewvc/llvm-project?rev=341171&view=rev
Log:
[X86] Add -x86-experimental-vector-widening-legalization run line to avx512-cvt.ll
This will cover the (v2i32 (setcc v2f32)) case in replaceNodeResults. That code shouldn't be needed at all in this mode. A future patch will skip it.
Modified:
llvm/trunk/test/CodeGen/X86/avx512-cvt.ll
Modified: llvm/trunk/test/CodeGen/X86/avx512-cvt.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/avx512-cvt.ll?rev=341171&r1=341170&r2=341171&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/avx512-cvt.ll (original)
+++ llvm/trunk/test/CodeGen/X86/avx512-cvt.ll Fri Aug 31 00:05:36 2018
@@ -6,6 +6,7 @@
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=avx512bw | FileCheck %s --check-prefix=ALL --check-prefix=NOVL --check-prefix=NODQ --check-prefix=NOVLDQ --check-prefix=AVX512BW
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=avx512vl,avx512dq | FileCheck %s --check-prefix=ALL --check-prefix=VL --check-prefix=VLDQ --check-prefix=VLNOBW --check-prefix=AVX512VLDQ
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=avx512vl,avx512bw | FileCheck %s --check-prefix=ALL --check-prefix=NODQ --check-prefix=VL --check-prefix=VLNODQ --check-prefix=VLBW --check-prefix=AVX512VLBW
+; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512f -x86-experimental-vector-widening-legalization | FileCheck %s --check-prefix=KNL_WIDEN
define <16 x float> @sitof32(<16 x i32> %a) nounwind {
@@ -13,6 +14,11 @@ define <16 x float> @sitof32(<16 x i32>
; ALL: # %bb.0:
; ALL-NEXT: vcvtdq2ps %zmm0, %zmm0
; ALL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: sitof32:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vcvtdq2ps %zmm0, %zmm0
+; KNL_WIDEN-NEXT: retq
%b = sitofp <16 x i32> %a to <16 x float>
ret <16 x float> %b
}
@@ -57,6 +63,36 @@ define <8 x double> @sltof864(<8 x i64>
; DQNOVL: # %bb.0:
; DQNOVL-NEXT: vcvtqq2pd %zmm0, %zmm0
; DQNOVL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: sltof864:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vextracti32x4 $3, %zmm0, %xmm1
+; KNL_WIDEN-NEXT: vpextrq $1, %xmm1, %rax
+; KNL_WIDEN-NEXT: vcvtsi2sdq %rax, %xmm2, %xmm2
+; KNL_WIDEN-NEXT: vmovq %xmm1, %rax
+; KNL_WIDEN-NEXT: vcvtsi2sdq %rax, %xmm3, %xmm1
+; KNL_WIDEN-NEXT: vmovlhps {{.*#+}} xmm1 = xmm1[0],xmm2[0]
+; KNL_WIDEN-NEXT: vextracti32x4 $2, %zmm0, %xmm2
+; KNL_WIDEN-NEXT: vpextrq $1, %xmm2, %rax
+; KNL_WIDEN-NEXT: vcvtsi2sdq %rax, %xmm3, %xmm3
+; KNL_WIDEN-NEXT: vmovq %xmm2, %rax
+; KNL_WIDEN-NEXT: vcvtsi2sdq %rax, %xmm4, %xmm2
+; KNL_WIDEN-NEXT: vmovlhps {{.*#+}} xmm2 = xmm2[0],xmm3[0]
+; KNL_WIDEN-NEXT: vinsertf128 $1, %xmm1, %ymm2, %ymm1
+; KNL_WIDEN-NEXT: vextracti128 $1, %ymm0, %xmm2
+; KNL_WIDEN-NEXT: vpextrq $1, %xmm2, %rax
+; KNL_WIDEN-NEXT: vcvtsi2sdq %rax, %xmm4, %xmm3
+; KNL_WIDEN-NEXT: vmovq %xmm2, %rax
+; KNL_WIDEN-NEXT: vcvtsi2sdq %rax, %xmm4, %xmm2
+; KNL_WIDEN-NEXT: vmovlhps {{.*#+}} xmm2 = xmm2[0],xmm3[0]
+; KNL_WIDEN-NEXT: vpextrq $1, %xmm0, %rax
+; KNL_WIDEN-NEXT: vcvtsi2sdq %rax, %xmm4, %xmm3
+; KNL_WIDEN-NEXT: vmovq %xmm0, %rax
+; KNL_WIDEN-NEXT: vcvtsi2sdq %rax, %xmm4, %xmm0
+; KNL_WIDEN-NEXT: vmovlhps {{.*#+}} xmm0 = xmm0[0],xmm3[0]
+; KNL_WIDEN-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0
+; KNL_WIDEN-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
+; KNL_WIDEN-NEXT: retq
%b = sitofp <8 x i64> %a to <8 x double>
ret <8 x double> %b
}
@@ -89,6 +125,22 @@ define <4 x double> @slto4f64(<4 x i64>
; DQNOVL-NEXT: vcvtqq2pd %zmm0, %zmm0
; DQNOVL-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
; DQNOVL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: slto4f64:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vextracti128 $1, %ymm0, %xmm1
+; KNL_WIDEN-NEXT: vpextrq $1, %xmm1, %rax
+; KNL_WIDEN-NEXT: vcvtsi2sdq %rax, %xmm2, %xmm2
+; KNL_WIDEN-NEXT: vmovq %xmm1, %rax
+; KNL_WIDEN-NEXT: vcvtsi2sdq %rax, %xmm3, %xmm1
+; KNL_WIDEN-NEXT: vmovlhps {{.*#+}} xmm1 = xmm1[0],xmm2[0]
+; KNL_WIDEN-NEXT: vpextrq $1, %xmm0, %rax
+; KNL_WIDEN-NEXT: vcvtsi2sdq %rax, %xmm3, %xmm2
+; KNL_WIDEN-NEXT: vmovq %xmm0, %rax
+; KNL_WIDEN-NEXT: vcvtsi2sdq %rax, %xmm3, %xmm0
+; KNL_WIDEN-NEXT: vmovlhps {{.*#+}} xmm0 = xmm0[0],xmm2[0]
+; KNL_WIDEN-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
+; KNL_WIDEN-NEXT: retq
%b = sitofp <4 x i64> %a to <4 x double>
ret <4 x double> %b
}
@@ -115,6 +167,15 @@ define <2 x double> @slto2f64(<2 x i64>
; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
; DQNOVL-NEXT: vzeroupper
; DQNOVL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: slto2f64:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vpextrq $1, %xmm0, %rax
+; KNL_WIDEN-NEXT: vcvtsi2sdq %rax, %xmm1, %xmm1
+; KNL_WIDEN-NEXT: vmovq %xmm0, %rax
+; KNL_WIDEN-NEXT: vcvtsi2sdq %rax, %xmm2, %xmm0
+; KNL_WIDEN-NEXT: vmovlhps {{.*#+}} xmm0 = xmm0[0],xmm1[0]
+; KNL_WIDEN-NEXT: retq
%b = sitofp <2 x i64> %a to <2 x double>
ret <2 x double> %b
}
@@ -143,6 +204,17 @@ define <2 x float> @sltof2f32(<2 x i64>
; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $ymm0
; DQNOVL-NEXT: vzeroupper
; DQNOVL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: sltof2f32:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vpextrq $1, %xmm0, %rax
+; KNL_WIDEN-NEXT: vcvtsi2ssq %rax, %xmm1, %xmm1
+; KNL_WIDEN-NEXT: vmovq %xmm0, %rax
+; KNL_WIDEN-NEXT: vcvtsi2ssq %rax, %xmm2, %xmm0
+; KNL_WIDEN-NEXT: vinsertps {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[2,3]
+; KNL_WIDEN-NEXT: vcvtsi2ssq %rax, %xmm2, %xmm1
+; KNL_WIDEN-NEXT: vshufps {{.*#+}} xmm0 = xmm0[0,1],xmm1[0,0]
+; KNL_WIDEN-NEXT: retq
%b = sitofp <2 x i64> %a to <2 x float>
ret <2 x float>%b
}
@@ -178,6 +250,24 @@ define <4 x float> @slto4f32_mem(<4 x i6
; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $ymm0
; DQNOVL-NEXT: vzeroupper
; DQNOVL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: slto4f32_mem:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vmovdqu (%rdi), %ymm0
+; KNL_WIDEN-NEXT: vpextrq $1, %xmm0, %rax
+; KNL_WIDEN-NEXT: vcvtsi2ssq %rax, %xmm1, %xmm1
+; KNL_WIDEN-NEXT: vmovq %xmm0, %rax
+; KNL_WIDEN-NEXT: vcvtsi2ssq %rax, %xmm2, %xmm2
+; KNL_WIDEN-NEXT: vinsertps {{.*#+}} xmm1 = xmm2[0],xmm1[0],xmm2[2,3]
+; KNL_WIDEN-NEXT: vextracti128 $1, %ymm0, %xmm0
+; KNL_WIDEN-NEXT: vmovq %xmm0, %rax
+; KNL_WIDEN-NEXT: vcvtsi2ssq %rax, %xmm3, %xmm2
+; KNL_WIDEN-NEXT: vinsertps {{.*#+}} xmm1 = xmm1[0,1],xmm2[0],xmm1[3]
+; KNL_WIDEN-NEXT: vpextrq $1, %xmm0, %rax
+; KNL_WIDEN-NEXT: vcvtsi2ssq %rax, %xmm3, %xmm0
+; KNL_WIDEN-NEXT: vinsertps {{.*#+}} xmm0 = xmm1[0,1,2],xmm0[0]
+; KNL_WIDEN-NEXT: vzeroupper
+; KNL_WIDEN-NEXT: retq
%a1 = load <4 x i64>, <4 x i64>* %a, align 8
%b = sitofp <4 x i64> %a1 to <4 x float>
ret <4 x float>%b
@@ -213,6 +303,24 @@ define <4 x i64> @f64to4sl(<4 x double>
; DQNOVL-NEXT: vcvttpd2qq %zmm0, %zmm0
; DQNOVL-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
; DQNOVL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: f64to4sl:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vextractf128 $1, %ymm0, %xmm1
+; KNL_WIDEN-NEXT: vcvttsd2si %xmm1, %rax
+; KNL_WIDEN-NEXT: vmovq %rax, %xmm2
+; KNL_WIDEN-NEXT: vpermilpd {{.*#+}} xmm1 = xmm1[1,0]
+; KNL_WIDEN-NEXT: vcvttsd2si %xmm1, %rax
+; KNL_WIDEN-NEXT: vmovq %rax, %xmm1
+; KNL_WIDEN-NEXT: vpunpcklqdq {{.*#+}} xmm1 = xmm2[0],xmm1[0]
+; KNL_WIDEN-NEXT: vcvttsd2si %xmm0, %rax
+; KNL_WIDEN-NEXT: vmovq %rax, %xmm2
+; KNL_WIDEN-NEXT: vpermilpd {{.*#+}} xmm0 = xmm0[1,0]
+; KNL_WIDEN-NEXT: vcvttsd2si %xmm0, %rax
+; KNL_WIDEN-NEXT: vmovq %rax, %xmm0
+; KNL_WIDEN-NEXT: vpunpcklqdq {{.*#+}} xmm0 = xmm2[0],xmm0[0]
+; KNL_WIDEN-NEXT: vinserti128 $1, %xmm1, %ymm0, %ymm0
+; KNL_WIDEN-NEXT: retq
%b = fptosi <4 x double> %a to <4 x i64>
ret <4 x i64> %b
}
@@ -247,6 +355,24 @@ define <4 x i64> @f32to4sl(<4 x float> %
; DQNOVL-NEXT: vcvttps2qq %ymm0, %zmm0
; DQNOVL-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
; DQNOVL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: f32to4sl:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vpermilps {{.*#+}} xmm1 = xmm0[3,1,2,3]
+; KNL_WIDEN-NEXT: vcvttss2si %xmm1, %rax
+; KNL_WIDEN-NEXT: vmovq %rax, %xmm1
+; KNL_WIDEN-NEXT: vpermilpd {{.*#+}} xmm2 = xmm0[1,0]
+; KNL_WIDEN-NEXT: vcvttss2si %xmm2, %rax
+; KNL_WIDEN-NEXT: vmovq %rax, %xmm2
+; KNL_WIDEN-NEXT: vpunpcklqdq {{.*#+}} xmm1 = xmm2[0],xmm1[0]
+; KNL_WIDEN-NEXT: vcvttss2si %xmm0, %rax
+; KNL_WIDEN-NEXT: vmovq %rax, %xmm2
+; KNL_WIDEN-NEXT: vmovshdup {{.*#+}} xmm0 = xmm0[1,1,3,3]
+; KNL_WIDEN-NEXT: vcvttss2si %xmm0, %rax
+; KNL_WIDEN-NEXT: vmovq %rax, %xmm0
+; KNL_WIDEN-NEXT: vpunpcklqdq {{.*#+}} xmm0 = xmm2[0],xmm0[0]
+; KNL_WIDEN-NEXT: vinserti128 $1, %xmm1, %ymm0, %ymm0
+; KNL_WIDEN-NEXT: retq
%b = fptosi <4 x float> %a to <4 x i64>
ret <4 x i64> %b
}
@@ -282,6 +408,23 @@ define <4 x float> @slto4f32(<4 x i64> %
; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $ymm0
; DQNOVL-NEXT: vzeroupper
; DQNOVL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: slto4f32:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vpextrq $1, %xmm0, %rax
+; KNL_WIDEN-NEXT: vcvtsi2ssq %rax, %xmm1, %xmm1
+; KNL_WIDEN-NEXT: vmovq %xmm0, %rax
+; KNL_WIDEN-NEXT: vcvtsi2ssq %rax, %xmm2, %xmm2
+; KNL_WIDEN-NEXT: vinsertps {{.*#+}} xmm1 = xmm2[0],xmm1[0],xmm2[2,3]
+; KNL_WIDEN-NEXT: vextracti128 $1, %ymm0, %xmm0
+; KNL_WIDEN-NEXT: vmovq %xmm0, %rax
+; KNL_WIDEN-NEXT: vcvtsi2ssq %rax, %xmm3, %xmm2
+; KNL_WIDEN-NEXT: vinsertps {{.*#+}} xmm1 = xmm1[0,1],xmm2[0],xmm1[3]
+; KNL_WIDEN-NEXT: vpextrq $1, %xmm0, %rax
+; KNL_WIDEN-NEXT: vcvtsi2ssq %rax, %xmm3, %xmm0
+; KNL_WIDEN-NEXT: vinsertps {{.*#+}} xmm0 = xmm1[0,1,2],xmm0[0]
+; KNL_WIDEN-NEXT: vzeroupper
+; KNL_WIDEN-NEXT: retq
%b = sitofp <4 x i64> %a to <4 x float>
ret <4 x float> %b
}
@@ -317,6 +460,23 @@ define <4 x float> @ulto4f32(<4 x i64> %
; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $ymm0
; DQNOVL-NEXT: vzeroupper
; DQNOVL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: ulto4f32:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vpextrq $1, %xmm0, %rax
+; KNL_WIDEN-NEXT: vcvtusi2ssq %rax, %xmm1, %xmm1
+; KNL_WIDEN-NEXT: vmovq %xmm0, %rax
+; KNL_WIDEN-NEXT: vcvtusi2ssq %rax, %xmm2, %xmm2
+; KNL_WIDEN-NEXT: vinsertps {{.*#+}} xmm1 = xmm2[0],xmm1[0],xmm2[2,3]
+; KNL_WIDEN-NEXT: vextracti128 $1, %ymm0, %xmm0
+; KNL_WIDEN-NEXT: vmovq %xmm0, %rax
+; KNL_WIDEN-NEXT: vcvtusi2ssq %rax, %xmm3, %xmm2
+; KNL_WIDEN-NEXT: vinsertps {{.*#+}} xmm1 = xmm1[0,1],xmm2[0],xmm1[3]
+; KNL_WIDEN-NEXT: vpextrq $1, %xmm0, %rax
+; KNL_WIDEN-NEXT: vcvtusi2ssq %rax, %xmm3, %xmm0
+; KNL_WIDEN-NEXT: vinsertps {{.*#+}} xmm0 = xmm1[0,1,2],xmm0[0]
+; KNL_WIDEN-NEXT: vzeroupper
+; KNL_WIDEN-NEXT: retq
%b = uitofp <4 x i64> %a to <4 x float>
ret <4 x float> %b
}
@@ -361,6 +521,36 @@ define <8 x double> @ulto8f64(<8 x i64>
; DQNOVL: # %bb.0:
; DQNOVL-NEXT: vcvtuqq2pd %zmm0, %zmm0
; DQNOVL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: ulto8f64:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vextracti32x4 $3, %zmm0, %xmm1
+; KNL_WIDEN-NEXT: vpextrq $1, %xmm1, %rax
+; KNL_WIDEN-NEXT: vcvtusi2sdq %rax, %xmm2, %xmm2
+; KNL_WIDEN-NEXT: vmovq %xmm1, %rax
+; KNL_WIDEN-NEXT: vcvtusi2sdq %rax, %xmm3, %xmm1
+; KNL_WIDEN-NEXT: vmovlhps {{.*#+}} xmm1 = xmm1[0],xmm2[0]
+; KNL_WIDEN-NEXT: vextracti32x4 $2, %zmm0, %xmm2
+; KNL_WIDEN-NEXT: vpextrq $1, %xmm2, %rax
+; KNL_WIDEN-NEXT: vcvtusi2sdq %rax, %xmm3, %xmm3
+; KNL_WIDEN-NEXT: vmovq %xmm2, %rax
+; KNL_WIDEN-NEXT: vcvtusi2sdq %rax, %xmm4, %xmm2
+; KNL_WIDEN-NEXT: vmovlhps {{.*#+}} xmm2 = xmm2[0],xmm3[0]
+; KNL_WIDEN-NEXT: vinsertf128 $1, %xmm1, %ymm2, %ymm1
+; KNL_WIDEN-NEXT: vextracti128 $1, %ymm0, %xmm2
+; KNL_WIDEN-NEXT: vpextrq $1, %xmm2, %rax
+; KNL_WIDEN-NEXT: vcvtusi2sdq %rax, %xmm4, %xmm3
+; KNL_WIDEN-NEXT: vmovq %xmm2, %rax
+; KNL_WIDEN-NEXT: vcvtusi2sdq %rax, %xmm4, %xmm2
+; KNL_WIDEN-NEXT: vmovlhps {{.*#+}} xmm2 = xmm2[0],xmm3[0]
+; KNL_WIDEN-NEXT: vpextrq $1, %xmm0, %rax
+; KNL_WIDEN-NEXT: vcvtusi2sdq %rax, %xmm4, %xmm3
+; KNL_WIDEN-NEXT: vmovq %xmm0, %rax
+; KNL_WIDEN-NEXT: vcvtusi2sdq %rax, %xmm4, %xmm0
+; KNL_WIDEN-NEXT: vmovlhps {{.*#+}} xmm0 = xmm0[0],xmm3[0]
+; KNL_WIDEN-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0
+; KNL_WIDEN-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
+; KNL_WIDEN-NEXT: retq
%b = uitofp <8 x i64> %a to <8 x double>
ret <8 x double> %b
}
@@ -433,6 +623,62 @@ define <16 x double> @ulto16f64(<16 x i6
; DQNOVL-NEXT: vcvtuqq2pd %zmm0, %zmm0
; DQNOVL-NEXT: vcvtuqq2pd %zmm1, %zmm1
; DQNOVL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: ulto16f64:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vextracti32x4 $3, %zmm0, %xmm2
+; KNL_WIDEN-NEXT: vpextrq $1, %xmm2, %rax
+; KNL_WIDEN-NEXT: vcvtusi2sdq %rax, %xmm3, %xmm3
+; KNL_WIDEN-NEXT: vmovq %xmm2, %rax
+; KNL_WIDEN-NEXT: vcvtusi2sdq %rax, %xmm4, %xmm2
+; KNL_WIDEN-NEXT: vmovlhps {{.*#+}} xmm2 = xmm2[0],xmm3[0]
+; KNL_WIDEN-NEXT: vextracti32x4 $2, %zmm0, %xmm3
+; KNL_WIDEN-NEXT: vpextrq $1, %xmm3, %rax
+; KNL_WIDEN-NEXT: vcvtusi2sdq %rax, %xmm4, %xmm4
+; KNL_WIDEN-NEXT: vmovq %xmm3, %rax
+; KNL_WIDEN-NEXT: vcvtusi2sdq %rax, %xmm5, %xmm3
+; KNL_WIDEN-NEXT: vmovlhps {{.*#+}} xmm3 = xmm3[0],xmm4[0]
+; KNL_WIDEN-NEXT: vinsertf128 $1, %xmm2, %ymm3, %ymm2
+; KNL_WIDEN-NEXT: vextracti128 $1, %ymm0, %xmm3
+; KNL_WIDEN-NEXT: vpextrq $1, %xmm3, %rax
+; KNL_WIDEN-NEXT: vcvtusi2sdq %rax, %xmm5, %xmm4
+; KNL_WIDEN-NEXT: vmovq %xmm3, %rax
+; KNL_WIDEN-NEXT: vcvtusi2sdq %rax, %xmm5, %xmm3
+; KNL_WIDEN-NEXT: vmovlhps {{.*#+}} xmm3 = xmm3[0],xmm4[0]
+; KNL_WIDEN-NEXT: vpextrq $1, %xmm0, %rax
+; KNL_WIDEN-NEXT: vcvtusi2sdq %rax, %xmm5, %xmm4
+; KNL_WIDEN-NEXT: vmovq %xmm0, %rax
+; KNL_WIDEN-NEXT: vcvtusi2sdq %rax, %xmm5, %xmm0
+; KNL_WIDEN-NEXT: vmovlhps {{.*#+}} xmm0 = xmm0[0],xmm4[0]
+; KNL_WIDEN-NEXT: vinsertf128 $1, %xmm3, %ymm0, %ymm0
+; KNL_WIDEN-NEXT: vinsertf64x4 $1, %ymm2, %zmm0, %zmm0
+; KNL_WIDEN-NEXT: vextracti32x4 $3, %zmm1, %xmm2
+; KNL_WIDEN-NEXT: vpextrq $1, %xmm2, %rax
+; KNL_WIDEN-NEXT: vcvtusi2sdq %rax, %xmm5, %xmm3
+; KNL_WIDEN-NEXT: vmovq %xmm2, %rax
+; KNL_WIDEN-NEXT: vcvtusi2sdq %rax, %xmm5, %xmm2
+; KNL_WIDEN-NEXT: vmovlhps {{.*#+}} xmm2 = xmm2[0],xmm3[0]
+; KNL_WIDEN-NEXT: vextracti32x4 $2, %zmm1, %xmm3
+; KNL_WIDEN-NEXT: vpextrq $1, %xmm3, %rax
+; KNL_WIDEN-NEXT: vcvtusi2sdq %rax, %xmm5, %xmm4
+; KNL_WIDEN-NEXT: vmovq %xmm3, %rax
+; KNL_WIDEN-NEXT: vcvtusi2sdq %rax, %xmm5, %xmm3
+; KNL_WIDEN-NEXT: vmovlhps {{.*#+}} xmm3 = xmm3[0],xmm4[0]
+; KNL_WIDEN-NEXT: vinsertf128 $1, %xmm2, %ymm3, %ymm2
+; KNL_WIDEN-NEXT: vextracti128 $1, %ymm1, %xmm3
+; KNL_WIDEN-NEXT: vpextrq $1, %xmm3, %rax
+; KNL_WIDEN-NEXT: vcvtusi2sdq %rax, %xmm5, %xmm4
+; KNL_WIDEN-NEXT: vmovq %xmm3, %rax
+; KNL_WIDEN-NEXT: vcvtusi2sdq %rax, %xmm5, %xmm3
+; KNL_WIDEN-NEXT: vmovlhps {{.*#+}} xmm3 = xmm3[0],xmm4[0]
+; KNL_WIDEN-NEXT: vpextrq $1, %xmm1, %rax
+; KNL_WIDEN-NEXT: vcvtusi2sdq %rax, %xmm5, %xmm4
+; KNL_WIDEN-NEXT: vmovq %xmm1, %rax
+; KNL_WIDEN-NEXT: vcvtusi2sdq %rax, %xmm5, %xmm1
+; KNL_WIDEN-NEXT: vmovlhps {{.*#+}} xmm1 = xmm1[0],xmm4[0]
+; KNL_WIDEN-NEXT: vinsertf128 $1, %xmm3, %ymm1, %ymm1
+; KNL_WIDEN-NEXT: vinsertf64x4 $1, %ymm2, %zmm1, %zmm1
+; KNL_WIDEN-NEXT: retq
%b = uitofp <16 x i64> %a to <16 x double>
ret <16 x double> %b
}
@@ -442,6 +688,11 @@ define <16 x i32> @f64to16si(<16 x float
; ALL: # %bb.0:
; ALL-NEXT: vcvttps2dq %zmm0, %zmm0
; ALL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: f64to16si:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vcvttps2dq %zmm0, %zmm0
+; KNL_WIDEN-NEXT: retq
%b = fptosi <16 x float> %a to <16 x i32>
ret <16 x i32> %b
}
@@ -453,6 +704,13 @@ define <16 x i8> @f32to16sc(<16 x float>
; ALL-NEXT: vpmovdb %zmm0, %xmm0
; ALL-NEXT: vzeroupper
; ALL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: f32to16sc:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vcvttps2dq %zmm0, %zmm0
+; KNL_WIDEN-NEXT: vpmovdb %zmm0, %xmm0
+; KNL_WIDEN-NEXT: vzeroupper
+; KNL_WIDEN-NEXT: retq
%res = fptosi <16 x float> %f to <16 x i8>
ret <16 x i8> %res
}
@@ -463,6 +721,12 @@ define <16 x i16> @f32to16ss(<16 x float
; ALL-NEXT: vcvttps2dq %zmm0, %zmm0
; ALL-NEXT: vpmovdw %zmm0, %ymm0
; ALL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: f32to16ss:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vcvttps2dq %zmm0, %zmm0
+; KNL_WIDEN-NEXT: vpmovdw %zmm0, %ymm0
+; KNL_WIDEN-NEXT: retq
%res = fptosi <16 x float> %f to <16 x i16>
ret <16 x i16> %res
}
@@ -472,6 +736,11 @@ define <16 x i32> @f32to16ui(<16 x float
; ALL: # %bb.0:
; ALL-NEXT: vcvttps2udq %zmm0, %zmm0
; ALL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: f32to16ui:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vcvttps2udq %zmm0, %zmm0
+; KNL_WIDEN-NEXT: retq
%b = fptoui <16 x float> %a to <16 x i32>
ret <16 x i32> %b
}
@@ -483,6 +752,13 @@ define <16 x i8> @f32to16uc(<16 x float>
; ALL-NEXT: vpmovdb %zmm0, %xmm0
; ALL-NEXT: vzeroupper
; ALL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: f32to16uc:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vcvttps2dq %zmm0, %zmm0
+; KNL_WIDEN-NEXT: vpmovdb %zmm0, %xmm0
+; KNL_WIDEN-NEXT: vzeroupper
+; KNL_WIDEN-NEXT: retq
%res = fptoui <16 x float> %f to <16 x i8>
ret <16 x i8> %res
}
@@ -493,6 +769,12 @@ define <16 x i16> @f32to16us(<16 x float
; ALL-NEXT: vcvttps2dq %zmm0, %zmm0
; ALL-NEXT: vpmovdw %zmm0, %ymm0
; ALL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: f32to16us:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vcvttps2dq %zmm0, %zmm0
+; KNL_WIDEN-NEXT: vpmovdw %zmm0, %ymm0
+; KNL_WIDEN-NEXT: retq
%res = fptoui <16 x float> %f to <16 x i16>
ret <16 x i16> %res
}
@@ -509,6 +791,13 @@ define <8 x i32> @f32to8ui(<8 x float> %
; VL: # %bb.0:
; VL-NEXT: vcvttps2udq %ymm0, %ymm0
; VL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: f32to8ui:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
+; KNL_WIDEN-NEXT: vcvttps2udq %zmm0, %zmm0
+; KNL_WIDEN-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
+; KNL_WIDEN-NEXT: retq
%b = fptoui <8 x float> %a to <8 x i32>
ret <8 x i32> %b
}
@@ -526,6 +815,14 @@ define <4 x i32> @f32to4ui(<4 x float> %
; VL: # %bb.0:
; VL-NEXT: vcvttps2udq %xmm0, %xmm0
; VL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: f32to4ui:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
+; KNL_WIDEN-NEXT: vcvttps2udq %zmm0, %zmm0
+; KNL_WIDEN-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
+; KNL_WIDEN-NEXT: vzeroupper
+; KNL_WIDEN-NEXT: retq
%b = fptoui <4 x float> %a to <4 x i32>
ret <4 x i32> %b
}
@@ -535,6 +832,11 @@ define <8 x i32> @f64to8ui(<8 x double>
; ALL: # %bb.0:
; ALL-NEXT: vcvttpd2udq %zmm0, %ymm0
; ALL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: f64to8ui:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vcvttpd2udq %zmm0, %ymm0
+; KNL_WIDEN-NEXT: retq
%b = fptoui <8 x double> %a to <8 x i32>
ret <8 x i32> %b
}
@@ -554,6 +856,14 @@ define <8 x i16> @f64to8us(<8 x double>
; VL-NEXT: vpmovdw %ymm0, %xmm0
; VL-NEXT: vzeroupper
; VL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: f64to8us:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vcvttpd2dq %zmm0, %ymm0
+; KNL_WIDEN-NEXT: vpmovdw %zmm0, %ymm0
+; KNL_WIDEN-NEXT: # kill: def $xmm0 killed $xmm0 killed $ymm0
+; KNL_WIDEN-NEXT: vzeroupper
+; KNL_WIDEN-NEXT: retq
%res = fptoui <8 x double> %f to <8 x i16>
ret <8 x i16> %res
}
@@ -573,6 +883,34 @@ define <8 x i8> @f64to8uc(<8 x double> %
; VL-NEXT: vpmovdw %ymm0, %xmm0
; VL-NEXT: vzeroupper
; VL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: f64to8uc:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vpermilpd {{.*#+}} xmm1 = xmm0[1,0]
+; KNL_WIDEN-NEXT: vcvttsd2si %xmm1, %eax
+; KNL_WIDEN-NEXT: vcvttsd2si %xmm0, %ecx
+; KNL_WIDEN-NEXT: vmovd %ecx, %xmm1
+; KNL_WIDEN-NEXT: vpinsrb $1, %eax, %xmm1, %xmm1
+; KNL_WIDEN-NEXT: vextractf128 $1, %ymm0, %xmm2
+; KNL_WIDEN-NEXT: vcvttsd2si %xmm2, %eax
+; KNL_WIDEN-NEXT: vpinsrb $2, %eax, %xmm1, %xmm1
+; KNL_WIDEN-NEXT: vpermilpd {{.*#+}} xmm2 = xmm2[1,0]
+; KNL_WIDEN-NEXT: vcvttsd2si %xmm2, %eax
+; KNL_WIDEN-NEXT: vpinsrb $3, %eax, %xmm1, %xmm1
+; KNL_WIDEN-NEXT: vextractf32x4 $2, %zmm0, %xmm2
+; KNL_WIDEN-NEXT: vcvttsd2si %xmm2, %eax
+; KNL_WIDEN-NEXT: vpinsrb $4, %eax, %xmm1, %xmm1
+; KNL_WIDEN-NEXT: vpermilpd {{.*#+}} xmm2 = xmm2[1,0]
+; KNL_WIDEN-NEXT: vcvttsd2si %xmm2, %eax
+; KNL_WIDEN-NEXT: vpinsrb $5, %eax, %xmm1, %xmm1
+; KNL_WIDEN-NEXT: vextractf32x4 $3, %zmm0, %xmm0
+; KNL_WIDEN-NEXT: vcvttsd2si %xmm0, %eax
+; KNL_WIDEN-NEXT: vpinsrb $6, %eax, %xmm1, %xmm1
+; KNL_WIDEN-NEXT: vpermilpd {{.*#+}} xmm0 = xmm0[1,0]
+; KNL_WIDEN-NEXT: vcvttsd2si %xmm0, %eax
+; KNL_WIDEN-NEXT: vpinsrb $7, %eax, %xmm1, %xmm0
+; KNL_WIDEN-NEXT: vzeroupper
+; KNL_WIDEN-NEXT: retq
%res = fptoui <8 x double> %f to <8 x i8>
ret <8 x i8> %res
}
@@ -591,6 +929,14 @@ define <4 x i32> @f64to4ui(<4 x double>
; VL-NEXT: vcvttpd2udq %ymm0, %xmm0
; VL-NEXT: vzeroupper
; VL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: f64to4ui:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
+; KNL_WIDEN-NEXT: vcvttpd2udq %zmm0, %ymm0
+; KNL_WIDEN-NEXT: # kill: def $xmm0 killed $xmm0 killed $ymm0
+; KNL_WIDEN-NEXT: vzeroupper
+; KNL_WIDEN-NEXT: retq
%b = fptoui <4 x double> %a to <4 x i32>
ret <4 x i32> %b
}
@@ -600,6 +946,11 @@ define <8 x double> @sito8f64(<8 x i32>
; ALL: # %bb.0:
; ALL-NEXT: vcvtdq2pd %ymm0, %zmm0
; ALL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: sito8f64:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vcvtdq2pd %ymm0, %zmm0
+; KNL_WIDEN-NEXT: retq
%b = sitofp <8 x i32> %a to <8 x double>
ret <8 x double> %b
}
@@ -633,6 +984,12 @@ define <8 x double> @i32to8f64_mask(<8 x
; AVX512BW-NEXT: kmovd %edi, %k1
; AVX512BW-NEXT: vcvtdq2pd %ymm1, %zmm0 {%k1}
; AVX512BW-NEXT: retq
+;
+; KNL_WIDEN-LABEL: i32to8f64_mask:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: kmovw %edi, %k1
+; KNL_WIDEN-NEXT: vcvtdq2pd %ymm1, %zmm0 {%k1}
+; KNL_WIDEN-NEXT: retq
%1 = bitcast i8 %c to <8 x i1>
%2 = sitofp <8 x i32> %b to <8 x double>
%3 = select <8 x i1> %1, <8 x double> %2, <8 x double> %a
@@ -668,6 +1025,12 @@ define <8 x double> @sito8f64_maskz(<8 x
; AVX512BW-NEXT: kmovd %edi, %k1
; AVX512BW-NEXT: vcvtdq2pd %ymm0, %zmm0 {%k1} {z}
; AVX512BW-NEXT: retq
+;
+; KNL_WIDEN-LABEL: sito8f64_maskz:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: kmovw %edi, %k1
+; KNL_WIDEN-NEXT: vcvtdq2pd %ymm0, %zmm0 {%k1} {z}
+; KNL_WIDEN-NEXT: retq
%1 = bitcast i8 %b to <8 x i1>
%2 = sitofp <8 x i32> %a to <8 x double>
%3 = select <8 x i1> %1, <8 x double> %2, <8 x double> zeroinitializer
@@ -679,6 +1042,11 @@ define <8 x i32> @f64to8si(<8 x double>
; ALL: # %bb.0:
; ALL-NEXT: vcvttpd2dq %zmm0, %ymm0
; ALL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: f64to8si:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vcvttpd2dq %zmm0, %ymm0
+; KNL_WIDEN-NEXT: retq
%b = fptosi <8 x double> %a to <8 x i32>
ret <8 x i32> %b
}
@@ -689,6 +1057,12 @@ define <4 x i32> @f64to4si(<4 x double>
; ALL-NEXT: vcvttpd2dq %ymm0, %xmm0
; ALL-NEXT: vzeroupper
; ALL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: f64to4si:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vcvttpd2dq %ymm0, %xmm0
+; KNL_WIDEN-NEXT: vzeroupper
+; KNL_WIDEN-NEXT: retq
%b = fptosi <4 x double> %a to <4 x i32>
ret <4 x i32> %b
}
@@ -700,6 +1074,13 @@ define <16 x float> @f64to16f32(<16 x do
; ALL-NEXT: vcvtpd2ps %zmm1, %ymm1
; ALL-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
; ALL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: f64to16f32:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vcvtpd2ps %zmm0, %ymm0
+; KNL_WIDEN-NEXT: vcvtpd2ps %zmm1, %ymm1
+; KNL_WIDEN-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
+; KNL_WIDEN-NEXT: retq
%a = fptrunc <16 x double> %b to <16 x float>
ret <16 x float> %a
}
@@ -710,6 +1091,12 @@ define <4 x float> @f64to4f32(<4 x doubl
; ALL-NEXT: vcvtpd2ps %ymm0, %xmm0
; ALL-NEXT: vzeroupper
; ALL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: f64to4f32:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vcvtpd2ps %ymm0, %xmm0
+; KNL_WIDEN-NEXT: vzeroupper
+; KNL_WIDEN-NEXT: retq
%a = fptrunc <4 x double> %b to <4 x float>
ret <4 x float> %a
}
@@ -750,6 +1137,16 @@ define <4 x float> @f64to4f32_mask(<4 x
; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
; DQNOVL-NEXT: vzeroupper
; DQNOVL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: f64to4f32_mask:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vpslld $31, %xmm1, %xmm1
+; KNL_WIDEN-NEXT: vptestmd %zmm1, %zmm1, %k1
+; KNL_WIDEN-NEXT: vcvtpd2ps %ymm0, %xmm0
+; KNL_WIDEN-NEXT: vmovaps %zmm0, %zmm0 {%k1} {z}
+; KNL_WIDEN-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
+; KNL_WIDEN-NEXT: vzeroupper
+; KNL_WIDEN-NEXT: retq
%a = fptrunc <4 x double> %b to <4 x float>
%c = select <4 x i1>%mask, <4 x float>%a, <4 x float> zeroinitializer
ret <4 x float> %c
@@ -760,6 +1157,11 @@ define <4 x float> @f64tof32_inreg(<2 x
; ALL: # %bb.0:
; ALL-NEXT: vcvtsd2ss %xmm0, %xmm1, %xmm0
; ALL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: f64tof32_inreg:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vcvtsd2ss %xmm0, %xmm1, %xmm0
+; KNL_WIDEN-NEXT: retq
%ext = extractelement <2 x double> %a0, i32 0
%cvt = fptrunc double %ext to float
%res = insertelement <4 x float> %a1, float %cvt, i32 0
@@ -771,6 +1173,11 @@ define <8 x double> @f32to8f64(<8 x floa
; ALL: # %bb.0:
; ALL-NEXT: vcvtps2pd %ymm0, %zmm0
; ALL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: f32to8f64:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vcvtps2pd %ymm0, %zmm0
+; KNL_WIDEN-NEXT: retq
%a = fpext <8 x float> %b to <8 x double>
ret <8 x double> %a
}
@@ -791,6 +1198,16 @@ define <4 x double> @f32to4f64_mask(<4 x
; VL-NEXT: vcmpltpd %ymm2, %ymm1, %k1
; VL-NEXT: vcvtps2pd %xmm0, %ymm0 {%k1} {z}
; VL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: f32to4f64_mask:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: # kill: def $ymm2 killed $ymm2 def $zmm2
+; KNL_WIDEN-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
+; KNL_WIDEN-NEXT: vcvtps2pd %xmm0, %ymm0
+; KNL_WIDEN-NEXT: vcmpltpd %zmm2, %zmm1, %k1
+; KNL_WIDEN-NEXT: vmovapd %zmm0, %zmm0 {%k1} {z}
+; KNL_WIDEN-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
+; KNL_WIDEN-NEXT: retq
%a = fpext <4 x float> %b to <4 x double>
%mask = fcmp ogt <4 x double> %a1, %b1
%c = select <4 x i1> %mask, <4 x double> %a, <4 x double> zeroinitializer
@@ -802,6 +1219,11 @@ define <2 x double> @f32tof64_inreg(<2 x
; ALL: # %bb.0:
; ALL-NEXT: vcvtss2sd %xmm1, %xmm0, %xmm0
; ALL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: f32tof64_inreg:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vcvtss2sd %xmm1, %xmm0, %xmm0
+; KNL_WIDEN-NEXT: retq
%ext = extractelement <4 x float> %a1, i32 0
%cvt = fpext float %ext to double
%res = insertelement <2 x double> %a0, double %cvt, i32 0
@@ -813,6 +1235,11 @@ define double @sltof64_load(i64* nocaptu
; ALL: # %bb.0: # %entry
; ALL-NEXT: vcvtsi2sdq (%rdi), %xmm0, %xmm0
; ALL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: sltof64_load:
+; KNL_WIDEN: # %bb.0: # %entry
+; KNL_WIDEN-NEXT: vcvtsi2sdq (%rdi), %xmm0, %xmm0
+; KNL_WIDEN-NEXT: retq
entry:
%tmp1 = load i64, i64* %e, align 8
%conv = sitofp i64 %tmp1 to double
@@ -824,6 +1251,11 @@ define double @sitof64_load(i32* %e) {
; ALL: # %bb.0: # %entry
; ALL-NEXT: vcvtsi2sdl (%rdi), %xmm0, %xmm0
; ALL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: sitof64_load:
+; KNL_WIDEN: # %bb.0: # %entry
+; KNL_WIDEN-NEXT: vcvtsi2sdl (%rdi), %xmm0, %xmm0
+; KNL_WIDEN-NEXT: retq
entry:
%tmp1 = load i32, i32* %e, align 4
%conv = sitofp i32 %tmp1 to double
@@ -835,6 +1267,11 @@ define float @sitof32_load(i32* %e) {
; ALL: # %bb.0: # %entry
; ALL-NEXT: vcvtsi2ssl (%rdi), %xmm0, %xmm0
; ALL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: sitof32_load:
+; KNL_WIDEN: # %bb.0: # %entry
+; KNL_WIDEN-NEXT: vcvtsi2ssl (%rdi), %xmm0, %xmm0
+; KNL_WIDEN-NEXT: retq
entry:
%tmp1 = load i32, i32* %e, align 4
%conv = sitofp i32 %tmp1 to float
@@ -846,6 +1283,11 @@ define float @sltof32_load(i64* %e) {
; ALL: # %bb.0: # %entry
; ALL-NEXT: vcvtsi2ssq (%rdi), %xmm0, %xmm0
; ALL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: sltof32_load:
+; KNL_WIDEN: # %bb.0: # %entry
+; KNL_WIDEN-NEXT: vcvtsi2ssq (%rdi), %xmm0, %xmm0
+; KNL_WIDEN-NEXT: retq
entry:
%tmp1 = load i64, i64* %e, align 8
%conv = sitofp i64 %tmp1 to float
@@ -859,6 +1301,13 @@ define void @f32tof64_loadstore() {
; ALL-NEXT: vcvtss2sd %xmm0, %xmm0, %xmm0
; ALL-NEXT: vmovsd %xmm0, -{{[0-9]+}}(%rsp)
; ALL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: f32tof64_loadstore:
+; KNL_WIDEN: # %bb.0: # %entry
+; KNL_WIDEN-NEXT: vmovss {{.*#+}} xmm0 = mem[0],zero,zero,zero
+; KNL_WIDEN-NEXT: vcvtss2sd %xmm0, %xmm0, %xmm0
+; KNL_WIDEN-NEXT: vmovsd %xmm0, -{{[0-9]+}}(%rsp)
+; KNL_WIDEN-NEXT: retq
entry:
%f = alloca float, align 4
%d = alloca double, align 8
@@ -875,6 +1324,13 @@ define void @f64tof32_loadstore() nounwi
; ALL-NEXT: vcvtsd2ss %xmm0, %xmm0, %xmm0
; ALL-NEXT: vmovss %xmm0, -{{[0-9]+}}(%rsp)
; ALL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: f64tof32_loadstore:
+; KNL_WIDEN: # %bb.0: # %entry
+; KNL_WIDEN-NEXT: vmovsd {{.*#+}} xmm0 = mem[0],zero
+; KNL_WIDEN-NEXT: vcvtsd2ss %xmm0, %xmm0, %xmm0
+; KNL_WIDEN-NEXT: vmovss %xmm0, -{{[0-9]+}}(%rsp)
+; KNL_WIDEN-NEXT: retq
entry:
%f = alloca float, align 4
%d = alloca double, align 8
@@ -889,6 +1345,11 @@ define double @long_to_double(i64 %x) {
; ALL: # %bb.0:
; ALL-NEXT: vmovq %rdi, %xmm0
; ALL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: long_to_double:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vmovq %rdi, %xmm0
+; KNL_WIDEN-NEXT: retq
%res = bitcast i64 %x to double
ret double %res
}
@@ -898,6 +1359,11 @@ define i64 @double_to_long(double %x) {
; ALL: # %bb.0:
; ALL-NEXT: vmovq %xmm0, %rax
; ALL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: double_to_long:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vmovq %xmm0, %rax
+; KNL_WIDEN-NEXT: retq
%res = bitcast double %x to i64
ret i64 %res
}
@@ -907,6 +1373,11 @@ define float @int_to_float(i32 %x) {
; ALL: # %bb.0:
; ALL-NEXT: vmovd %edi, %xmm0
; ALL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: int_to_float:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vmovd %edi, %xmm0
+; KNL_WIDEN-NEXT: retq
%res = bitcast i32 %x to float
ret float %res
}
@@ -916,6 +1387,11 @@ define i32 @float_to_int(float %x) {
; ALL: # %bb.0:
; ALL-NEXT: vmovd %xmm0, %eax
; ALL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: float_to_int:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vmovd %xmm0, %eax
+; KNL_WIDEN-NEXT: retq
%res = bitcast float %x to i32
ret i32 %res
}
@@ -928,6 +1404,14 @@ define <16 x double> @uito16f64(<16 x i3
; ALL-NEXT: vcvtudq2pd %ymm0, %zmm1
; ALL-NEXT: vmovaps %zmm2, %zmm0
; ALL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: uito16f64:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vcvtudq2pd %ymm0, %zmm2
+; KNL_WIDEN-NEXT: vextractf64x4 $1, %zmm0, %ymm0
+; KNL_WIDEN-NEXT: vcvtudq2pd %ymm0, %zmm1
+; KNL_WIDEN-NEXT: vmovaps %zmm2, %zmm0
+; KNL_WIDEN-NEXT: retq
%b = uitofp <16 x i32> %a to <16 x double>
ret <16 x double> %b
}
@@ -972,6 +1456,36 @@ define <8 x float> @slto8f32(<8 x i64> %
; DQNOVL: # %bb.0:
; DQNOVL-NEXT: vcvtqq2ps %zmm0, %ymm0
; DQNOVL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: slto8f32:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vextracti32x4 $2, %zmm0, %xmm1
+; KNL_WIDEN-NEXT: vpextrq $1, %xmm1, %rax
+; KNL_WIDEN-NEXT: vcvtsi2ssq %rax, %xmm2, %xmm2
+; KNL_WIDEN-NEXT: vmovq %xmm1, %rax
+; KNL_WIDEN-NEXT: vcvtsi2ssq %rax, %xmm3, %xmm1
+; KNL_WIDEN-NEXT: vinsertps {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[2,3]
+; KNL_WIDEN-NEXT: vextracti32x4 $3, %zmm0, %xmm2
+; KNL_WIDEN-NEXT: vmovq %xmm2, %rax
+; KNL_WIDEN-NEXT: vcvtsi2ssq %rax, %xmm3, %xmm3
+; KNL_WIDEN-NEXT: vinsertps {{.*#+}} xmm1 = xmm1[0,1],xmm3[0],xmm1[3]
+; KNL_WIDEN-NEXT: vpextrq $1, %xmm2, %rax
+; KNL_WIDEN-NEXT: vcvtsi2ssq %rax, %xmm4, %xmm2
+; KNL_WIDEN-NEXT: vinsertps {{.*#+}} xmm1 = xmm1[0,1,2],xmm2[0]
+; KNL_WIDEN-NEXT: vpextrq $1, %xmm0, %rax
+; KNL_WIDEN-NEXT: vcvtsi2ssq %rax, %xmm4, %xmm2
+; KNL_WIDEN-NEXT: vmovq %xmm0, %rax
+; KNL_WIDEN-NEXT: vcvtsi2ssq %rax, %xmm4, %xmm3
+; KNL_WIDEN-NEXT: vinsertps {{.*#+}} xmm2 = xmm3[0],xmm2[0],xmm3[2,3]
+; KNL_WIDEN-NEXT: vextracti128 $1, %ymm0, %xmm0
+; KNL_WIDEN-NEXT: vmovq %xmm0, %rax
+; KNL_WIDEN-NEXT: vcvtsi2ssq %rax, %xmm4, %xmm3
+; KNL_WIDEN-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0,1],xmm3[0],xmm2[3]
+; KNL_WIDEN-NEXT: vpextrq $1, %xmm0, %rax
+; KNL_WIDEN-NEXT: vcvtsi2ssq %rax, %xmm4, %xmm0
+; KNL_WIDEN-NEXT: vinsertps {{.*#+}} xmm0 = xmm2[0,1,2],xmm0[0]
+; KNL_WIDEN-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
+; KNL_WIDEN-NEXT: retq
%b = sitofp <8 x i64> %a to <8 x float>
ret <8 x float> %b
}
@@ -1047,6 +1561,63 @@ define <16 x float> @slto16f32(<16 x i64
; DQNOVL-NEXT: vcvtqq2ps %zmm1, %ymm1
; DQNOVL-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
; DQNOVL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: slto16f32:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vextracti32x4 $2, %zmm1, %xmm2
+; KNL_WIDEN-NEXT: vpextrq $1, %xmm2, %rax
+; KNL_WIDEN-NEXT: vcvtsi2ssq %rax, %xmm3, %xmm3
+; KNL_WIDEN-NEXT: vmovq %xmm2, %rax
+; KNL_WIDEN-NEXT: vcvtsi2ssq %rax, %xmm4, %xmm2
+; KNL_WIDEN-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0],xmm3[0],xmm2[2,3]
+; KNL_WIDEN-NEXT: vextracti32x4 $3, %zmm1, %xmm3
+; KNL_WIDEN-NEXT: vmovq %xmm3, %rax
+; KNL_WIDEN-NEXT: vcvtsi2ssq %rax, %xmm4, %xmm4
+; KNL_WIDEN-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0,1],xmm4[0],xmm2[3]
+; KNL_WIDEN-NEXT: vpextrq $1, %xmm3, %rax
+; KNL_WIDEN-NEXT: vcvtsi2ssq %rax, %xmm5, %xmm3
+; KNL_WIDEN-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0,1,2],xmm3[0]
+; KNL_WIDEN-NEXT: vpextrq $1, %xmm1, %rax
+; KNL_WIDEN-NEXT: vcvtsi2ssq %rax, %xmm5, %xmm3
+; KNL_WIDEN-NEXT: vmovq %xmm1, %rax
+; KNL_WIDEN-NEXT: vcvtsi2ssq %rax, %xmm5, %xmm4
+; KNL_WIDEN-NEXT: vinsertps {{.*#+}} xmm3 = xmm4[0],xmm3[0],xmm4[2,3]
+; KNL_WIDEN-NEXT: vextracti128 $1, %ymm1, %xmm1
+; KNL_WIDEN-NEXT: vmovq %xmm1, %rax
+; KNL_WIDEN-NEXT: vcvtsi2ssq %rax, %xmm5, %xmm4
+; KNL_WIDEN-NEXT: vinsertps {{.*#+}} xmm3 = xmm3[0,1],xmm4[0],xmm3[3]
+; KNL_WIDEN-NEXT: vpextrq $1, %xmm1, %rax
+; KNL_WIDEN-NEXT: vcvtsi2ssq %rax, %xmm5, %xmm1
+; KNL_WIDEN-NEXT: vinsertps {{.*#+}} xmm1 = xmm3[0,1,2],xmm1[0]
+; KNL_WIDEN-NEXT: vinsertf128 $1, %xmm2, %ymm1, %ymm1
+; KNL_WIDEN-NEXT: vextracti32x4 $2, %zmm0, %xmm2
+; KNL_WIDEN-NEXT: vpextrq $1, %xmm2, %rax
+; KNL_WIDEN-NEXT: vcvtsi2ssq %rax, %xmm5, %xmm3
+; KNL_WIDEN-NEXT: vmovq %xmm2, %rax
+; KNL_WIDEN-NEXT: vcvtsi2ssq %rax, %xmm5, %xmm2
+; KNL_WIDEN-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0],xmm3[0],xmm2[2,3]
+; KNL_WIDEN-NEXT: vextracti32x4 $3, %zmm0, %xmm3
+; KNL_WIDEN-NEXT: vmovq %xmm3, %rax
+; KNL_WIDEN-NEXT: vcvtsi2ssq %rax, %xmm5, %xmm4
+; KNL_WIDEN-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0,1],xmm4[0],xmm2[3]
+; KNL_WIDEN-NEXT: vpextrq $1, %xmm3, %rax
+; KNL_WIDEN-NEXT: vcvtsi2ssq %rax, %xmm5, %xmm3
+; KNL_WIDEN-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0,1,2],xmm3[0]
+; KNL_WIDEN-NEXT: vpextrq $1, %xmm0, %rax
+; KNL_WIDEN-NEXT: vcvtsi2ssq %rax, %xmm5, %xmm3
+; KNL_WIDEN-NEXT: vmovq %xmm0, %rax
+; KNL_WIDEN-NEXT: vcvtsi2ssq %rax, %xmm5, %xmm4
+; KNL_WIDEN-NEXT: vinsertps {{.*#+}} xmm3 = xmm4[0],xmm3[0],xmm4[2,3]
+; KNL_WIDEN-NEXT: vextracti128 $1, %ymm0, %xmm0
+; KNL_WIDEN-NEXT: vmovq %xmm0, %rax
+; KNL_WIDEN-NEXT: vcvtsi2ssq %rax, %xmm5, %xmm4
+; KNL_WIDEN-NEXT: vinsertps {{.*#+}} xmm3 = xmm3[0,1],xmm4[0],xmm3[3]
+; KNL_WIDEN-NEXT: vpextrq $1, %xmm0, %rax
+; KNL_WIDEN-NEXT: vcvtsi2ssq %rax, %xmm5, %xmm0
+; KNL_WIDEN-NEXT: vinsertps {{.*#+}} xmm0 = xmm3[0,1,2],xmm0[0]
+; KNL_WIDEN-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0
+; KNL_WIDEN-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
+; KNL_WIDEN-NEXT: retq
%b = sitofp <16 x i64> %a to <16 x float>
ret <16 x float> %b
}
@@ -1091,6 +1662,36 @@ define <8 x double> @slto8f64(<8 x i64>
; DQNOVL: # %bb.0:
; DQNOVL-NEXT: vcvtqq2pd %zmm0, %zmm0
; DQNOVL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: slto8f64:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vextracti32x4 $3, %zmm0, %xmm1
+; KNL_WIDEN-NEXT: vpextrq $1, %xmm1, %rax
+; KNL_WIDEN-NEXT: vcvtsi2sdq %rax, %xmm2, %xmm2
+; KNL_WIDEN-NEXT: vmovq %xmm1, %rax
+; KNL_WIDEN-NEXT: vcvtsi2sdq %rax, %xmm3, %xmm1
+; KNL_WIDEN-NEXT: vmovlhps {{.*#+}} xmm1 = xmm1[0],xmm2[0]
+; KNL_WIDEN-NEXT: vextracti32x4 $2, %zmm0, %xmm2
+; KNL_WIDEN-NEXT: vpextrq $1, %xmm2, %rax
+; KNL_WIDEN-NEXT: vcvtsi2sdq %rax, %xmm3, %xmm3
+; KNL_WIDEN-NEXT: vmovq %xmm2, %rax
+; KNL_WIDEN-NEXT: vcvtsi2sdq %rax, %xmm4, %xmm2
+; KNL_WIDEN-NEXT: vmovlhps {{.*#+}} xmm2 = xmm2[0],xmm3[0]
+; KNL_WIDEN-NEXT: vinsertf128 $1, %xmm1, %ymm2, %ymm1
+; KNL_WIDEN-NEXT: vextracti128 $1, %ymm0, %xmm2
+; KNL_WIDEN-NEXT: vpextrq $1, %xmm2, %rax
+; KNL_WIDEN-NEXT: vcvtsi2sdq %rax, %xmm4, %xmm3
+; KNL_WIDEN-NEXT: vmovq %xmm2, %rax
+; KNL_WIDEN-NEXT: vcvtsi2sdq %rax, %xmm4, %xmm2
+; KNL_WIDEN-NEXT: vmovlhps {{.*#+}} xmm2 = xmm2[0],xmm3[0]
+; KNL_WIDEN-NEXT: vpextrq $1, %xmm0, %rax
+; KNL_WIDEN-NEXT: vcvtsi2sdq %rax, %xmm4, %xmm3
+; KNL_WIDEN-NEXT: vmovq %xmm0, %rax
+; KNL_WIDEN-NEXT: vcvtsi2sdq %rax, %xmm4, %xmm0
+; KNL_WIDEN-NEXT: vmovlhps {{.*#+}} xmm0 = xmm0[0],xmm3[0]
+; KNL_WIDEN-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0
+; KNL_WIDEN-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
+; KNL_WIDEN-NEXT: retq
%b = sitofp <8 x i64> %a to <8 x double>
ret <8 x double> %b
}
@@ -1163,6 +1764,62 @@ define <16 x double> @slto16f64(<16 x i6
; DQNOVL-NEXT: vcvtqq2pd %zmm0, %zmm0
; DQNOVL-NEXT: vcvtqq2pd %zmm1, %zmm1
; DQNOVL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: slto16f64:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vextracti32x4 $3, %zmm0, %xmm2
+; KNL_WIDEN-NEXT: vpextrq $1, %xmm2, %rax
+; KNL_WIDEN-NEXT: vcvtsi2sdq %rax, %xmm3, %xmm3
+; KNL_WIDEN-NEXT: vmovq %xmm2, %rax
+; KNL_WIDEN-NEXT: vcvtsi2sdq %rax, %xmm4, %xmm2
+; KNL_WIDEN-NEXT: vmovlhps {{.*#+}} xmm2 = xmm2[0],xmm3[0]
+; KNL_WIDEN-NEXT: vextracti32x4 $2, %zmm0, %xmm3
+; KNL_WIDEN-NEXT: vpextrq $1, %xmm3, %rax
+; KNL_WIDEN-NEXT: vcvtsi2sdq %rax, %xmm4, %xmm4
+; KNL_WIDEN-NEXT: vmovq %xmm3, %rax
+; KNL_WIDEN-NEXT: vcvtsi2sdq %rax, %xmm5, %xmm3
+; KNL_WIDEN-NEXT: vmovlhps {{.*#+}} xmm3 = xmm3[0],xmm4[0]
+; KNL_WIDEN-NEXT: vinsertf128 $1, %xmm2, %ymm3, %ymm2
+; KNL_WIDEN-NEXT: vextracti128 $1, %ymm0, %xmm3
+; KNL_WIDEN-NEXT: vpextrq $1, %xmm3, %rax
+; KNL_WIDEN-NEXT: vcvtsi2sdq %rax, %xmm5, %xmm4
+; KNL_WIDEN-NEXT: vmovq %xmm3, %rax
+; KNL_WIDEN-NEXT: vcvtsi2sdq %rax, %xmm5, %xmm3
+; KNL_WIDEN-NEXT: vmovlhps {{.*#+}} xmm3 = xmm3[0],xmm4[0]
+; KNL_WIDEN-NEXT: vpextrq $1, %xmm0, %rax
+; KNL_WIDEN-NEXT: vcvtsi2sdq %rax, %xmm5, %xmm4
+; KNL_WIDEN-NEXT: vmovq %xmm0, %rax
+; KNL_WIDEN-NEXT: vcvtsi2sdq %rax, %xmm5, %xmm0
+; KNL_WIDEN-NEXT: vmovlhps {{.*#+}} xmm0 = xmm0[0],xmm4[0]
+; KNL_WIDEN-NEXT: vinsertf128 $1, %xmm3, %ymm0, %ymm0
+; KNL_WIDEN-NEXT: vinsertf64x4 $1, %ymm2, %zmm0, %zmm0
+; KNL_WIDEN-NEXT: vextracti32x4 $3, %zmm1, %xmm2
+; KNL_WIDEN-NEXT: vpextrq $1, %xmm2, %rax
+; KNL_WIDEN-NEXT: vcvtsi2sdq %rax, %xmm5, %xmm3
+; KNL_WIDEN-NEXT: vmovq %xmm2, %rax
+; KNL_WIDEN-NEXT: vcvtsi2sdq %rax, %xmm5, %xmm2
+; KNL_WIDEN-NEXT: vmovlhps {{.*#+}} xmm2 = xmm2[0],xmm3[0]
+; KNL_WIDEN-NEXT: vextracti32x4 $2, %zmm1, %xmm3
+; KNL_WIDEN-NEXT: vpextrq $1, %xmm3, %rax
+; KNL_WIDEN-NEXT: vcvtsi2sdq %rax, %xmm5, %xmm4
+; KNL_WIDEN-NEXT: vmovq %xmm3, %rax
+; KNL_WIDEN-NEXT: vcvtsi2sdq %rax, %xmm5, %xmm3
+; KNL_WIDEN-NEXT: vmovlhps {{.*#+}} xmm3 = xmm3[0],xmm4[0]
+; KNL_WIDEN-NEXT: vinsertf128 $1, %xmm2, %ymm3, %ymm2
+; KNL_WIDEN-NEXT: vextracti128 $1, %ymm1, %xmm3
+; KNL_WIDEN-NEXT: vpextrq $1, %xmm3, %rax
+; KNL_WIDEN-NEXT: vcvtsi2sdq %rax, %xmm5, %xmm4
+; KNL_WIDEN-NEXT: vmovq %xmm3, %rax
+; KNL_WIDEN-NEXT: vcvtsi2sdq %rax, %xmm5, %xmm3
+; KNL_WIDEN-NEXT: vmovlhps {{.*#+}} xmm3 = xmm3[0],xmm4[0]
+; KNL_WIDEN-NEXT: vpextrq $1, %xmm1, %rax
+; KNL_WIDEN-NEXT: vcvtsi2sdq %rax, %xmm5, %xmm4
+; KNL_WIDEN-NEXT: vmovq %xmm1, %rax
+; KNL_WIDEN-NEXT: vcvtsi2sdq %rax, %xmm5, %xmm1
+; KNL_WIDEN-NEXT: vmovlhps {{.*#+}} xmm1 = xmm1[0],xmm4[0]
+; KNL_WIDEN-NEXT: vinsertf128 $1, %xmm3, %ymm1, %ymm1
+; KNL_WIDEN-NEXT: vinsertf64x4 $1, %ymm2, %zmm1, %zmm1
+; KNL_WIDEN-NEXT: retq
%b = sitofp <16 x i64> %a to <16 x double>
ret <16 x double> %b
}
@@ -1207,6 +1864,36 @@ define <8 x float> @ulto8f32(<8 x i64> %
; DQNOVL: # %bb.0:
; DQNOVL-NEXT: vcvtuqq2ps %zmm0, %ymm0
; DQNOVL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: ulto8f32:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vextracti32x4 $2, %zmm0, %xmm1
+; KNL_WIDEN-NEXT: vpextrq $1, %xmm1, %rax
+; KNL_WIDEN-NEXT: vcvtusi2ssq %rax, %xmm2, %xmm2
+; KNL_WIDEN-NEXT: vmovq %xmm1, %rax
+; KNL_WIDEN-NEXT: vcvtusi2ssq %rax, %xmm3, %xmm1
+; KNL_WIDEN-NEXT: vinsertps {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[2,3]
+; KNL_WIDEN-NEXT: vextracti32x4 $3, %zmm0, %xmm2
+; KNL_WIDEN-NEXT: vmovq %xmm2, %rax
+; KNL_WIDEN-NEXT: vcvtusi2ssq %rax, %xmm3, %xmm3
+; KNL_WIDEN-NEXT: vinsertps {{.*#+}} xmm1 = xmm1[0,1],xmm3[0],xmm1[3]
+; KNL_WIDEN-NEXT: vpextrq $1, %xmm2, %rax
+; KNL_WIDEN-NEXT: vcvtusi2ssq %rax, %xmm4, %xmm2
+; KNL_WIDEN-NEXT: vinsertps {{.*#+}} xmm1 = xmm1[0,1,2],xmm2[0]
+; KNL_WIDEN-NEXT: vpextrq $1, %xmm0, %rax
+; KNL_WIDEN-NEXT: vcvtusi2ssq %rax, %xmm4, %xmm2
+; KNL_WIDEN-NEXT: vmovq %xmm0, %rax
+; KNL_WIDEN-NEXT: vcvtusi2ssq %rax, %xmm4, %xmm3
+; KNL_WIDEN-NEXT: vinsertps {{.*#+}} xmm2 = xmm3[0],xmm2[0],xmm3[2,3]
+; KNL_WIDEN-NEXT: vextracti128 $1, %ymm0, %xmm0
+; KNL_WIDEN-NEXT: vmovq %xmm0, %rax
+; KNL_WIDEN-NEXT: vcvtusi2ssq %rax, %xmm4, %xmm3
+; KNL_WIDEN-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0,1],xmm3[0],xmm2[3]
+; KNL_WIDEN-NEXT: vpextrq $1, %xmm0, %rax
+; KNL_WIDEN-NEXT: vcvtusi2ssq %rax, %xmm4, %xmm0
+; KNL_WIDEN-NEXT: vinsertps {{.*#+}} xmm0 = xmm2[0,1,2],xmm0[0]
+; KNL_WIDEN-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
+; KNL_WIDEN-NEXT: retq
%b = uitofp <8 x i64> %a to <8 x float>
ret <8 x float> %b
}
@@ -1282,6 +1969,63 @@ define <16 x float> @ulto16f32(<16 x i64
; DQNOVL-NEXT: vcvtuqq2ps %zmm1, %ymm1
; DQNOVL-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
; DQNOVL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: ulto16f32:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vextracti32x4 $2, %zmm1, %xmm2
+; KNL_WIDEN-NEXT: vpextrq $1, %xmm2, %rax
+; KNL_WIDEN-NEXT: vcvtusi2ssq %rax, %xmm3, %xmm3
+; KNL_WIDEN-NEXT: vmovq %xmm2, %rax
+; KNL_WIDEN-NEXT: vcvtusi2ssq %rax, %xmm4, %xmm2
+; KNL_WIDEN-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0],xmm3[0],xmm2[2,3]
+; KNL_WIDEN-NEXT: vextracti32x4 $3, %zmm1, %xmm3
+; KNL_WIDEN-NEXT: vmovq %xmm3, %rax
+; KNL_WIDEN-NEXT: vcvtusi2ssq %rax, %xmm4, %xmm4
+; KNL_WIDEN-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0,1],xmm4[0],xmm2[3]
+; KNL_WIDEN-NEXT: vpextrq $1, %xmm3, %rax
+; KNL_WIDEN-NEXT: vcvtusi2ssq %rax, %xmm5, %xmm3
+; KNL_WIDEN-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0,1,2],xmm3[0]
+; KNL_WIDEN-NEXT: vpextrq $1, %xmm1, %rax
+; KNL_WIDEN-NEXT: vcvtusi2ssq %rax, %xmm5, %xmm3
+; KNL_WIDEN-NEXT: vmovq %xmm1, %rax
+; KNL_WIDEN-NEXT: vcvtusi2ssq %rax, %xmm5, %xmm4
+; KNL_WIDEN-NEXT: vinsertps {{.*#+}} xmm3 = xmm4[0],xmm3[0],xmm4[2,3]
+; KNL_WIDEN-NEXT: vextracti128 $1, %ymm1, %xmm1
+; KNL_WIDEN-NEXT: vmovq %xmm1, %rax
+; KNL_WIDEN-NEXT: vcvtusi2ssq %rax, %xmm5, %xmm4
+; KNL_WIDEN-NEXT: vinsertps {{.*#+}} xmm3 = xmm3[0,1],xmm4[0],xmm3[3]
+; KNL_WIDEN-NEXT: vpextrq $1, %xmm1, %rax
+; KNL_WIDEN-NEXT: vcvtusi2ssq %rax, %xmm5, %xmm1
+; KNL_WIDEN-NEXT: vinsertps {{.*#+}} xmm1 = xmm3[0,1,2],xmm1[0]
+; KNL_WIDEN-NEXT: vinsertf128 $1, %xmm2, %ymm1, %ymm1
+; KNL_WIDEN-NEXT: vextracti32x4 $2, %zmm0, %xmm2
+; KNL_WIDEN-NEXT: vpextrq $1, %xmm2, %rax
+; KNL_WIDEN-NEXT: vcvtusi2ssq %rax, %xmm5, %xmm3
+; KNL_WIDEN-NEXT: vmovq %xmm2, %rax
+; KNL_WIDEN-NEXT: vcvtusi2ssq %rax, %xmm5, %xmm2
+; KNL_WIDEN-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0],xmm3[0],xmm2[2,3]
+; KNL_WIDEN-NEXT: vextracti32x4 $3, %zmm0, %xmm3
+; KNL_WIDEN-NEXT: vmovq %xmm3, %rax
+; KNL_WIDEN-NEXT: vcvtusi2ssq %rax, %xmm5, %xmm4
+; KNL_WIDEN-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0,1],xmm4[0],xmm2[3]
+; KNL_WIDEN-NEXT: vpextrq $1, %xmm3, %rax
+; KNL_WIDEN-NEXT: vcvtusi2ssq %rax, %xmm5, %xmm3
+; KNL_WIDEN-NEXT: vinsertps {{.*#+}} xmm2 = xmm2[0,1,2],xmm3[0]
+; KNL_WIDEN-NEXT: vpextrq $1, %xmm0, %rax
+; KNL_WIDEN-NEXT: vcvtusi2ssq %rax, %xmm5, %xmm3
+; KNL_WIDEN-NEXT: vmovq %xmm0, %rax
+; KNL_WIDEN-NEXT: vcvtusi2ssq %rax, %xmm5, %xmm4
+; KNL_WIDEN-NEXT: vinsertps {{.*#+}} xmm3 = xmm4[0],xmm3[0],xmm4[2,3]
+; KNL_WIDEN-NEXT: vextracti128 $1, %ymm0, %xmm0
+; KNL_WIDEN-NEXT: vmovq %xmm0, %rax
+; KNL_WIDEN-NEXT: vcvtusi2ssq %rax, %xmm5, %xmm4
+; KNL_WIDEN-NEXT: vinsertps {{.*#+}} xmm3 = xmm3[0,1],xmm4[0],xmm3[3]
+; KNL_WIDEN-NEXT: vpextrq $1, %xmm0, %rax
+; KNL_WIDEN-NEXT: vcvtusi2ssq %rax, %xmm5, %xmm0
+; KNL_WIDEN-NEXT: vinsertps {{.*#+}} xmm0 = xmm3[0,1,2],xmm0[0]
+; KNL_WIDEN-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0
+; KNL_WIDEN-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
+; KNL_WIDEN-NEXT: retq
%b = uitofp <16 x i64> %a to <16 x float>
ret <16 x float> %b
}
@@ -1316,6 +2060,12 @@ define <8 x double> @uito8f64_mask(<8 x
; AVX512BW-NEXT: kmovd %edi, %k1
; AVX512BW-NEXT: vcvtudq2pd %ymm1, %zmm0 {%k1}
; AVX512BW-NEXT: retq
+;
+; KNL_WIDEN-LABEL: uito8f64_mask:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: kmovw %edi, %k1
+; KNL_WIDEN-NEXT: vcvtudq2pd %ymm1, %zmm0 {%k1}
+; KNL_WIDEN-NEXT: retq
%1 = bitcast i8 %c to <8 x i1>
%2 = uitofp <8 x i32> %b to <8 x double>
%3 = select <8 x i1> %1, <8 x double> %2, <8 x double> %a
@@ -1351,6 +2101,12 @@ define <8 x double> @uito8f64_maskz(<8 x
; AVX512BW-NEXT: kmovd %edi, %k1
; AVX512BW-NEXT: vcvtudq2pd %ymm0, %zmm0 {%k1} {z}
; AVX512BW-NEXT: retq
+;
+; KNL_WIDEN-LABEL: uito8f64_maskz:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: kmovw %edi, %k1
+; KNL_WIDEN-NEXT: vcvtudq2pd %ymm0, %zmm0 {%k1} {z}
+; KNL_WIDEN-NEXT: retq
%1 = bitcast i8 %b to <8 x i1>
%2 = uitofp <8 x i32> %a to <8 x double>
%3 = select <8 x i1> %1, <8 x double> %2, <8 x double> zeroinitializer
@@ -1369,6 +2125,13 @@ define <4 x double> @uito4f64(<4 x i32>
; VL: # %bb.0:
; VL-NEXT: vcvtudq2pd %xmm0, %ymm0
; VL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: uito4f64:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: # kill: def $xmm0 killed $xmm0 def $ymm0
+; KNL_WIDEN-NEXT: vcvtudq2pd %ymm0, %zmm0
+; KNL_WIDEN-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
+; KNL_WIDEN-NEXT: retq
%b = uitofp <4 x i32> %a to <4 x double>
ret <4 x double> %b
}
@@ -1378,6 +2141,11 @@ define <16 x float> @uito16f32(<16 x i32
; ALL: # %bb.0:
; ALL-NEXT: vcvtudq2ps %zmm0, %zmm0
; ALL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: uito16f32:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vcvtudq2ps %zmm0, %zmm0
+; KNL_WIDEN-NEXT: retq
%b = uitofp <16 x i32> %a to <16 x float>
ret <16 x float> %b
}
@@ -1387,6 +2155,11 @@ define <8 x double> @uito8f64(<8 x i32>
; ALL: # %bb.0:
; ALL-NEXT: vcvtudq2pd %ymm0, %zmm0
; ALL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: uito8f64:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vcvtudq2pd %ymm0, %zmm0
+; KNL_WIDEN-NEXT: retq
%b = uitofp <8 x i32> %a to <8 x double>
ret <8 x double> %b
}
@@ -1403,6 +2176,13 @@ define <8 x float> @uito8f32(<8 x i32> %
; VL: # %bb.0:
; VL-NEXT: vcvtudq2ps %ymm0, %ymm0
; VL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: uito8f32:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
+; KNL_WIDEN-NEXT: vcvtudq2ps %zmm0, %zmm0
+; KNL_WIDEN-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
+; KNL_WIDEN-NEXT: retq
%b = uitofp <8 x i32> %a to <8 x float>
ret <8 x float> %b
}
@@ -1420,6 +2200,14 @@ define <4 x float> @uito4f32(<4 x i32> %
; VL: # %bb.0:
; VL-NEXT: vcvtudq2ps %xmm0, %xmm0
; VL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: uito4f32:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
+; KNL_WIDEN-NEXT: vcvtudq2ps %zmm0, %zmm0
+; KNL_WIDEN-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
+; KNL_WIDEN-NEXT: vzeroupper
+; KNL_WIDEN-NEXT: retq
%b = uitofp <4 x i32> %a to <4 x float>
ret <4 x float> %b
}
@@ -1429,6 +2217,11 @@ define i32 @fptosi(float %a) nounwind {
; ALL: # %bb.0:
; ALL-NEXT: vcvttss2si %xmm0, %eax
; ALL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: fptosi:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vcvttss2si %xmm0, %eax
+; KNL_WIDEN-NEXT: retq
%b = fptosi float %a to i32
ret i32 %b
}
@@ -1438,6 +2231,11 @@ define i32 @fptoui(float %a) nounwind {
; ALL: # %bb.0:
; ALL-NEXT: vcvttss2usi %xmm0, %eax
; ALL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: fptoui:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vcvttss2usi %xmm0, %eax
+; KNL_WIDEN-NEXT: retq
%b = fptoui float %a to i32
ret i32 %b
}
@@ -1447,6 +2245,11 @@ define float @uitof32(i32 %a) nounwind {
; ALL: # %bb.0:
; ALL-NEXT: vcvtusi2ssl %edi, %xmm0, %xmm0
; ALL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: uitof32:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vcvtusi2ssl %edi, %xmm0, %xmm0
+; KNL_WIDEN-NEXT: retq
%b = uitofp i32 %a to float
ret float %b
}
@@ -1456,6 +2259,11 @@ define double @uitof64(i32 %a) nounwind
; ALL: # %bb.0:
; ALL-NEXT: vcvtusi2sdl %edi, %xmm0, %xmm0
; ALL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: uitof64:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vcvtusi2sdl %edi, %xmm0, %xmm0
+; KNL_WIDEN-NEXT: retq
%b = uitofp i32 %a to double
ret double %b
}
@@ -1482,6 +2290,14 @@ define <16 x float> @sbto16f32(<16 x i32
; DQNOVL-NEXT: vpmovm2d %k0, %zmm0
; DQNOVL-NEXT: vcvtdq2ps %zmm0, %zmm0
; DQNOVL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: sbto16f32:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vpxor %xmm1, %xmm1, %xmm1
+; KNL_WIDEN-NEXT: vpcmpgtd %zmm0, %zmm1, %k1
+; KNL_WIDEN-NEXT: vpternlogd $255, %zmm0, %zmm0, %zmm0 {%k1} {z}
+; KNL_WIDEN-NEXT: vcvtdq2ps %zmm0, %zmm0
+; KNL_WIDEN-NEXT: retq
%mask = icmp slt <16 x i32> %a, zeroinitializer
%1 = sitofp <16 x i1> %mask to <16 x float>
ret <16 x float> %1
@@ -1493,6 +2309,12 @@ define <16 x float> @scto16f32(<16 x i8>
; ALL-NEXT: vpmovsxbd %xmm0, %zmm0
; ALL-NEXT: vcvtdq2ps %zmm0, %zmm0
; ALL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: scto16f32:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vpmovsxbd %xmm0, %zmm0
+; KNL_WIDEN-NEXT: vcvtdq2ps %zmm0, %zmm0
+; KNL_WIDEN-NEXT: retq
%1 = sitofp <16 x i8> %a to <16 x float>
ret <16 x float> %1
}
@@ -1503,6 +2325,12 @@ define <16 x float> @ssto16f32(<16 x i16
; ALL-NEXT: vpmovsxwd %ymm0, %zmm0
; ALL-NEXT: vcvtdq2ps %zmm0, %zmm0
; ALL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: ssto16f32:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vpmovsxwd %ymm0, %zmm0
+; KNL_WIDEN-NEXT: vcvtdq2ps %zmm0, %zmm0
+; KNL_WIDEN-NEXT: retq
%1 = sitofp <16 x i16> %a to <16 x float>
ret <16 x float> %1
}
@@ -1513,6 +2341,12 @@ define <8 x double> @ssto16f64(<8 x i16>
; ALL-NEXT: vpmovsxwd %xmm0, %ymm0
; ALL-NEXT: vcvtdq2pd %ymm0, %zmm0
; ALL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: ssto16f64:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vpmovsxwd %xmm0, %ymm0
+; KNL_WIDEN-NEXT: vcvtdq2pd %ymm0, %zmm0
+; KNL_WIDEN-NEXT: retq
%1 = sitofp <8 x i16> %a to <8 x double>
ret <8 x double> %1
}
@@ -1525,6 +2359,12 @@ define <8 x double> @scto8f64(<8 x i8> %
; ALL-NEXT: vpsrad $24, %ymm0, %ymm0
; ALL-NEXT: vcvtdq2pd %ymm0, %zmm0
; ALL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: scto8f64:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vpmovsxbd %xmm0, %ymm0
+; KNL_WIDEN-NEXT: vcvtdq2pd %ymm0, %zmm0
+; KNL_WIDEN-NEXT: retq
%1 = sitofp <8 x i8> %a to <8 x double>
ret <8 x double> %1
}
@@ -1537,6 +2377,14 @@ define <16 x double> @scto16f64(<16 x i8
; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm1
; ALL-NEXT: vcvtdq2pd %ymm1, %zmm1
; ALL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: scto16f64:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vpmovsxbd %xmm0, %zmm1
+; KNL_WIDEN-NEXT: vcvtdq2pd %ymm1, %zmm0
+; KNL_WIDEN-NEXT: vextracti64x4 $1, %zmm1, %ymm1
+; KNL_WIDEN-NEXT: vcvtdq2pd %ymm1, %zmm1
+; KNL_WIDEN-NEXT: retq
%b = sitofp <16 x i8> %a to <16 x double>
ret <16 x double> %b
}
@@ -1577,6 +2425,18 @@ define <16 x double> @sbto16f64(<16 x do
; DQNOVL-NEXT: vextracti64x4 $1, %zmm1, %ymm1
; DQNOVL-NEXT: vcvtdq2pd %ymm1, %zmm1
; DQNOVL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: sbto16f64:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vxorpd %xmm2, %xmm2, %xmm2
+; KNL_WIDEN-NEXT: vcmpltpd %zmm0, %zmm2, %k0
+; KNL_WIDEN-NEXT: vcmpltpd %zmm1, %zmm2, %k1
+; KNL_WIDEN-NEXT: kunpckbw %k0, %k1, %k1
+; KNL_WIDEN-NEXT: vpternlogd $255, %zmm1, %zmm1, %zmm1 {%k1} {z}
+; KNL_WIDEN-NEXT: vcvtdq2pd %ymm1, %zmm0
+; KNL_WIDEN-NEXT: vextracti64x4 $1, %zmm1, %ymm1
+; KNL_WIDEN-NEXT: vcvtdq2pd %ymm1, %zmm1
+; KNL_WIDEN-NEXT: retq
%cmpres = fcmp ogt <16 x double> %a, zeroinitializer
%1 = sitofp <16 x i1> %cmpres to <16 x double>
ret <16 x double> %1
@@ -1615,6 +2475,14 @@ define <8 x double> @sbto8f64(<8 x doubl
; DQNOVL-NEXT: vpmovm2d %k0, %zmm0
; DQNOVL-NEXT: vcvtdq2pd %ymm0, %zmm0
; DQNOVL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: sbto8f64:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vxorpd %xmm1, %xmm1, %xmm1
+; KNL_WIDEN-NEXT: vcmpltpd %zmm0, %zmm1, %k1
+; KNL_WIDEN-NEXT: vpternlogd $255, %zmm0, %zmm0, %zmm0 {%k1} {z}
+; KNL_WIDEN-NEXT: vcvtdq2pd %ymm0, %zmm0
+; KNL_WIDEN-NEXT: retq
%cmpres = fcmp ogt <8 x double> %a, zeroinitializer
%1 = sitofp <8 x i1> %cmpres to <8 x double>
ret <8 x double> %1
@@ -1627,6 +2495,13 @@ define <8 x float> @sbto8f32(<8 x float>
; ALL-NEXT: vcmpltps %ymm0, %ymm1, %ymm0
; ALL-NEXT: vcvtdq2ps %ymm0, %ymm0
; ALL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: sbto8f32:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vxorps %xmm1, %xmm1, %xmm1
+; KNL_WIDEN-NEXT: vcmpltps %ymm0, %ymm1, %ymm0
+; KNL_WIDEN-NEXT: vcvtdq2ps %ymm0, %ymm0
+; KNL_WIDEN-NEXT: retq
%cmpres = fcmp ogt <8 x float> %a, zeroinitializer
%1 = sitofp <8 x i1> %cmpres to <8 x float>
ret <8 x float> %1
@@ -1639,6 +2514,13 @@ define <4 x float> @sbto4f32(<4 x float>
; ALL-NEXT: vcmpltps %xmm0, %xmm1, %xmm0
; ALL-NEXT: vcvtdq2ps %xmm0, %xmm0
; ALL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: sbto4f32:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vxorps %xmm1, %xmm1, %xmm1
+; KNL_WIDEN-NEXT: vcmpltps %xmm0, %xmm1, %xmm0
+; KNL_WIDEN-NEXT: vcvtdq2ps %xmm0, %xmm0
+; KNL_WIDEN-NEXT: retq
%cmpres = fcmp ogt <4 x float> %a, zeroinitializer
%1 = sitofp <4 x i1> %cmpres to <4 x float>
ret <4 x float> %1
@@ -1669,6 +2551,14 @@ define <4 x double> @sbto4f64(<4 x doubl
; VLNODQ-NEXT: vmovdqa32 %xmm0, %xmm0 {%k1} {z}
; VLNODQ-NEXT: vcvtdq2pd %xmm0, %ymm0
; VLNODQ-NEXT: retq
+;
+; KNL_WIDEN-LABEL: sbto4f64:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vxorpd %xmm1, %xmm1, %xmm1
+; KNL_WIDEN-NEXT: vcmpltpd %ymm0, %ymm1, %ymm0
+; KNL_WIDEN-NEXT: vpmovqd %zmm0, %ymm0
+; KNL_WIDEN-NEXT: vcvtdq2pd %xmm0, %ymm0
+; KNL_WIDEN-NEXT: retq
%cmpres = fcmp ogt <4 x double> %a, zeroinitializer
%1 = sitofp <4 x i1> %cmpres to <4 x double>
ret <4 x double> %1
@@ -1681,6 +2571,13 @@ define <2 x float> @sbto2f32(<2 x float>
; ALL-NEXT: vcmpltps %xmm0, %xmm1, %xmm0
; ALL-NEXT: vcvtdq2ps %xmm0, %xmm0
; ALL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: sbto2f32:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vxorps %xmm1, %xmm1, %xmm1
+; KNL_WIDEN-NEXT: vcmpltps %xmm0, %xmm1, %xmm0
+; KNL_WIDEN-NEXT: vcvtdq2ps %xmm0, %xmm0
+; KNL_WIDEN-NEXT: retq
%cmpres = fcmp ogt <2 x float> %a, zeroinitializer
%1 = sitofp <2 x i1> %cmpres to <2 x float>
ret <2 x float> %1
@@ -1694,6 +2591,15 @@ define <2 x double> @sbto2f64(<2 x doubl
; ALL-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[0,2,2,3]
; ALL-NEXT: vcvtdq2pd %xmm0, %xmm0
; ALL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: sbto2f64:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vxorpd %xmm1, %xmm1, %xmm1
+; KNL_WIDEN-NEXT: vcmpltpd %xmm0, %xmm1, %xmm0
+; KNL_WIDEN-NEXT: vpmovqd %zmm0, %ymm0
+; KNL_WIDEN-NEXT: vcvtdq2pd %xmm0, %xmm0
+; KNL_WIDEN-NEXT: vzeroupper
+; KNL_WIDEN-NEXT: retq
%cmpres = fcmp ogt <2 x double> %a, zeroinitializer
%1 = sitofp <2 x i1> %cmpres to <2 x double>
ret <2 x double> %1
@@ -1705,6 +2611,12 @@ define <16 x float> @ucto16f32(<16 x i8>
; ALL-NEXT: vpmovzxbd {{.*#+}} zmm0 = xmm0[0],zero,zero,zero,xmm0[1],zero,zero,zero,xmm0[2],zero,zero,zero,xmm0[3],zero,zero,zero,xmm0[4],zero,zero,zero,xmm0[5],zero,zero,zero,xmm0[6],zero,zero,zero,xmm0[7],zero,zero,zero,xmm0[8],zero,zero,zero,xmm0[9],zero,zero,zero,xmm0[10],zero,zero,zero,xmm0[11],zero,zero,zero,xmm0[12],zero,zero,zero,xmm0[13],zero,zero,zero,xmm0[14],zero,zero,zero,xmm0[15],zero,zero,zero
; ALL-NEXT: vcvtdq2ps %zmm0, %zmm0
; ALL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: ucto16f32:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vpmovzxbd {{.*#+}} zmm0 = xmm0[0],zero,zero,zero,xmm0[1],zero,zero,zero,xmm0[2],zero,zero,zero,xmm0[3],zero,zero,zero,xmm0[4],zero,zero,zero,xmm0[5],zero,zero,zero,xmm0[6],zero,zero,zero,xmm0[7],zero,zero,zero,xmm0[8],zero,zero,zero,xmm0[9],zero,zero,zero,xmm0[10],zero,zero,zero,xmm0[11],zero,zero,zero,xmm0[12],zero,zero,zero,xmm0[13],zero,zero,zero,xmm0[14],zero,zero,zero,xmm0[15],zero,zero,zero
+; KNL_WIDEN-NEXT: vcvtdq2ps %zmm0, %zmm0
+; KNL_WIDEN-NEXT: retq
%b = uitofp <16 x i8> %a to <16 x float>
ret <16 x float>%b
}
@@ -1716,6 +2628,12 @@ define <8 x double> @ucto8f64(<8 x i8> %
; ALL-NEXT: vpmovzxwd {{.*#+}} ymm0 = xmm0[0],zero,xmm0[1],zero,xmm0[2],zero,xmm0[3],zero,xmm0[4],zero,xmm0[5],zero,xmm0[6],zero,xmm0[7],zero
; ALL-NEXT: vcvtdq2pd %ymm0, %zmm0
; ALL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: ucto8f64:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vpmovzxbd {{.*#+}} ymm0 = xmm0[0],zero,zero,zero,xmm0[1],zero,zero,zero,xmm0[2],zero,zero,zero,xmm0[3],zero,zero,zero,xmm0[4],zero,zero,zero,xmm0[5],zero,zero,zero,xmm0[6],zero,zero,zero,xmm0[7],zero,zero,zero
+; KNL_WIDEN-NEXT: vcvtdq2pd %ymm0, %zmm0
+; KNL_WIDEN-NEXT: retq
%b = uitofp <8 x i8> %a to <8 x double>
ret <8 x double> %b
}
@@ -1726,6 +2644,12 @@ define <16 x float> @swto16f32(<16 x i16
; ALL-NEXT: vpmovsxwd %ymm0, %zmm0
; ALL-NEXT: vcvtdq2ps %zmm0, %zmm0
; ALL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: swto16f32:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vpmovsxwd %ymm0, %zmm0
+; KNL_WIDEN-NEXT: vcvtdq2ps %zmm0, %zmm0
+; KNL_WIDEN-NEXT: retq
%b = sitofp <16 x i16> %a to <16 x float>
ret <16 x float> %b
}
@@ -1736,6 +2660,12 @@ define <8 x double> @swto8f64(<8 x i16>
; ALL-NEXT: vpmovsxwd %xmm0, %ymm0
; ALL-NEXT: vcvtdq2pd %ymm0, %zmm0
; ALL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: swto8f64:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vpmovsxwd %xmm0, %ymm0
+; KNL_WIDEN-NEXT: vcvtdq2pd %ymm0, %zmm0
+; KNL_WIDEN-NEXT: retq
%b = sitofp <8 x i16> %a to <8 x double>
ret <8 x double> %b
}
@@ -1748,6 +2678,14 @@ define <16 x double> @swto16f64(<16 x i1
; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm1
; ALL-NEXT: vcvtdq2pd %ymm1, %zmm1
; ALL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: swto16f64:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vpmovsxwd %ymm0, %zmm1
+; KNL_WIDEN-NEXT: vcvtdq2pd %ymm1, %zmm0
+; KNL_WIDEN-NEXT: vextracti64x4 $1, %zmm1, %ymm1
+; KNL_WIDEN-NEXT: vcvtdq2pd %ymm1, %zmm1
+; KNL_WIDEN-NEXT: retq
%b = sitofp <16 x i16> %a to <16 x double>
ret <16 x double> %b
}
@@ -1760,6 +2698,14 @@ define <16 x double> @ucto16f64(<16 x i8
; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm1
; ALL-NEXT: vcvtdq2pd %ymm1, %zmm1
; ALL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: ucto16f64:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vpmovzxbd {{.*#+}} zmm1 = xmm0[0],zero,zero,zero,xmm0[1],zero,zero,zero,xmm0[2],zero,zero,zero,xmm0[3],zero,zero,zero,xmm0[4],zero,zero,zero,xmm0[5],zero,zero,zero,xmm0[6],zero,zero,zero,xmm0[7],zero,zero,zero,xmm0[8],zero,zero,zero,xmm0[9],zero,zero,zero,xmm0[10],zero,zero,zero,xmm0[11],zero,zero,zero,xmm0[12],zero,zero,zero,xmm0[13],zero,zero,zero,xmm0[14],zero,zero,zero,xmm0[15],zero,zero,zero
+; KNL_WIDEN-NEXT: vcvtdq2pd %ymm1, %zmm0
+; KNL_WIDEN-NEXT: vextracti64x4 $1, %zmm1, %ymm1
+; KNL_WIDEN-NEXT: vcvtdq2pd %ymm1, %zmm1
+; KNL_WIDEN-NEXT: retq
%b = uitofp <16 x i8> %a to <16 x double>
ret <16 x double> %b
}
@@ -1770,6 +2716,12 @@ define <16 x float> @uwto16f32(<16 x i16
; ALL-NEXT: vpmovzxwd {{.*#+}} zmm0 = ymm0[0],zero,ymm0[1],zero,ymm0[2],zero,ymm0[3],zero,ymm0[4],zero,ymm0[5],zero,ymm0[6],zero,ymm0[7],zero,ymm0[8],zero,ymm0[9],zero,ymm0[10],zero,ymm0[11],zero,ymm0[12],zero,ymm0[13],zero,ymm0[14],zero,ymm0[15],zero
; ALL-NEXT: vcvtdq2ps %zmm0, %zmm0
; ALL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: uwto16f32:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vpmovzxwd {{.*#+}} zmm0 = ymm0[0],zero,ymm0[1],zero,ymm0[2],zero,ymm0[3],zero,ymm0[4],zero,ymm0[5],zero,ymm0[6],zero,ymm0[7],zero,ymm0[8],zero,ymm0[9],zero,ymm0[10],zero,ymm0[11],zero,ymm0[12],zero,ymm0[13],zero,ymm0[14],zero,ymm0[15],zero
+; KNL_WIDEN-NEXT: vcvtdq2ps %zmm0, %zmm0
+; KNL_WIDEN-NEXT: retq
%b = uitofp <16 x i16> %a to <16 x float>
ret <16 x float> %b
}
@@ -1780,6 +2732,12 @@ define <8 x double> @uwto8f64(<8 x i16>
; ALL-NEXT: vpmovzxwd {{.*#+}} ymm0 = xmm0[0],zero,xmm0[1],zero,xmm0[2],zero,xmm0[3],zero,xmm0[4],zero,xmm0[5],zero,xmm0[6],zero,xmm0[7],zero
; ALL-NEXT: vcvtdq2pd %ymm0, %zmm0
; ALL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: uwto8f64:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vpmovzxwd {{.*#+}} ymm0 = xmm0[0],zero,xmm0[1],zero,xmm0[2],zero,xmm0[3],zero,xmm0[4],zero,xmm0[5],zero,xmm0[6],zero,xmm0[7],zero
+; KNL_WIDEN-NEXT: vcvtdq2pd %ymm0, %zmm0
+; KNL_WIDEN-NEXT: retq
%b = uitofp <8 x i16> %a to <8 x double>
ret <8 x double> %b
}
@@ -1792,6 +2750,14 @@ define <16 x double> @uwto16f64(<16 x i1
; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm1
; ALL-NEXT: vcvtdq2pd %ymm1, %zmm1
; ALL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: uwto16f64:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vpmovzxwd {{.*#+}} zmm1 = ymm0[0],zero,ymm0[1],zero,ymm0[2],zero,ymm0[3],zero,ymm0[4],zero,ymm0[5],zero,ymm0[6],zero,ymm0[7],zero,ymm0[8],zero,ymm0[9],zero,ymm0[10],zero,ymm0[11],zero,ymm0[12],zero,ymm0[13],zero,ymm0[14],zero,ymm0[15],zero
+; KNL_WIDEN-NEXT: vcvtdq2pd %ymm1, %zmm0
+; KNL_WIDEN-NEXT: vextracti64x4 $1, %zmm1, %ymm1
+; KNL_WIDEN-NEXT: vcvtdq2pd %ymm1, %zmm1
+; KNL_WIDEN-NEXT: retq
%b = uitofp <16 x i16> %a to <16 x double>
ret <16 x double> %b
}
@@ -1801,6 +2767,11 @@ define <16 x float> @sito16f32(<16 x i32
; ALL: # %bb.0:
; ALL-NEXT: vcvtdq2ps %zmm0, %zmm0
; ALL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: sito16f32:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vcvtdq2ps %zmm0, %zmm0
+; KNL_WIDEN-NEXT: retq
%b = sitofp <16 x i32> %a to <16 x float>
ret <16 x float> %b
}
@@ -1813,6 +2784,14 @@ define <16 x double> @sito16f64(<16 x i3
; ALL-NEXT: vcvtdq2pd %ymm0, %zmm1
; ALL-NEXT: vmovaps %zmm2, %zmm0
; ALL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: sito16f64:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vcvtdq2pd %ymm0, %zmm2
+; KNL_WIDEN-NEXT: vextractf64x4 $1, %zmm0, %ymm0
+; KNL_WIDEN-NEXT: vcvtdq2pd %ymm0, %zmm1
+; KNL_WIDEN-NEXT: vmovaps %zmm2, %zmm0
+; KNL_WIDEN-NEXT: retq
%b = sitofp <16 x i32> %a to <16 x double>
ret <16 x double> %b
}
@@ -1823,6 +2802,12 @@ define <16 x float> @usto16f32(<16 x i16
; ALL-NEXT: vpmovzxwd {{.*#+}} zmm0 = ymm0[0],zero,ymm0[1],zero,ymm0[2],zero,ymm0[3],zero,ymm0[4],zero,ymm0[5],zero,ymm0[6],zero,ymm0[7],zero,ymm0[8],zero,ymm0[9],zero,ymm0[10],zero,ymm0[11],zero,ymm0[12],zero,ymm0[13],zero,ymm0[14],zero,ymm0[15],zero
; ALL-NEXT: vcvtdq2ps %zmm0, %zmm0
; ALL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: usto16f32:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vpmovzxwd {{.*#+}} zmm0 = ymm0[0],zero,ymm0[1],zero,ymm0[2],zero,ymm0[3],zero,ymm0[4],zero,ymm0[5],zero,ymm0[6],zero,ymm0[7],zero,ymm0[8],zero,ymm0[9],zero,ymm0[10],zero,ymm0[11],zero,ymm0[12],zero,ymm0[13],zero,ymm0[14],zero,ymm0[15],zero
+; KNL_WIDEN-NEXT: vcvtdq2ps %zmm0, %zmm0
+; KNL_WIDEN-NEXT: retq
%b = uitofp <16 x i16> %a to <16 x float>
ret <16 x float> %b
}
@@ -1852,6 +2837,15 @@ define <16 x float> @ubto16f32(<16 x i32
; DQNOVL-NEXT: vpsrld $31, %zmm0, %zmm0
; DQNOVL-NEXT: vcvtdq2ps %zmm0, %zmm0
; DQNOVL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: ubto16f32:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vpxor %xmm1, %xmm1, %xmm1
+; KNL_WIDEN-NEXT: vpcmpgtd %zmm0, %zmm1, %k1
+; KNL_WIDEN-NEXT: vpternlogd $255, %zmm0, %zmm0, %zmm0 {%k1} {z}
+; KNL_WIDEN-NEXT: vpsrld $31, %zmm0, %zmm0
+; KNL_WIDEN-NEXT: vcvtdq2ps %zmm0, %zmm0
+; KNL_WIDEN-NEXT: retq
%mask = icmp slt <16 x i32> %a, zeroinitializer
%1 = uitofp <16 x i1> %mask to <16 x float>
ret <16 x float> %1
@@ -1888,6 +2882,17 @@ define <16 x double> @ubto16f64(<16 x i3
; DQNOVL-NEXT: vextracti64x4 $1, %zmm1, %ymm1
; DQNOVL-NEXT: vcvtdq2pd %ymm1, %zmm1
; DQNOVL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: ubto16f64:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vpxor %xmm1, %xmm1, %xmm1
+; KNL_WIDEN-NEXT: vpcmpgtd %zmm0, %zmm1, %k1
+; KNL_WIDEN-NEXT: vpternlogd $255, %zmm0, %zmm0, %zmm0 {%k1} {z}
+; KNL_WIDEN-NEXT: vpsrld $31, %zmm0, %zmm1
+; KNL_WIDEN-NEXT: vcvtdq2pd %ymm1, %zmm0
+; KNL_WIDEN-NEXT: vextracti64x4 $1, %zmm1, %ymm1
+; KNL_WIDEN-NEXT: vcvtdq2pd %ymm1, %zmm1
+; KNL_WIDEN-NEXT: retq
%mask = icmp slt <16 x i32> %a, zeroinitializer
%1 = uitofp <16 x i1> %mask to <16 x double>
ret <16 x double> %1
@@ -1908,6 +2913,14 @@ define <8 x float> @ubto8f32(<8 x i32> %
; VL-NEXT: vpcmpgtd %ymm0, %ymm1, %ymm0
; VL-NEXT: vpandd {{.*}}(%rip){1to8}, %ymm0, %ymm0
; VL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: ubto8f32:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vpxor %xmm1, %xmm1, %xmm1
+; KNL_WIDEN-NEXT: vpcmpgtd %ymm0, %ymm1, %ymm0
+; KNL_WIDEN-NEXT: vpbroadcastd {{.*#+}} ymm1 = [1065353216,1065353216,1065353216,1065353216,1065353216,1065353216,1065353216,1065353216]
+; KNL_WIDEN-NEXT: vpand %ymm1, %ymm0, %ymm0
+; KNL_WIDEN-NEXT: retq
%mask = icmp slt <8 x i32> %a, zeroinitializer
%1 = uitofp <8 x i1> %mask to <8 x float>
ret <8 x float> %1
@@ -1921,6 +2934,14 @@ define <8 x double> @ubto8f64(<8 x i32>
; ALL-NEXT: vpsrld $31, %ymm0, %ymm0
; ALL-NEXT: vcvtdq2pd %ymm0, %zmm0
; ALL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: ubto8f64:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vpxor %xmm1, %xmm1, %xmm1
+; KNL_WIDEN-NEXT: vpcmpgtd %ymm0, %ymm1, %ymm0
+; KNL_WIDEN-NEXT: vpsrld $31, %ymm0, %ymm0
+; KNL_WIDEN-NEXT: vcvtdq2pd %ymm0, %zmm0
+; KNL_WIDEN-NEXT: retq
%mask = icmp slt <8 x i32> %a, zeroinitializer
%1 = uitofp <8 x i1> %mask to <8 x double>
ret <8 x double> %1
@@ -1941,6 +2962,14 @@ define <4 x float> @ubto4f32(<4 x i32> %
; VL-NEXT: vpcmpgtd %xmm0, %xmm1, %xmm0
; VL-NEXT: vpandd {{.*}}(%rip){1to4}, %xmm0, %xmm0
; VL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: ubto4f32:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vpxor %xmm1, %xmm1, %xmm1
+; KNL_WIDEN-NEXT: vpcmpgtd %xmm0, %xmm1, %xmm0
+; KNL_WIDEN-NEXT: vpbroadcastd {{.*#+}} xmm1 = [1065353216,1065353216,1065353216,1065353216]
+; KNL_WIDEN-NEXT: vpand %xmm1, %xmm0, %xmm0
+; KNL_WIDEN-NEXT: retq
%mask = icmp slt <4 x i32> %a, zeroinitializer
%1 = uitofp <4 x i1> %mask to <4 x float>
ret <4 x float> %1
@@ -1954,6 +2983,14 @@ define <4 x double> @ubto4f64(<4 x i32>
; ALL-NEXT: vpsrld $31, %xmm0, %xmm0
; ALL-NEXT: vcvtdq2pd %xmm0, %ymm0
; ALL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: ubto4f64:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vpxor %xmm1, %xmm1, %xmm1
+; KNL_WIDEN-NEXT: vpcmpgtd %xmm0, %xmm1, %xmm0
+; KNL_WIDEN-NEXT: vpsrld $31, %xmm0, %xmm0
+; KNL_WIDEN-NEXT: vcvtdq2pd %xmm0, %ymm0
+; KNL_WIDEN-NEXT: retq
%mask = icmp slt <4 x i32> %a, zeroinitializer
%1 = uitofp <4 x i1> %mask to <4 x double>
ret <4 x double> %1
@@ -1968,6 +3005,14 @@ define <2 x float> @ubto2f32(<2 x i32> %
; ALL-NEXT: vpandn {{.*}}(%rip), %xmm0, %xmm0
; ALL-NEXT: vpshufd {{.*#+}} xmm0 = xmm0[0,2,2,3]
; ALL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: ubto2f32:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vpxor %xmm1, %xmm1, %xmm1
+; KNL_WIDEN-NEXT: vpcmpeqd %xmm1, %xmm0, %xmm0
+; KNL_WIDEN-NEXT: vpbroadcastd {{.*#+}} xmm1 = [1065353216,1065353216,1065353216,1065353216]
+; KNL_WIDEN-NEXT: vpandn %xmm1, %xmm0, %xmm0
+; KNL_WIDEN-NEXT: retq
%mask = icmp ne <2 x i32> %a, zeroinitializer
%1 = uitofp <2 x i1> %mask to <2 x float>
ret <2 x float> %1
@@ -1983,6 +3028,15 @@ define <2 x double> @ubto2f64(<2 x i32>
; ALL-NEXT: vpshufd {{.*#+}} xmm0 = xmm0[0,2,2,3]
; ALL-NEXT: vcvtdq2pd %xmm0, %xmm0
; ALL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: ubto2f64:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vpxor %xmm1, %xmm1, %xmm1
+; KNL_WIDEN-NEXT: vpcmpeqd %xmm1, %xmm0, %xmm0
+; KNL_WIDEN-NEXT: vpbroadcastd {{.*#+}} xmm1 = [1,1,1,1]
+; KNL_WIDEN-NEXT: vpandn %xmm1, %xmm0, %xmm0
+; KNL_WIDEN-NEXT: vcvtdq2pd %xmm0, %xmm0
+; KNL_WIDEN-NEXT: retq
%mask = icmp ne <2 x i32> %a, zeroinitializer
%1 = uitofp <2 x i1> %mask to <2 x double>
ret <2 x double> %1
@@ -2028,6 +3082,18 @@ define <2 x i64> @test_2f64toub(<2 x dou
; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
; DQNOVL-NEXT: vzeroupper
; DQNOVL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: test_2f64toub:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
+; KNL_WIDEN-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
+; KNL_WIDEN-NEXT: vcvttpd2udq %zmm0, %ymm0
+; KNL_WIDEN-NEXT: vpslld $31, %ymm0, %ymm0
+; KNL_WIDEN-NEXT: vptestmd %zmm0, %zmm0, %k1
+; KNL_WIDEN-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
+; KNL_WIDEN-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
+; KNL_WIDEN-NEXT: vzeroupper
+; KNL_WIDEN-NEXT: retq
%mask = fptoui <2 x double> %a to <2 x i1>
%select = select <2 x i1> %mask, <2 x i64> %passthru, <2 x i64> zeroinitializer
ret <2 x i64> %select
@@ -2069,6 +3135,16 @@ define <4 x i64> @test_4f64toub(<4 x dou
; DQNOVL-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
; DQNOVL-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
; DQNOVL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: test_4f64toub:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
+; KNL_WIDEN-NEXT: vcvttpd2dq %ymm0, %xmm0
+; KNL_WIDEN-NEXT: vpslld $31, %xmm0, %xmm0
+; KNL_WIDEN-NEXT: vptestmd %zmm0, %zmm0, %k1
+; KNL_WIDEN-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
+; KNL_WIDEN-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
+; KNL_WIDEN-NEXT: retq
%mask = fptoui <4 x double> %a to <4 x i1>
%select = select <4 x i1> %mask, <4 x i64> %passthru, <4 x i64> zeroinitializer
ret <4 x i64> %select
@@ -2106,6 +3182,14 @@ define <8 x i64> @test_8f64toub(<8 x dou
; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
; DQNOVL-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
; DQNOVL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: test_8f64toub:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vcvttpd2dq %zmm0, %ymm0
+; KNL_WIDEN-NEXT: vpslld $31, %ymm0, %ymm0
+; KNL_WIDEN-NEXT: vptestmd %zmm0, %zmm0, %k1
+; KNL_WIDEN-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
+; KNL_WIDEN-NEXT: retq
%mask = fptoui <8 x double> %a to <8 x i1>
%select = select <8 x i1> %mask, <8 x i64> %passthru, <8 x i64> zeroinitializer
ret <8 x i64> %select
@@ -2149,6 +3233,17 @@ define <2 x i64> @test_2f32toub(<2 x flo
; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
; DQNOVL-NEXT: vzeroupper
; DQNOVL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: test_2f32toub:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
+; KNL_WIDEN-NEXT: vcvttps2dq %xmm0, %xmm0
+; KNL_WIDEN-NEXT: vpslld $31, %xmm0, %xmm0
+; KNL_WIDEN-NEXT: vptestmd %zmm0, %zmm0, %k1
+; KNL_WIDEN-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
+; KNL_WIDEN-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
+; KNL_WIDEN-NEXT: vzeroupper
+; KNL_WIDEN-NEXT: retq
%mask = fptoui <2 x float> %a to <2 x i1>
%select = select <2 x i1> %mask, <2 x i64> %passthru, <2 x i64> zeroinitializer
ret <2 x i64> %select
@@ -2190,6 +3285,16 @@ define <4 x i64> @test_4f32toub(<4 x flo
; DQNOVL-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
; DQNOVL-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
; DQNOVL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: test_4f32toub:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
+; KNL_WIDEN-NEXT: vcvttps2dq %xmm0, %xmm0
+; KNL_WIDEN-NEXT: vpslld $31, %xmm0, %xmm0
+; KNL_WIDEN-NEXT: vptestmd %zmm0, %zmm0, %k1
+; KNL_WIDEN-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
+; KNL_WIDEN-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
+; KNL_WIDEN-NEXT: retq
%mask = fptoui <4 x float> %a to <4 x i1>
%select = select <4 x i1> %mask, <4 x i64> %passthru, <4 x i64> zeroinitializer
ret <4 x i64> %select
@@ -2227,6 +3332,14 @@ define <8 x i64> @test_8f32toub(<8 x flo
; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
; DQNOVL-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
; DQNOVL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: test_8f32toub:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vcvttps2dq %ymm0, %ymm0
+; KNL_WIDEN-NEXT: vpslld $31, %ymm0, %ymm0
+; KNL_WIDEN-NEXT: vptestmd %zmm0, %zmm0, %k1
+; KNL_WIDEN-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
+; KNL_WIDEN-NEXT: retq
%mask = fptoui <8 x float> %a to <8 x i1>
%select = select <8 x i1> %mask, <8 x i64> %passthru, <8 x i64> zeroinitializer
ret <8 x i64> %select
@@ -2256,6 +3369,14 @@ define <16 x i32> @test_16f32toub(<16 x
; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
; DQNOVL-NEXT: vmovdqa32 %zmm1, %zmm0 {%k1} {z}
; DQNOVL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: test_16f32toub:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vcvttps2dq %zmm0, %zmm0
+; KNL_WIDEN-NEXT: vpslld $31, %zmm0, %zmm0
+; KNL_WIDEN-NEXT: vptestmd %zmm0, %zmm0, %k1
+; KNL_WIDEN-NEXT: vmovdqa32 %zmm1, %zmm0 {%k1} {z}
+; KNL_WIDEN-NEXT: retq
%mask = fptoui <16 x float> %a to <16 x i1>
%select = select <16 x i1> %mask, <16 x i32> %passthru, <16 x i32> zeroinitializer
ret <16 x i32> %select
@@ -2299,6 +3420,17 @@ define <2 x i64> @test_2f64tosb(<2 x dou
; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
; DQNOVL-NEXT: vzeroupper
; DQNOVL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: test_2f64tosb:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
+; KNL_WIDEN-NEXT: vcvttpd2dq %xmm0, %xmm0
+; KNL_WIDEN-NEXT: vpslld $31, %xmm0, %xmm0
+; KNL_WIDEN-NEXT: vptestmd %zmm0, %zmm0, %k1
+; KNL_WIDEN-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
+; KNL_WIDEN-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
+; KNL_WIDEN-NEXT: vzeroupper
+; KNL_WIDEN-NEXT: retq
%mask = fptosi <2 x double> %a to <2 x i1>
%select = select <2 x i1> %mask, <2 x i64> %passthru, <2 x i64> zeroinitializer
ret <2 x i64> %select
@@ -2336,6 +3468,15 @@ define <4 x i64> @test_4f64tosb(<4 x dou
; DQNOVL-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
; DQNOVL-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
; DQNOVL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: test_4f64tosb:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
+; KNL_WIDEN-NEXT: vcvttpd2dq %ymm0, %xmm0
+; KNL_WIDEN-NEXT: vptestmd %zmm0, %zmm0, %k1
+; KNL_WIDEN-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
+; KNL_WIDEN-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
+; KNL_WIDEN-NEXT: retq
%mask = fptosi <4 x double> %a to <4 x i1>
%select = select <4 x i1> %mask, <4 x i64> %passthru, <4 x i64> zeroinitializer
ret <4 x i64> %select
@@ -2369,6 +3510,13 @@ define <8 x i64> @test_8f64tosb(<8 x dou
; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
; DQNOVL-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
; DQNOVL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: test_8f64tosb:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vcvttpd2dq %zmm0, %ymm0
+; KNL_WIDEN-NEXT: vptestmd %zmm0, %zmm0, %k1
+; KNL_WIDEN-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
+; KNL_WIDEN-NEXT: retq
%mask = fptosi <8 x double> %a to <8 x i1>
%select = select <8 x i1> %mask, <8 x i64> %passthru, <8 x i64> zeroinitializer
ret <8 x i64> %select
@@ -2408,6 +3556,16 @@ define <2 x i64> @test_2f32tosb(<2 x flo
; DQNOVL-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
; DQNOVL-NEXT: vzeroupper
; DQNOVL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: test_2f32tosb:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
+; KNL_WIDEN-NEXT: vcvttps2dq %xmm0, %xmm0
+; KNL_WIDEN-NEXT: vptestmd %zmm0, %zmm0, %k1
+; KNL_WIDEN-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
+; KNL_WIDEN-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
+; KNL_WIDEN-NEXT: vzeroupper
+; KNL_WIDEN-NEXT: retq
%mask = fptosi <2 x float> %a to <2 x i1>
%select = select <2 x i1> %mask, <2 x i64> %passthru, <2 x i64> zeroinitializer
ret <2 x i64> %select
@@ -2445,6 +3603,15 @@ define <4 x i64> @test_4f32tosb(<4 x flo
; DQNOVL-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
; DQNOVL-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
; DQNOVL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: test_4f32tosb:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
+; KNL_WIDEN-NEXT: vcvttps2dq %xmm0, %xmm0
+; KNL_WIDEN-NEXT: vptestmd %zmm0, %zmm0, %k1
+; KNL_WIDEN-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
+; KNL_WIDEN-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
+; KNL_WIDEN-NEXT: retq
%mask = fptosi <4 x float> %a to <4 x i1>
%select = select <4 x i1> %mask, <4 x i64> %passthru, <4 x i64> zeroinitializer
ret <4 x i64> %select
@@ -2478,6 +3645,13 @@ define <8 x i64> @test_8f32tosb(<8 x flo
; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
; DQNOVL-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
; DQNOVL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: test_8f32tosb:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vcvttps2dq %ymm0, %ymm0
+; KNL_WIDEN-NEXT: vptestmd %zmm0, %zmm0, %k1
+; KNL_WIDEN-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
+; KNL_WIDEN-NEXT: retq
%mask = fptosi <8 x float> %a to <8 x i1>
%select = select <8 x i1> %mask, <8 x i64> %passthru, <8 x i64> zeroinitializer
ret <8 x i64> %select
@@ -2504,6 +3678,13 @@ define <16 x i32> @test_16f32tosb(<16 x
; DQNOVL-NEXT: vpmovd2m %zmm0, %k1
; DQNOVL-NEXT: vmovdqa32 %zmm1, %zmm0 {%k1} {z}
; DQNOVL-NEXT: retq
+;
+; KNL_WIDEN-LABEL: test_16f32tosb:
+; KNL_WIDEN: # %bb.0:
+; KNL_WIDEN-NEXT: vcvttps2dq %zmm0, %zmm0
+; KNL_WIDEN-NEXT: vptestmd %zmm0, %zmm0, %k1
+; KNL_WIDEN-NEXT: vmovdqa32 %zmm1, %zmm0 {%k1} {z}
+; KNL_WIDEN-NEXT: retq
%mask = fptosi <16 x float> %a to <16 x i1>
%select = select <16 x i1> %mask, <16 x i32> %passthru, <16 x i32> zeroinitializer
ret <16 x i32> %select
More information about the llvm-commits
mailing list