1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=skx | FileCheck %s
4 define i8 @mask8(i8 %x) {
7 ; CHECK-NEXT: movl %edi, %eax
9 ; CHECK-NEXT: ## kill: def $al killed $al killed $eax
11 %m0 = bitcast i8 %x to <8 x i1>
12 %m1 = xor <8 x i1> %m0, <i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1>
13 %ret = bitcast <8 x i1> %m1 to i8
17 define void @mask8_mem(ptr %ptr) {
18 ; CHECK-LABEL: mask8_mem:
20 ; CHECK-NEXT: kmovb (%rdi), %k0
21 ; CHECK-NEXT: knotb %k0, %k0
22 ; CHECK-NEXT: kmovb %k0, (%rdi)
24 %x = load i8, ptr %ptr, align 4
25 %m0 = bitcast i8 %x to <8 x i1>
26 %m1 = xor <8 x i1> %m0, <i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1>
27 %ret = bitcast <8 x i1> %m1 to i8
28 store i8 %ret, ptr %ptr, align 4
32 define i8 @mand8(i8 %x, i8 %y) {
35 ; CHECK-NEXT: movl %edi, %eax
36 ; CHECK-NEXT: andb %sil, %al
37 ; CHECK-NEXT: xorb %sil, %dil
38 ; CHECK-NEXT: orb %dil, %al
40 %ma = bitcast i8 %x to <8 x i1>
41 %mb = bitcast i8 %y to <8 x i1>
42 %mc = and <8 x i1> %ma, %mb
43 %md = xor <8 x i1> %ma, %mb
44 %me = or <8 x i1> %mc, %md
45 %ret = bitcast <8 x i1> %me to i8
49 define i8 @mand8_mem(ptr %x, ptr %y) {
50 ; CHECK-LABEL: mand8_mem:
52 ; CHECK-NEXT: kmovb (%rdi), %k0
53 ; CHECK-NEXT: kmovb (%rsi), %k1
54 ; CHECK-NEXT: kandb %k1, %k0, %k2
55 ; CHECK-NEXT: kxorb %k1, %k0, %k0
56 ; CHECK-NEXT: korb %k0, %k2, %k0
57 ; CHECK-NEXT: kmovd %k0, %eax
58 ; CHECK-NEXT: ## kill: def $al killed $al killed $eax
60 %ma = load <8 x i1>, ptr %x
61 %mb = load <8 x i1>, ptr %y
62 %mc = and <8 x i1> %ma, %mb
63 %md = xor <8 x i1> %ma, %mb
64 %me = or <8 x i1> %mc, %md
65 %ret = bitcast <8 x i1> %me to i8