2016-04-10 22:16:03 +08:00
|
|
|
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
|
|
|
; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=skx | FileCheck %s
|
2014-07-24 02:17:49 +08:00
|
|
|
|
|
|
|
define i8 @mask8(i8 %x) {
|
2016-04-10 22:16:03 +08:00
|
|
|
; CHECK-LABEL: mask8:
|
|
|
|
; CHECK: ## BB#0:
|
2017-03-29 00:35:29 +08:00
|
|
|
; CHECK-NEXT: kmovd %edi, %k0
|
2016-04-10 22:16:03 +08:00
|
|
|
; CHECK-NEXT: knotb %k0, %k0
|
2017-03-29 00:35:29 +08:00
|
|
|
; CHECK-NEXT: kmovd %k0, %eax
|
|
|
|
; CHECK-NEXT: ## kill: %AL<def> %AL<kill> %EAX<kill>
|
2016-04-10 22:16:03 +08:00
|
|
|
; CHECK-NEXT: retq
|
2014-07-24 02:17:49 +08:00
|
|
|
%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
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @mask8_mem(i8* %ptr) {
|
2016-04-10 22:16:03 +08:00
|
|
|
; 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
|
2015-02-28 05:17:42 +08:00
|
|
|
%x = load i8, i8* %ptr, align 4
|
2014-07-24 02:17:49 +08:00
|
|
|
%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
|
|
|
|
}
|
2014-07-28 21:46:45 +08:00
|
|
|
|
|
|
|
define i8 @mand8(i8 %x, i8 %y) {
|
2016-04-10 22:16:03 +08:00
|
|
|
; CHECK-LABEL: mand8:
|
|
|
|
; CHECK: ## BB#0:
|
2016-04-12 05:10:33 +08:00
|
|
|
; CHECK-NEXT: movl %edi, %eax
|
|
|
|
; CHECK-NEXT: xorl %esi, %eax
|
|
|
|
; CHECK-NEXT: andl %esi, %edi
|
|
|
|
; CHECK-NEXT: orl %eax, %edi
|
2016-05-07 09:11:17 +08:00
|
|
|
; CHECK-NEXT: movl %edi, %eax
|
2016-04-12 05:10:33 +08:00
|
|
|
; 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
|
|
|
|
ret i8 %ret
|
|
|
|
}
|
|
|
|
|
|
|
|
define i8 @mand8_mem(<8 x i1>* %x, <8 x i1>* %y) {
|
|
|
|
; CHECK-LABEL: mand8_mem:
|
|
|
|
; CHECK: ## BB#0:
|
|
|
|
; CHECK-NEXT: kmovb (%rdi), %k0
|
|
|
|
; CHECK-NEXT: kmovb (%rsi), %k1
|
2016-04-10 22:16:03 +08:00
|
|
|
; CHECK-NEXT: kandb %k1, %k0, %k2
|
|
|
|
; CHECK-NEXT: kxorb %k1, %k0, %k0
|
|
|
|
; CHECK-NEXT: korb %k0, %k2, %k0
|
2017-03-29 00:35:29 +08:00
|
|
|
; CHECK-NEXT: kmovd %k0, %eax
|
|
|
|
; CHECK-NEXT: ## kill: %AL<def> %AL<kill> %EAX<kill>
|
2016-04-10 22:16:03 +08:00
|
|
|
; CHECK-NEXT: retq
|
2016-04-12 05:10:33 +08:00
|
|
|
%ma = load <8 x i1>, <8 x i1>* %x
|
|
|
|
%mb = load <8 x i1>, <8 x i1>* %y
|
2014-07-28 21:46:45 +08:00
|
|
|
%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
|
|
|
|
ret i8 %ret
|
|
|
|
}
|