[llvm] r341173 - [X86] Add a -x86-experimental-vector-widening command line to vec_fp_to_int.ll.

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 31 00:05:39 PDT 2018


Author: ctopper
Date: Fri Aug 31 00:05:38 2018
New Revision: 341173

URL: http://llvm.org/viewvc/llvm-project?rev=341173&view=rev
Log:
[X86] Add a -x86-experimental-vector-widening command line to vec_fp_to_int.ll.

Modified:
    llvm/trunk/test/CodeGen/X86/vec_fp_to_int.ll

Modified: llvm/trunk/test/CodeGen/X86/vec_fp_to_int.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/vec_fp_to_int.ll?rev=341173&r1=341172&r2=341173&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/vec_fp_to_int.ll (original)
+++ llvm/trunk/test/CodeGen/X86/vec_fp_to_int.ll Fri Aug 31 00:05:38 2018
@@ -6,6 +6,7 @@
 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512f,+avx512vl | FileCheck %s --check-prefix=ALL --check-prefix=AVX --check-prefix=AVX512 --check-prefix=AVX512VL
 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512dq | FileCheck %s --check-prefix=ALL --check-prefix=AVX --check-prefix=AVX512 --check-prefix=AVX512DQ
 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512dq,+avx512vl | FileCheck %s --check-prefix=ALL --check-prefix=AVX --check-prefix=AVX512 --check-prefix=AVX512VLDQ
+; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512dq,+avx512vl -x86-experimental-vector-widening-legalization | FileCheck %s --check-prefix=WIDEN
 ;
 ; 32-bit tests to make sure we're not doing anything stupid.
 ; RUN: llc < %s -mtriple=i686-unknown-unknown
@@ -70,6 +71,11 @@ define <2 x i64> @fptosi_2f64_to_2i64(<2
 ; AVX512VLDQ:       # %bb.0:
 ; AVX512VLDQ-NEXT:    vcvttpd2qq %xmm0, %xmm0
 ; AVX512VLDQ-NEXT:    retq
+;
+; WIDEN-LABEL: fptosi_2f64_to_2i64:
+; WIDEN:       # %bb.0:
+; WIDEN-NEXT:    vcvttpd2qq %xmm0, %xmm0
+; WIDEN-NEXT:    retq
   %cvt = fptosi <2 x double> %a to <2 x i64>
   ret <2 x i64> %cvt
 }
