1 ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=knl --show-mc-encoding| FileCheck %s
3 ;CHECK-LABEL: _inreg16xi32:
4 ;CHECK: vpbroadcastd {{.*}}, %zmm
6 define <16 x i32> @_inreg16xi32(i32 %a) {
7 %b = insertelement <16 x i32> undef, i32 %a, i32 0
8 %c = shufflevector <16 x i32> %b, <16 x i32> undef, <16 x i32> zeroinitializer
12 ;CHECK-LABEL: _inreg8xi64:
13 ;CHECK: vpbroadcastq {{.*}}, %zmm
15 define <8 x i64> @_inreg8xi64(i64 %a) {
16 %b = insertelement <8 x i64> undef, i64 %a, i32 0
17 %c = shufflevector <8 x i64> %b, <8 x i64> undef, <8 x i32> zeroinitializer
21 ;CHECK-LABEL: _inreg16xfloat:
22 ;CHECK: vbroadcastss {{.*}}, %zmm
24 define <16 x float> @_inreg16xfloat(float %a) {
25 %b = insertelement <16 x float> undef, float %a, i32 0
26 %c = shufflevector <16 x float> %b, <16 x float> undef, <16 x i32> zeroinitializer
30 ;CHECK-LABEL: _inreg8xdouble:
31 ;CHECK: vbroadcastsd {{.*}}, %zmm
33 define <8 x double> @_inreg8xdouble(double %a) {
34 %b = insertelement <8 x double> undef, double %a, i32 0
35 %c = shufflevector <8 x double> %b, <8 x double> undef, <8 x i32> zeroinitializer
39 ;CHECK-LABEL: _xmm16xi32
42 define <16 x i32> @_xmm16xi32(<16 x i32> %a) {
43 %b = shufflevector <16 x i32> %a, <16 x i32> undef, <16 x i32> zeroinitializer
47 ;CHECK-LABEL: _xmm16xfloat
48 ;CHECK: vbroadcastss {{.*}}## encoding: [0x62
50 define <16 x float> @_xmm16xfloat(<16 x float> %a) {
51 %b = shufflevector <16 x float> %a, <16 x float> undef, <16 x i32> zeroinitializer
55 define <16 x i32> @test_vbroadcast() {
58 %0 = sext <16 x i1> zeroinitializer to <16 x i32>
59 %1 = fcmp uno <16 x float> undef, zeroinitializer
60 %2 = sext <16 x i1> %1 to <16 x i32>
61 %3 = select <16 x i1> %1, <16 x i32> %0, <16 x i32> %2