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:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: ## %bb.0:
|
2018-02-09 06:26:36 +08:00
|
|
|
; CHECK-NEXT: movl %edi, %eax
|
2018-09-20 02:59:08 +08:00
|
|
|
; CHECK-NEXT: notb %al
|
|
|
|
; CHECK-NEXT: ## kill: def $al killed $al killed $eax
|
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:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: ## %bb.0:
|
2016-04-10 22:16:03 +08:00
|
|
|
; 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:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: ## %bb.0:
|
2016-04-12 05:10:33 +08:00
|
|
|
; CHECK-NEXT: movl %edi, %eax
|
2018-09-20 02:59:08 +08:00
|
|
|
; CHECK-NEXT: movl %edi, %ecx
|
|
|
|
; CHECK-NEXT: xorl %esi, %ecx
|
|
|
|
; CHECK-NEXT: andl %esi, %eax
|
|
|
|
; CHECK-NEXT: orl %ecx, %eax
|
|
|
|
; CHECK-NEXT: ## kill: def $al killed $al killed $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:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: ## %bb.0:
|
2016-04-12 05:10:33 +08:00
|
|
|
; 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
|
2018-02-01 06:04:26 +08:00
|
|
|
; CHECK-NEXT: ## kill: def $al killed $al killed $eax
|
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
|
|
|
|
}
|