2013-12-11 22:31:04 +08:00
|
|
|
; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=knl --show-mc-encoding| FileCheck %s
|
2013-08-07 20:34:55 +08:00
|
|
|
|
2013-08-10 01:50:15 +08:00
|
|
|
;CHECK-LABEL: _inreg16xi32:
|
2013-08-07 20:34:55 +08:00
|
|
|
;CHECK: vpbroadcastd {{.*}}, %zmm
|
|
|
|
;CHECK: ret
|
|
|
|
define <16 x i32> @_inreg16xi32(i32 %a) {
|
|
|
|
%b = insertelement <16 x i32> undef, i32 %a, i32 0
|
|
|
|
%c = shufflevector <16 x i32> %b, <16 x i32> undef, <16 x i32> zeroinitializer
|
|
|
|
ret <16 x i32> %c
|
|
|
|
}
|
|
|
|
|
2013-08-10 01:50:15 +08:00
|
|
|
;CHECK-LABEL: _inreg8xi64:
|
2013-08-07 20:34:55 +08:00
|
|
|
;CHECK: vpbroadcastq {{.*}}, %zmm
|
|
|
|
;CHECK: ret
|
|
|
|
define <8 x i64> @_inreg8xi64(i64 %a) {
|
|
|
|
%b = insertelement <8 x i64> undef, i64 %a, i32 0
|
|
|
|
%c = shufflevector <8 x i64> %b, <8 x i64> undef, <8 x i32> zeroinitializer
|
|
|
|
ret <8 x i64> %c
|
|
|
|
}
|
|
|
|
|
2013-08-10 01:50:15 +08:00
|
|
|
;CHECK-LABEL: _inreg16xfloat:
|
2013-12-11 22:31:04 +08:00
|
|
|
;CHECK: vbroadcastss {{.*}}, %zmm
|
2013-08-07 20:34:55 +08:00
|
|
|
;CHECK: ret
|
|
|
|
define <16 x float> @_inreg16xfloat(float %a) {
|
|
|
|
%b = insertelement <16 x float> undef, float %a, i32 0
|
|
|
|
%c = shufflevector <16 x float> %b, <16 x float> undef, <16 x i32> zeroinitializer
|
|
|
|
ret <16 x float> %c
|
|
|
|
}
|
|
|
|
|
2013-08-10 01:50:15 +08:00
|
|
|
;CHECK-LABEL: _inreg8xdouble:
|
2013-12-11 22:31:04 +08:00
|
|
|
;CHECK: vbroadcastsd {{.*}}, %zmm
|
2013-08-07 20:34:55 +08:00
|
|
|
;CHECK: ret
|
|
|
|
define <8 x double> @_inreg8xdouble(double %a) {
|
|
|
|
%b = insertelement <8 x double> undef, double %a, i32 0
|
|
|
|
%c = shufflevector <8 x double> %b, <8 x double> undef, <8 x i32> zeroinitializer
|
|
|
|
ret <8 x double> %c
|
|
|
|
}
|
2013-08-11 20:29:16 +08:00
|
|
|
|
|
|
|
;CHECK-LABEL: _xmm16xi32
|
|
|
|
;CHECK: vpbroadcastd
|
|
|
|
;CHECK: ret
|
|
|
|
define <16 x i32> @_xmm16xi32(<16 x i32> %a) {
|
|
|
|
%b = shufflevector <16 x i32> %a, <16 x i32> undef, <16 x i32> zeroinitializer
|
|
|
|
ret <16 x i32> %b
|
|
|
|
}
|
|
|
|
|
|
|
|
;CHECK-LABEL: _xmm16xfloat
|
2013-12-11 22:31:04 +08:00
|
|
|
;CHECK: vbroadcastss {{.*}}## encoding: [0x62
|
2013-08-11 20:29:16 +08:00
|
|
|
;CHECK: ret
|
|
|
|
define <16 x float> @_xmm16xfloat(<16 x float> %a) {
|
|
|
|
%b = shufflevector <16 x float> %a, <16 x float> undef, <16 x i32> zeroinitializer
|
|
|
|
ret <16 x float> %b
|
|
|
|
}
|
2013-12-11 22:31:04 +08:00
|
|
|
|
|
|
|
define <16 x i32> @test_vbroadcast() {
|
|
|
|
; CHECK: vpbroadcastd
|
|
|
|
entry:
|
|
|
|
%0 = sext <16 x i1> zeroinitializer to <16 x i32>
|
|
|
|
%1 = fcmp uno <16 x float> undef, zeroinitializer
|
|
|
|
%2 = sext <16 x i1> %1 to <16 x i32>
|
|
|
|
%3 = select <16 x i1> %1, <16 x i32> %0, <16 x i32> %2
|
|
|
|
ret <16 x i32> %3
|
|
|
|
}
|
|
|
|
|