aboutsummaryrefslogtreecommitdiffstats
path: root/test/CodeGen/X86/avx512-insert-extract.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGen/X86/avx512-insert-extract.ll')
-rw-r--r--test/CodeGen/X86/avx512-insert-extract.ll75
1 files changed, 55 insertions, 20 deletions
diff --git a/test/CodeGen/X86/avx512-insert-extract.ll b/test/CodeGen/X86/avx512-insert-extract.ll
index 3f06740..6557ac3 100644
--- a/test/CodeGen/X86/avx512-insert-extract.ll
+++ b/test/CodeGen/X86/avx512-insert-extract.ll
@@ -44,7 +44,7 @@ define <8 x i64> @test4(<8 x i64> %x) nounwind {
}
;CHECK-LABEL: test5:
-;CHECK: vextractpsz
+;CHECK: vextractps
;CHECK: ret
define i32 @test5(<4 x float> %x) nounwind {
%ef = extractelement <4 x float> %x, i32 3
@@ -53,7 +53,7 @@ define i32 @test5(<4 x float> %x) nounwind {
}
;CHECK-LABEL: test6:
-;CHECK: vextractpsz {{.*}}, (%rdi)
+;CHECK: vextractps {{.*}}, (%rdi)
;CHECK: ret
define void @test6(<4 x float> %x, float* %out) nounwind {
%ef = extractelement <4 x float> %x, i32 3
@@ -62,7 +62,7 @@ define void @test6(<4 x float> %x, float* %out) nounwind {
}
;CHECK-LABEL: test7
-;CHECK: vmovdz
+;CHECK: vmovd
;CHECK: vpermps %zmm
;CHECK: ret
define float @test7(<16 x float> %x, i32 %ind) nounwind {
@@ -71,7 +71,7 @@ define float @test7(<16 x float> %x, i32 %ind) nounwind {
}
;CHECK-LABEL: test8
-;CHECK: vmovqz
+;CHECK: vmovq
;CHECK: vpermpd %zmm
;CHECK: ret
define double @test8(<8 x double> %x, i32 %ind) nounwind {
@@ -89,9 +89,9 @@ define float @test9(<8 x float> %x, i32 %ind) nounwind {
}
;CHECK-LABEL: test10
-;CHECK: vmovdz
+;CHECK: vmovd
;CHECK: vpermd %zmm
-;CHEKK: vmovdz %xmm0, %eax
+;CHECK: vmovd %xmm0, %eax
;CHECK: ret
define i32 @test10(<16 x i32> %x, i32 %ind) nounwind {
%e = extractelement <16 x i32> %x, i32 %ind
@@ -99,27 +99,62 @@ define i32 @test10(<16 x i32> %x, i32 %ind) nounwind {
}
;CHECK-LABEL: test11
-;CHECK: movl $260
-;CHECK: bextrl
-;CHECK: movl $268
-;CHECK: bextrl
+;CHECK: vpcmpltud
+;CHECK: kshiftlw $11
+;CHECK: kshiftrw $15
+;CHECK: kortestw
+;CHECK: je
+;CHECK: ret
;CHECK: ret
define <16 x i32> @test11(<16 x i32>%a, <16 x i32>%b) {
%cmp_res = icmp ult <16 x i32> %a, %b
%ia = extractelement <16 x i1> %cmp_res, i32 4
- %ib = extractelement <16 x i1> %cmp_res, i32 12
-
br i1 %ia, label %A, label %B
-
A:
ret <16 x i32>%b
B:
%c = add <16 x i32>%b, %a
- br i1 %ib, label %C, label %D
- C:
- %c1 = sub <16 x i32>%c, %a
- ret <16 x i32>%c1
- D:
- %c2 = mul <16 x i32>%c, %a
- ret <16 x i32>%c2
+ ret <16 x i32>%c
+}
+
+;CHECK-LABEL: test12
+;CHECK: vpcmpgtq
+;CHECK: kshiftlw $15
+;CHECK: kshiftrw $15
+;CHECK: kortestw
+;CHECK: ret
+
+define i64 @test12(<16 x i64>%a, <16 x i64>%b, i64 %a1, i64 %b1) {
+
+ %cmpvector_func.i = icmp slt <16 x i64> %a, %b
+ %extract24vector_func.i = extractelement <16 x i1> %cmpvector_func.i, i32 0
+ %res = select i1 %extract24vector_func.i, i64 %a1, i64 %b1
+ ret i64 %res
+}
+
+;CHECK-LABEL: test13
+;CHECK: cmpl
+;CHECK: sbbl
+;CHECK: orl $65532
+;CHECK: ret
+define i16 @test13(i32 %a, i32 %b) {
+ %cmp_res = icmp ult i32 %a, %b
+ %maskv = insertelement <16 x i1> <i1 true, i1 false, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true>, i1 %cmp_res, i32 0
+ %res = bitcast <16 x i1> %maskv to i16
+ ret i16 %res
+}
+
+;CHECK-LABEL: test14
+;CHECK: vpcmpgtq
+;CHECK: kshiftlw $11
+;CHECK: kshiftrw $15
+;CHECK: kortestw
+;CHECK: ret
+
+define i64 @test14(<8 x i64>%a, <8 x i64>%b, i64 %a1, i64 %b1) {
+
+ %cmpvector_func.i = icmp slt <8 x i64> %a, %b
+ %extract24vector_func.i = extractelement <8 x i1> %cmpvector_func.i, i32 4
+ %res = select i1 %extract24vector_func.i, i64 %a1, i64 %b1
+ ret i64 %res
}