2016-06-14 15:05:10 +08:00
|
|
|
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
2014-08-29 16:46:04 +08:00
|
|
|
; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=skx | FileCheck %s
|
|
|
|
|
|
|
|
define <64 x i8> @test1(<64 x i8> %x, <64 x i8> %y) nounwind {
|
2016-06-14 15:05:10 +08:00
|
|
|
; CHECK-LABEL: test1:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: ## %bb.0:
|
2016-06-14 15:05:10 +08:00
|
|
|
; CHECK-NEXT: vpcmpeqb %zmm1, %zmm0, %k1
|
2017-01-14 15:50:52 +08:00
|
|
|
; CHECK-NEXT: vpblendmb %zmm0, %zmm1, %zmm0 {%k1}
|
2016-06-14 15:05:10 +08:00
|
|
|
; CHECK-NEXT: retq
|
2014-08-29 16:46:04 +08:00
|
|
|
%mask = icmp eq <64 x i8> %x, %y
|
|
|
|
%max = select <64 x i1> %mask, <64 x i8> %x, <64 x i8> %y
|
|
|
|
ret <64 x i8> %max
|
|
|
|
}
|
|
|
|
|
2014-12-12 23:10:43 +08:00
|
|
|
define <64 x i8> @test2(<64 x i8> %x, <64 x i8> %y, <64 x i8> %x1) nounwind {
|
2016-06-14 15:05:10 +08:00
|
|
|
; CHECK-LABEL: test2:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: ## %bb.0:
|
2016-06-14 15:05:10 +08:00
|
|
|
; CHECK-NEXT: vpcmpgtb %zmm1, %zmm0, %k1
|
2017-01-14 15:50:52 +08:00
|
|
|
; CHECK-NEXT: vpblendmb %zmm2, %zmm1, %zmm0 {%k1}
|
2016-06-14 15:05:10 +08:00
|
|
|
; CHECK-NEXT: retq
|
2014-08-29 16:46:04 +08:00
|
|
|
%mask = icmp sgt <64 x i8> %x, %y
|
2014-12-12 23:10:43 +08:00
|
|
|
%max = select <64 x i1> %mask, <64 x i8> %x1, <64 x i8> %y
|
2014-08-29 16:46:04 +08:00
|
|
|
ret <64 x i8> %max
|
|
|
|
}
|
|
|
|
|
|
|
|
define <32 x i16> @test3(<32 x i16> %x, <32 x i16> %y, <32 x i16> %x1) nounwind {
|
2016-06-14 15:05:10 +08:00
|
|
|
; CHECK-LABEL: test3:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: ## %bb.0:
|
2018-02-20 03:23:35 +08:00
|
|
|
; CHECK-NEXT: vpcmpnltw %zmm1, %zmm0, %k1
|
2017-01-14 15:50:52 +08:00
|
|
|
; CHECK-NEXT: vpblendmw %zmm2, %zmm1, %zmm0 {%k1}
|
2016-06-14 15:05:10 +08:00
|
|
|
; CHECK-NEXT: retq
|
2014-08-29 16:46:04 +08:00
|
|
|
%mask = icmp sge <32 x i16> %x, %y
|
|
|
|
%max = select <32 x i1> %mask, <32 x i16> %x1, <32 x i16> %y
|
|
|
|
ret <32 x i16> %max
|
|
|
|
}
|
|
|
|
|
2014-12-12 23:10:43 +08:00
|
|
|
define <64 x i8> @test4(<64 x i8> %x, <64 x i8> %y, <64 x i8> %x1) nounwind {
|
2016-06-14 15:05:10 +08:00
|
|
|
; CHECK-LABEL: test4:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: ## %bb.0:
|
2016-06-14 15:05:10 +08:00
|
|
|
; CHECK-NEXT: vpcmpnleub %zmm1, %zmm0, %k1
|
2017-01-14 15:50:52 +08:00
|
|
|
; CHECK-NEXT: vpblendmb %zmm2, %zmm1, %zmm0 {%k1}
|
2016-06-14 15:05:10 +08:00
|
|
|
; CHECK-NEXT: retq
|
2014-08-29 16:46:04 +08:00
|
|
|
%mask = icmp ugt <64 x i8> %x, %y
|
2014-12-12 23:10:43 +08:00
|
|
|
%max = select <64 x i1> %mask, <64 x i8> %x1, <64 x i8> %y
|
2014-08-29 16:46:04 +08:00
|
|
|
ret <64 x i8> %max
|
|
|
|
}
|
|
|
|
|
|
|
|
define <32 x i16> @test5(<32 x i16> %x, <32 x i16> %x1, <32 x i16>* %yp) nounwind {
|
2016-06-14 15:05:10 +08:00
|
|
|
; CHECK-LABEL: test5:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: ## %bb.0:
|
2016-06-14 15:05:10 +08:00
|
|
|
; CHECK-NEXT: vpcmpeqw (%rdi), %zmm0, %k1
|
2017-01-14 15:50:52 +08:00
|
|
|
; CHECK-NEXT: vpblendmw %zmm0, %zmm1, %zmm0 {%k1}
|
2016-06-14 15:05:10 +08:00
|
|
|
; CHECK-NEXT: retq
|
2015-02-28 05:17:42 +08:00
|
|
|
%y = load <32 x i16>, <32 x i16>* %yp, align 4
|
2014-08-29 16:46:04 +08:00
|
|
|
%mask = icmp eq <32 x i16> %x, %y
|
|
|
|
%max = select <32 x i1> %mask, <32 x i16> %x, <32 x i16> %x1
|
|
|
|
ret <32 x i16> %max
|
|
|
|
}
|
|
|
|
|
|
|
|
define <32 x i16> @test6(<32 x i16> %x, <32 x i16> %x1, <32 x i16>* %y.ptr) nounwind {
|
2016-06-14 15:05:10 +08:00
|
|
|
; CHECK-LABEL: test6:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: ## %bb.0:
|
2016-06-14 15:05:10 +08:00
|
|
|
; CHECK-NEXT: vpcmpgtw (%rdi), %zmm0, %k1
|
2017-01-14 15:50:52 +08:00
|
|
|
; CHECK-NEXT: vpblendmw %zmm0, %zmm1, %zmm0 {%k1}
|
2016-06-14 15:05:10 +08:00
|
|
|
; CHECK-NEXT: retq
|
2015-02-28 05:17:42 +08:00
|
|
|
%y = load <32 x i16>, <32 x i16>* %y.ptr, align 4
|
2014-08-29 16:46:04 +08:00
|
|
|
%mask = icmp sgt <32 x i16> %x, %y
|
|
|
|
%max = select <32 x i1> %mask, <32 x i16> %x, <32 x i16> %x1
|
|
|
|
ret <32 x i16> %max
|
|
|
|
}
|
|
|
|
|
|
|
|
define <32 x i16> @test7(<32 x i16> %x, <32 x i16> %x1, <32 x i16>* %y.ptr) nounwind {
|
2016-06-14 15:05:10 +08:00
|
|
|
; CHECK-LABEL: test7:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: ## %bb.0:
|
2016-06-14 15:05:10 +08:00
|
|
|
; CHECK-NEXT: vpcmplew (%rdi), %zmm0, %k1
|
2017-01-14 15:50:52 +08:00
|
|
|
; CHECK-NEXT: vpblendmw %zmm0, %zmm1, %zmm0 {%k1}
|
2016-06-14 15:05:10 +08:00
|
|
|
; CHECK-NEXT: retq
|
2015-02-28 05:17:42 +08:00
|
|
|
%y = load <32 x i16>, <32 x i16>* %y.ptr, align 4
|
2014-08-29 16:46:04 +08:00
|
|
|
%mask = icmp sle <32 x i16> %x, %y
|
|
|
|
%max = select <32 x i1> %mask, <32 x i16> %x, <32 x i16> %x1
|
|
|
|
ret <32 x i16> %max
|
|
|
|
}
|
|
|
|
|
|
|
|
define <32 x i16> @test8(<32 x i16> %x, <32 x i16> %x1, <32 x i16>* %y.ptr) nounwind {
|
2016-06-14 15:05:10 +08:00
|
|
|
; CHECK-LABEL: test8:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: ## %bb.0:
|
2016-06-14 15:05:10 +08:00
|
|
|
; CHECK-NEXT: vpcmpleuw (%rdi), %zmm0, %k1
|
2017-01-14 15:50:52 +08:00
|
|
|
; CHECK-NEXT: vpblendmw %zmm0, %zmm1, %zmm0 {%k1}
|
2016-06-14 15:05:10 +08:00
|
|
|
; CHECK-NEXT: retq
|
2015-02-28 05:17:42 +08:00
|
|
|
%y = load <32 x i16>, <32 x i16>* %y.ptr, align 4
|
2014-08-29 16:46:04 +08:00
|
|
|
%mask = icmp ule <32 x i16> %x, %y
|
|
|
|
%max = select <32 x i1> %mask, <32 x i16> %x, <32 x i16> %x1
|
|
|
|
ret <32 x i16> %max
|
|
|
|
}
|
|
|
|
|
|
|
|
define <32 x i16> @test9(<32 x i16> %x, <32 x i16> %y, <32 x i16> %x1, <32 x i16> %y1) nounwind {
|
2016-06-14 15:05:10 +08:00
|
|
|
; CHECK-LABEL: test9:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: ## %bb.0:
|
2016-06-14 15:05:10 +08:00
|
|
|
; CHECK-NEXT: vpcmpeqw %zmm1, %zmm0, %k1
|
|
|
|
; CHECK-NEXT: vpcmpeqw %zmm3, %zmm2, %k1 {%k1}
|
2017-01-14 15:50:52 +08:00
|
|
|
; CHECK-NEXT: vpblendmw %zmm0, %zmm1, %zmm0 {%k1}
|
2016-06-14 15:05:10 +08:00
|
|
|
; CHECK-NEXT: retq
|
2014-08-29 16:46:04 +08:00
|
|
|
%mask1 = icmp eq <32 x i16> %x1, %y1
|
|
|
|
%mask0 = icmp eq <32 x i16> %x, %y
|
|
|
|
%mask = select <32 x i1> %mask0, <32 x i1> %mask1, <32 x i1> zeroinitializer
|
|
|
|
%max = select <32 x i1> %mask, <32 x i16> %x, <32 x i16> %y
|
|
|
|
ret <32 x i16> %max
|
|
|
|
}
|
|
|
|
|
|
|
|
define <64 x i8> @test10(<64 x i8> %x, <64 x i8> %y, <64 x i8> %x1, <64 x i8> %y1) nounwind {
|
2016-06-14 15:05:10 +08:00
|
|
|
; CHECK-LABEL: test10:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: ## %bb.0:
|
2016-06-14 15:05:10 +08:00
|
|
|
; CHECK-NEXT: vpcmpleb %zmm1, %zmm0, %k1
|
2018-02-20 03:23:35 +08:00
|
|
|
; CHECK-NEXT: vpcmpnltb %zmm3, %zmm2, %k1 {%k1}
|
2017-01-14 15:50:52 +08:00
|
|
|
; CHECK-NEXT: vpblendmb %zmm0, %zmm2, %zmm0 {%k1}
|
2016-06-14 15:05:10 +08:00
|
|
|
; CHECK-NEXT: retq
|
2014-08-29 16:46:04 +08:00
|
|
|
%mask1 = icmp sge <64 x i8> %x1, %y1
|
|
|
|
%mask0 = icmp sle <64 x i8> %x, %y
|
|
|
|
%mask = select <64 x i1> %mask0, <64 x i1> %mask1, <64 x i1> zeroinitializer
|
|
|
|
%max = select <64 x i1> %mask, <64 x i8> %x, <64 x i8> %x1
|
|
|
|
ret <64 x i8> %max
|
|
|
|
}
|
|
|
|
|
|
|
|
define <64 x i8> @test11(<64 x i8> %x, <64 x i8>* %y.ptr, <64 x i8> %x1, <64 x i8> %y1) nounwind {
|
2016-06-14 15:05:10 +08:00
|
|
|
; CHECK-LABEL: test11:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: ## %bb.0:
|
2016-06-14 15:05:10 +08:00
|
|
|
; CHECK-NEXT: vpcmpgtb %zmm2, %zmm1, %k1
|
|
|
|
; CHECK-NEXT: vpcmpgtb (%rdi), %zmm0, %k1 {%k1}
|
2017-01-14 15:50:52 +08:00
|
|
|
; CHECK-NEXT: vpblendmb %zmm0, %zmm1, %zmm0 {%k1}
|
2016-06-14 15:05:10 +08:00
|
|
|
; CHECK-NEXT: retq
|
2014-08-29 16:46:04 +08:00
|
|
|
%mask1 = icmp sgt <64 x i8> %x1, %y1
|
2015-02-28 05:17:42 +08:00
|
|
|
%y = load <64 x i8>, <64 x i8>* %y.ptr, align 4
|
2014-08-29 16:46:04 +08:00
|
|
|
%mask0 = icmp sgt <64 x i8> %x, %y
|
|
|
|
%mask = select <64 x i1> %mask0, <64 x i1> %mask1, <64 x i1> zeroinitializer
|
|
|
|
%max = select <64 x i1> %mask, <64 x i8> %x, <64 x i8> %x1
|
|
|
|
ret <64 x i8> %max
|
|
|
|
}
|
|
|
|
|
|
|
|
define <32 x i16> @test12(<32 x i16> %x, <32 x i16>* %y.ptr, <32 x i16> %x1, <32 x i16> %y1) nounwind {
|
2016-06-14 15:05:10 +08:00
|
|
|
; CHECK-LABEL: test12:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: ## %bb.0:
|
2018-02-20 03:23:35 +08:00
|
|
|
; CHECK-NEXT: vpcmpnltw %zmm2, %zmm1, %k1
|
2016-06-14 15:05:10 +08:00
|
|
|
; CHECK-NEXT: vpcmpleuw (%rdi), %zmm0, %k1 {%k1}
|
2017-01-14 15:50:52 +08:00
|
|
|
; CHECK-NEXT: vpblendmw %zmm0, %zmm1, %zmm0 {%k1}
|
2016-06-14 15:05:10 +08:00
|
|
|
; CHECK-NEXT: retq
|
2014-08-29 16:46:04 +08:00
|
|
|
%mask1 = icmp sge <32 x i16> %x1, %y1
|
2015-02-28 05:17:42 +08:00
|
|
|
%y = load <32 x i16>, <32 x i16>* %y.ptr, align 4
|
2014-08-29 16:46:04 +08:00
|
|
|
%mask0 = icmp ule <32 x i16> %x, %y
|
|
|
|
%mask = select <32 x i1> %mask0, <32 x i1> %mask1, <32 x i1> zeroinitializer
|
|
|
|
%max = select <32 x i1> %mask, <32 x i16> %x, <32 x i16> %x1
|
|
|
|
ret <32 x i16> %max
|
|
|
|
}
|