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(i8* %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, i8* %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, i8* %ptr, align 4
32 define i8 @mand8(i8 %x, i8 %y) {
35 ; CHECK-NEXT: movl %edi, %eax
36 ; CHECK-NEXT: movl %eax, %ecx
37 ; CHECK-NEXT: andb %sil, %cl
38 ; CHECK-NEXT: xorb %sil, %al
39 ; CHECK-NEXT: orb %cl, %al
40 ; CHECK-NEXT: ## kill: def $al killed $al killed $eax
42 %ma = bitcast i8 %x to <8 x i1>
43 %mb = bitcast i8 %y to <8 x i1>
44 %mc = and <8 x i1> %ma, %mb
45 %md = xor <8 x i1> %ma, %mb
46 %me = or <8 x i1> %mc, %md
47 %ret = bitcast <8 x i1> %me to i8
51 define i8 @mand8_mem(<8 x i1>* %x, <8 x i1>* %y) {
52 ; CHECK-LABEL: mand8_mem:
54 ; CHECK-NEXT: kmovb (%rdi), %k0
55 ; CHECK-NEXT: kmovb (%rsi), %k1
56 ; CHECK-NEXT: kandb %k1, %k0, %k2
57 ; CHECK-NEXT: kxorb %k1, %k0, %k0
58 ; CHECK-NEXT: korb %k0, %k2, %k0
59 ; CHECK-NEXT: kmovd %k0, %eax
60 ; CHECK-NEXT: ## kill: def $al killed $al killed $eax
62 %ma = load <8 x i1>, <8 x i1>* %x
63 %mb = load <8 x i1>, <8 x i1>* %y
64 %mc = and <8 x i1> %ma, %mb
65 %md = xor <8 x i1> %ma, %mb
66 %me = or <8 x i1> %mc, %md
67 %ret = bitcast <8 x i1> %me to i8