2016-07-09 08:19:07 +08:00
|
|
|
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
2016-06-29 22:51:10 +08:00
|
|
|
; RUN: llc < %s -mtriple=x86_64-apple-darwin9 -mcpu=knl | FileCheck %s --check-prefix=ALL_X64 --check-prefix=KNL
|
|
|
|
; RUN: llc < %s -mtriple=x86_64-apple-darwin9 -mcpu=skx | FileCheck %s --check-prefix=ALL_X64 --check-prefix=SKX
|
|
|
|
; RUN: llc < %s -mtriple=i686-apple-darwin9 -mcpu=knl | FileCheck %s --check-prefix=KNL_X32
|
2015-04-27 23:11:19 +08:00
|
|
|
|
|
|
|
define <16 x i1> @test1() {
|
2016-08-01 15:55:33 +08:00
|
|
|
; ALL_X64-LABEL: test1:
|
2017-12-05 01:18:51 +08:00
|
|
|
; ALL_X64: ## %bb.0:
|
2016-08-01 15:55:33 +08:00
|
|
|
; ALL_X64-NEXT: vxorps %xmm0, %xmm0, %xmm0
|
|
|
|
; ALL_X64-NEXT: retq
|
2015-12-27 21:56:16 +08:00
|
|
|
;
|
|
|
|
; KNL_X32-LABEL: test1:
|
2017-12-05 01:18:51 +08:00
|
|
|
; KNL_X32: ## %bb.0:
|
2015-12-27 21:56:16 +08:00
|
|
|
; KNL_X32-NEXT: vxorps %xmm0, %xmm0, %xmm0
|
|
|
|
; KNL_X32-NEXT: retl
|
2015-04-27 23:11:19 +08:00
|
|
|
ret <16 x i1> zeroinitializer
|
|
|
|
}
|
|
|
|
|
|
|
|
define <16 x i1> @test2(<16 x i1>%a, <16 x i1>%b) {
|
2017-12-24 02:53:05 +08:00
|
|
|
; ALL_X64-LABEL: test2:
|
|
|
|
; ALL_X64: ## %bb.0:
|
2018-01-04 02:11:01 +08:00
|
|
|
; ALL_X64-NEXT: vandps %xmm1, %xmm0, %xmm0
|
2017-12-24 02:53:05 +08:00
|
|
|
; ALL_X64-NEXT: retq
|
2015-12-27 21:56:16 +08:00
|
|
|
;
|
|
|
|
; KNL_X32-LABEL: test2:
|
2017-12-05 01:18:51 +08:00
|
|
|
; KNL_X32: ## %bb.0:
|
2018-01-04 02:11:01 +08:00
|
|
|
; KNL_X32-NEXT: vandps %xmm1, %xmm0, %xmm0
|
2015-12-27 21:56:16 +08:00
|
|
|
; KNL_X32-NEXT: retl
|
2015-04-27 23:11:19 +08:00
|
|
|
%c = and <16 x i1>%a, %b
|
|
|
|
ret <16 x i1> %c
|
|
|
|
}
|
|
|
|
|
|
|
|
define <8 x i1> @test3(<8 x i1>%a, <8 x i1>%b) {
|
2017-12-24 02:53:05 +08:00
|
|
|
; ALL_X64-LABEL: test3:
|
|
|
|
; ALL_X64: ## %bb.0:
|
2018-01-04 02:11:01 +08:00
|
|
|
; ALL_X64-NEXT: vandps %xmm1, %xmm0, %xmm0
|
2017-12-24 02:53:05 +08:00
|
|
|
; ALL_X64-NEXT: retq
|
2015-12-27 21:56:16 +08:00
|
|
|
;
|
|
|
|
; KNL_X32-LABEL: test3:
|
2017-12-05 01:18:51 +08:00
|
|
|
; KNL_X32: ## %bb.0:
|
2018-01-04 02:11:01 +08:00
|
|
|
; KNL_X32-NEXT: vandps %xmm1, %xmm0, %xmm0
|
2015-12-27 21:56:16 +08:00
|
|
|
; KNL_X32-NEXT: retl
|
2015-04-27 23:11:19 +08:00
|
|
|
%c = and <8 x i1>%a, %b
|
|
|
|
ret <8 x i1> %c
|
|
|
|
}
|
|
|
|
|
|
|
|
define <4 x i1> @test4(<4 x i1>%a, <4 x i1>%b) {
|
2018-01-04 02:11:01 +08:00
|
|
|
; ALL_X64-LABEL: test4:
|
|
|
|
; ALL_X64: ## %bb.0:
|
|
|
|
; ALL_X64-NEXT: vandps %xmm1, %xmm0, %xmm0
|
|
|
|
; ALL_X64-NEXT: retq
|
2015-12-27 21:56:16 +08:00
|
|
|
;
|
|
|
|
; KNL_X32-LABEL: test4:
|
2017-12-05 01:18:51 +08:00
|
|
|
; KNL_X32: ## %bb.0:
|
2015-12-27 21:56:16 +08:00
|
|
|
; KNL_X32-NEXT: vandps %xmm1, %xmm0, %xmm0
|
|
|
|
; KNL_X32-NEXT: retl
|
2015-04-27 23:11:19 +08:00
|
|
|
%c = and <4 x i1>%a, %b
|
|
|
|
ret <4 x i1> %c
|
|
|
|
}
|
|
|
|
|
2015-05-04 20:40:50 +08:00
|
|
|
declare <8 x i1> @func8xi1(<8 x i1> %a)
|
2015-12-27 21:56:16 +08:00
|
|
|
|
2015-05-04 20:40:50 +08:00
|
|
|
define <8 x i32> @test5(<8 x i32>%a, <8 x i32>%b) {
|
2015-12-27 21:56:16 +08:00
|
|
|
; KNL-LABEL: test5:
|
2017-12-05 01:18:51 +08:00
|
|
|
; KNL: ## %bb.0:
|
2015-12-27 21:56:16 +08:00
|
|
|
; KNL-NEXT: pushq %rax
|
|
|
|
; KNL-NEXT: .cfi_def_cfa_offset 16
|
|
|
|
; KNL-NEXT: vpcmpgtd %ymm1, %ymm0, %ymm0
|
|
|
|
; KNL-NEXT: vpmovdw %zmm0, %ymm0
|
2018-02-01 06:04:26 +08:00
|
|
|
; KNL-NEXT: ## kill: def $xmm0 killed $xmm0 killed $ymm0
|
2015-12-27 21:56:16 +08:00
|
|
|
; KNL-NEXT: callq _func8xi1
|
|
|
|
; KNL-NEXT: vpmovzxwd {{.*#+}} ymm0 = xmm0[0],zero,xmm0[1],zero,xmm0[2],zero,xmm0[3],zero,xmm0[4],zero,xmm0[5],zero,xmm0[6],zero,xmm0[7],zero
|
|
|
|
; KNL-NEXT: vpslld $31, %ymm0, %ymm0
|
|
|
|
; KNL-NEXT: vpsrad $31, %ymm0, %ymm0
|
|
|
|
; KNL-NEXT: popq %rax
|
|
|
|
; KNL-NEXT: retq
|
|
|
|
;
|
|
|
|
; SKX-LABEL: test5:
|
2017-12-05 01:18:51 +08:00
|
|
|
; SKX: ## %bb.0:
|
2015-12-27 21:56:16 +08:00
|
|
|
; SKX-NEXT: pushq %rax
|
|
|
|
; SKX-NEXT: .cfi_def_cfa_offset 16
|
|
|
|
; SKX-NEXT: vpcmpgtd %ymm1, %ymm0, %k0
|
|
|
|
; SKX-NEXT: vpmovm2w %k0, %xmm0
|
2017-03-03 17:03:24 +08:00
|
|
|
; SKX-NEXT: vzeroupper
|
2015-12-27 21:56:16 +08:00
|
|
|
; SKX-NEXT: callq _func8xi1
|
2016-04-12 21:31:01 +08:00
|
|
|
; SKX-NEXT: vpmovzxwd {{.*#+}} ymm0 = xmm0[0],zero,xmm0[1],zero,xmm0[2],zero,xmm0[3],zero,xmm0[4],zero,xmm0[5],zero,xmm0[6],zero,xmm0[7],zero
|
2015-12-27 21:56:16 +08:00
|
|
|
; SKX-NEXT: vpslld $31, %ymm0, %ymm0
|
|
|
|
; SKX-NEXT: vpsrad $31, %ymm0, %ymm0
|
|
|
|
; SKX-NEXT: popq %rax
|
|
|
|
; SKX-NEXT: retq
|
|
|
|
;
|
|
|
|
; KNL_X32-LABEL: test5:
|
2017-12-05 01:18:51 +08:00
|
|
|
; KNL_X32: ## %bb.0:
|
2015-12-27 21:56:16 +08:00
|
|
|
; KNL_X32-NEXT: subl $12, %esp
|
|
|
|
; KNL_X32-NEXT: .cfi_def_cfa_offset 16
|
|
|
|
; KNL_X32-NEXT: vpcmpgtd %ymm1, %ymm0, %ymm0
|
|
|
|
; KNL_X32-NEXT: vpmovdw %zmm0, %ymm0
|
2018-02-01 06:04:26 +08:00
|
|
|
; KNL_X32-NEXT: ## kill: def $xmm0 killed $xmm0 killed $ymm0
|
2016-06-29 22:51:10 +08:00
|
|
|
; KNL_X32-NEXT: calll _func8xi1
|
2015-12-27 21:56:16 +08:00
|
|
|
; KNL_X32-NEXT: vpmovzxwd {{.*#+}} ymm0 = xmm0[0],zero,xmm0[1],zero,xmm0[2],zero,xmm0[3],zero,xmm0[4],zero,xmm0[5],zero,xmm0[6],zero,xmm0[7],zero
|
|
|
|
; KNL_X32-NEXT: vpslld $31, %ymm0, %ymm0
|
|
|
|
; KNL_X32-NEXT: vpsrad $31, %ymm0, %ymm0
|
|
|
|
; KNL_X32-NEXT: addl $12, %esp
|
|
|
|
; KNL_X32-NEXT: retl
|
2015-05-04 20:40:50 +08:00
|
|
|
%cmpRes = icmp sgt <8 x i32>%a, %b
|
|
|
|
%resi = call <8 x i1> @func8xi1(<8 x i1> %cmpRes)
|
|
|
|
%res = sext <8 x i1>%resi to <8 x i32>
|
|
|
|
ret <8 x i32> %res
|
|
|
|
}
|
|
|
|
|
|
|
|
declare <16 x i1> @func16xi1(<16 x i1> %a)
|
|
|
|
|
|
|
|
define <16 x i32> @test6(<16 x i32>%a, <16 x i32>%b) {
|
2015-12-27 21:56:16 +08:00
|
|
|
; KNL-LABEL: test6:
|
2017-12-05 01:18:51 +08:00
|
|
|
; KNL: ## %bb.0:
|
2015-12-27 21:56:16 +08:00
|
|
|
; KNL-NEXT: pushq %rax
|
|
|
|
; KNL-NEXT: .cfi_def_cfa_offset 16
|
|
|
|
; KNL-NEXT: vpcmpgtd %zmm1, %zmm0, %k1
|
2017-01-09 10:44:34 +08:00
|
|
|
; KNL-NEXT: vpternlogd $255, %zmm0, %zmm0, %zmm0 {%k1} {z}
|
2015-12-27 21:56:16 +08:00
|
|
|
; KNL-NEXT: vpmovdb %zmm0, %xmm0
|
|
|
|
; KNL-NEXT: callq _func16xi1
|
2016-04-12 21:31:01 +08:00
|
|
|
; KNL-NEXT: vpmovzxbd {{.*#+}} zmm0 = xmm0[0],zero,zero,zero,xmm0[1],zero,zero,zero,xmm0[2],zero,zero,zero,xmm0[3],zero,zero,zero,xmm0[4],zero,zero,zero,xmm0[5],zero,zero,zero,xmm0[6],zero,zero,zero,xmm0[7],zero,zero,zero,xmm0[8],zero,zero,zero,xmm0[9],zero,zero,zero,xmm0[10],zero,zero,zero,xmm0[11],zero,zero,zero,xmm0[12],zero,zero,zero,xmm0[13],zero,zero,zero,xmm0[14],zero,zero,zero,xmm0[15],zero,zero,zero
|
2015-12-27 21:56:16 +08:00
|
|
|
; KNL-NEXT: vpslld $31, %zmm0, %zmm0
|
|
|
|
; KNL-NEXT: vpsrad $31, %zmm0, %zmm0
|
|
|
|
; KNL-NEXT: popq %rax
|
|
|
|
; KNL-NEXT: retq
|
|
|
|
;
|
|
|
|
; SKX-LABEL: test6:
|
2017-12-05 01:18:51 +08:00
|
|
|
; SKX: ## %bb.0:
|
2015-12-27 21:56:16 +08:00
|
|
|
; SKX-NEXT: pushq %rax
|
|
|
|
; SKX-NEXT: .cfi_def_cfa_offset 16
|
|
|
|
; SKX-NEXT: vpcmpgtd %zmm1, %zmm0, %k0
|
|
|
|
; SKX-NEXT: vpmovm2b %k0, %xmm0
|
2017-03-03 17:03:24 +08:00
|
|
|
; SKX-NEXT: vzeroupper
|
2015-12-27 21:56:16 +08:00
|
|
|
; SKX-NEXT: callq _func16xi1
|
2016-04-12 21:31:01 +08:00
|
|
|
; SKX-NEXT: vpmovzxbd {{.*#+}} zmm0 = xmm0[0],zero,zero,zero,xmm0[1],zero,zero,zero,xmm0[2],zero,zero,zero,xmm0[3],zero,zero,zero,xmm0[4],zero,zero,zero,xmm0[5],zero,zero,zero,xmm0[6],zero,zero,zero,xmm0[7],zero,zero,zero,xmm0[8],zero,zero,zero,xmm0[9],zero,zero,zero,xmm0[10],zero,zero,zero,xmm0[11],zero,zero,zero,xmm0[12],zero,zero,zero,xmm0[13],zero,zero,zero,xmm0[14],zero,zero,zero,xmm0[15],zero,zero,zero
|
2015-12-27 21:56:16 +08:00
|
|
|
; SKX-NEXT: vpslld $31, %zmm0, %zmm0
|
|
|
|
; SKX-NEXT: vpsrad $31, %zmm0, %zmm0
|
|
|
|
; SKX-NEXT: popq %rax
|
|
|
|
; SKX-NEXT: retq
|
|
|
|
;
|
|
|
|
; KNL_X32-LABEL: test6:
|
2017-12-05 01:18:51 +08:00
|
|
|
; KNL_X32: ## %bb.0:
|
2015-12-27 21:56:16 +08:00
|
|
|
; KNL_X32-NEXT: subl $12, %esp
|
|
|
|
; KNL_X32-NEXT: .cfi_def_cfa_offset 16
|
|
|
|
; KNL_X32-NEXT: vpcmpgtd %zmm1, %zmm0, %k1
|
2017-01-09 10:44:34 +08:00
|
|
|
; KNL_X32-NEXT: vpternlogd $255, %zmm0, %zmm0, %zmm0 {%k1} {z}
|
2015-12-27 21:56:16 +08:00
|
|
|
; KNL_X32-NEXT: vpmovdb %zmm0, %xmm0
|
2016-06-29 22:51:10 +08:00
|
|
|
; KNL_X32-NEXT: calll _func16xi1
|
2016-04-12 21:31:01 +08:00
|
|
|
; KNL_X32-NEXT: vpmovzxbd {{.*#+}} zmm0 = xmm0[0],zero,zero,zero,xmm0[1],zero,zero,zero,xmm0[2],zero,zero,zero,xmm0[3],zero,zero,zero,xmm0[4],zero,zero,zero,xmm0[5],zero,zero,zero,xmm0[6],zero,zero,zero,xmm0[7],zero,zero,zero,xmm0[8],zero,zero,zero,xmm0[9],zero,zero,zero,xmm0[10],zero,zero,zero,xmm0[11],zero,zero,zero,xmm0[12],zero,zero,zero,xmm0[13],zero,zero,zero,xmm0[14],zero,zero,zero,xmm0[15],zero,zero,zero
|
2015-12-27 21:56:16 +08:00
|
|
|
; KNL_X32-NEXT: vpslld $31, %zmm0, %zmm0
|
|
|
|
; KNL_X32-NEXT: vpsrad $31, %zmm0, %zmm0
|
|
|
|
; KNL_X32-NEXT: addl $12, %esp
|
|
|
|
; KNL_X32-NEXT: retl
|
2015-05-04 20:40:50 +08:00
|
|
|
%cmpRes = icmp sgt <16 x i32>%a, %b
|
|
|
|
%resi = call <16 x i1> @func16xi1(<16 x i1> %cmpRes)
|
|
|
|
%res = sext <16 x i1>%resi to <16 x i32>
|
|
|
|
ret <16 x i32> %res
|
|
|
|
}
|
|
|
|
|
|
|
|
declare <4 x i1> @func4xi1(<4 x i1> %a)
|
|
|
|
|
|
|
|
define <4 x i32> @test7(<4 x i32>%a, <4 x i32>%b) {
|
2018-01-27 04:02:52 +08:00
|
|
|
; ALL_X64-LABEL: test7:
|
|
|
|
; ALL_X64: ## %bb.0:
|
|
|
|
; ALL_X64-NEXT: pushq %rax
|
|
|
|
; ALL_X64-NEXT: .cfi_def_cfa_offset 16
|
|
|
|
; ALL_X64-NEXT: vpcmpgtd %xmm1, %xmm0, %xmm0
|
|
|
|
; ALL_X64-NEXT: callq _func4xi1
|
|
|
|
; ALL_X64-NEXT: vpslld $31, %xmm0, %xmm0
|
|
|
|
; ALL_X64-NEXT: vpsrad $31, %xmm0, %xmm0
|
|
|
|
; ALL_X64-NEXT: popq %rax
|
|
|
|
; ALL_X64-NEXT: retq
|
2015-12-27 21:56:16 +08:00
|
|
|
;
|
|
|
|
; KNL_X32-LABEL: test7:
|
2017-12-05 01:18:51 +08:00
|
|
|
; KNL_X32: ## %bb.0:
|
2015-12-27 21:56:16 +08:00
|
|
|
; KNL_X32-NEXT: subl $12, %esp
|
|
|
|
; KNL_X32-NEXT: .cfi_def_cfa_offset 16
|
|
|
|
; KNL_X32-NEXT: vpcmpgtd %xmm1, %xmm0, %xmm0
|
2016-06-29 22:51:10 +08:00
|
|
|
; KNL_X32-NEXT: calll _func4xi1
|
2015-12-27 21:56:16 +08:00
|
|
|
; KNL_X32-NEXT: vpslld $31, %xmm0, %xmm0
|
|
|
|
; KNL_X32-NEXT: vpsrad $31, %xmm0, %xmm0
|
|
|
|
; KNL_X32-NEXT: addl $12, %esp
|
|
|
|
; KNL_X32-NEXT: retl
|
2015-05-04 20:40:50 +08:00
|
|
|
%cmpRes = icmp sgt <4 x i32>%a, %b
|
|
|
|
%resi = call <4 x i1> @func4xi1(<4 x i1> %cmpRes)
|
|
|
|
%res = sext <4 x i1>%resi to <4 x i32>
|
|
|
|
ret <4 x i32> %res
|
|
|
|
}
|
2015-05-14 17:04:45 +08:00
|
|
|
|
|
|
|
define <8 x i1> @test7a(<8 x i32>%a, <8 x i32>%b) {
|
2015-12-27 21:56:16 +08:00
|
|
|
; KNL-LABEL: test7a:
|
2017-12-05 01:18:51 +08:00
|
|
|
; KNL: ## %bb.0:
|
2015-12-27 21:56:16 +08:00
|
|
|
; KNL-NEXT: pushq %rax
|
|
|
|
; KNL-NEXT: .cfi_def_cfa_offset 16
|
|
|
|
; KNL-NEXT: vpcmpgtd %ymm1, %ymm0, %ymm0
|
|
|
|
; KNL-NEXT: vpmovdw %zmm0, %ymm0
|
2018-02-01 06:04:26 +08:00
|
|
|
; KNL-NEXT: ## kill: def $xmm0 killed $xmm0 killed $ymm0
|
2015-12-27 21:56:16 +08:00
|
|
|
; KNL-NEXT: callq _func8xi1
|
2018-01-04 02:11:01 +08:00
|
|
|
; KNL-NEXT: vandps {{.*}}(%rip), %xmm0, %xmm0
|
2015-12-27 21:56:16 +08:00
|
|
|
; KNL-NEXT: popq %rax
|
|
|
|
; KNL-NEXT: retq
|
|
|
|
;
|
|
|
|
; SKX-LABEL: test7a:
|
2017-12-05 01:18:51 +08:00
|
|
|
; SKX: ## %bb.0:
|
2015-12-27 21:56:16 +08:00
|
|
|
; SKX-NEXT: pushq %rax
|
|
|
|
; SKX-NEXT: .cfi_def_cfa_offset 16
|
|
|
|
; SKX-NEXT: vpcmpgtd %ymm1, %ymm0, %k0
|
|
|
|
; SKX-NEXT: vpmovm2w %k0, %xmm0
|
2017-03-03 17:03:24 +08:00
|
|
|
; SKX-NEXT: vzeroupper
|
2015-12-27 21:56:16 +08:00
|
|
|
; SKX-NEXT: callq _func8xi1
|
2017-12-24 09:03:31 +08:00
|
|
|
; SKX-NEXT: vpand {{.*}}(%rip), %xmm0, %xmm0
|
2015-12-27 21:56:16 +08:00
|
|
|
; SKX-NEXT: popq %rax
|
|
|
|
; SKX-NEXT: retq
|
|
|
|
;
|
|
|
|
; KNL_X32-LABEL: test7a:
|
2017-12-05 01:18:51 +08:00
|
|
|
; KNL_X32: ## %bb.0:
|
2015-12-27 21:56:16 +08:00
|
|
|
; KNL_X32-NEXT: subl $12, %esp
|
|
|
|
; KNL_X32-NEXT: .cfi_def_cfa_offset 16
|
|
|
|
; KNL_X32-NEXT: vpcmpgtd %ymm1, %ymm0, %ymm0
|
|
|
|
; KNL_X32-NEXT: vpmovdw %zmm0, %ymm0
|
2018-02-01 06:04:26 +08:00
|
|
|
; KNL_X32-NEXT: ## kill: def $xmm0 killed $xmm0 killed $ymm0
|
2016-06-29 22:51:10 +08:00
|
|
|
; KNL_X32-NEXT: calll _func8xi1
|
2018-01-04 02:11:01 +08:00
|
|
|
; KNL_X32-NEXT: vandps LCPI7_0, %xmm0, %xmm0
|
2015-12-27 21:56:16 +08:00
|
|
|
; KNL_X32-NEXT: addl $12, %esp
|
|
|
|
; KNL_X32-NEXT: retl
|
2015-05-14 17:04:45 +08:00
|
|
|
%cmpRes = icmp sgt <8 x i32>%a, %b
|
|
|
|
%resi = call <8 x i1> @func8xi1(<8 x i1> %cmpRes)
|
|
|
|
%res = and <8 x i1>%resi, <i1 true, i1 false, i1 true, i1 false, i1 true, i1 false, i1 true, i1 false>
|
|
|
|
ret <8 x i1> %res
|
|
|
|
}
|
|
|
|
|
|
|
|
define <16 x i8> @test8(<16 x i8> %a1, <16 x i8> %a2, i1 %cond) {
|
2016-09-05 14:43:06 +08:00
|
|
|
; ALL_X64-LABEL: test8:
|
2017-12-05 01:18:51 +08:00
|
|
|
; ALL_X64: ## %bb.0:
|
2016-09-05 14:43:06 +08:00
|
|
|
; ALL_X64-NEXT: testb $1, %dil
|
|
|
|
; ALL_X64-NEXT: jne LBB8_2
|
2017-12-05 01:18:51 +08:00
|
|
|
; ALL_X64-NEXT: ## %bb.1:
|
2016-09-05 14:43:06 +08:00
|
|
|
; ALL_X64-NEXT: vmovaps %xmm1, %xmm0
|
|
|
|
; ALL_X64-NEXT: LBB8_2:
|
|
|
|
; ALL_X64-NEXT: retq
|
2015-12-27 21:56:16 +08:00
|
|
|
;
|
|
|
|
; KNL_X32-LABEL: test8:
|
2017-12-05 01:18:51 +08:00
|
|
|
; KNL_X32: ## %bb.0:
|
2015-12-27 21:56:16 +08:00
|
|
|
; KNL_X32-NEXT: testb $1, {{[0-9]+}}(%esp)
|
|
|
|
; KNL_X32-NEXT: jne LBB8_2
|
2017-12-05 01:18:51 +08:00
|
|
|
; KNL_X32-NEXT: ## %bb.1:
|
2016-09-05 14:43:06 +08:00
|
|
|
; KNL_X32-NEXT: vmovaps %xmm1, %xmm0
|
2015-12-27 21:56:16 +08:00
|
|
|
; KNL_X32-NEXT: LBB8_2:
|
|
|
|
; KNL_X32-NEXT: retl
|
2015-05-14 17:04:45 +08:00
|
|
|
%res = select i1 %cond, <16 x i8> %a1, <16 x i8> %a2
|
|
|
|
ret <16 x i8> %res
|
|
|
|
}
|
|
|
|
|
|
|
|
define i1 @test9(double %a, double %b) {
|
2015-12-27 21:56:16 +08:00
|
|
|
; ALL_X64-LABEL: test9:
|
2017-12-05 01:18:51 +08:00
|
|
|
; ALL_X64: ## %bb.0:
|
2015-12-27 21:56:16 +08:00
|
|
|
; ALL_X64-NEXT: vucomisd %xmm0, %xmm1
|
|
|
|
; ALL_X64-NEXT: setb %al
|
|
|
|
; ALL_X64-NEXT: retq
|
|
|
|
;
|
|
|
|
; KNL_X32-LABEL: test9:
|
2017-12-05 01:18:51 +08:00
|
|
|
; KNL_X32: ## %bb.0:
|
2016-04-12 21:31:01 +08:00
|
|
|
; KNL_X32-NEXT: vmovsd {{.*#+}} xmm0 = mem[0],zero
|
2015-12-27 21:56:16 +08:00
|
|
|
; KNL_X32-NEXT: vucomisd {{[0-9]+}}(%esp), %xmm0
|
|
|
|
; KNL_X32-NEXT: setb %al
|
|
|
|
; KNL_X32-NEXT: retl
|
2015-05-14 17:04:45 +08:00
|
|
|
%c = fcmp ugt double %a, %b
|
|
|
|
ret i1 %c
|
|
|
|
}
|
|
|
|
|
|
|
|
define i32 @test10(i32 %a, i32 %b, i1 %cond) {
|
2015-12-27 21:56:16 +08:00
|
|
|
; ALL_X64-LABEL: test10:
|
2017-12-05 01:18:51 +08:00
|
|
|
; ALL_X64: ## %bb.0:
|
2015-12-27 21:56:16 +08:00
|
|
|
; ALL_X64-NEXT: movl %edi, %eax
|
2018-09-20 02:59:08 +08:00
|
|
|
; ALL_X64-NEXT: testb $1, %dl
|
|
|
|
; ALL_X64-NEXT: cmovel %esi, %eax
|
2015-12-27 21:56:16 +08:00
|
|
|
; ALL_X64-NEXT: retq
|
|
|
|
;
|
|
|
|
; KNL_X32-LABEL: test10:
|
2017-12-05 01:18:51 +08:00
|
|
|
; KNL_X32: ## %bb.0:
|
2015-12-27 21:56:16 +08:00
|
|
|
; KNL_X32-NEXT: testb $1, {{[0-9]+}}(%esp)
|
|
|
|
; KNL_X32-NEXT: leal {{[0-9]+}}(%esp), %eax
|
|
|
|
; KNL_X32-NEXT: leal {{[0-9]+}}(%esp), %ecx
|
|
|
|
; KNL_X32-NEXT: cmovnel %eax, %ecx
|
|
|
|
; KNL_X32-NEXT: movl (%ecx), %eax
|
|
|
|
; KNL_X32-NEXT: retl
|
2015-05-14 17:04:45 +08:00
|
|
|
%c = select i1 %cond, i32 %a, i32 %b
|
|
|
|
ret i32 %c
|
|
|
|
}
|
|
|
|
|
|
|
|
define i1 @test11(i32 %a, i32 %b) {
|
2015-12-27 21:56:16 +08:00
|
|
|
; ALL_X64-LABEL: test11:
|
2017-12-05 01:18:51 +08:00
|
|
|
; ALL_X64: ## %bb.0:
|
2015-12-27 21:56:16 +08:00
|
|
|
; ALL_X64-NEXT: cmpl %esi, %edi
|
|
|
|
; ALL_X64-NEXT: setg %al
|
|
|
|
; ALL_X64-NEXT: retq
|
|
|
|
;
|
|
|
|
; KNL_X32-LABEL: test11:
|
2017-12-05 01:18:51 +08:00
|
|
|
; KNL_X32: ## %bb.0:
|
2015-12-27 21:56:16 +08:00
|
|
|
; KNL_X32-NEXT: movl {{[0-9]+}}(%esp), %eax
|
|
|
|
; KNL_X32-NEXT: cmpl {{[0-9]+}}(%esp), %eax
|
|
|
|
; KNL_X32-NEXT: setg %al
|
|
|
|
; KNL_X32-NEXT: retl
|
2015-05-14 17:04:45 +08:00
|
|
|
%c = icmp sgt i32 %a, %b
|
|
|
|
ret i1 %c
|
|
|
|
}
|
|
|
|
|
|
|
|
define i32 @test12(i32 %a1, i32 %a2, i32 %b1) {
|
2015-12-27 21:56:16 +08:00
|
|
|
; ALL_X64-LABEL: test12:
|
2017-12-05 01:18:51 +08:00
|
|
|
; ALL_X64: ## %bb.0:
|
2015-12-27 21:56:16 +08:00
|
|
|
; ALL_X64-NEXT: pushq %rbp
|
|
|
|
; ALL_X64-NEXT: .cfi_def_cfa_offset 16
|
|
|
|
; ALL_X64-NEXT: pushq %r14
|
|
|
|
; ALL_X64-NEXT: .cfi_def_cfa_offset 24
|
|
|
|
; ALL_X64-NEXT: pushq %rbx
|
|
|
|
; ALL_X64-NEXT: .cfi_def_cfa_offset 32
|
|
|
|
; ALL_X64-NEXT: .cfi_offset %rbx, -32
|
|
|
|
; ALL_X64-NEXT: .cfi_offset %r14, -24
|
|
|
|
; ALL_X64-NEXT: .cfi_offset %rbp, -16
|
|
|
|
; ALL_X64-NEXT: movl %esi, %r14d
|
|
|
|
; ALL_X64-NEXT: movl %edi, %ebp
|
|
|
|
; ALL_X64-NEXT: movl %edx, %esi
|
|
|
|
; ALL_X64-NEXT: callq _test11
|
|
|
|
; ALL_X64-NEXT: movzbl %al, %ebx
|
|
|
|
; ALL_X64-NEXT: movl %ebp, %edi
|
|
|
|
; ALL_X64-NEXT: movl %r14d, %esi
|
|
|
|
; ALL_X64-NEXT: movl %ebx, %edx
|
|
|
|
; ALL_X64-NEXT: callq _test10
|
|
|
|
; ALL_X64-NEXT: xorl %ecx, %ecx
|
|
|
|
; ALL_X64-NEXT: testb $1, %bl
|
|
|
|
; ALL_X64-NEXT: cmovel %ecx, %eax
|
|
|
|
; ALL_X64-NEXT: popq %rbx
|
|
|
|
; ALL_X64-NEXT: popq %r14
|
|
|
|
; ALL_X64-NEXT: popq %rbp
|
|
|
|
; ALL_X64-NEXT: retq
|
|
|
|
;
|
|
|
|
; KNL_X32-LABEL: test12:
|
2017-12-05 01:18:51 +08:00
|
|
|
; KNL_X32: ## %bb.0:
|
2015-12-27 21:56:16 +08:00
|
|
|
; KNL_X32-NEXT: pushl %ebx
|
|
|
|
; KNL_X32-NEXT: .cfi_def_cfa_offset 8
|
|
|
|
; KNL_X32-NEXT: pushl %edi
|
|
|
|
; KNL_X32-NEXT: .cfi_def_cfa_offset 12
|
|
|
|
; KNL_X32-NEXT: pushl %esi
|
|
|
|
; KNL_X32-NEXT: .cfi_def_cfa_offset 16
|
|
|
|
; KNL_X32-NEXT: subl $16, %esp
|
|
|
|
; KNL_X32-NEXT: .cfi_def_cfa_offset 32
|
|
|
|
; KNL_X32-NEXT: .cfi_offset %esi, -16
|
|
|
|
; KNL_X32-NEXT: .cfi_offset %edi, -12
|
|
|
|
; KNL_X32-NEXT: .cfi_offset %ebx, -8
|
|
|
|
; KNL_X32-NEXT: movl {{[0-9]+}}(%esp), %esi
|
|
|
|
; KNL_X32-NEXT: movl {{[0-9]+}}(%esp), %edi
|
|
|
|
; KNL_X32-NEXT: movl {{[0-9]+}}(%esp), %eax
|
|
|
|
; KNL_X32-NEXT: movl %eax, {{[0-9]+}}(%esp)
|
|
|
|
; KNL_X32-NEXT: movl %edi, (%esp)
|
|
|
|
; KNL_X32-NEXT: calll _test11
|
2016-05-07 09:11:17 +08:00
|
|
|
; KNL_X32-NEXT: movl %eax, %ebx
|
2018-02-28 00:59:10 +08:00
|
|
|
; KNL_X32-NEXT: movzbl %al, %eax
|
2015-12-27 21:56:16 +08:00
|
|
|
; KNL_X32-NEXT: movl %eax, {{[0-9]+}}(%esp)
|
|
|
|
; KNL_X32-NEXT: movl %esi, {{[0-9]+}}(%esp)
|
|
|
|
; KNL_X32-NEXT: movl %edi, (%esp)
|
|
|
|
; KNL_X32-NEXT: calll _test10
|
|
|
|
; KNL_X32-NEXT: xorl %ecx, %ecx
|
|
|
|
; KNL_X32-NEXT: testb $1, %bl
|
|
|
|
; KNL_X32-NEXT: cmovel %ecx, %eax
|
|
|
|
; KNL_X32-NEXT: addl $16, %esp
|
|
|
|
; KNL_X32-NEXT: popl %esi
|
|
|
|
; KNL_X32-NEXT: popl %edi
|
|
|
|
; KNL_X32-NEXT: popl %ebx
|
|
|
|
; KNL_X32-NEXT: retl
|
2015-05-14 17:04:45 +08:00
|
|
|
%cond = call i1 @test11(i32 %a1, i32 %b1)
|
|
|
|
%res = call i32 @test10(i32 %a1, i32 %a2, i1 %cond)
|
|
|
|
%res1 = select i1 %cond, i32 %res, i32 0
|
|
|
|
ret i32 %res1
|
2015-12-27 21:56:16 +08:00
|
|
|
}
|
2017-12-31 15:38:30 +08:00
|
|
|
|
|
|
|
define <1 x i1> @test13(<1 x i1>* %foo) {
|
2017-12-31 15:38:33 +08:00
|
|
|
; KNL-LABEL: test13:
|
|
|
|
; KNL: ## %bb.0:
|
|
|
|
; KNL-NEXT: movzbl (%rdi), %eax
|
2018-02-01 06:04:26 +08:00
|
|
|
; KNL-NEXT: ## kill: def $al killed $al killed $eax
|
2017-12-31 15:38:33 +08:00
|
|
|
; KNL-NEXT: retq
|
|
|
|
;
|
|
|
|
; SKX-LABEL: test13:
|
|
|
|
; SKX: ## %bb.0:
|
|
|
|
; SKX-NEXT: kmovb (%rdi), %k0
|
|
|
|
; SKX-NEXT: kmovd %k0, %eax
|
2018-02-01 06:04:26 +08:00
|
|
|
; SKX-NEXT: ## kill: def $al killed $al killed $eax
|
2017-12-31 15:38:33 +08:00
|
|
|
; SKX-NEXT: retq
|
2017-12-31 15:38:30 +08:00
|
|
|
;
|
|
|
|
; KNL_X32-LABEL: test13:
|
|
|
|
; KNL_X32: ## %bb.0:
|
|
|
|
; KNL_X32-NEXT: movl {{[0-9]+}}(%esp), %eax
|
|
|
|
; KNL_X32-NEXT: movzbl (%eax), %eax
|
2018-02-01 06:04:26 +08:00
|
|
|
; KNL_X32-NEXT: ## kill: def $al killed $al killed $eax
|
2017-12-31 15:38:30 +08:00
|
|
|
; KNL_X32-NEXT: retl
|
|
|
|
%bar = load <1 x i1>, <1 x i1>* %foo
|
|
|
|
ret <1 x i1> %bar
|
|
|
|
}
|