-; RUN: llc < %s -march=x86-64 -mtriple=x86_64-apple-darwin -mcpu=skx | FileCheck %s
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=skx | FileCheck %s
define i32 @mask32(i32 %x) {
+; CHECK-LABEL: mask32:
+; CHECK: ## BB#0:
+; CHECK-NEXT: kmovd %edi, %k0
+; CHECK-NEXT: knotd %k0, %k0
+; CHECK-NEXT: kmovd %k0, %eax
+; CHECK-NEXT: retq
%m0 = bitcast i32 %x to <32 x i1>
%m1 = xor <32 x i1> %m0, <i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1,
i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1,
i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1>
%ret = bitcast <32 x i1> %m1 to i32
ret i32 %ret
-; CHECK-LABEL: mask32
-; CHECK: kmovd
-; CHECK-NEXT: knotd
-; CHECK-NEXT: kmovd
-; CHECK-NEXT: ret
}
define i64 @mask64(i64 %x) {
+; CHECK-LABEL: mask64:
+; CHECK: ## BB#0:
+; CHECK-NEXT: kmovq %rdi, %k0
+; CHECK-NEXT: knotq %k0, %k0
+; CHECK-NEXT: kmovq %k0, %rax
+; CHECK-NEXT: retq
%m0 = bitcast i64 %x to <64 x i1>
%m1 = xor <64 x i1> %m0, <i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1,
i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1,
i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1>
%ret = bitcast <64 x i1> %m1 to i64
ret i64 %ret
-; CHECK-LABEL: mask64
-; CHECK: kmovq
-; CHECK-NEXT: knotq
-; CHECK-NEXT: kmovq
-; CHECK-NEXT: ret
}
define void @mask32_mem(i32* %ptr) {
+; CHECK-LABEL: mask32_mem:
+; CHECK: ## BB#0:
+; CHECK-NEXT: kmovd (%rdi), %k0
+; CHECK-NEXT: knotd %k0, %k0
+; CHECK-NEXT: kmovd %k0, (%rdi)
+; CHECK-NEXT: retq
%x = load i32, i32* %ptr, align 4
%m0 = bitcast i32 %x to <32 x i1>
%m1 = xor <32 x i1> %m0, <i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1,
%ret = bitcast <32 x i1> %m1 to i32
store i32 %ret, i32* %ptr, align 4
ret void
-; CHECK-LABEL: mask32_mem
-; CHECK: kmovd ([[ARG1:%rdi|%rcx]]), %k{{[0-7]}}
-; CHECK-NEXT: knotd
-; CHECK-NEXT: kmovd %k{{[0-7]}}, ([[ARG1]])
-; CHECK-NEXT: ret
}
define void @mask64_mem(i64* %ptr) {
+; CHECK-LABEL: mask64_mem:
+; CHECK: ## BB#0:
+; CHECK-NEXT: kmovq (%rdi), %k0
+; CHECK-NEXT: knotq %k0, %k0
+; CHECK-NEXT: kmovq %k0, (%rdi)
+; CHECK-NEXT: retq
%x = load i64, i64* %ptr, align 4
%m0 = bitcast i64 %x to <64 x i1>
%m1 = xor <64 x i1> %m0, <i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1,
%ret = bitcast <64 x i1> %m1 to i64
store i64 %ret, i64* %ptr, align 4
ret void
-; CHECK-LABEL: mask64_mem
-; CHECK: kmovq ([[ARG1]]), %k{{[0-7]}}
-; CHECK-NEXT: knotq
-; CHECK-NEXT: kmovq %k{{[0-7]}}, ([[ARG1]])
-; CHECK-NEXT: ret
}
define i32 @mand32(i32 %x, i32 %y) {
+; CHECK-LABEL: mand32:
+; CHECK: ## BB#0:
+; CHECK-NEXT: kmovd %edi, %k0
+; CHECK-NEXT: kmovd %esi, %k1
+; CHECK-NEXT: kandd %k1, %k0, %k2
+; CHECK-NEXT: kxord %k1, %k0, %k0
+; CHECK-NEXT: kord %k0, %k2, %k0
+; CHECK-NEXT: kmovd %k0, %eax
+; CHECK-NEXT: retq
%ma = bitcast i32 %x to <32 x i1>
%mb = bitcast i32 %y to <32 x i1>
%mc = and <32 x i1> %ma, %mb
%md = xor <32 x i1> %ma, %mb
%me = or <32 x i1> %mc, %md
%ret = bitcast <32 x i1> %me to i32
-; CHECK: kandd
-; CHECK: kxord
-; CHECK: kord
ret i32 %ret
}
define i64 @mand64(i64 %x, i64 %y) {
+; CHECK-LABEL: mand64:
+; CHECK: ## BB#0:
+; CHECK-NEXT: kmovq %rdi, %k0
+; CHECK-NEXT: kmovq %rsi, %k1
+; CHECK-NEXT: kandq %k1, %k0, %k2
+; CHECK-NEXT: kxorq %k1, %k0, %k0
+; CHECK-NEXT: korq %k0, %k2, %k0
+; CHECK-NEXT: kmovq %k0, %rax
+; CHECK-NEXT: retq
%ma = bitcast i64 %x to <64 x i1>
%mb = bitcast i64 %y to <64 x i1>
%mc = and <64 x i1> %ma, %mb
%md = xor <64 x i1> %ma, %mb
%me = or <64 x i1> %mc, %md
%ret = bitcast <64 x i1> %me to i64
-; CHECK: kandq
-; CHECK: kxorq
-; CHECK: korq
ret i64 %ret
}
-; RUN: llc < %s -march=x86-64 -mtriple=x86_64-apple-darwin -mcpu=skx | FileCheck %s
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=skx | FileCheck %s
define i8 @mask8(i8 %x) {
+; CHECK-LABEL: mask8:
+; CHECK: ## BB#0:
+; CHECK-NEXT: kmovb %edi, %k0
+; CHECK-NEXT: knotb %k0, %k0
+; CHECK-NEXT: kmovb %k0, %eax
+; CHECK-NEXT: retq
%m0 = bitcast i8 %x to <8 x i1>
%m1 = xor <8 x i1> %m0, <i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1>
%ret = bitcast <8 x i1> %m1 to i8
ret i8 %ret
-; CHECK: mask8
-; CHECK: knotb
-; CHECK: ret
}
define void @mask8_mem(i8* %ptr) {
+; CHECK-LABEL: mask8_mem:
+; CHECK: ## BB#0:
+; CHECK-NEXT: kmovb (%rdi), %k0
+; CHECK-NEXT: knotb %k0, %k0
+; CHECK-NEXT: kmovb %k0, (%rdi)
+; CHECK-NEXT: retq
%x = load i8, i8* %ptr, align 4
%m0 = bitcast i8 %x to <8 x i1>
%m1 = xor <8 x i1> %m0, <i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1>
%ret = bitcast <8 x i1> %m1 to i8
store i8 %ret, i8* %ptr, align 4
ret void
-; CHECK-LABEL: mask8_mem
-; CHECK: kmovb ([[ARG1:%rdi|%rcx]]), %k{{[0-7]}}
-; CHECK-NEXT: knotb
-; CHECK-NEXT: kmovb %k{{[0-7]}}, ([[ARG1]])
-; CHECK: ret
}
define i8 @mand8(i8 %x, i8 %y) {
+; CHECK-LABEL: mand8:
+; CHECK: ## BB#0:
+; CHECK-NEXT: kmovb %edi, %k0
+; CHECK-NEXT: kmovb %esi, %k1
+; CHECK-NEXT: kandb %k1, %k0, %k2
+; CHECK-NEXT: kxorb %k1, %k0, %k0
+; CHECK-NEXT: korb %k0, %k2, %k0
+; CHECK-NEXT: kmovb %k0, %eax
+; CHECK-NEXT: retq
%ma = bitcast i8 %x to <8 x i1>
%mb = bitcast i8 %y to <8 x i1>
%mc = and <8 x i1> %ma, %mb
%md = xor <8 x i1> %ma, %mb
%me = or <8 x i1> %mc, %md
%ret = bitcast <8 x i1> %me to i8
-; CHECK: kandb
-; CHECK: kxorb
-; CHECK: korb
ret i8 %ret
}