@@ -84,6 +90,11 @@ define <4 x i32> @fptosi_2f64_to_4i32(<2
 ; AVX:       # %bb.0:
 ; AVX-NEXT:    vcvttpd2dq %xmm0, %xmm0
 ; AVX-NEXT:    retq
+;
+; WIDEN-LABEL: fptosi_2f64_to_4i32:
+; WIDEN:       # %bb.0:
+; WIDEN-NEXT:    vcvttpd2dq %xmm0, %xmm0
+; WIDEN-NEXT:    retq
   %cvt = fptosi <2 x double> %a to <2 x i32>
   %ext = shufflevector <2 x i32> %cvt, <2 x i32> zeroinitializer, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
   ret <4 x i32> %ext
@@ -101,6 +112,11 @@ define <2 x i32> @fptosi_2f64_to_2i32(<2
 ; AVX-NEXT:    vcvttpd2dq %xmm0, %xmm0
 ; AVX-NEXT:    vpmovzxdq {{.*#+}} xmm0 = xmm0[0],zero,xmm0[1],zero
 ; AVX-NEXT:    retq
+;
+; WIDEN-LABEL: fptosi_2f64_to_2i32:
+; WIDEN:       # %bb.0:
+; WIDEN-NEXT:    vcvttpd2dq %xmm0, %xmm0
+; WIDEN-NEXT:    retq
   %cvt = fptosi <2 x double> %a to <2 x i32>
   ret <2 x i32> %cvt
 }
@@ -119,6 +135,13 @@ define <4 x i32> @fptosi_4f64_to_2i32(<2
 ; AVX-NEXT:    vcvttpd2dq %ymm0, %xmm0
 ; AVX-NEXT:    vzeroupper
 ; AVX-NEXT:    retq
+;
+; WIDEN-LABEL: fptosi_4f64_to_2i32:
+; WIDEN:       # %bb.0:
+; WIDEN-NEXT:    # kill: def $xmm0 killed $xmm0 def $ymm0
+; WIDEN-NEXT:    vcvttpd2dq %ymm0, %xmm0
+; WIDEN-NEXT:    vzeroupper
+; WIDEN-NEXT:    retq
   %ext = shufflevector <2 x double> %a, <2 x double> undef, <4 x i32> <i32 0, i32 1, i32 undef, i32 undef>
   %cvt = fptosi <4 x double> %ext to <4 x i32>
   ret <4 x i32> %cvt
@@ -226,6 +249,11 @@ define <4 x i64> @fptosi_4f64_to_4i64(<4
 ; AVX512VLDQ:       # %bb.0:
 ; AVX512VLDQ-NEXT:    vcvttpd2qq %ymm0, %ymm0
 ; AVX512VLDQ-NEXT:    retq
+;
+; WIDEN-LABEL: fptosi_4f64_to_4i64:
+; WIDEN:       # %bb.0:
+; WIDEN-NEXT:    vcvttpd2qq %ymm0, %ymm0
+; WIDEN-NEXT:    retq
   %cvt = fptosi <4 x double> %a to <4 x i64>
   ret <4 x i64> %cvt
 }
@@ -243,6 +271,12 @@ define <4 x i32> @fptosi_4f64_to_4i32(<4
 ; AVX-NEXT:    vcvttpd2dq %ymm0, %xmm0
 ; AVX-NEXT:    vzeroupper
 ; AVX-NEXT:    retq
+;
+; WIDEN-LABEL: fptosi_4f64_to_4i32:
+; WIDEN:       # %bb.0:
+; WIDEN-NEXT:    vcvttpd2dq %ymm0, %xmm0
+; WIDEN-NEXT:    vzeroupper
+; WIDEN-NEXT:    retq
   %cvt = fptosi <4 x double> %a to <4 x i32>
   ret <4 x i32> %cvt
 }
@@ -331,6 +365,11 @@ define <2 x i64> @fptoui_2f64_to_2i64(<2
 ; AVX512VLDQ:       # %bb.0:
 ; AVX512VLDQ-NEXT:    vcvttpd2uqq %xmm0, %xmm0
 ; AVX512VLDQ-NEXT:    retq
+;
+; WIDEN-LABEL: fptoui_2f64_to_2i64:
+; WIDEN:       # %bb.0:
+; WIDEN-NEXT:    vcvttpd2uqq %xmm0, %xmm0
+; WIDEN-NEXT:    retq
   %cvt = fptoui <2 x double> %a to <2 x i64>
   ret <2 x i64> %cvt
 }
@@ -411,6 +450,11 @@ define <4 x i32> @fptoui_2f64_to_4i32(<2
 ; AVX512VLDQ:       # %bb.0:
 ; AVX512VLDQ-NEXT:    vcvttpd2udq %xmm0, %xmm0
 ; AVX512VLDQ-NEXT:    retq
+;
+; WIDEN-LABEL: fptoui_2f64_to_4i32:
+; WIDEN:       # %bb.0:
+; WIDEN-NEXT:    vcvttpd2udq %xmm0, %xmm0
+; WIDEN-NEXT:    retq
   %cvt = fptoui <2 x double> %a to <2 x i32>
   %ext = shufflevector <2 x i32> %cvt, <2 x i32> zeroinitializer, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
   ret <4 x i32> %ext
@@ -490,6 +534,11 @@ define <4 x i32> @fptoui_2f64_to_2i32(<2
 ; AVX512VLDQ:       # %bb.0:
 ; AVX512VLDQ-NEXT:    vcvttpd2udq %xmm0, %xmm0
 ; AVX512VLDQ-NEXT:    retq
+;
+; WIDEN-LABEL: fptoui_2f64_to_2i32:
+; WIDEN:       # %bb.0:
+; WIDEN-NEXT:    vcvttpd2udq %xmm0, %xmm0
+; WIDEN-NEXT:    retq
   %cvt = fptoui <2 x double> %a to <2 x i32>
   %ext = shufflevector <2 x i32> %cvt, <2 x i32> undef, <4 x i32> <i32 0, i32 1, i32 undef, i32 undef>
   ret <4 x i32> %ext
@@ -563,6 +612,13 @@ define <4 x i32> @fptoui_4f64_to_2i32(<2
 ; AVX512VLDQ-NEXT:    vcvttpd2udq %ymm0, %xmm0
 ; AVX512VLDQ-NEXT:    vzeroupper
 ; AVX512VLDQ-NEXT:    retq
+;
+; WIDEN-LABEL: fptoui_4f64_to_2i32:
+; WIDEN:       # %bb.0:
+; WIDEN-NEXT:    vmovaps %xmm0, %xmm0
+; WIDEN-NEXT:    vcvttpd2udq %ymm0, %xmm0
+; WIDEN-NEXT:    vzeroupper
+; WIDEN-NEXT:    retq
   %ext = shufflevector <2 x double> %a, <2 x double> zeroinitializer, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
   %cvt = fptoui <4 x double> %ext to <4 x i32>
   ret <4 x i32> %cvt
@@ -739,6 +795,11 @@ define <4 x i64> @fptoui_4f64_to_4i64(<4
 ; AVX512VLDQ:       # %bb.0:
 ; AVX512VLDQ-NEXT:    vcvttpd2uqq %ymm0, %ymm0
 ; AVX512VLDQ-NEXT:    retq
+;
+; WIDEN-LABEL: fptoui_4f64_to_4i64:
+; WIDEN:       # %bb.0:
+; WIDEN-NEXT:    vcvttpd2uqq %ymm0, %ymm0
+; WIDEN-NEXT:    retq
   %cvt = fptoui <4 x double> %a to <4 x i64>
   ret <4 x i64> %cvt
 }
@@ -831,6 +892,12 @@ define <4 x i32> @fptoui_4f64_to_4i32(<4
 ; AVX512VLDQ-NEXT:    vcvttpd2udq %ymm0, %xmm0
 ; AVX512VLDQ-NEXT:    vzeroupper
 ; AVX512VLDQ-NEXT:    retq
+;
+; WIDEN-LABEL: fptoui_4f64_to_4i32:
+; WIDEN:       # %bb.0:
+; WIDEN-NEXT:    vcvttpd2udq %ymm0, %xmm0
+; WIDEN-NEXT:    vzeroupper
+; WIDEN-NEXT:    retq
   %cvt = fptoui <4 x double> %a to <4 x i32>
   ret <4 x i32> %cvt
 }
@@ -851,6 +918,11 @@ define <2 x i32> @fptosi_2f32_to_2i32(<2
 ; AVX-NEXT:    vcvttps2dq %xmm0, %xmm0
 ; AVX-NEXT:    vpmovzxdq {{.*#+}} xmm0 = xmm0[0],zero,xmm0[1],zero
 ; AVX-NEXT:    retq
+;
+; WIDEN-LABEL: fptosi_2f32_to_2i32:
+; WIDEN:       # %bb.0:
+; WIDEN-NEXT:    vcvttps2dq %xmm0, %xmm0
+; WIDEN-NEXT:    retq
   %cvt = fptosi <2 x float> %a to <2 x i32>
   ret <2 x i32> %cvt
 }
@@ -865,6 +937,11 @@ define <4 x i32> @fptosi_4f32_to_4i32(<4
 ; AVX:       # %bb.0:
 ; AVX-NEXT:    vcvttps2dq %xmm0, %xmm0
 ; AVX-NEXT:    retq
+;
+; WIDEN-LABEL: fptosi_4f32_to_4i32:
+; WIDEN:       # %bb.0:
+; WIDEN-NEXT:    vcvttps2dq %xmm0, %xmm0
+; WIDEN-NEXT:    retq
   %cvt = fptosi <4 x float> %a to <4 x i32>
   ret <4 x i32> %cvt
 }
@@ -923,6 +1000,11 @@ define <2 x i64> @fptosi_2f32_to_2i64(<4
 ; AVX512VLDQ:       # %bb.0:
 ; AVX512VLDQ-NEXT:    vcvttps2qq %xmm0, %xmm0
 ; AVX512VLDQ-NEXT:    retq
+;
+; WIDEN-LABEL: fptosi_2f32_to_2i64:
+; WIDEN:       # %bb.0:
+; WIDEN-NEXT:    vcvttps2qq %xmm0, %xmm0
+; WIDEN-NEXT:    retq
   %shuf = shufflevector <4 x float> %a, <4 x float> undef, <2 x i32> <i32 0, i32 1>
   %cvt = fptosi <2 x float> %shuf to <2 x i64>
   ret <2 x i64> %cvt
@@ -984,6 +1066,13 @@ define <2 x i64> @fptosi_4f32_to_2i64(<4
 ; AVX512VLDQ-NEXT:    # kill: def $xmm0 killed $xmm0 killed $ymm0
 ; AVX512VLDQ-NEXT:    vzeroupper
 ; AVX512VLDQ-NEXT:    retq
+;
+; WIDEN-LABEL: fptosi_4f32_to_2i64:
+; WIDEN:       # %bb.0:
+; WIDEN-NEXT:    vcvttps2qq %xmm0, %ymm0
+; WIDEN-NEXT:    # kill: def $xmm0 killed $xmm0 killed $ymm0
+; WIDEN-NEXT:    vzeroupper
+; WIDEN-NEXT:    retq
   %cvt = fptosi <4 x float> %a to <4 x i64>
   %shuf = shufflevector <4 x i64> %cvt, <4 x i64> undef, <2 x i32> <i32 0, i32 1>
   ret <2 x i64> %shuf
@@ -1000,6 +1089,11 @@ define <8 x i32> @fptosi_8f32_to_8i32(<8
 ; AVX:       # %bb.0:
 ; AVX-NEXT:    vcvttps2dq %ymm0, %ymm0
 ; AVX-NEXT:    retq
+;
+; WIDEN-LABEL: fptosi_8f32_to_8i32:
+; WIDEN:       # %bb.0:
+; WIDEN-NEXT:    vcvttps2dq %ymm0, %ymm0
+; WIDEN-NEXT:    retq
   %cvt = fptosi <8 x float> %a to <8 x i32>
   ret <8 x i32> %cvt
 }
@@ -1107,6 +1201,11 @@ define <4 x i64> @fptosi_4f32_to_4i64(<8
 ; AVX512VLDQ:       # %bb.0:
 ; AVX512VLDQ-NEXT:    vcvttps2qq %xmm0, %ymm0
 ; AVX512VLDQ-NEXT:    retq
+;
+; WIDEN-LABEL: fptosi_4f32_to_4i64:
+; WIDEN:       # %bb.0:
+; WIDEN-NEXT:    vcvttps2qq %xmm0, %ymm0
+; WIDEN-NEXT:    retq
   %shuf = shufflevector <8 x float> %a, <8 x float> undef, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
   %cvt = fptosi <4 x float> %shuf to <4 x i64>
   ret <4 x i64> %cvt
@@ -1216,6 +1315,12 @@ define <4 x i64> @fptosi_8f32_to_4i64(<8
 ; AVX512VLDQ-NEXT:    vcvttps2qq %ymm0, %zmm0
 ; AVX512VLDQ-NEXT:    # kill: def $ymm0 killed $ymm0 killed $zmm0
 ; AVX512VLDQ-NEXT:    retq
+;
+; WIDEN-LABEL: fptosi_8f32_to_4i64:
+; WIDEN:       # %bb.0:
+; WIDEN-NEXT:    vcvttps2qq %ymm0, %zmm0
+; WIDEN-NEXT:    # kill: def $ymm0 killed $ymm0 killed $zmm0
+; WIDEN-NEXT:    retq
   %cvt = fptosi <8 x float> %a to <8 x i64>
   %shuf = shufflevector <8 x i64> %cvt, <8 x i64> undef, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
   ret <4 x i64> %shuf
@@ -1300,6 +1405,11 @@ define <2 x i32> @fptoui_2f32_to_2i32(<2
 ; AVX512VLDQ-NEXT:    vcvttps2udq %xmm0, %xmm0
 ; AVX512VLDQ-NEXT:    vpmovzxdq {{.*#+}} xmm0 = xmm0[0],zero,xmm0[1],zero
 ; AVX512VLDQ-NEXT:    retq
+;
+; WIDEN-LABEL: fptoui_2f32_to_2i32:
+; WIDEN:       # %bb.0:
+; WIDEN-NEXT:    vcvttps2udq %xmm0, %xmm0
+; WIDEN-NEXT:    retq
   %cvt = fptoui <2 x float> %a to <2 x i32>
   ret <2 x i32> %cvt
 }
@@ -1366,6 +1476,11 @@ define <4 x i32> @fptoui_4f32_to_4i32(<4
 ; AVX512VLDQ:       # %bb.0:
 ; AVX512VLDQ-NEXT:    vcvttps2udq %xmm0, %xmm0
 ; AVX512VLDQ-NEXT:    retq
+;
+; WIDEN-LABEL: fptoui_4f32_to_4i32:
+; WIDEN:       # %bb.0:
+; WIDEN-NEXT:    vcvttps2udq %xmm0, %xmm0
+; WIDEN-NEXT:    retq
   %cvt = fptoui <4 x float> %a to <4 x i32>
   ret <4 x i32> %cvt
 }
@@ -1450,6 +1565,11 @@ define <2 x i64> @fptoui_2f32_to_2i64(<4
 ; AVX512VLDQ:       # %bb.0:
 ; AVX512VLDQ-NEXT:    vcvttps2uqq %xmm0, %xmm0
 ; AVX512VLDQ-NEXT:    retq
+;
+; WIDEN-LABEL: fptoui_2f32_to_2i64:
+; WIDEN:       # %bb.0:
+; WIDEN-NEXT:    vcvttps2uqq %xmm0, %xmm0
+; WIDEN-NEXT:    retq
   %shuf = shufflevector <4 x float> %a, <4 x float> undef, <2 x i32> <i32 0, i32 1>
   %cvt = fptoui <2 x float> %shuf to <2 x i64>
   ret <2 x i64> %cvt
@@ -1537,6 +1657,13 @@ define <2 x i64> @fptoui_4f32_to_2i64(<4
 ; AVX512VLDQ-NEXT:    # kill: def $xmm0 killed $xmm0 killed $ymm0
 ; AVX512VLDQ-NEXT:    vzeroupper
 ; AVX512VLDQ-NEXT:    retq
+;
+; WIDEN-LABEL: fptoui_4f32_to_2i64:
+; WIDEN:       # %bb.0:
+; WIDEN-NEXT:    vcvttps2uqq %xmm0, %ymm0
+; WIDEN-NEXT:    # kill: def $xmm0 killed $xmm0 killed $ymm0
+; WIDEN-NEXT:    vzeroupper
+; WIDEN-NEXT:    retq
   %cvt = fptoui <4 x float> %a to <4 x i64>
   %shuf = shufflevector <4 x i64> %cvt, <4 x i64> undef, <2 x i32> <i32 0, i32 1>
   ret <2 x i64> %shuf
@@ -1659,6 +1786,11 @@ define <8 x i32> @fptoui_8f32_to_8i32(<8
 ; AVX512VLDQ:       # %bb.0:
 ; AVX512VLDQ-NEXT:    vcvttps2udq %ymm0, %ymm0
 ; AVX512VLDQ-NEXT:    retq
+;
+; WIDEN-LABEL: fptoui_8f32_to_8i32:
+; WIDEN:       # %bb.0:
+; WIDEN-NEXT:    vcvttps2udq %ymm0, %ymm0
+; WIDEN-NEXT:    retq
   %cvt = fptoui <8 x float> %a to <8 x i32>
   ret <8 x i32> %cvt
 }
@@ -1836,6 +1968,11 @@ define <4 x i64> @fptoui_4f32_to_4i64(<8
 ; AVX512VLDQ:       # %bb.0:
 ; AVX512VLDQ-NEXT:    vcvttps2uqq %xmm0, %ymm0
 ; AVX512VLDQ-NEXT:    retq
+;
+; WIDEN-LABEL: fptoui_4f32_to_4i64:
+; WIDEN:       # %bb.0:
+; WIDEN-NEXT:    vcvttps2uqq %xmm0, %ymm0
+; WIDEN-NEXT:    retq
   %shuf = shufflevector <8 x float> %a, <8 x float> undef, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
   %cvt = fptoui <4 x float> %shuf to <4 x i64>
   ret <4 x i64> %cvt
@@ -2015,6 +2152,12 @@ define <4 x i64> @fptoui_8f32_to_4i64(<8
 ; AVX512VLDQ-NEXT:    vcvttps2uqq %ymm0, %zmm0
 ; AVX512VLDQ-NEXT:    # kill: def $ymm0 killed $ymm0 killed $zmm0
 ; AVX512VLDQ-NEXT:    retq
+;
+; WIDEN-LABEL: fptoui_8f32_to_4i64:
+; WIDEN:       # %bb.0:
+; WIDEN-NEXT:    vcvttps2uqq %ymm0, %zmm0
+; WIDEN-NEXT:    # kill: def $ymm0 killed $ymm0 killed $zmm0
+; WIDEN-NEXT:    retq
   %cvt = fptoui <8 x float> %a to <8 x i64>
   %shuf = shufflevector <8 x i64> %cvt, <8 x i64> undef, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
   ret <4 x i64> %shuf
@@ -2034,6 +2177,11 @@ define <2 x i64> @fptosi_2f64_to_2i64_co
 ; AVX:       # %bb.0:
 ; AVX-NEXT:    vmovaps {{.*#+}} xmm0 = [1,18446744073709551615]
 ; AVX-NEXT:    retq
+;
+; WIDEN-LABEL: fptosi_2f64_to_2i64_const:
+; WIDEN:       # %bb.0:
+; WIDEN-NEXT:    vmovaps {{.*#+}} xmm0 = [1,18446744073709551615]
+; WIDEN-NEXT:    retq
   %cvt = fptosi <2 x double> <double 1.0, double -1.0> to <2 x i64>
   ret <2 x i64> %cvt
 }
@@ -2048,6 +2196,11 @@ define <4 x i32> @fptosi_2f64_to_2i32_co
 ; AVX:       # %bb.0:
 ; AVX-NEXT:    vmovaps {{.*#+}} xmm0 = <4294967295,1,u,u>
 ; AVX-NEXT:    retq
+;
+; WIDEN-LABEL: fptosi_2f64_to_2i32_const:
+; WIDEN:       # %bb.0:
+; WIDEN-NEXT:    vmovaps {{.*#+}} xmm0 = <4294967295,1,u,u>
+; WIDEN-NEXT:    retq
   %cvt = fptosi <2 x double> <double -1.0, double 1.0> to <2 x i32>
   %ext = shufflevector <2 x i32> %cvt, <2 x i32> undef, <4 x i32> <i32 0, i32 1, i32 undef, i32 undef>
   ret <4 x i32> %ext
@@ -2064,6 +2217,11 @@ define <4 x i64> @fptosi_4f64_to_4i64_co
 ; AVX:       # %bb.0:
 ; AVX-NEXT:    vmovaps {{.*#+}} ymm0 = [1,18446744073709551615,2,18446744073709551613]
 ; AVX-NEXT:    retq
+;
+; WIDEN-LABEL: fptosi_4f64_to_4i64_const:
+; WIDEN:       # %bb.0:
+; WIDEN-NEXT:    vmovaps {{.*#+}} ymm0 = [1,18446744073709551615,2,18446744073709551613]
+; WIDEN-NEXT:    retq
   %cvt = fptosi <4 x double> <double 1.0, double -1.0, double 2.0, double -3.0> to <4 x i64>
   ret <4 x i64> %cvt
 }
@@ -2078,6 +2236,11 @@ define <4 x i32> @fptosi_4f64_to_4i32_co
 ; AVX:       # %bb.0:
 ; AVX-NEXT:    vmovaps {{.*#+}} xmm0 = [4294967295,1,4294967294,3]
 ; AVX-NEXT:    retq
+;
+; WIDEN-LABEL: fptosi_4f64_to_4i32_const:
+; WIDEN:       # %bb.0:
+; WIDEN-NEXT:    vmovaps {{.*#+}} xmm0 = [4294967295,1,4294967294,3]
+; WIDEN-NEXT:    retq
   %cvt = fptosi <4 x double> <double -1.0, double 1.0, double -2.0, double 3.0> to <4 x i32>
   ret <4 x i32> %cvt
 }
@@ -2092,6 +2255,11 @@ define <2 x i64> @fptoui_2f64_to_2i64_co
 ; AVX:       # %bb.0:
 ; AVX-NEXT:    vmovaps {{.*#+}} xmm0 = [2,4]
 ; AVX-NEXT:    retq
+;
+; WIDEN-LABEL: fptoui_2f64_to_2i64_const:
+; WIDEN:       # %bb.0:
+; WIDEN-NEXT:    vmovaps {{.*#+}} xmm0 = [2,4]
+; WIDEN-NEXT:    retq
   %cvt = fptoui <2 x double> <double 2.0, double 4.0> to <2 x i64>
   ret <2 x i64> %cvt
 }
@@ -2106,6 +2274,11 @@ define <4 x i32> @fptoui_2f64_to_2i32_co
 ; AVX:       # %bb.0:
 ; AVX-NEXT:    vmovaps {{.*#+}} xmm0 = <2,4,u,u>
 ; AVX-NEXT:    retq
+;
+; WIDEN-LABEL: fptoui_2f64_to_2i32_const:
+; WIDEN:       # %bb.0:
+; WIDEN-NEXT:    vmovaps {{.*#+}} xmm0 = <2,4,u,u>
+; WIDEN-NEXT:    retq
   %cvt = fptoui <2 x double> <double 2.0, double 4.0> to <2 x i32>
   %ext = shufflevector <2 x i32> %cvt, <2 x i32> undef, <4 x i32> <i32 0, i32 1, i32 undef, i32 undef>
   ret <4 x i32> %ext
@@ -2122,6 +2295,11 @@ define <4 x i64> @fptoui_4f64_to_4i64_co
 ; AVX:       # %bb.0:
 ; AVX-NEXT:    vmovaps {{.*#+}} ymm0 = [2,4,6,8]
 ; AVX-NEXT:    retq
+;
+; WIDEN-LABEL: fptoui_4f64_to_4i64_const:
+; WIDEN:       # %bb.0:
+; WIDEN-NEXT:    vmovaps {{.*#+}} ymm0 = [2,4,6,8]
+; WIDEN-NEXT:    retq
   %cvt = fptoui <4 x double> <double 2.0, double 4.0, double 6.0, double 8.0> to <4 x i64>
   ret <4 x i64> %cvt
 }
@@ -2136,6 +2314,11 @@ define <4 x i32> @fptoui_4f64_to_4i32_co
 ; AVX:       # %bb.0:
 ; AVX-NEXT:    vmovaps {{.*#+}} xmm0 = [2,4,6,8]
 ; AVX-NEXT:    retq
+;
+; WIDEN-LABEL: fptoui_4f64_to_4i32_const:
+; WIDEN:       # %bb.0:
+; WIDEN-NEXT:    vmovaps {{.*#+}} xmm0 = [2,4,6,8]
+; WIDEN-NEXT:    retq
   %cvt = fptoui <4 x double> <double 2.0, double 4.0, double 6.0, double 8.0> to <4 x i32>
   ret <4 x i32> %cvt
 }
@@ -2150,6 +2333,11 @@ define <4 x i32> @fptosi_4f32_to_4i32_co
 ; AVX:       # %bb.0:
 ; AVX-NEXT:    vmovaps {{.*#+}} xmm0 = [1,4294967295,2,3]
 ; AVX-NEXT:    retq
+;
+; WIDEN-LABEL: fptosi_4f32_to_4i32_const:
+; WIDEN:       # %bb.0:
+; WIDEN-NEXT:    vmovaps {{.*#+}} xmm0 = [1,4294967295,2,3]
+; WIDEN-NEXT:    retq
   %cvt = fptosi <4 x float> <float 1.0, float -1.0, float 2.0, float 3.0> to <4 x i32>
   ret <4 x i32> %cvt
 }
@@ -2165,6 +2353,11 @@ define <4 x i64> @fptosi_4f32_to_4i64_co
 ; AVX:       # %bb.0:
 ; AVX-NEXT:    vmovaps {{.*#+}} ymm0 = [1,18446744073709551615,2,3]
 ; AVX-NEXT:    retq
+;
+; WIDEN-LABEL: fptosi_4f32_to_4i64_const:
+; WIDEN:       # %bb.0:
+; WIDEN-NEXT:    vmovaps {{.*#+}} ymm0 = [1,18446744073709551615,2,3]
+; WIDEN-NEXT:    retq
   %cvt = fptosi <4 x float> <float 1.0, float -1.0, float 2.0, float 3.0> to <4 x i64>
   ret <4 x i64> %cvt
 }
@@ -2180,6 +2373,11 @@ define <8 x i32> @fptosi_8f32_to_8i32_co
 ; AVX:       # %bb.0:
 ; AVX-NEXT:    vmovaps {{.*#+}} ymm0 = [1,4294967295,2,3,6,4294967288,2,4294967295]
 ; AVX-NEXT:    retq
+;
+; WIDEN-LABEL: fptosi_8f32_to_8i32_const:
+; WIDEN:       # %bb.0:
+; WIDEN-NEXT:    vmovaps {{.*#+}} ymm0 = [1,4294967295,2,3,6,4294967288,2,4294967295]
+; WIDEN-NEXT:    retq
   %cvt = fptosi <8 x float> <float 1.0, float -1.0, float 2.0, float 3.0, float 6.0, float -8.0, float 2.0, float -1.0> to <8 x i32>
   ret <8 x i32> %cvt
 }
@@ -2194,6 +2392,11 @@ define <4 x i32> @fptoui_4f32_to_4i32_co
 ; AVX:       # %bb.0:
 ; AVX-NEXT:    vmovaps {{.*#+}} xmm0 = [1,2,4,6]
 ; AVX-NEXT:    retq
+;
+; WIDEN-LABEL: fptoui_4f32_to_4i32_const:
+; WIDEN:       # %bb.0:
+; WIDEN-NEXT:    vmovaps {{.*#+}} xmm0 = [1,2,4,6]
+; WIDEN-NEXT:    retq
   %cvt = fptoui <4 x float> <float 1.0, float 2.0, float 4.0, float 6.0> to <4 x i32>
   ret <4 x i32> %cvt
 }
@@ -2209,6 +2412,11 @@ define <4 x i64> @fptoui_4f32_to_4i64_co
 ; AVX:       # %bb.0:
 ; AVX-NEXT:    vmovaps {{.*#+}} ymm0 = [1,2,4,8]
 ; AVX-NEXT:    retq
+;
+; WIDEN-LABEL: fptoui_4f32_to_4i64_const:
+; WIDEN:       # %bb.0:
+; WIDEN-NEXT:    vmovaps {{.*#+}} ymm0 = [1,2,4,8]
+; WIDEN-NEXT:    retq
   %cvt = fptoui <4 x float> <float 1.0, float 2.0, float 4.0, float 8.0> to <4 x i64>
   ret <4 x i64> %cvt
 }
@@ -2224,6 +2432,11 @@ define <8 x i32> @fptoui_8f32_to_8i32_co
 ; AVX:       # %bb.0:
 ; AVX-NEXT:    vmovaps {{.*#+}} ymm0 = [1,2,4,6,8,6,4,1]
 ; AVX-NEXT:    retq
+;
+; WIDEN-LABEL: fptoui_8f32_to_8i32_const:
+; WIDEN:       # %bb.0:
+; WIDEN-NEXT:    vmovaps {{.*#+}} ymm0 = [1,2,4,6,8,6,4,1]
+; WIDEN-NEXT:    retq
   %cvt = fptoui <8 x float> <float 1.0, float 2.0, float 4.0, float 6.0, float 8.0, float 6.0, float 4.0, float 1.0> to <8 x i32>
   ret <8 x i32> %cvt
 }
@@ -2291,6 +2504,20 @@ define <4 x i32> @fptosi_2f16_to_4i32(<2
 ; AVX512-NEXT:    vpunpcklqdq {{.*#+}} xmm0 = xmm0[0],xmm1[0]
 ; AVX512-NEXT:    vinsertps {{.*#+}} xmm0 = xmm0[0,2],zero,zero
 ; AVX512-NEXT:    retq
+;
+; WIDEN-LABEL: fptosi_2f16_to_4i32:
+; WIDEN:       # %bb.0:
+; WIDEN-NEXT:    vcvtps2ph $4, %xmm1, %xmm1
+; WIDEN-NEXT:    vcvtph2ps %xmm1, %xmm1
+; WIDEN-NEXT:    vcvtps2ph $4, %xmm0, %xmm0
+; WIDEN-NEXT:    vcvtph2ps %xmm0, %xmm0
+; WIDEN-NEXT:    vcvttss2si %xmm0, %eax
+; WIDEN-NEXT:    vcvttss2si %xmm1, %ecx
+; WIDEN-NEXT:    vmovd %ecx, %xmm0
+; WIDEN-NEXT:    vmovd %eax, %xmm1
+; WIDEN-NEXT:    vpunpckldq {{.*#+}} xmm0 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
+; WIDEN-NEXT:    vmovq {{.*#+}} xmm0 = xmm0[0],zero
+; WIDEN-NEXT:    retq
   %cvt = fptosi <2 x half> %a to <2 x i32>
   %ext = shufflevector <2 x i32> %cvt, <2 x i32> zeroinitializer, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
   ret <4 x i32> %ext
@@ -2333,6 +2560,18 @@ define <4 x i32> @fptosi_2f80_to_4i32(<2
 ; AVX-NEXT:    vmovlhps {{.*#+}} xmm0 = xmm1[0],xmm0[0]
 ; AVX-NEXT:    vinsertps {{.*#+}} xmm0 = xmm0[0,2],zero,zero
 ; AVX-NEXT:    retq
+;
+; WIDEN-LABEL: fptosi_2f80_to_4i32:
+; WIDEN:       # %bb.0:
+; WIDEN-NEXT:    fldt {{[0-9]+}}(%rsp)
+; WIDEN-NEXT:    fldt {{[0-9]+}}(%rsp)
+; WIDEN-NEXT:    fisttpl -{{[0-9]+}}(%rsp)
+; WIDEN-NEXT:    fisttpl -{{[0-9]+}}(%rsp)
+; WIDEN-NEXT:    vmovd {{.*#+}} xmm0 = mem[0],zero,zero,zero
+; WIDEN-NEXT:    vmovd {{.*#+}} xmm1 = mem[0],zero,zero,zero
+; WIDEN-NEXT:    vpunpckldq {{.*#+}} xmm0 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
+; WIDEN-NEXT:    vmovq {{.*#+}} xmm0 = xmm0[0],zero
+; WIDEN-NEXT:    retq
   %cvt = fptosi <2 x x86_fp80> %a to <2 x i32>
   %ext = shufflevector <2 x i32> %cvt, <2 x i32> zeroinitializer, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
   ret <4 x i32> %ext
@@ -2387,6 +2626,27 @@ define <4 x i32> @fptosi_2f128_to_4i32(<
 ; AVX-NEXT:    popq %rbx
 ; AVX-NEXT:    popq %r14
 ; AVX-NEXT:    retq
+;
+; WIDEN-LABEL: fptosi_2f128_to_4i32:
+; WIDEN:       # %bb.0:
+; WIDEN-NEXT:    pushq %rbp
+; WIDEN-NEXT:    pushq %r14
+; WIDEN-NEXT:    pushq %rbx
+; WIDEN-NEXT:    movq %rcx, %r14
+; WIDEN-NEXT:    movq %rdx, %rbx
+; WIDEN-NEXT:    callq __fixtfsi
+; WIDEN-NEXT:    movl %eax, %ebp
+; WIDEN-NEXT:    movq %rbx, %rdi
+; WIDEN-NEXT:    movq %r14, %rsi
+; WIDEN-NEXT:    callq __fixtfsi
+; WIDEN-NEXT:    vmovd %eax, %xmm0
+; WIDEN-NEXT:    vmovd %ebp, %xmm1
+; WIDEN-NEXT:    vpunpckldq {{.*#+}} xmm0 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
+; WIDEN-NEXT:    vmovq {{.*#+}} xmm0 = xmm0[0],zero
+; WIDEN-NEXT:    popq %rbx
+; WIDEN-NEXT:    popq %r14
+; WIDEN-NEXT:    popq %rbp
+; WIDEN-NEXT:    retq
   %cvt = fptosi <2 x fp128> %a to <2 x i32>
   %ext = shufflevector <2 x i32> %cvt, <2 x i32> zeroinitializer, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
   ret <4 x i32> %ext




More information about the llvm-commits mailing list