2016-04-02 05:00:00 +08:00
|
|
|
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
|
|
|
; RUN: llc < %s -mtriple=i686-apple-darwin -mattr=+avx | FileCheck %s --check-prefix=CHECK --check-prefix=X32
|
|
|
|
; RUN: llc < %s -mtriple=x86_64-apple-darwin -mattr=+avx | FileCheck %s --check-prefix=CHECK --check-prefix=X64
|
2012-12-27 16:15:45 +08:00
|
|
|
|
|
|
|
define void @and_masks(<8 x float>* %a, <8 x float>* %b, <8 x float>* %c) nounwind uwtable noinline ssp {
|
2016-04-02 05:00:00 +08:00
|
|
|
; X32-LABEL: and_masks:
|
|
|
|
; X32: ## BB#0:
|
|
|
|
; X32-NEXT: movl {{[0-9]+}}(%esp), %eax
|
|
|
|
; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx
|
|
|
|
; X32-NEXT: movl {{[0-9]+}}(%esp), %edx
|
|
|
|
; X32-NEXT: vmovups (%edx), %ymm0
|
|
|
|
; X32-NEXT: vmovups (%ecx), %ymm1
|
|
|
|
; X32-NEXT: vcmpltps %ymm0, %ymm1, %ymm1
|
|
|
|
; X32-NEXT: vmovups (%eax), %ymm2
|
|
|
|
; X32-NEXT: vcmpltps %ymm0, %ymm2, %ymm0
|
2016-07-18 14:14:50 +08:00
|
|
|
; X32-NEXT: vandps LCPI0_0, %ymm1, %ymm1
|
2016-04-02 05:00:00 +08:00
|
|
|
; X32-NEXT: vandps %ymm1, %ymm0, %ymm0
|
|
|
|
; X32-NEXT: vmovaps %ymm0, (%eax)
|
|
|
|
; X32-NEXT: vzeroupper
|
|
|
|
; X32-NEXT: retl
|
|
|
|
;
|
|
|
|
; X64-LABEL: and_masks:
|
|
|
|
; X64: ## BB#0:
|
|
|
|
; X64-NEXT: vmovups (%rdi), %ymm0
|
|
|
|
; X64-NEXT: vmovups (%rsi), %ymm1
|
|
|
|
; X64-NEXT: vcmpltps %ymm0, %ymm1, %ymm1
|
|
|
|
; X64-NEXT: vmovups (%rdx), %ymm2
|
|
|
|
; X64-NEXT: vcmpltps %ymm0, %ymm2, %ymm0
|
2016-07-18 14:14:50 +08:00
|
|
|
; X64-NEXT: vandps {{.*}}(%rip), %ymm1, %ymm1
|
2016-04-02 05:00:00 +08:00
|
|
|
; X64-NEXT: vandps %ymm1, %ymm0, %ymm0
|
|
|
|
; X64-NEXT: vmovaps %ymm0, (%rax)
|
|
|
|
; X64-NEXT: vzeroupper
|
|
|
|
; X64-NEXT: retq
|
2015-02-28 05:17:42 +08:00
|
|
|
%v0 = load <8 x float>, <8 x float>* %a, align 16
|
|
|
|
%v1 = load <8 x float>, <8 x float>* %b, align 16
|
2012-12-27 16:15:45 +08:00
|
|
|
%m0 = fcmp olt <8 x float> %v1, %v0
|
2015-02-28 05:17:42 +08:00
|
|
|
%v2 = load <8 x float>, <8 x float>* %c, align 16
|
2012-12-27 16:15:45 +08:00
|
|
|
%m1 = fcmp olt <8 x float> %v2, %v0
|
|
|
|
%mand = and <8 x i1> %m1, %m0
|
|
|
|
%r = zext <8 x i1> %mand to <8 x i32>
|
2013-01-19 16:38:41 +08:00
|
|
|
store <8 x i32> %r, <8 x i32>* undef, align 32
|
2012-12-27 16:15:45 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @neg_masks(<8 x float>* %a, <8 x float>* %b, <8 x float>* %c) nounwind uwtable noinline ssp {
|
2016-04-02 05:00:00 +08:00
|
|
|
; X32-LABEL: neg_masks:
|
|
|
|
; X32: ## BB#0:
|
|
|
|
; X32-NEXT: movl {{[0-9]+}}(%esp), %eax
|
|
|
|
; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx
|
|
|
|
; X32-NEXT: vmovups (%ecx), %ymm0
|
|
|
|
; X32-NEXT: vcmpltps (%eax), %ymm0, %ymm0
|
|
|
|
; X32-NEXT: vmovaps {{.*#+}} ymm1 = [1,1,1,1,1,1,1,1]
|
|
|
|
; X32-NEXT: vxorps %ymm1, %ymm0, %ymm0
|
|
|
|
; X32-NEXT: vandps %ymm1, %ymm0, %ymm0
|
|
|
|
; X32-NEXT: vmovaps %ymm0, (%eax)
|
|
|
|
; X32-NEXT: vzeroupper
|
|
|
|
; X32-NEXT: retl
|
|
|
|
;
|
|
|
|
; X64-LABEL: neg_masks:
|
|
|
|
; X64: ## BB#0:
|
|
|
|
; X64-NEXT: vmovups (%rsi), %ymm0
|
|
|
|
; X64-NEXT: vcmpltps (%rdi), %ymm0, %ymm0
|
|
|
|
; X64-NEXT: vmovaps {{.*#+}} ymm1 = [1,1,1,1,1,1,1,1]
|
|
|
|
; X64-NEXT: vxorps %ymm1, %ymm0, %ymm0
|
|
|
|
; X64-NEXT: vandps %ymm1, %ymm0, %ymm0
|
|
|
|
; X64-NEXT: vmovaps %ymm0, (%rax)
|
|
|
|
; X64-NEXT: vzeroupper
|
|
|
|
; X64-NEXT: retq
|
2015-02-28 05:17:42 +08:00
|
|
|
%v0 = load <8 x float>, <8 x float>* %a, align 16
|
|
|
|
%v1 = load <8 x float>, <8 x float>* %b, align 16
|
2012-12-27 16:15:45 +08:00
|
|
|
%m0 = fcmp olt <8 x float> %v1, %v0
|
|
|
|
%mand = xor <8 x i1> %m0, <i1 1, i1 1, i1 1, i1 1, i1 1, i1 1, i1 1, i1 1>
|
|
|
|
%r = zext <8 x i1> %mand to <8 x i32>
|
2013-01-19 16:38:41 +08:00
|
|
|
store <8 x i32> %r, <8 x i32>* undef, align 32
|
2012-12-27 16:15:45 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|