2017-09-03 21:53:44 +08:00
|
|
|
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
2018-01-10 00:26:06 +08:00
|
|
|
; RUN: llc -mtriple=x86_64-unknown-linux-gnu -mattr=+avx512f,+avx512vl,+avx512dq,+fast-variable-shuffle %s -o - | FileCheck %s
|
2017-09-03 21:53:44 +08:00
|
|
|
|
|
|
|
; FIXME: fixing PR34394 should fix the i32x2 memory cases resulting in a simple vbroadcasti32x2 instruction.
|
|
|
|
|
|
|
|
define <4 x i32> @test_2xi32_to_4xi32(<4 x i32> %vec) {
|
|
|
|
; CHECK-LABEL: test_2xi32_to_4xi32:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vpbroadcastq %xmm0, %xmm0
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%res = shufflevector <4 x i32> %vec, <4 x i32> undef, <4 x i32> <i32 0, i32 1, i32 0, i32 1>
|
|
|
|
ret <4 x i32> %res
|
|
|
|
}
|
2017-10-15 14:05:50 +08:00
|
|
|
define <4 x i32> @test_masked_2xi32_to_4xi32_mask0(<4 x i32> %vec, <4 x i32> %default, <4 x i32> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_2xi32_to_4xi32_mask0:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmd %xmm2, %xmm2, %k1
|
2017-10-11 08:11:53 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti32x2 {{.*#+}} xmm1 {%k1} = xmm0[0,1,0,1]
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vmovdqa %xmm1, %xmm0
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%shuf = shufflevector <4 x i32> %vec, <4 x i32> undef, <4 x i32> <i32 0, i32 1, i32 0, i32 1>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <4 x i32> %mask, zeroinitializer
|
|
|
|
%res = select <4 x i1> %cmp, <4 x i32> %shuf, <4 x i32> %default
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <4 x i32> %res
|
|
|
|
}
|
|
|
|
|
2017-10-15 14:05:50 +08:00
|
|
|
define <4 x i32> @test_masked_z_2xi32_to_4xi32_mask0(<4 x i32> %vec, <4 x i32> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_z_2xi32_to_4xi32_mask0:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmd %xmm1, %xmm1, %k1
|
2017-10-11 08:11:53 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti32x2 {{.*#+}} xmm0 {%k1} {z} = xmm0[0,1,0,1]
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%shuf = shufflevector <4 x i32> %vec, <4 x i32> undef, <4 x i32> <i32 0, i32 1, i32 0, i32 1>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <4 x i32> %mask, zeroinitializer
|
|
|
|
%res = select <4 x i1> %cmp, <4 x i32> %shuf, <4 x i32> zeroinitializer
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <4 x i32> %res
|
|
|
|
}
|
2017-10-15 14:05:50 +08:00
|
|
|
define <4 x i32> @test_masked_2xi32_to_4xi32_mask1(<4 x i32> %vec, <4 x i32> %default, <4 x i32> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_2xi32_to_4xi32_mask1:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmd %xmm2, %xmm2, %k1
|
2017-10-11 08:11:53 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti32x2 {{.*#+}} xmm1 {%k1} = xmm0[0,1,0,1]
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vmovdqa %xmm1, %xmm0
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%shuf = shufflevector <4 x i32> %vec, <4 x i32> undef, <4 x i32> <i32 0, i32 1, i32 0, i32 1>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <4 x i32> %mask, zeroinitializer
|
|
|
|
%res = select <4 x i1> %cmp, <4 x i32> %shuf, <4 x i32> %default
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <4 x i32> %res
|
|
|
|
}
|
|
|
|
|
2017-10-15 14:05:50 +08:00
|
|
|
define <4 x i32> @test_masked_z_2xi32_to_4xi32_mask1(<4 x i32> %vec, <4 x i32> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_z_2xi32_to_4xi32_mask1:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmd %xmm1, %xmm1, %k1
|
2017-10-11 08:11:53 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti32x2 {{.*#+}} xmm0 {%k1} {z} = xmm0[0,1,0,1]
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%shuf = shufflevector <4 x i32> %vec, <4 x i32> undef, <4 x i32> <i32 0, i32 1, i32 0, i32 1>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <4 x i32> %mask, zeroinitializer
|
|
|
|
%res = select <4 x i1> %cmp, <4 x i32> %shuf, <4 x i32> zeroinitializer
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <4 x i32> %res
|
|
|
|
}
|
2017-10-15 14:05:50 +08:00
|
|
|
define <4 x i32> @test_masked_2xi32_to_4xi32_mask2(<4 x i32> %vec, <4 x i32> %default, <4 x i32> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_2xi32_to_4xi32_mask2:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmd %xmm2, %xmm2, %k1
|
2017-10-11 08:11:53 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti32x2 {{.*#+}} xmm1 {%k1} = xmm0[0,1,0,1]
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vmovdqa %xmm1, %xmm0
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%shuf = shufflevector <4 x i32> %vec, <4 x i32> undef, <4 x i32> <i32 0, i32 1, i32 0, i32 1>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <4 x i32> %mask, zeroinitializer
|
|
|
|
%res = select <4 x i1> %cmp, <4 x i32> %shuf, <4 x i32> %default
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <4 x i32> %res
|
|
|
|
}
|
|
|
|
|
2017-10-15 14:05:50 +08:00
|
|
|
define <4 x i32> @test_masked_z_2xi32_to_4xi32_mask2(<4 x i32> %vec, <4 x i32> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_z_2xi32_to_4xi32_mask2:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmd %xmm1, %xmm1, %k1
|
2017-10-11 08:11:53 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti32x2 {{.*#+}} xmm0 {%k1} {z} = xmm0[0,1,0,1]
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%shuf = shufflevector <4 x i32> %vec, <4 x i32> undef, <4 x i32> <i32 0, i32 1, i32 0, i32 1>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <4 x i32> %mask, zeroinitializer
|
|
|
|
%res = select <4 x i1> %cmp, <4 x i32> %shuf, <4 x i32> zeroinitializer
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <4 x i32> %res
|
|
|
|
}
|
2017-10-15 14:05:50 +08:00
|
|
|
define <4 x i32> @test_masked_2xi32_to_4xi32_mask3(<4 x i32> %vec, <4 x i32> %default, <4 x i32> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_2xi32_to_4xi32_mask3:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmd %xmm2, %xmm2, %k1
|
2017-10-11 08:11:53 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti32x2 {{.*#+}} xmm1 {%k1} = xmm0[0,1,0,1]
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vmovdqa %xmm1, %xmm0
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%shuf = shufflevector <4 x i32> %vec, <4 x i32> undef, <4 x i32> <i32 0, i32 1, i32 0, i32 1>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <4 x i32> %mask, zeroinitializer
|
|
|
|
%res = select <4 x i1> %cmp, <4 x i32> %shuf, <4 x i32> %default
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <4 x i32> %res
|
|
|
|
}
|
|
|
|
|
2017-10-15 14:05:50 +08:00
|
|
|
define <4 x i32> @test_masked_z_2xi32_to_4xi32_mask3(<4 x i32> %vec, <4 x i32> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_z_2xi32_to_4xi32_mask3:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmd %xmm1, %xmm1, %k1
|
2017-10-11 08:11:53 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti32x2 {{.*#+}} xmm0 {%k1} {z} = xmm0[0,1,0,1]
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%shuf = shufflevector <4 x i32> %vec, <4 x i32> undef, <4 x i32> <i32 0, i32 1, i32 0, i32 1>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <4 x i32> %mask, zeroinitializer
|
|
|
|
%res = select <4 x i1> %cmp, <4 x i32> %shuf, <4 x i32> zeroinitializer
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <4 x i32> %res
|
|
|
|
}
|
|
|
|
define <8 x i32> @test_2xi32_to_8xi32(<8 x i32> %vec) {
|
|
|
|
; CHECK-LABEL: test_2xi32_to_8xi32:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2017-10-13 14:07:10 +08:00
|
|
|
; CHECK-NEXT: vbroadcastsd %xmm0, %ymm0
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%res = shufflevector <8 x i32> %vec, <8 x i32> undef, <8 x i32> <i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1>
|
|
|
|
ret <8 x i32> %res
|
|
|
|
}
|
2017-10-15 14:05:50 +08:00
|
|
|
define <8 x i32> @test_masked_2xi32_to_8xi32_mask0(<8 x i32> %vec, <8 x i32> %default, <8 x i32> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_2xi32_to_8xi32_mask0:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmd %ymm2, %ymm2, %k1
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti32x2 {{.*#+}} ymm1 {%k1} = xmm0[0,1,0,1,0,1,0,1]
|
|
|
|
; CHECK-NEXT: vmovdqa %ymm1, %ymm0
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%shuf = shufflevector <8 x i32> %vec, <8 x i32> undef, <8 x i32> <i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <8 x i32> %mask, zeroinitializer
|
|
|
|
%res = select <8 x i1> %cmp, <8 x i32> %shuf, <8 x i32> %default
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <8 x i32> %res
|
|
|
|
}
|
|
|
|
|
2017-10-15 14:05:50 +08:00
|
|
|
define <8 x i32> @test_masked_z_2xi32_to_8xi32_mask0(<8 x i32> %vec, <8 x i32> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_z_2xi32_to_8xi32_mask0:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmd %ymm1, %ymm1, %k1
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti32x2 {{.*#+}} ymm0 {%k1} {z} = xmm0[0,1,0,1,0,1,0,1]
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%shuf = shufflevector <8 x i32> %vec, <8 x i32> undef, <8 x i32> <i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <8 x i32> %mask, zeroinitializer
|
|
|
|
%res = select <8 x i1> %cmp, <8 x i32> %shuf, <8 x i32> zeroinitializer
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <8 x i32> %res
|
|
|
|
}
|
2017-10-15 14:05:50 +08:00
|
|
|
define <8 x i32> @test_masked_2xi32_to_8xi32_mask1(<8 x i32> %vec, <8 x i32> %default, <8 x i32> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_2xi32_to_8xi32_mask1:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmd %ymm2, %ymm2, %k1
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti32x2 {{.*#+}} ymm1 {%k1} = xmm0[0,1,0,1,0,1,0,1]
|
|
|
|
; CHECK-NEXT: vmovdqa %ymm1, %ymm0
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%shuf = shufflevector <8 x i32> %vec, <8 x i32> undef, <8 x i32> <i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <8 x i32> %mask, zeroinitializer
|
|
|
|
%res = select <8 x i1> %cmp, <8 x i32> %shuf, <8 x i32> %default
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <8 x i32> %res
|
|
|
|
}
|
|
|
|
|
2017-10-15 14:05:50 +08:00
|
|
|
define <8 x i32> @test_masked_z_2xi32_to_8xi32_mask1(<8 x i32> %vec, <8 x i32> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_z_2xi32_to_8xi32_mask1:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmd %ymm1, %ymm1, %k1
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti32x2 {{.*#+}} ymm0 {%k1} {z} = xmm0[0,1,0,1,0,1,0,1]
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%shuf = shufflevector <8 x i32> %vec, <8 x i32> undef, <8 x i32> <i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <8 x i32> %mask, zeroinitializer
|
|
|
|
%res = select <8 x i1> %cmp, <8 x i32> %shuf, <8 x i32> zeroinitializer
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <8 x i32> %res
|
|
|
|
}
|
2017-10-15 14:05:50 +08:00
|
|
|
define <8 x i32> @test_masked_2xi32_to_8xi32_mask2(<8 x i32> %vec, <8 x i32> %default, <8 x i32> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_2xi32_to_8xi32_mask2:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmd %ymm2, %ymm2, %k1
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti32x2 {{.*#+}} ymm1 {%k1} = xmm0[0,1,0,1,0,1,0,1]
|
|
|
|
; CHECK-NEXT: vmovdqa %ymm1, %ymm0
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%shuf = shufflevector <8 x i32> %vec, <8 x i32> undef, <8 x i32> <i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <8 x i32> %mask, zeroinitializer
|
|
|
|
%res = select <8 x i1> %cmp, <8 x i32> %shuf, <8 x i32> %default
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <8 x i32> %res
|
|
|
|
}
|
|
|
|
|
2017-10-15 14:05:50 +08:00
|
|
|
define <8 x i32> @test_masked_z_2xi32_to_8xi32_mask2(<8 x i32> %vec, <8 x i32> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_z_2xi32_to_8xi32_mask2:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmd %ymm1, %ymm1, %k1
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti32x2 {{.*#+}} ymm0 {%k1} {z} = xmm0[0,1,0,1,0,1,0,1]
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%shuf = shufflevector <8 x i32> %vec, <8 x i32> undef, <8 x i32> <i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <8 x i32> %mask, zeroinitializer
|
|
|
|
%res = select <8 x i1> %cmp, <8 x i32> %shuf, <8 x i32> zeroinitializer
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <8 x i32> %res
|
|
|
|
}
|
2017-10-15 14:05:50 +08:00
|
|
|
define <8 x i32> @test_masked_2xi32_to_8xi32_mask3(<8 x i32> %vec, <8 x i32> %default, <8 x i32> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_2xi32_to_8xi32_mask3:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmd %ymm2, %ymm2, %k1
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti32x2 {{.*#+}} ymm1 {%k1} = xmm0[0,1,0,1,0,1,0,1]
|
|
|
|
; CHECK-NEXT: vmovdqa %ymm1, %ymm0
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%shuf = shufflevector <8 x i32> %vec, <8 x i32> undef, <8 x i32> <i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <8 x i32> %mask, zeroinitializer
|
|
|
|
%res = select <8 x i1> %cmp, <8 x i32> %shuf, <8 x i32> %default
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <8 x i32> %res
|
|
|
|
}
|
|
|
|
|
2017-10-15 14:05:50 +08:00
|
|
|
define <8 x i32> @test_masked_z_2xi32_to_8xi32_mask3(<8 x i32> %vec, <8 x i32> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_z_2xi32_to_8xi32_mask3:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmd %ymm1, %ymm1, %k1
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti32x2 {{.*#+}} ymm0 {%k1} {z} = xmm0[0,1,0,1,0,1,0,1]
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%shuf = shufflevector <8 x i32> %vec, <8 x i32> undef, <8 x i32> <i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <8 x i32> %mask, zeroinitializer
|
|
|
|
%res = select <8 x i1> %cmp, <8 x i32> %shuf, <8 x i32> zeroinitializer
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <8 x i32> %res
|
|
|
|
}
|
|
|
|
define <16 x i32> @test_2xi32_to_16xi32(<16 x i32> %vec) {
|
|
|
|
; CHECK-LABEL: test_2xi32_to_16xi32:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2017-10-13 14:07:10 +08:00
|
|
|
; CHECK-NEXT: vbroadcastsd %xmm0, %zmm0
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%res = shufflevector <16 x i32> %vec, <16 x i32> undef, <16 x i32> <i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1>
|
|
|
|
ret <16 x i32> %res
|
|
|
|
}
|
2017-10-15 14:05:50 +08:00
|
|
|
define <16 x i32> @test_masked_2xi32_to_16xi32_mask0(<16 x i32> %vec, <16 x i32> %default, <16 x i32> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_2xi32_to_16xi32_mask0:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmd %zmm2, %zmm2, %k1
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti32x2 {{.*#+}} zmm1 {%k1} = xmm0[0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1]
|
|
|
|
; CHECK-NEXT: vmovdqa64 %zmm1, %zmm0
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%shuf = shufflevector <16 x i32> %vec, <16 x i32> undef, <16 x i32> <i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <16 x i32> %mask, zeroinitializer
|
|
|
|
%res = select <16 x i1> %cmp, <16 x i32> %shuf, <16 x i32> %default
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <16 x i32> %res
|
|
|
|
}
|
|
|
|
|
2017-10-15 14:05:50 +08:00
|
|
|
define <16 x i32> @test_masked_z_2xi32_to_16xi32_mask0(<16 x i32> %vec, <16 x i32> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_z_2xi32_to_16xi32_mask0:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmd %zmm1, %zmm1, %k1
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti32x2 {{.*#+}} zmm0 {%k1} {z} = xmm0[0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1]
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%shuf = shufflevector <16 x i32> %vec, <16 x i32> undef, <16 x i32> <i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <16 x i32> %mask, zeroinitializer
|
|
|
|
%res = select <16 x i1> %cmp, <16 x i32> %shuf, <16 x i32> zeroinitializer
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <16 x i32> %res
|
|
|
|
}
|
2017-10-15 14:05:50 +08:00
|
|
|
define <16 x i32> @test_masked_2xi32_to_16xi32_mask1(<16 x i32> %vec, <16 x i32> %default, <16 x i32> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_2xi32_to_16xi32_mask1:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmd %zmm2, %zmm2, %k1
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti32x2 {{.*#+}} zmm1 {%k1} = xmm0[0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1]
|
|
|
|
; CHECK-NEXT: vmovdqa64 %zmm1, %zmm0
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%shuf = shufflevector <16 x i32> %vec, <16 x i32> undef, <16 x i32> <i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <16 x i32> %mask, zeroinitializer
|
|
|
|
%res = select <16 x i1> %cmp, <16 x i32> %shuf, <16 x i32> %default
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <16 x i32> %res
|
|
|
|
}
|
|
|
|
|
2017-10-15 14:05:50 +08:00
|
|
|
define <16 x i32> @test_masked_z_2xi32_to_16xi32_mask1(<16 x i32> %vec, <16 x i32> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_z_2xi32_to_16xi32_mask1:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmd %zmm1, %zmm1, %k1
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti32x2 {{.*#+}} zmm0 {%k1} {z} = xmm0[0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1]
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%shuf = shufflevector <16 x i32> %vec, <16 x i32> undef, <16 x i32> <i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <16 x i32> %mask, zeroinitializer
|
|
|
|
%res = select <16 x i1> %cmp, <16 x i32> %shuf, <16 x i32> zeroinitializer
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <16 x i32> %res
|
|
|
|
}
|
2017-10-15 14:05:50 +08:00
|
|
|
define <16 x i32> @test_masked_2xi32_to_16xi32_mask2(<16 x i32> %vec, <16 x i32> %default, <16 x i32> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_2xi32_to_16xi32_mask2:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmd %zmm2, %zmm2, %k1
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti32x2 {{.*#+}} zmm1 {%k1} = xmm0[0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1]
|
|
|
|
; CHECK-NEXT: vmovdqa64 %zmm1, %zmm0
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%shuf = shufflevector <16 x i32> %vec, <16 x i32> undef, <16 x i32> <i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <16 x i32> %mask, zeroinitializer
|
|
|
|
%res = select <16 x i1> %cmp, <16 x i32> %shuf, <16 x i32> %default
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <16 x i32> %res
|
|
|
|
}
|
|
|
|
|
2017-10-15 14:05:50 +08:00
|
|
|
define <16 x i32> @test_masked_z_2xi32_to_16xi32_mask2(<16 x i32> %vec, <16 x i32> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_z_2xi32_to_16xi32_mask2:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmd %zmm1, %zmm1, %k1
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti32x2 {{.*#+}} zmm0 {%k1} {z} = xmm0[0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1]
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%shuf = shufflevector <16 x i32> %vec, <16 x i32> undef, <16 x i32> <i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <16 x i32> %mask, zeroinitializer
|
|
|
|
%res = select <16 x i1> %cmp, <16 x i32> %shuf, <16 x i32> zeroinitializer
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <16 x i32> %res
|
|
|
|
}
|
2017-10-15 14:05:50 +08:00
|
|
|
define <16 x i32> @test_masked_2xi32_to_16xi32_mask3(<16 x i32> %vec, <16 x i32> %default, <16 x i32> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_2xi32_to_16xi32_mask3:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmd %zmm2, %zmm2, %k1
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti32x2 {{.*#+}} zmm1 {%k1} = xmm0[0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1]
|
|
|
|
; CHECK-NEXT: vmovdqa64 %zmm1, %zmm0
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%shuf = shufflevector <16 x i32> %vec, <16 x i32> undef, <16 x i32> <i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <16 x i32> %mask, zeroinitializer
|
|
|
|
%res = select <16 x i1> %cmp, <16 x i32> %shuf, <16 x i32> %default
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <16 x i32> %res
|
|
|
|
}
|
|
|
|
|
2017-10-15 14:05:50 +08:00
|
|
|
define <16 x i32> @test_masked_z_2xi32_to_16xi32_mask3(<16 x i32> %vec, <16 x i32> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_z_2xi32_to_16xi32_mask3:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmd %zmm1, %zmm1, %k1
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti32x2 {{.*#+}} zmm0 {%k1} {z} = xmm0[0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1]
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%shuf = shufflevector <16 x i32> %vec, <16 x i32> undef, <16 x i32> <i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <16 x i32> %mask, zeroinitializer
|
|
|
|
%res = select <16 x i1> %cmp, <16 x i32> %shuf, <16 x i32> zeroinitializer
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <16 x i32> %res
|
|
|
|
}
|
|
|
|
define <4 x i32> @test_2xi32_to_4xi32_mem(<2 x i32>* %vp) {
|
|
|
|
; CHECK-LABEL: test_2xi32_to_4xi32_mem:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2017-10-16 00:41:17 +08:00
|
|
|
; CHECK-NEXT: vpbroadcastq (%rdi), %xmm0
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <2 x i32>, <2 x i32>* %vp
|
|
|
|
%res = shufflevector <2 x i32> %vec, <2 x i32> undef, <4 x i32> <i32 0, i32 1, i32 0, i32 1>
|
|
|
|
ret <4 x i32> %res
|
|
|
|
}
|
2017-10-15 14:05:50 +08:00
|
|
|
define <4 x i32> @test_masked_2xi32_to_4xi32_mem_mask0(<2 x i32>* %vp, <4 x i32> %default, <4 x i32> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_2xi32_to_4xi32_mem_mask0:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmd %xmm1, %xmm1, %k1
|
2017-10-16 00:41:17 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti32x2 {{.*#+}} xmm0 {%k1} = mem[0,1,0,1]
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <2 x i32>, <2 x i32>* %vp
|
|
|
|
%shuf = shufflevector <2 x i32> %vec, <2 x i32> undef, <4 x i32> <i32 0, i32 1, i32 0, i32 1>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <4 x i32> %mask, zeroinitializer
|
|
|
|
%res = select <4 x i1> %cmp, <4 x i32> %shuf, <4 x i32> %default
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <4 x i32> %res
|
|
|
|
}
|
|
|
|
|
2017-10-15 14:05:50 +08:00
|
|
|
define <4 x i32> @test_masked_z_2xi32_to_4xi32_mem_mask0(<2 x i32>* %vp, <4 x i32> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_z_2xi32_to_4xi32_mem_mask0:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmd %xmm0, %xmm0, %k1
|
2017-10-16 00:41:17 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti32x2 {{.*#+}} xmm0 {%k1} {z} = mem[0,1,0,1]
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <2 x i32>, <2 x i32>* %vp
|
|
|
|
%shuf = shufflevector <2 x i32> %vec, <2 x i32> undef, <4 x i32> <i32 0, i32 1, i32 0, i32 1>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <4 x i32> %mask, zeroinitializer
|
|
|
|
%res = select <4 x i1> %cmp, <4 x i32> %shuf, <4 x i32> zeroinitializer
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <4 x i32> %res
|
|
|
|
}
|
2017-10-15 14:05:50 +08:00
|
|
|
define <4 x i32> @test_masked_2xi32_to_4xi32_mem_mask1(<2 x i32>* %vp, <4 x i32> %default, <4 x i32> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_2xi32_to_4xi32_mem_mask1:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmd %xmm1, %xmm1, %k1
|
2017-10-16 00:41:17 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti32x2 {{.*#+}} xmm0 {%k1} = mem[0,1,0,1]
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <2 x i32>, <2 x i32>* %vp
|
|
|
|
%shuf = shufflevector <2 x i32> %vec, <2 x i32> undef, <4 x i32> <i32 0, i32 1, i32 0, i32 1>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <4 x i32> %mask, zeroinitializer
|
|
|
|
%res = select <4 x i1> %cmp, <4 x i32> %shuf, <4 x i32> %default
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <4 x i32> %res
|
|
|
|
}
|
|
|
|
|
2017-10-15 14:05:50 +08:00
|
|
|
define <4 x i32> @test_masked_z_2xi32_to_4xi32_mem_mask1(<2 x i32>* %vp, <4 x i32> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_z_2xi32_to_4xi32_mem_mask1:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmd %xmm0, %xmm0, %k1
|
2017-10-16 00:41:17 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti32x2 {{.*#+}} xmm0 {%k1} {z} = mem[0,1,0,1]
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <2 x i32>, <2 x i32>* %vp
|
|
|
|
%shuf = shufflevector <2 x i32> %vec, <2 x i32> undef, <4 x i32> <i32 0, i32 1, i32 0, i32 1>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <4 x i32> %mask, zeroinitializer
|
|
|
|
%res = select <4 x i1> %cmp, <4 x i32> %shuf, <4 x i32> zeroinitializer
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <4 x i32> %res
|
|
|
|
}
|
2017-10-15 14:05:50 +08:00
|
|
|
define <4 x i32> @test_masked_2xi32_to_4xi32_mem_mask2(<2 x i32>* %vp, <4 x i32> %default, <4 x i32> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_2xi32_to_4xi32_mem_mask2:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmd %xmm1, %xmm1, %k1
|
2017-10-16 00:41:17 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti32x2 {{.*#+}} xmm0 {%k1} = mem[0,1,0,1]
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <2 x i32>, <2 x i32>* %vp
|
|
|
|
%shuf = shufflevector <2 x i32> %vec, <2 x i32> undef, <4 x i32> <i32 0, i32 1, i32 0, i32 1>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <4 x i32> %mask, zeroinitializer
|
|
|
|
%res = select <4 x i1> %cmp, <4 x i32> %shuf, <4 x i32> %default
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <4 x i32> %res
|
|
|
|
}
|
|
|
|
|
2017-10-15 14:05:50 +08:00
|
|
|
define <4 x i32> @test_masked_z_2xi32_to_4xi32_mem_mask2(<2 x i32>* %vp, <4 x i32> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_z_2xi32_to_4xi32_mem_mask2:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmd %xmm0, %xmm0, %k1
|
2017-10-16 00:41:17 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti32x2 {{.*#+}} xmm0 {%k1} {z} = mem[0,1,0,1]
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <2 x i32>, <2 x i32>* %vp
|
|
|
|
%shuf = shufflevector <2 x i32> %vec, <2 x i32> undef, <4 x i32> <i32 0, i32 1, i32 0, i32 1>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <4 x i32> %mask, zeroinitializer
|
|
|
|
%res = select <4 x i1> %cmp, <4 x i32> %shuf, <4 x i32> zeroinitializer
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <4 x i32> %res
|
|
|
|
}
|
2017-10-15 14:05:50 +08:00
|
|
|
define <4 x i32> @test_masked_2xi32_to_4xi32_mem_mask3(<2 x i32>* %vp, <4 x i32> %default, <4 x i32> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_2xi32_to_4xi32_mem_mask3:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmd %xmm1, %xmm1, %k1
|
2017-10-16 00:41:17 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti32x2 {{.*#+}} xmm0 {%k1} = mem[0,1,0,1]
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <2 x i32>, <2 x i32>* %vp
|
|
|
|
%shuf = shufflevector <2 x i32> %vec, <2 x i32> undef, <4 x i32> <i32 0, i32 1, i32 0, i32 1>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <4 x i32> %mask, zeroinitializer
|
|
|
|
%res = select <4 x i1> %cmp, <4 x i32> %shuf, <4 x i32> %default
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <4 x i32> %res
|
|
|
|
}
|
|
|
|
|
2017-10-15 14:05:50 +08:00
|
|
|
define <4 x i32> @test_masked_z_2xi32_to_4xi32_mem_mask3(<2 x i32>* %vp, <4 x i32> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_z_2xi32_to_4xi32_mem_mask3:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmd %xmm0, %xmm0, %k1
|
2017-10-16 00:41:17 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti32x2 {{.*#+}} xmm0 {%k1} {z} = mem[0,1,0,1]
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <2 x i32>, <2 x i32>* %vp
|
|
|
|
%shuf = shufflevector <2 x i32> %vec, <2 x i32> undef, <4 x i32> <i32 0, i32 1, i32 0, i32 1>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <4 x i32> %mask, zeroinitializer
|
|
|
|
%res = select <4 x i1> %cmp, <4 x i32> %shuf, <4 x i32> zeroinitializer
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <4 x i32> %res
|
|
|
|
}
|
|
|
|
define <8 x i32> @test_2xi32_to_8xi32_mem(<2 x i32>* %vp) {
|
|
|
|
; CHECK-LABEL: test_2xi32_to_8xi32_mem:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 03:48:13 +08:00
|
|
|
; CHECK-NEXT: vbroadcastsd (%rdi), %ymm0
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <2 x i32>, <2 x i32>* %vp
|
|
|
|
%res = shufflevector <2 x i32> %vec, <2 x i32> undef, <8 x i32> <i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1>
|
|
|
|
ret <8 x i32> %res
|
|
|
|
}
|
2017-10-15 14:05:50 +08:00
|
|
|
define <8 x i32> @test_masked_2xi32_to_8xi32_mem_mask0(<2 x i32>* %vp, <8 x i32> %default, <8 x i32> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_2xi32_to_8xi32_mem_mask0:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmd %ymm1, %ymm1, %k1
|
2018-01-28 03:48:13 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti32x2 {{.*#+}} ymm0 {%k1} = mem[0,1,0,1,0,1,0,1]
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <2 x i32>, <2 x i32>* %vp
|
|
|
|
%shuf = shufflevector <2 x i32> %vec, <2 x i32> undef, <8 x i32> <i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <8 x i32> %mask, zeroinitializer
|
|
|
|
%res = select <8 x i1> %cmp, <8 x i32> %shuf, <8 x i32> %default
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <8 x i32> %res
|
|
|
|
}
|
|
|
|
|
2017-10-15 14:05:50 +08:00
|
|
|
define <8 x i32> @test_masked_z_2xi32_to_8xi32_mem_mask0(<2 x i32>* %vp, <8 x i32> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_z_2xi32_to_8xi32_mem_mask0:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmd %ymm0, %ymm0, %k1
|
2018-01-28 03:48:13 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti32x2 {{.*#+}} ymm0 {%k1} {z} = mem[0,1,0,1,0,1,0,1]
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <2 x i32>, <2 x i32>* %vp
|
|
|
|
%shuf = shufflevector <2 x i32> %vec, <2 x i32> undef, <8 x i32> <i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <8 x i32> %mask, zeroinitializer
|
|
|
|
%res = select <8 x i1> %cmp, <8 x i32> %shuf, <8 x i32> zeroinitializer
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <8 x i32> %res
|
|
|
|
}
|
2017-10-15 14:05:50 +08:00
|
|
|
define <8 x i32> @test_masked_2xi32_to_8xi32_mem_mask1(<2 x i32>* %vp, <8 x i32> %default, <8 x i32> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_2xi32_to_8xi32_mem_mask1:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmd %ymm1, %ymm1, %k1
|
2018-01-28 03:48:13 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti32x2 {{.*#+}} ymm0 {%k1} = mem[0,1,0,1,0,1,0,1]
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <2 x i32>, <2 x i32>* %vp
|
|
|
|
%shuf = shufflevector <2 x i32> %vec, <2 x i32> undef, <8 x i32> <i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <8 x i32> %mask, zeroinitializer
|
|
|
|
%res = select <8 x i1> %cmp, <8 x i32> %shuf, <8 x i32> %default
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <8 x i32> %res
|
|
|
|
}
|
|
|
|
|
2017-10-15 14:05:50 +08:00
|
|
|
define <8 x i32> @test_masked_z_2xi32_to_8xi32_mem_mask1(<2 x i32>* %vp, <8 x i32> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_z_2xi32_to_8xi32_mem_mask1:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmd %ymm0, %ymm0, %k1
|
2018-01-28 03:48:13 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti32x2 {{.*#+}} ymm0 {%k1} {z} = mem[0,1,0,1,0,1,0,1]
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <2 x i32>, <2 x i32>* %vp
|
|
|
|
%shuf = shufflevector <2 x i32> %vec, <2 x i32> undef, <8 x i32> <i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <8 x i32> %mask, zeroinitializer
|
|
|
|
%res = select <8 x i1> %cmp, <8 x i32> %shuf, <8 x i32> zeroinitializer
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <8 x i32> %res
|
|
|
|
}
|
2017-10-15 14:05:50 +08:00
|
|
|
define <8 x i32> @test_masked_2xi32_to_8xi32_mem_mask2(<2 x i32>* %vp, <8 x i32> %default, <8 x i32> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_2xi32_to_8xi32_mem_mask2:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmd %ymm1, %ymm1, %k1
|
2018-01-28 03:48:13 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti32x2 {{.*#+}} ymm0 {%k1} = mem[0,1,0,1,0,1,0,1]
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <2 x i32>, <2 x i32>* %vp
|
|
|
|
%shuf = shufflevector <2 x i32> %vec, <2 x i32> undef, <8 x i32> <i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <8 x i32> %mask, zeroinitializer
|
|
|
|
%res = select <8 x i1> %cmp, <8 x i32> %shuf, <8 x i32> %default
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <8 x i32> %res
|
|
|
|
}
|
|
|
|
|
2017-10-15 14:05:50 +08:00
|
|
|
define <8 x i32> @test_masked_z_2xi32_to_8xi32_mem_mask2(<2 x i32>* %vp, <8 x i32> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_z_2xi32_to_8xi32_mem_mask2:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmd %ymm0, %ymm0, %k1
|
2018-01-28 03:48:13 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti32x2 {{.*#+}} ymm0 {%k1} {z} = mem[0,1,0,1,0,1,0,1]
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <2 x i32>, <2 x i32>* %vp
|
|
|
|
%shuf = shufflevector <2 x i32> %vec, <2 x i32> undef, <8 x i32> <i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <8 x i32> %mask, zeroinitializer
|
|
|
|
%res = select <8 x i1> %cmp, <8 x i32> %shuf, <8 x i32> zeroinitializer
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <8 x i32> %res
|
|
|
|
}
|
2017-10-15 14:05:50 +08:00
|
|
|
define <8 x i32> @test_masked_2xi32_to_8xi32_mem_mask3(<2 x i32>* %vp, <8 x i32> %default, <8 x i32> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_2xi32_to_8xi32_mem_mask3:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmd %ymm1, %ymm1, %k1
|
2018-01-28 03:48:13 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti32x2 {{.*#+}} ymm0 {%k1} = mem[0,1,0,1,0,1,0,1]
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <2 x i32>, <2 x i32>* %vp
|
|
|
|
%shuf = shufflevector <2 x i32> %vec, <2 x i32> undef, <8 x i32> <i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <8 x i32> %mask, zeroinitializer
|
|
|
|
%res = select <8 x i1> %cmp, <8 x i32> %shuf, <8 x i32> %default
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <8 x i32> %res
|
|
|
|
}
|
|
|
|
|
2017-10-15 14:05:50 +08:00
|
|
|
define <8 x i32> @test_masked_z_2xi32_to_8xi32_mem_mask3(<2 x i32>* %vp, <8 x i32> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_z_2xi32_to_8xi32_mem_mask3:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmd %ymm0, %ymm0, %k1
|
2018-01-28 03:48:13 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti32x2 {{.*#+}} ymm0 {%k1} {z} = mem[0,1,0,1,0,1,0,1]
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <2 x i32>, <2 x i32>* %vp
|
|
|
|
%shuf = shufflevector <2 x i32> %vec, <2 x i32> undef, <8 x i32> <i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <8 x i32> %mask, zeroinitializer
|
|
|
|
%res = select <8 x i1> %cmp, <8 x i32> %shuf, <8 x i32> zeroinitializer
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <8 x i32> %res
|
|
|
|
}
|
|
|
|
define <16 x i32> @test_2xi32_to_16xi32_mem(<2 x i32>* %vp) {
|
|
|
|
; CHECK-LABEL: test_2xi32_to_16xi32_mem:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vpmovzxdq {{.*#+}} xmm0 = mem[0],zero,mem[1],zero
|
2018-01-18 15:44:06 +08:00
|
|
|
; CHECK-NEXT: vmovdqa64 {{.*#+}} zmm1 = [0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2]
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vpermd %zmm0, %zmm1, %zmm0
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <2 x i32>, <2 x i32>* %vp
|
|
|
|
%res = shufflevector <2 x i32> %vec, <2 x i32> undef, <16 x i32> <i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1>
|
|
|
|
ret <16 x i32> %res
|
|
|
|
}
|
2017-10-15 14:05:50 +08:00
|
|
|
define <16 x i32> @test_masked_2xi32_to_16xi32_mem_mask0(<2 x i32>* %vp, <16 x i32> %default, <16 x i32> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_2xi32_to_16xi32_mem_mask0:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2017-10-15 14:05:50 +08:00
|
|
|
; CHECK-NEXT: vpmovzxdq {{.*#+}} xmm2 = mem[0],zero,mem[1],zero
|
2018-01-18 15:44:06 +08:00
|
|
|
; CHECK-NEXT: vmovdqa64 {{.*#+}} zmm3 = [0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2]
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmd %zmm1, %zmm1, %k1
|
2017-10-15 14:05:50 +08:00
|
|
|
; CHECK-NEXT: vpermd %zmm2, %zmm3, %zmm0 {%k1}
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <2 x i32>, <2 x i32>* %vp
|
|
|
|
%shuf = shufflevector <2 x i32> %vec, <2 x i32> undef, <16 x i32> <i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <16 x i32> %mask, zeroinitializer
|
|
|
|
%res = select <16 x i1> %cmp, <16 x i32> %shuf, <16 x i32> %default
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <16 x i32> %res
|
|
|
|
}
|
|
|
|
|
2017-10-15 14:05:50 +08:00
|
|
|
define <16 x i32> @test_masked_z_2xi32_to_16xi32_mem_mask0(<2 x i32>* %vp, <16 x i32> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_z_2xi32_to_16xi32_mem_mask0:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2017-10-15 14:05:50 +08:00
|
|
|
; CHECK-NEXT: vpmovzxdq {{.*#+}} xmm1 = mem[0],zero,mem[1],zero
|
2018-01-18 15:44:06 +08:00
|
|
|
; CHECK-NEXT: vmovdqa64 {{.*#+}} zmm2 = [0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2]
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmd %zmm0, %zmm0, %k1
|
2017-10-15 14:05:50 +08:00
|
|
|
; CHECK-NEXT: vpermd %zmm1, %zmm2, %zmm0 {%k1} {z}
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <2 x i32>, <2 x i32>* %vp
|
|
|
|
%shuf = shufflevector <2 x i32> %vec, <2 x i32> undef, <16 x i32> <i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <16 x i32> %mask, zeroinitializer
|
|
|
|
%res = select <16 x i1> %cmp, <16 x i32> %shuf, <16 x i32> zeroinitializer
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <16 x i32> %res
|
|
|
|
}
|
2017-10-15 14:05:50 +08:00
|
|
|
define <16 x i32> @test_masked_2xi32_to_16xi32_mem_mask1(<2 x i32>* %vp, <16 x i32> %default, <16 x i32> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_2xi32_to_16xi32_mem_mask1:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2017-10-15 14:05:50 +08:00
|
|
|
; CHECK-NEXT: vpmovzxdq {{.*#+}} xmm2 = mem[0],zero,mem[1],zero
|
2018-01-18 15:44:06 +08:00
|
|
|
; CHECK-NEXT: vmovdqa64 {{.*#+}} zmm3 = [0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2]
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmd %zmm1, %zmm1, %k1
|
2017-10-15 14:05:50 +08:00
|
|
|
; CHECK-NEXT: vpermd %zmm2, %zmm3, %zmm0 {%k1}
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <2 x i32>, <2 x i32>* %vp
|
|
|
|
%shuf = shufflevector <2 x i32> %vec, <2 x i32> undef, <16 x i32> <i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <16 x i32> %mask, zeroinitializer
|
|
|
|
%res = select <16 x i1> %cmp, <16 x i32> %shuf, <16 x i32> %default
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <16 x i32> %res
|
|
|
|
}
|
|
|
|
|
2017-10-15 14:05:50 +08:00
|
|
|
define <16 x i32> @test_masked_z_2xi32_to_16xi32_mem_mask1(<2 x i32>* %vp, <16 x i32> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_z_2xi32_to_16xi32_mem_mask1:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2017-10-15 14:05:50 +08:00
|
|
|
; CHECK-NEXT: vpmovzxdq {{.*#+}} xmm1 = mem[0],zero,mem[1],zero
|
2018-01-18 15:44:06 +08:00
|
|
|
; CHECK-NEXT: vmovdqa64 {{.*#+}} zmm2 = [0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2]
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmd %zmm0, %zmm0, %k1
|
2017-10-15 14:05:50 +08:00
|
|
|
; CHECK-NEXT: vpermd %zmm1, %zmm2, %zmm0 {%k1} {z}
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <2 x i32>, <2 x i32>* %vp
|
|
|
|
%shuf = shufflevector <2 x i32> %vec, <2 x i32> undef, <16 x i32> <i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <16 x i32> %mask, zeroinitializer
|
|
|
|
%res = select <16 x i1> %cmp, <16 x i32> %shuf, <16 x i32> zeroinitializer
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <16 x i32> %res
|
|
|
|
}
|
2017-10-15 14:05:50 +08:00
|
|
|
define <16 x i32> @test_masked_2xi32_to_16xi32_mem_mask2(<2 x i32>* %vp, <16 x i32> %default, <16 x i32> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_2xi32_to_16xi32_mem_mask2:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2017-10-15 14:05:50 +08:00
|
|
|
; CHECK-NEXT: vpmovzxdq {{.*#+}} xmm2 = mem[0],zero,mem[1],zero
|
2018-01-18 15:44:06 +08:00
|
|
|
; CHECK-NEXT: vmovdqa64 {{.*#+}} zmm3 = [0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2]
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmd %zmm1, %zmm1, %k1
|
2017-10-15 14:05:50 +08:00
|
|
|
; CHECK-NEXT: vpermd %zmm2, %zmm3, %zmm0 {%k1}
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <2 x i32>, <2 x i32>* %vp
|
|
|
|
%shuf = shufflevector <2 x i32> %vec, <2 x i32> undef, <16 x i32> <i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <16 x i32> %mask, zeroinitializer
|
|
|
|
%res = select <16 x i1> %cmp, <16 x i32> %shuf, <16 x i32> %default
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <16 x i32> %res
|
|
|
|
}
|
|
|
|
|
2017-10-15 14:05:50 +08:00
|
|
|
define <16 x i32> @test_masked_z_2xi32_to_16xi32_mem_mask2(<2 x i32>* %vp, <16 x i32> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_z_2xi32_to_16xi32_mem_mask2:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2017-10-15 14:05:50 +08:00
|
|
|
; CHECK-NEXT: vpmovzxdq {{.*#+}} xmm1 = mem[0],zero,mem[1],zero
|
2018-01-18 15:44:06 +08:00
|
|
|
; CHECK-NEXT: vmovdqa64 {{.*#+}} zmm2 = [0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2]
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmd %zmm0, %zmm0, %k1
|
2017-10-15 14:05:50 +08:00
|
|
|
; CHECK-NEXT: vpermd %zmm1, %zmm2, %zmm0 {%k1} {z}
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <2 x i32>, <2 x i32>* %vp
|
|
|
|
%shuf = shufflevector <2 x i32> %vec, <2 x i32> undef, <16 x i32> <i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <16 x i32> %mask, zeroinitializer
|
|
|
|
%res = select <16 x i1> %cmp, <16 x i32> %shuf, <16 x i32> zeroinitializer
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <16 x i32> %res
|
|
|
|
}
|
2017-10-15 14:05:50 +08:00
|
|
|
define <16 x i32> @test_masked_2xi32_to_16xi32_mem_mask3(<2 x i32>* %vp, <16 x i32> %default, <16 x i32> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_2xi32_to_16xi32_mem_mask3:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2017-10-15 14:05:50 +08:00
|
|
|
; CHECK-NEXT: vpmovzxdq {{.*#+}} xmm2 = mem[0],zero,mem[1],zero
|
2018-01-18 15:44:06 +08:00
|
|
|
; CHECK-NEXT: vmovdqa64 {{.*#+}} zmm3 = [0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2]
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmd %zmm1, %zmm1, %k1
|
2017-10-15 14:05:50 +08:00
|
|
|
; CHECK-NEXT: vpermd %zmm2, %zmm3, %zmm0 {%k1}
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <2 x i32>, <2 x i32>* %vp
|
|
|
|
%shuf = shufflevector <2 x i32> %vec, <2 x i32> undef, <16 x i32> <i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <16 x i32> %mask, zeroinitializer
|
|
|
|
%res = select <16 x i1> %cmp, <16 x i32> %shuf, <16 x i32> %default
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <16 x i32> %res
|
|
|
|
}
|
|
|
|
|
2017-10-15 14:05:50 +08:00
|
|
|
define <16 x i32> @test_masked_z_2xi32_to_16xi32_mem_mask3(<2 x i32>* %vp, <16 x i32> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_z_2xi32_to_16xi32_mem_mask3:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2017-10-15 14:05:50 +08:00
|
|
|
; CHECK-NEXT: vpmovzxdq {{.*#+}} xmm1 = mem[0],zero,mem[1],zero
|
2018-01-18 15:44:06 +08:00
|
|
|
; CHECK-NEXT: vmovdqa64 {{.*#+}} zmm2 = [0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2]
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmd %zmm0, %zmm0, %k1
|
2017-10-15 14:05:50 +08:00
|
|
|
; CHECK-NEXT: vpermd %zmm1, %zmm2, %zmm0 {%k1} {z}
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <2 x i32>, <2 x i32>* %vp
|
|
|
|
%shuf = shufflevector <2 x i32> %vec, <2 x i32> undef, <16 x i32> <i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <16 x i32> %mask, zeroinitializer
|
|
|
|
%res = select <16 x i1> %cmp, <16 x i32> %shuf, <16 x i32> zeroinitializer
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <16 x i32> %res
|
|
|
|
}
|
|
|
|
define <8 x i32> @test_4xi32_to_8xi32_mem(<4 x i32>* %vp) {
|
|
|
|
; CHECK-LABEL: test_4xi32_to_8xi32_mem:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti128 {{.*#+}} ymm0 = mem[0,1,0,1]
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <4 x i32>, <4 x i32>* %vp
|
|
|
|
%res = shufflevector <4 x i32> %vec, <4 x i32> undef, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 0, i32 1, i32 2, i32 3>
|
|
|
|
ret <8 x i32> %res
|
|
|
|
}
|
2017-10-15 14:05:50 +08:00
|
|
|
define <8 x i32> @test_masked_4xi32_to_8xi32_mem_mask0(<4 x i32>* %vp, <8 x i32> %default, <8 x i32> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_4xi32_to_8xi32_mem_mask0:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmd %ymm1, %ymm1, %k1
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti32x4 {{.*#+}} ymm0 {%k1} = mem[0,1,2,3,0,1,2,3]
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <4 x i32>, <4 x i32>* %vp
|
|
|
|
%shuf = shufflevector <4 x i32> %vec, <4 x i32> undef, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 0, i32 1, i32 2, i32 3>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <8 x i32> %mask, zeroinitializer
|
|
|
|
%res = select <8 x i1> %cmp, <8 x i32> %shuf, <8 x i32> %default
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <8 x i32> %res
|
|
|
|
}
|
|
|
|
|
2017-10-15 14:05:50 +08:00
|
|
|
define <8 x i32> @test_masked_z_4xi32_to_8xi32_mem_mask0(<4 x i32>* %vp, <8 x i32> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_z_4xi32_to_8xi32_mem_mask0:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmd %ymm0, %ymm0, %k1
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti32x4 {{.*#+}} ymm0 {%k1} {z} = mem[0,1,2,3,0,1,2,3]
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <4 x i32>, <4 x i32>* %vp
|
|
|
|
%shuf = shufflevector <4 x i32> %vec, <4 x i32> undef, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 0, i32 1, i32 2, i32 3>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <8 x i32> %mask, zeroinitializer
|
|
|
|
%res = select <8 x i1> %cmp, <8 x i32> %shuf, <8 x i32> zeroinitializer
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <8 x i32> %res
|
|
|
|
}
|
2017-10-15 14:05:50 +08:00
|
|
|
define <8 x i32> @test_masked_4xi32_to_8xi32_mem_mask1(<4 x i32>* %vp, <8 x i32> %default, <8 x i32> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_4xi32_to_8xi32_mem_mask1:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmd %ymm1, %ymm1, %k1
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti32x4 {{.*#+}} ymm0 {%k1} = mem[0,1,2,3,0,1,2,3]
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <4 x i32>, <4 x i32>* %vp
|
|
|
|
%shuf = shufflevector <4 x i32> %vec, <4 x i32> undef, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 0, i32 1, i32 2, i32 3>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <8 x i32> %mask, zeroinitializer
|
|
|
|
%res = select <8 x i1> %cmp, <8 x i32> %shuf, <8 x i32> %default
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <8 x i32> %res
|
|
|
|
}
|
|
|
|
|
2017-10-15 14:05:50 +08:00
|
|
|
define <8 x i32> @test_masked_z_4xi32_to_8xi32_mem_mask1(<4 x i32>* %vp, <8 x i32> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_z_4xi32_to_8xi32_mem_mask1:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmd %ymm0, %ymm0, %k1
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti32x4 {{.*#+}} ymm0 {%k1} {z} = mem[0,1,2,3,0,1,2,3]
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <4 x i32>, <4 x i32>* %vp
|
|
|
|
%shuf = shufflevector <4 x i32> %vec, <4 x i32> undef, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 0, i32 1, i32 2, i32 3>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <8 x i32> %mask, zeroinitializer
|
|
|
|
%res = select <8 x i1> %cmp, <8 x i32> %shuf, <8 x i32> zeroinitializer
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <8 x i32> %res
|
|
|
|
}
|
2017-10-15 14:05:50 +08:00
|
|
|
define <8 x i32> @test_masked_4xi32_to_8xi32_mem_mask2(<4 x i32>* %vp, <8 x i32> %default, <8 x i32> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_4xi32_to_8xi32_mem_mask2:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmd %ymm1, %ymm1, %k1
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti32x4 {{.*#+}} ymm0 {%k1} = mem[0,1,2,3,0,1,2,3]
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <4 x i32>, <4 x i32>* %vp
|
|
|
|
%shuf = shufflevector <4 x i32> %vec, <4 x i32> undef, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 0, i32 1, i32 2, i32 3>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <8 x i32> %mask, zeroinitializer
|
|
|
|
%res = select <8 x i1> %cmp, <8 x i32> %shuf, <8 x i32> %default
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <8 x i32> %res
|
|
|
|
}
|
|
|
|
|
2017-10-15 14:05:50 +08:00
|
|
|
define <8 x i32> @test_masked_z_4xi32_to_8xi32_mem_mask2(<4 x i32>* %vp, <8 x i32> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_z_4xi32_to_8xi32_mem_mask2:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmd %ymm0, %ymm0, %k1
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti32x4 {{.*#+}} ymm0 {%k1} {z} = mem[0,1,2,3,0,1,2,3]
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <4 x i32>, <4 x i32>* %vp
|
|
|
|
%shuf = shufflevector <4 x i32> %vec, <4 x i32> undef, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 0, i32 1, i32 2, i32 3>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <8 x i32> %mask, zeroinitializer
|
|
|
|
%res = select <8 x i1> %cmp, <8 x i32> %shuf, <8 x i32> zeroinitializer
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <8 x i32> %res
|
|
|
|
}
|
2017-10-15 14:05:50 +08:00
|
|
|
define <8 x i32> @test_masked_4xi32_to_8xi32_mem_mask3(<4 x i32>* %vp, <8 x i32> %default, <8 x i32> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_4xi32_to_8xi32_mem_mask3:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmd %ymm1, %ymm1, %k1
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti32x4 {{.*#+}} ymm0 {%k1} = mem[0,1,2,3,0,1,2,3]
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <4 x i32>, <4 x i32>* %vp
|
|
|
|
%shuf = shufflevector <4 x i32> %vec, <4 x i32> undef, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 0, i32 1, i32 2, i32 3>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <8 x i32> %mask, zeroinitializer
|
|
|
|
%res = select <8 x i1> %cmp, <8 x i32> %shuf, <8 x i32> %default
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <8 x i32> %res
|
|
|
|
}
|
|
|
|
|
2017-10-15 14:05:50 +08:00
|
|
|
define <8 x i32> @test_masked_z_4xi32_to_8xi32_mem_mask3(<4 x i32>* %vp, <8 x i32> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_z_4xi32_to_8xi32_mem_mask3:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmd %ymm0, %ymm0, %k1
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti32x4 {{.*#+}} ymm0 {%k1} {z} = mem[0,1,2,3,0,1,2,3]
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <4 x i32>, <4 x i32>* %vp
|
|
|
|
%shuf = shufflevector <4 x i32> %vec, <4 x i32> undef, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 0, i32 1, i32 2, i32 3>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <8 x i32> %mask, zeroinitializer
|
|
|
|
%res = select <8 x i1> %cmp, <8 x i32> %shuf, <8 x i32> zeroinitializer
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <8 x i32> %res
|
|
|
|
}
|
|
|
|
define <16 x i32> @test_4xi32_to_16xi32_mem(<4 x i32>* %vp) {
|
|
|
|
; CHECK-LABEL: test_4xi32_to_16xi32_mem:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti32x4 {{.*#+}} zmm0 = mem[0,1,2,3,0,1,2,3,0,1,2,3,0,1,2,3]
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <4 x i32>, <4 x i32>* %vp
|
|
|
|
%res = shufflevector <4 x i32> %vec, <4 x i32> undef, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 0, i32 1, i32 2, i32 3, i32 0, i32 1, i32 2, i32 3, i32 0, i32 1, i32 2, i32 3>
|
|
|
|
ret <16 x i32> %res
|
|
|
|
}
|
2017-10-15 14:05:50 +08:00
|
|
|
define <16 x i32> @test_masked_4xi32_to_16xi32_mem_mask0(<4 x i32>* %vp, <16 x i32> %default, <16 x i32> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_4xi32_to_16xi32_mem_mask0:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmd %zmm1, %zmm1, %k1
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti32x4 {{.*#+}} zmm0 {%k1} = mem[0,1,2,3,0,1,2,3,0,1,2,3,0,1,2,3]
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <4 x i32>, <4 x i32>* %vp
|
|
|
|
%shuf = shufflevector <4 x i32> %vec, <4 x i32> undef, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 0, i32 1, i32 2, i32 3, i32 0, i32 1, i32 2, i32 3, i32 0, i32 1, i32 2, i32 3>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <16 x i32> %mask, zeroinitializer
|
|
|
|
%res = select <16 x i1> %cmp, <16 x i32> %shuf, <16 x i32> %default
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <16 x i32> %res
|
|
|
|
}
|
|
|
|
|
2017-10-15 14:05:50 +08:00
|
|
|
define <16 x i32> @test_masked_z_4xi32_to_16xi32_mem_mask0(<4 x i32>* %vp, <16 x i32> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_z_4xi32_to_16xi32_mem_mask0:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmd %zmm0, %zmm0, %k1
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti32x4 {{.*#+}} zmm0 {%k1} {z} = mem[0,1,2,3,0,1,2,3,0,1,2,3,0,1,2,3]
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <4 x i32>, <4 x i32>* %vp
|
|
|
|
%shuf = shufflevector <4 x i32> %vec, <4 x i32> undef, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 0, i32 1, i32 2, i32 3, i32 0, i32 1, i32 2, i32 3, i32 0, i32 1, i32 2, i32 3>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <16 x i32> %mask, zeroinitializer
|
|
|
|
%res = select <16 x i1> %cmp, <16 x i32> %shuf, <16 x i32> zeroinitializer
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <16 x i32> %res
|
|
|
|
}
|
2017-10-15 14:05:50 +08:00
|
|
|
define <16 x i32> @test_masked_4xi32_to_16xi32_mem_mask1(<4 x i32>* %vp, <16 x i32> %default, <16 x i32> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_4xi32_to_16xi32_mem_mask1:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmd %zmm1, %zmm1, %k1
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti32x4 {{.*#+}} zmm0 {%k1} = mem[0,1,2,3,0,1,2,3,0,1,2,3,0,1,2,3]
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <4 x i32>, <4 x i32>* %vp
|
|
|
|
%shuf = shufflevector <4 x i32> %vec, <4 x i32> undef, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 0, i32 1, i32 2, i32 3, i32 0, i32 1, i32 2, i32 3, i32 0, i32 1, i32 2, i32 3>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <16 x i32> %mask, zeroinitializer
|
|
|
|
%res = select <16 x i1> %cmp, <16 x i32> %shuf, <16 x i32> %default
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <16 x i32> %res
|
|
|
|
}
|
|
|
|
|
2017-10-15 14:05:50 +08:00
|
|
|
define <16 x i32> @test_masked_z_4xi32_to_16xi32_mem_mask1(<4 x i32>* %vp, <16 x i32> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_z_4xi32_to_16xi32_mem_mask1:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmd %zmm0, %zmm0, %k1
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti32x4 {{.*#+}} zmm0 {%k1} {z} = mem[0,1,2,3,0,1,2,3,0,1,2,3,0,1,2,3]
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <4 x i32>, <4 x i32>* %vp
|
|
|
|
%shuf = shufflevector <4 x i32> %vec, <4 x i32> undef, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 0, i32 1, i32 2, i32 3, i32 0, i32 1, i32 2, i32 3, i32 0, i32 1, i32 2, i32 3>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <16 x i32> %mask, zeroinitializer
|
|
|
|
%res = select <16 x i1> %cmp, <16 x i32> %shuf, <16 x i32> zeroinitializer
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <16 x i32> %res
|
|
|
|
}
|
2017-10-15 14:05:50 +08:00
|
|
|
define <16 x i32> @test_masked_4xi32_to_16xi32_mem_mask2(<4 x i32>* %vp, <16 x i32> %default, <16 x i32> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_4xi32_to_16xi32_mem_mask2:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmd %zmm1, %zmm1, %k1
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti32x4 {{.*#+}} zmm0 {%k1} = mem[0,1,2,3,0,1,2,3,0,1,2,3,0,1,2,3]
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <4 x i32>, <4 x i32>* %vp
|
|
|
|
%shuf = shufflevector <4 x i32> %vec, <4 x i32> undef, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 0, i32 1, i32 2, i32 3, i32 0, i32 1, i32 2, i32 3, i32 0, i32 1, i32 2, i32 3>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <16 x i32> %mask, zeroinitializer
|
|
|
|
%res = select <16 x i1> %cmp, <16 x i32> %shuf, <16 x i32> %default
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <16 x i32> %res
|
|
|
|
}
|
|
|
|
|
2017-10-15 14:05:50 +08:00
|
|
|
define <16 x i32> @test_masked_z_4xi32_to_16xi32_mem_mask2(<4 x i32>* %vp, <16 x i32> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_z_4xi32_to_16xi32_mem_mask2:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmd %zmm0, %zmm0, %k1
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti32x4 {{.*#+}} zmm0 {%k1} {z} = mem[0,1,2,3,0,1,2,3,0,1,2,3,0,1,2,3]
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <4 x i32>, <4 x i32>* %vp
|
|
|
|
%shuf = shufflevector <4 x i32> %vec, <4 x i32> undef, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 0, i32 1, i32 2, i32 3, i32 0, i32 1, i32 2, i32 3, i32 0, i32 1, i32 2, i32 3>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <16 x i32> %mask, zeroinitializer
|
|
|
|
%res = select <16 x i1> %cmp, <16 x i32> %shuf, <16 x i32> zeroinitializer
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <16 x i32> %res
|
|
|
|
}
|
2017-10-15 14:05:50 +08:00
|
|
|
define <16 x i32> @test_masked_4xi32_to_16xi32_mem_mask3(<4 x i32>* %vp, <16 x i32> %default, <16 x i32> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_4xi32_to_16xi32_mem_mask3:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmd %zmm1, %zmm1, %k1
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti32x4 {{.*#+}} zmm0 {%k1} = mem[0,1,2,3,0,1,2,3,0,1,2,3,0,1,2,3]
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <4 x i32>, <4 x i32>* %vp
|
|
|
|
%shuf = shufflevector <4 x i32> %vec, <4 x i32> undef, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 0, i32 1, i32 2, i32 3, i32 0, i32 1, i32 2, i32 3, i32 0, i32 1, i32 2, i32 3>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <16 x i32> %mask, zeroinitializer
|
|
|
|
%res = select <16 x i1> %cmp, <16 x i32> %shuf, <16 x i32> %default
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <16 x i32> %res
|
|
|
|
}
|
|
|
|
|
2017-10-15 14:05:50 +08:00
|
|
|
define <16 x i32> @test_masked_z_4xi32_to_16xi32_mem_mask3(<4 x i32>* %vp, <16 x i32> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_z_4xi32_to_16xi32_mem_mask3:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmd %zmm0, %zmm0, %k1
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti32x4 {{.*#+}} zmm0 {%k1} {z} = mem[0,1,2,3,0,1,2,3,0,1,2,3,0,1,2,3]
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <4 x i32>, <4 x i32>* %vp
|
|
|
|
%shuf = shufflevector <4 x i32> %vec, <4 x i32> undef, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 0, i32 1, i32 2, i32 3, i32 0, i32 1, i32 2, i32 3, i32 0, i32 1, i32 2, i32 3>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <16 x i32> %mask, zeroinitializer
|
|
|
|
%res = select <16 x i1> %cmp, <16 x i32> %shuf, <16 x i32> zeroinitializer
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <16 x i32> %res
|
|
|
|
}
|
|
|
|
define <4 x i64> @test_2xi64_to_4xi64_mem(<2 x i64>* %vp) {
|
|
|
|
; CHECK-LABEL: test_2xi64_to_4xi64_mem:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti128 {{.*#+}} ymm0 = mem[0,1,0,1]
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <2 x i64>, <2 x i64>* %vp
|
|
|
|
%res = shufflevector <2 x i64> %vec, <2 x i64> undef, <4 x i32> <i32 0, i32 1, i32 0, i32 1>
|
|
|
|
ret <4 x i64> %res
|
|
|
|
}
|
2017-10-15 14:05:50 +08:00
|
|
|
define <4 x i64> @test_masked_2xi64_to_4xi64_mem_mask0(<2 x i64>* %vp, <4 x i64> %default, <4 x i64> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_2xi64_to_4xi64_mem_mask0:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmq %ymm1, %ymm1, %k1
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti64x2 {{.*#+}} ymm0 {%k1} = mem[0,1,0,1]
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <2 x i64>, <2 x i64>* %vp
|
|
|
|
%shuf = shufflevector <2 x i64> %vec, <2 x i64> undef, <4 x i32> <i32 0, i32 1, i32 0, i32 1>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <4 x i64> %mask, zeroinitializer
|
|
|
|
%res = select <4 x i1> %cmp, <4 x i64> %shuf, <4 x i64> %default
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <4 x i64> %res
|
|
|
|
}
|
|
|
|
|
2017-10-15 14:05:50 +08:00
|
|
|
define <4 x i64> @test_masked_z_2xi64_to_4xi64_mem_mask0(<2 x i64>* %vp, <4 x i64> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_z_2xi64_to_4xi64_mem_mask0:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmq %ymm0, %ymm0, %k1
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti64x2 {{.*#+}} ymm0 {%k1} {z} = mem[0,1,0,1]
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <2 x i64>, <2 x i64>* %vp
|
|
|
|
%shuf = shufflevector <2 x i64> %vec, <2 x i64> undef, <4 x i32> <i32 0, i32 1, i32 0, i32 1>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <4 x i64> %mask, zeroinitializer
|
|
|
|
%res = select <4 x i1> %cmp, <4 x i64> %shuf, <4 x i64> zeroinitializer
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <4 x i64> %res
|
|
|
|
}
|
2017-10-15 14:05:50 +08:00
|
|
|
define <4 x i64> @test_masked_2xi64_to_4xi64_mem_mask1(<2 x i64>* %vp, <4 x i64> %default, <4 x i64> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_2xi64_to_4xi64_mem_mask1:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmq %ymm1, %ymm1, %k1
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti64x2 {{.*#+}} ymm0 {%k1} = mem[0,1,0,1]
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <2 x i64>, <2 x i64>* %vp
|
|
|
|
%shuf = shufflevector <2 x i64> %vec, <2 x i64> undef, <4 x i32> <i32 0, i32 1, i32 0, i32 1>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <4 x i64> %mask, zeroinitializer
|
|
|
|
%res = select <4 x i1> %cmp, <4 x i64> %shuf, <4 x i64> %default
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <4 x i64> %res
|
|
|
|
}
|
|
|
|
|
2017-10-15 14:05:50 +08:00
|
|
|
define <4 x i64> @test_masked_z_2xi64_to_4xi64_mem_mask1(<2 x i64>* %vp, <4 x i64> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_z_2xi64_to_4xi64_mem_mask1:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmq %ymm0, %ymm0, %k1
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti64x2 {{.*#+}} ymm0 {%k1} {z} = mem[0,1,0,1]
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <2 x i64>, <2 x i64>* %vp
|
|
|
|
%shuf = shufflevector <2 x i64> %vec, <2 x i64> undef, <4 x i32> <i32 0, i32 1, i32 0, i32 1>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <4 x i64> %mask, zeroinitializer
|
|
|
|
%res = select <4 x i1> %cmp, <4 x i64> %shuf, <4 x i64> zeroinitializer
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <4 x i64> %res
|
|
|
|
}
|
2017-10-15 14:05:50 +08:00
|
|
|
define <4 x i64> @test_masked_2xi64_to_4xi64_mem_mask2(<2 x i64>* %vp, <4 x i64> %default, <4 x i64> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_2xi64_to_4xi64_mem_mask2:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmq %ymm1, %ymm1, %k1
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti64x2 {{.*#+}} ymm0 {%k1} = mem[0,1,0,1]
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <2 x i64>, <2 x i64>* %vp
|
|
|
|
%shuf = shufflevector <2 x i64> %vec, <2 x i64> undef, <4 x i32> <i32 0, i32 1, i32 0, i32 1>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <4 x i64> %mask, zeroinitializer
|
|
|
|
%res = select <4 x i1> %cmp, <4 x i64> %shuf, <4 x i64> %default
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <4 x i64> %res
|
|
|
|
}
|
|
|
|
|
2017-10-15 14:05:50 +08:00
|
|
|
define <4 x i64> @test_masked_z_2xi64_to_4xi64_mem_mask2(<2 x i64>* %vp, <4 x i64> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_z_2xi64_to_4xi64_mem_mask2:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmq %ymm0, %ymm0, %k1
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti64x2 {{.*#+}} ymm0 {%k1} {z} = mem[0,1,0,1]
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <2 x i64>, <2 x i64>* %vp
|
|
|
|
%shuf = shufflevector <2 x i64> %vec, <2 x i64> undef, <4 x i32> <i32 0, i32 1, i32 0, i32 1>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <4 x i64> %mask, zeroinitializer
|
|
|
|
%res = select <4 x i1> %cmp, <4 x i64> %shuf, <4 x i64> zeroinitializer
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <4 x i64> %res
|
|
|
|
}
|
2017-10-15 14:05:50 +08:00
|
|
|
define <4 x i64> @test_masked_2xi64_to_4xi64_mem_mask3(<2 x i64>* %vp, <4 x i64> %default, <4 x i64> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_2xi64_to_4xi64_mem_mask3:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmq %ymm1, %ymm1, %k1
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti64x2 {{.*#+}} ymm0 {%k1} = mem[0,1,0,1]
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <2 x i64>, <2 x i64>* %vp
|
|
|
|
%shuf = shufflevector <2 x i64> %vec, <2 x i64> undef, <4 x i32> <i32 0, i32 1, i32 0, i32 1>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <4 x i64> %mask, zeroinitializer
|
|
|
|
%res = select <4 x i1> %cmp, <4 x i64> %shuf, <4 x i64> %default
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <4 x i64> %res
|
|
|
|
}
|
|
|
|
|
2017-10-15 14:05:50 +08:00
|
|
|
define <4 x i64> @test_masked_z_2xi64_to_4xi64_mem_mask3(<2 x i64>* %vp, <4 x i64> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_z_2xi64_to_4xi64_mem_mask3:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmq %ymm0, %ymm0, %k1
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti64x2 {{.*#+}} ymm0 {%k1} {z} = mem[0,1,0,1]
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <2 x i64>, <2 x i64>* %vp
|
|
|
|
%shuf = shufflevector <2 x i64> %vec, <2 x i64> undef, <4 x i32> <i32 0, i32 1, i32 0, i32 1>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <4 x i64> %mask, zeroinitializer
|
|
|
|
%res = select <4 x i1> %cmp, <4 x i64> %shuf, <4 x i64> zeroinitializer
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <4 x i64> %res
|
|
|
|
}
|
|
|
|
define <8 x i64> @test_2xi64_to_8xi64_mem(<2 x i64>* %vp) {
|
|
|
|
; CHECK-LABEL: test_2xi64_to_8xi64_mem:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti32x4 {{.*#+}} zmm0 = mem[0,1,2,3,0,1,2,3,0,1,2,3,0,1,2,3]
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <2 x i64>, <2 x i64>* %vp
|
|
|
|
%res = shufflevector <2 x i64> %vec, <2 x i64> undef, <8 x i32> <i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1>
|
|
|
|
ret <8 x i64> %res
|
|
|
|
}
|
2017-10-15 14:05:50 +08:00
|
|
|
define <8 x i64> @test_masked_2xi64_to_8xi64_mem_mask0(<2 x i64>* %vp, <8 x i64> %default, <8 x i64> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_2xi64_to_8xi64_mem_mask0:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmq %zmm1, %zmm1, %k1
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti64x2 {{.*#+}} zmm0 {%k1} = mem[0,1,0,1,0,1,0,1]
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <2 x i64>, <2 x i64>* %vp
|
|
|
|
%shuf = shufflevector <2 x i64> %vec, <2 x i64> undef, <8 x i32> <i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <8 x i64> %mask, zeroinitializer
|
|
|
|
%res = select <8 x i1> %cmp, <8 x i64> %shuf, <8 x i64> %default
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <8 x i64> %res
|
|
|
|
}
|
|
|
|
|
2017-10-15 14:05:50 +08:00
|
|
|
define <8 x i64> @test_masked_z_2xi64_to_8xi64_mem_mask0(<2 x i64>* %vp, <8 x i64> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_z_2xi64_to_8xi64_mem_mask0:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmq %zmm0, %zmm0, %k1
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti64x2 {{.*#+}} zmm0 {%k1} {z} = mem[0,1,0,1,0,1,0,1]
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <2 x i64>, <2 x i64>* %vp
|
|
|
|
%shuf = shufflevector <2 x i64> %vec, <2 x i64> undef, <8 x i32> <i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <8 x i64> %mask, zeroinitializer
|
|
|
|
%res = select <8 x i1> %cmp, <8 x i64> %shuf, <8 x i64> zeroinitializer
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <8 x i64> %res
|
|
|
|
}
|
2017-10-15 14:05:50 +08:00
|
|
|
define <8 x i64> @test_masked_2xi64_to_8xi64_mem_mask1(<2 x i64>* %vp, <8 x i64> %default, <8 x i64> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_2xi64_to_8xi64_mem_mask1:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmq %zmm1, %zmm1, %k1
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti64x2 {{.*#+}} zmm0 {%k1} = mem[0,1,0,1,0,1,0,1]
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <2 x i64>, <2 x i64>* %vp
|
|
|
|
%shuf = shufflevector <2 x i64> %vec, <2 x i64> undef, <8 x i32> <i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <8 x i64> %mask, zeroinitializer
|
|
|
|
%res = select <8 x i1> %cmp, <8 x i64> %shuf, <8 x i64> %default
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <8 x i64> %res
|
|
|
|
}
|
|
|
|
|
2017-10-15 14:05:50 +08:00
|
|
|
define <8 x i64> @test_masked_z_2xi64_to_8xi64_mem_mask1(<2 x i64>* %vp, <8 x i64> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_z_2xi64_to_8xi64_mem_mask1:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmq %zmm0, %zmm0, %k1
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti64x2 {{.*#+}} zmm0 {%k1} {z} = mem[0,1,0,1,0,1,0,1]
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <2 x i64>, <2 x i64>* %vp
|
|
|
|
%shuf = shufflevector <2 x i64> %vec, <2 x i64> undef, <8 x i32> <i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <8 x i64> %mask, zeroinitializer
|
|
|
|
%res = select <8 x i1> %cmp, <8 x i64> %shuf, <8 x i64> zeroinitializer
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <8 x i64> %res
|
|
|
|
}
|
2017-10-15 14:05:50 +08:00
|
|
|
define <8 x i64> @test_masked_2xi64_to_8xi64_mem_mask2(<2 x i64>* %vp, <8 x i64> %default, <8 x i64> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_2xi64_to_8xi64_mem_mask2:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmq %zmm1, %zmm1, %k1
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti64x2 {{.*#+}} zmm0 {%k1} = mem[0,1,0,1,0,1,0,1]
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <2 x i64>, <2 x i64>* %vp
|
|
|
|
%shuf = shufflevector <2 x i64> %vec, <2 x i64> undef, <8 x i32> <i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <8 x i64> %mask, zeroinitializer
|
|
|
|
%res = select <8 x i1> %cmp, <8 x i64> %shuf, <8 x i64> %default
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <8 x i64> %res
|
|
|
|
}
|
|
|
|
|
2017-10-15 14:05:50 +08:00
|
|
|
define <8 x i64> @test_masked_z_2xi64_to_8xi64_mem_mask2(<2 x i64>* %vp, <8 x i64> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_z_2xi64_to_8xi64_mem_mask2:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmq %zmm0, %zmm0, %k1
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti64x2 {{.*#+}} zmm0 {%k1} {z} = mem[0,1,0,1,0,1,0,1]
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <2 x i64>, <2 x i64>* %vp
|
|
|
|
%shuf = shufflevector <2 x i64> %vec, <2 x i64> undef, <8 x i32> <i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <8 x i64> %mask, zeroinitializer
|
|
|
|
%res = select <8 x i1> %cmp, <8 x i64> %shuf, <8 x i64> zeroinitializer
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <8 x i64> %res
|
|
|
|
}
|
2017-10-15 14:05:50 +08:00
|
|
|
define <8 x i64> @test_masked_2xi64_to_8xi64_mem_mask3(<2 x i64>* %vp, <8 x i64> %default, <8 x i64> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_2xi64_to_8xi64_mem_mask3:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmq %zmm1, %zmm1, %k1
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti64x2 {{.*#+}} zmm0 {%k1} = mem[0,1,0,1,0,1,0,1]
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <2 x i64>, <2 x i64>* %vp
|
|
|
|
%shuf = shufflevector <2 x i64> %vec, <2 x i64> undef, <8 x i32> <i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <8 x i64> %mask, zeroinitializer
|
|
|
|
%res = select <8 x i1> %cmp, <8 x i64> %shuf, <8 x i64> %default
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <8 x i64> %res
|
|
|
|
}
|
|
|
|
|
2017-10-15 14:05:50 +08:00
|
|
|
define <8 x i64> @test_masked_z_2xi64_to_8xi64_mem_mask3(<2 x i64>* %vp, <8 x i64> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_z_2xi64_to_8xi64_mem_mask3:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmq %zmm0, %zmm0, %k1
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti64x2 {{.*#+}} zmm0 {%k1} {z} = mem[0,1,0,1,0,1,0,1]
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <2 x i64>, <2 x i64>* %vp
|
|
|
|
%shuf = shufflevector <2 x i64> %vec, <2 x i64> undef, <8 x i32> <i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <8 x i64> %mask, zeroinitializer
|
|
|
|
%res = select <8 x i1> %cmp, <8 x i64> %shuf, <8 x i64> zeroinitializer
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <8 x i64> %res
|
|
|
|
}
|
|
|
|
define <16 x i32> @test_8xi32_to_16xi32_mem(<8 x i32>* %vp) {
|
|
|
|
; CHECK-LABEL: test_8xi32_to_16xi32_mem:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti64x4 {{.*#+}} zmm0 = mem[0,1,2,3,0,1,2,3]
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <8 x i32>, <8 x i32>* %vp
|
|
|
|
%res = shufflevector <8 x i32> %vec, <8 x i32> undef, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
|
|
|
|
ret <16 x i32> %res
|
|
|
|
}
|
2017-10-15 14:05:50 +08:00
|
|
|
define <16 x i32> @test_masked_8xi32_to_16xi32_mem_mask0(<8 x i32>* %vp, <16 x i32> %default, <16 x i32> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_8xi32_to_16xi32_mem_mask0:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmd %zmm1, %zmm1, %k1
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti32x8 {{.*#+}} zmm0 {%k1} = mem[0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7]
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <8 x i32>, <8 x i32>* %vp
|
|
|
|
%shuf = shufflevector <8 x i32> %vec, <8 x i32> undef, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <16 x i32> %mask, zeroinitializer
|
|
|
|
%res = select <16 x i1> %cmp, <16 x i32> %shuf, <16 x i32> %default
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <16 x i32> %res
|
|
|
|
}
|
|
|
|
|
2017-10-15 14:05:50 +08:00
|
|
|
define <16 x i32> @test_masked_z_8xi32_to_16xi32_mem_mask0(<8 x i32>* %vp, <16 x i32> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_z_8xi32_to_16xi32_mem_mask0:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmd %zmm0, %zmm0, %k1
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti32x8 {{.*#+}} zmm0 {%k1} {z} = mem[0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7]
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <8 x i32>, <8 x i32>* %vp
|
|
|
|
%shuf = shufflevector <8 x i32> %vec, <8 x i32> undef, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <16 x i32> %mask, zeroinitializer
|
|
|
|
%res = select <16 x i1> %cmp, <16 x i32> %shuf, <16 x i32> zeroinitializer
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <16 x i32> %res
|
|
|
|
}
|
2017-10-15 14:05:50 +08:00
|
|
|
define <16 x i32> @test_masked_8xi32_to_16xi32_mem_mask1(<8 x i32>* %vp, <16 x i32> %default, <16 x i32> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_8xi32_to_16xi32_mem_mask1:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmd %zmm1, %zmm1, %k1
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti32x8 {{.*#+}} zmm0 {%k1} = mem[0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7]
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <8 x i32>, <8 x i32>* %vp
|
|
|
|
%shuf = shufflevector <8 x i32> %vec, <8 x i32> undef, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <16 x i32> %mask, zeroinitializer
|
|
|
|
%res = select <16 x i1> %cmp, <16 x i32> %shuf, <16 x i32> %default
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <16 x i32> %res
|
|
|
|
}
|
|
|
|
|
2017-10-15 14:05:50 +08:00
|
|
|
define <16 x i32> @test_masked_z_8xi32_to_16xi32_mem_mask1(<8 x i32>* %vp, <16 x i32> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_z_8xi32_to_16xi32_mem_mask1:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmd %zmm0, %zmm0, %k1
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti32x8 {{.*#+}} zmm0 {%k1} {z} = mem[0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7]
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <8 x i32>, <8 x i32>* %vp
|
|
|
|
%shuf = shufflevector <8 x i32> %vec, <8 x i32> undef, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <16 x i32> %mask, zeroinitializer
|
|
|
|
%res = select <16 x i1> %cmp, <16 x i32> %shuf, <16 x i32> zeroinitializer
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <16 x i32> %res
|
|
|
|
}
|
2017-10-15 14:05:50 +08:00
|
|
|
define <16 x i32> @test_masked_8xi32_to_16xi32_mem_mask2(<8 x i32>* %vp, <16 x i32> %default, <16 x i32> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_8xi32_to_16xi32_mem_mask2:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmd %zmm1, %zmm1, %k1
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti32x8 {{.*#+}} zmm0 {%k1} = mem[0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7]
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <8 x i32>, <8 x i32>* %vp
|
|
|
|
%shuf = shufflevector <8 x i32> %vec, <8 x i32> undef, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <16 x i32> %mask, zeroinitializer
|
|
|
|
%res = select <16 x i1> %cmp, <16 x i32> %shuf, <16 x i32> %default
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <16 x i32> %res
|
|
|
|
}
|
|
|
|
|
2017-10-15 14:05:50 +08:00
|
|
|
define <16 x i32> @test_masked_z_8xi32_to_16xi32_mem_mask2(<8 x i32>* %vp, <16 x i32> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_z_8xi32_to_16xi32_mem_mask2:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmd %zmm0, %zmm0, %k1
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti32x8 {{.*#+}} zmm0 {%k1} {z} = mem[0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7]
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <8 x i32>, <8 x i32>* %vp
|
|
|
|
%shuf = shufflevector <8 x i32> %vec, <8 x i32> undef, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <16 x i32> %mask, zeroinitializer
|
|
|
|
%res = select <16 x i1> %cmp, <16 x i32> %shuf, <16 x i32> zeroinitializer
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <16 x i32> %res
|
|
|
|
}
|
2017-10-15 14:05:50 +08:00
|
|
|
define <16 x i32> @test_masked_8xi32_to_16xi32_mem_mask3(<8 x i32>* %vp, <16 x i32> %default, <16 x i32> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_8xi32_to_16xi32_mem_mask3:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmd %zmm1, %zmm1, %k1
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti32x8 {{.*#+}} zmm0 {%k1} = mem[0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7]
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <8 x i32>, <8 x i32>* %vp
|
|
|
|
%shuf = shufflevector <8 x i32> %vec, <8 x i32> undef, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <16 x i32> %mask, zeroinitializer
|
|
|
|
%res = select <16 x i1> %cmp, <16 x i32> %shuf, <16 x i32> %default
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <16 x i32> %res
|
|
|
|
}
|
|
|
|
|
2017-10-15 14:05:50 +08:00
|
|
|
define <16 x i32> @test_masked_z_8xi32_to_16xi32_mem_mask3(<8 x i32>* %vp, <16 x i32> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_z_8xi32_to_16xi32_mem_mask3:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmd %zmm0, %zmm0, %k1
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti32x8 {{.*#+}} zmm0 {%k1} {z} = mem[0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7]
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <8 x i32>, <8 x i32>* %vp
|
|
|
|
%shuf = shufflevector <8 x i32> %vec, <8 x i32> undef, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <16 x i32> %mask, zeroinitializer
|
|
|
|
%res = select <16 x i1> %cmp, <16 x i32> %shuf, <16 x i32> zeroinitializer
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <16 x i32> %res
|
|
|
|
}
|
|
|
|
define <8 x i64> @test_4xi64_to_8xi64_mem(<4 x i64>* %vp) {
|
|
|
|
; CHECK-LABEL: test_4xi64_to_8xi64_mem:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti64x4 {{.*#+}} zmm0 = mem[0,1,2,3,0,1,2,3]
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <4 x i64>, <4 x i64>* %vp
|
|
|
|
%res = shufflevector <4 x i64> %vec, <4 x i64> undef, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 0, i32 1, i32 2, i32 3>
|
|
|
|
ret <8 x i64> %res
|
|
|
|
}
|
2017-10-15 14:05:50 +08:00
|
|
|
define <8 x i64> @test_masked_4xi64_to_8xi64_mem_mask0(<4 x i64>* %vp, <8 x i64> %default, <8 x i64> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_4xi64_to_8xi64_mem_mask0:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmq %zmm1, %zmm1, %k1
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti64x4 {{.*#+}} zmm0 {%k1} = mem[0,1,2,3,0,1,2,3]
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <4 x i64>, <4 x i64>* %vp
|
|
|
|
%shuf = shufflevector <4 x i64> %vec, <4 x i64> undef, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 0, i32 1, i32 2, i32 3>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <8 x i64> %mask, zeroinitializer
|
|
|
|
%res = select <8 x i1> %cmp, <8 x i64> %shuf, <8 x i64> %default
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <8 x i64> %res
|
|
|
|
}
|
|
|
|
|
2017-10-15 14:05:50 +08:00
|
|
|
define <8 x i64> @test_masked_z_4xi64_to_8xi64_mem_mask0(<4 x i64>* %vp, <8 x i64> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_z_4xi64_to_8xi64_mem_mask0:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmq %zmm0, %zmm0, %k1
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti64x4 {{.*#+}} zmm0 {%k1} {z} = mem[0,1,2,3,0,1,2,3]
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <4 x i64>, <4 x i64>* %vp
|
|
|
|
%shuf = shufflevector <4 x i64> %vec, <4 x i64> undef, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 0, i32 1, i32 2, i32 3>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <8 x i64> %mask, zeroinitializer
|
|
|
|
%res = select <8 x i1> %cmp, <8 x i64> %shuf, <8 x i64> zeroinitializer
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <8 x i64> %res
|
|
|
|
}
|
2017-10-15 14:05:50 +08:00
|
|
|
define <8 x i64> @test_masked_4xi64_to_8xi64_mem_mask1(<4 x i64>* %vp, <8 x i64> %default, <8 x i64> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_4xi64_to_8xi64_mem_mask1:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmq %zmm1, %zmm1, %k1
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti64x4 {{.*#+}} zmm0 {%k1} = mem[0,1,2,3,0,1,2,3]
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <4 x i64>, <4 x i64>* %vp
|
|
|
|
%shuf = shufflevector <4 x i64> %vec, <4 x i64> undef, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 0, i32 1, i32 2, i32 3>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <8 x i64> %mask, zeroinitializer
|
|
|
|
%res = select <8 x i1> %cmp, <8 x i64> %shuf, <8 x i64> %default
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <8 x i64> %res
|
|
|
|
}
|
|
|
|
|
2017-10-15 14:05:50 +08:00
|
|
|
define <8 x i64> @test_masked_z_4xi64_to_8xi64_mem_mask1(<4 x i64>* %vp, <8 x i64> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_z_4xi64_to_8xi64_mem_mask1:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmq %zmm0, %zmm0, %k1
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti64x4 {{.*#+}} zmm0 {%k1} {z} = mem[0,1,2,3,0,1,2,3]
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <4 x i64>, <4 x i64>* %vp
|
|
|
|
%shuf = shufflevector <4 x i64> %vec, <4 x i64> undef, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 0, i32 1, i32 2, i32 3>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <8 x i64> %mask, zeroinitializer
|
|
|
|
%res = select <8 x i1> %cmp, <8 x i64> %shuf, <8 x i64> zeroinitializer
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <8 x i64> %res
|
|
|
|
}
|
2017-10-15 14:05:50 +08:00
|
|
|
define <8 x i64> @test_masked_4xi64_to_8xi64_mem_mask2(<4 x i64>* %vp, <8 x i64> %default, <8 x i64> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_4xi64_to_8xi64_mem_mask2:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmq %zmm1, %zmm1, %k1
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti64x4 {{.*#+}} zmm0 {%k1} = mem[0,1,2,3,0,1,2,3]
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <4 x i64>, <4 x i64>* %vp
|
|
|
|
%shuf = shufflevector <4 x i64> %vec, <4 x i64> undef, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 0, i32 1, i32 2, i32 3>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <8 x i64> %mask, zeroinitializer
|
|
|
|
%res = select <8 x i1> %cmp, <8 x i64> %shuf, <8 x i64> %default
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <8 x i64> %res
|
|
|
|
}
|
|
|
|
|
2017-10-15 14:05:50 +08:00
|
|
|
define <8 x i64> @test_masked_z_4xi64_to_8xi64_mem_mask2(<4 x i64>* %vp, <8 x i64> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_z_4xi64_to_8xi64_mem_mask2:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmq %zmm0, %zmm0, %k1
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti64x4 {{.*#+}} zmm0 {%k1} {z} = mem[0,1,2,3,0,1,2,3]
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <4 x i64>, <4 x i64>* %vp
|
|
|
|
%shuf = shufflevector <4 x i64> %vec, <4 x i64> undef, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 0, i32 1, i32 2, i32 3>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <8 x i64> %mask, zeroinitializer
|
|
|
|
%res = select <8 x i1> %cmp, <8 x i64> %shuf, <8 x i64> zeroinitializer
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <8 x i64> %res
|
|
|
|
}
|
2017-10-15 14:05:50 +08:00
|
|
|
define <8 x i64> @test_masked_4xi64_to_8xi64_mem_mask3(<4 x i64>* %vp, <8 x i64> %default, <8 x i64> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_4xi64_to_8xi64_mem_mask3:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmq %zmm1, %zmm1, %k1
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti64x4 {{.*#+}} zmm0 {%k1} = mem[0,1,2,3,0,1,2,3]
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <4 x i64>, <4 x i64>* %vp
|
|
|
|
%shuf = shufflevector <4 x i64> %vec, <4 x i64> undef, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 0, i32 1, i32 2, i32 3>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <8 x i64> %mask, zeroinitializer
|
|
|
|
%res = select <8 x i1> %cmp, <8 x i64> %shuf, <8 x i64> %default
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <8 x i64> %res
|
|
|
|
}
|
|
|
|
|
2017-10-15 14:05:50 +08:00
|
|
|
define <8 x i64> @test_masked_z_4xi64_to_8xi64_mem_mask3(<4 x i64>* %vp, <8 x i64> %mask) {
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-LABEL: test_masked_z_4xi64_to_8xi64_mem_mask3:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2018-01-28 04:19:09 +08:00
|
|
|
; CHECK-NEXT: vptestnmq %zmm0, %zmm0, %k1
|
2017-09-03 21:53:44 +08:00
|
|
|
; CHECK-NEXT: vbroadcasti64x4 {{.*#+}} zmm0 {%k1} {z} = mem[0,1,2,3,0,1,2,3]
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%vec = load <4 x i64>, <4 x i64>* %vp
|
|
|
|
%shuf = shufflevector <4 x i64> %vec, <4 x i64> undef, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 0, i32 1, i32 2, i32 3>
|
2017-10-15 14:05:50 +08:00
|
|
|
%cmp = icmp eq <8 x i64> %mask, zeroinitializer
|
|
|
|
%res = select <8 x i1> %cmp, <8 x i64> %shuf, <8 x i64> zeroinitializer
|
2017-09-03 21:53:44 +08:00
|
|
|
ret <8 x i64> %res
|
|
|
|
}
|