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: orl %esi, %eax
37 ; CHECK-NEXT: ## kill: def $al killed $al killed $eax
39 %ma = bitcast i8 %x to <8 x i1>
40 %mb = bitcast i8 %y to <8 x i1>
41 %mc = and <8 x i1> %ma, %mb
42 %md = xor <8 x i1> %ma, %mb
43 %me = or <8 x i1> %mc, %md
44 %ret = bitcast <8 x i1> %me to i8
48 define i8 @mand8_mem(ptr %x, ptr %y) {
49 ; CHECK-LABEL: mand8_mem:
51 ; CHECK-NEXT: kmovb (%rdi), %k0
52 ; CHECK-NEXT: kmovb (%rsi), %k1
53 ; CHECK-NEXT: korb %k1, %k0, %k0
54 ; CHECK-NEXT: kmovd %k0, %eax
55 ; CHECK-NEXT: ## kill: def $al killed $al killed $eax
57 %ma = load <8 x i1>, ptr %x
58 %mb = load <8 x i1>, ptr %y
59 %mc = and <8 x i1> %ma, %mb
60 %md = xor <8 x i1> %ma, %mb
61 %me = or <8 x i1> %mc, %md
62 %ret = bitcast <8 x i1> %me to i8