[llvm] r297978 - [AVX-512] Add tests for kandn, kor, kxor, and kxnor intrinsics.
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 16 12:58:06 PDT 2017
Author: ctopper
Date: Thu Mar 16 14:58:06 2017
New Revision: 297978
URL: http://llvm.org/viewvc/llvm-project?rev=297978&view=rev
Log:
[AVX-512] Add tests for kandn, kor, kxor, and kxnor intrinsics.
Modified:
llvm/trunk/test/CodeGen/X86/avx512-intrinsics.ll
Modified: llvm/trunk/test/CodeGen/X86/avx512-intrinsics.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/avx512-intrinsics.ll?rev=297978&r1=297977&r2=297978&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/avx512-intrinsics.ll (original)
+++ llvm/trunk/test/CodeGen/X86/avx512-intrinsics.ll Thu Mar 16 14:58:06 2017
@@ -46,6 +46,23 @@ define i16 @test_kand(i16 %a0, i16 %a1)
ret i16 %t2
}
+declare i16 @llvm.x86.avx512.kandn.w(i16, i16) nounwind readnone
+define i16 @test_kandn(i16 %a0, i16 %a1) {
+; CHECK-LABEL: test_kandn:
+; CHECK: ## BB#0:
+; CHECK-NEXT: movw $8, %ax
+; CHECK-NEXT: kmovw %eax, %k0
+; CHECK-NEXT: kmovw %edi, %k1
+; CHECK-NEXT: kandnw %k0, %k1, %k0
+; CHECK-NEXT: kmovw %esi, %k1
+; CHECK-NEXT: kandnw %k1, %k0, %k0
+; CHECK-NEXT: kmovw %k0, %eax
+; CHECK-NEXT: retq
+ %t1 = call i16 @llvm.x86.avx512.kandn.w(i16 %a0, i16 8)
+ %t2 = call i16 @llvm.x86.avx512.kandn.w(i16 %t1, i16 %a1)
+ ret i16 %t2
+}
+
declare i16 @llvm.x86.avx512.knot.w(i16) nounwind readnone
define i16 @test_knot(i16 %a0) {
; CHECK-LABEL: test_knot:
@@ -58,6 +75,23 @@ define i16 @test_knot(i16 %a0) {
ret i16 %res
}
+declare i16 @llvm.x86.avx512.kor.w(i16, i16) nounwind readnone
+define i16 @test_kor(i16 %a0, i16 %a1) {
+; CHECK-LABEL: test_kor:
+; CHECK: ## BB#0:
+; CHECK-NEXT: movw $8, %ax
+; CHECK-NEXT: kmovw %eax, %k0
+; CHECK-NEXT: kmovw %edi, %k1
+; CHECK-NEXT: korw %k0, %k1, %k0
+; CHECK-NEXT: kmovw %esi, %k1
+; CHECK-NEXT: korw %k1, %k0, %k0
+; CHECK-NEXT: kmovw %k0, %eax
+; CHECK-NEXT: retq
+ %t1 = call i16 @llvm.x86.avx512.kor.w(i16 %a0, i16 8)
+ %t2 = call i16 @llvm.x86.avx512.kor.w(i16 %t1, i16 %a1)
+ ret i16 %t2
+}
+
declare i16 @llvm.x86.avx512.kunpck.bw(i16, i16) nounwind readnone
define i16 @unpckbw_test(i16 %a0, i16 %a1) {
@@ -72,6 +106,40 @@ define i16 @unpckbw_test(i16 %a0, i16 %a
ret i16 %res
}
+declare i16 @llvm.x86.avx512.kxnor.w(i16, i16) nounwind readnone
+define i16 @test_kxnor(i16 %a0, i16 %a1) {
+; CHECK-LABEL: test_kxnor:
+; CHECK: ## BB#0:
+; CHECK-NEXT: movw $8, %ax
+; CHECK-NEXT: kmovw %eax, %k0
+; CHECK-NEXT: kmovw %edi, %k1
+; CHECK-NEXT: kxnorw %k0, %k1, %k0
+; CHECK-NEXT: kmovw %esi, %k1
+; CHECK-NEXT: kxnorw %k1, %k0, %k0
+; CHECK-NEXT: kmovw %k0, %eax
+; CHECK-NEXT: retq
+ %t1 = call i16 @llvm.x86.avx512.kxnor.w(i16 %a0, i16 8)
+ %t2 = call i16 @llvm.x86.avx512.kxnor.w(i16 %t1, i16 %a1)
+ ret i16 %t2
+}
+
+declare i16 @llvm.x86.avx512.kxor.w(i16, i16) nounwind readnone
+define i16 @test_kxor(i16 %a0, i16 %a1) {
+; CHECK-LABEL: test_kxor:
+; CHECK: ## BB#0:
+; CHECK-NEXT: movw $8, %ax
+; CHECK-NEXT: kmovw %eax, %k0
+; CHECK-NEXT: kmovw %edi, %k1
+; CHECK-NEXT: kxorw %k0, %k1, %k0
+; CHECK-NEXT: kmovw %esi, %k1
+; CHECK-NEXT: kxorw %k1, %k0, %k0
+; CHECK-NEXT: kmovw %k0, %eax
+; CHECK-NEXT: retq
+ %t1 = call i16 @llvm.x86.avx512.kxor.w(i16 %a0, i16 8)
+ %t2 = call i16 @llvm.x86.avx512.kxor.w(i16 %t1, i16 %a1)
+ ret i16 %t2
+}
+
define <16 x float> @test_rcp_ps_512(<16 x float> %a0) {
; CHECK-LABEL: test_rcp_ps_512:
; CHECK: ## BB#0:
More information about the llvm-commits
mailing list