1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i686-unknown-unknown -mattr=+avx | FileCheck %s --check-prefix=X86
3 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx | FileCheck %s --check-prefix=X64
5 define <8 x i32> @select00(i32 %a, <8 x i32> %b) nounwind {
8 ; X86-NEXT: cmpl $255, {{[0-9]+}}(%esp)
9 ; X86-NEXT: vxorps %xmm1, %xmm1, %xmm1
10 ; X86-NEXT: je .LBB0_2
12 ; X86-NEXT: vmovaps %ymm0, %ymm1
14 ; X86-NEXT: vxorps %ymm1, %ymm0, %ymm0
17 ; X64-LABEL: select00:
19 ; X64-NEXT: cmpl $255, %edi
20 ; X64-NEXT: vxorps %xmm1, %xmm1, %xmm1
21 ; X64-NEXT: je .LBB0_2
23 ; X64-NEXT: vmovaps %ymm0, %ymm1
25 ; X64-NEXT: vxorps %ymm1, %ymm0, %ymm0
27 %cmpres = icmp eq i32 %a, 255
28 %selres = select i1 %cmpres, <8 x i32> zeroinitializer, <8 x i32> %b
29 %res = xor <8 x i32> %b, %selres
33 define <4 x i64> @select01(i32 %a, <4 x i64> %b) nounwind {
34 ; X86-LABEL: select01:
36 ; X86-NEXT: cmpl $255, {{[0-9]+}}(%esp)
37 ; X86-NEXT: vxorps %xmm1, %xmm1, %xmm1
38 ; X86-NEXT: je .LBB1_2
40 ; X86-NEXT: vmovaps %ymm0, %ymm1
42 ; X86-NEXT: vxorps %ymm1, %ymm0, %ymm0
45 ; X64-LABEL: select01:
47 ; X64-NEXT: cmpl $255, %edi
48 ; X64-NEXT: vxorps %xmm1, %xmm1, %xmm1
49 ; X64-NEXT: je .LBB1_2
51 ; X64-NEXT: vmovaps %ymm0, %ymm1
53 ; X64-NEXT: vxorps %ymm1, %ymm0, %ymm0
55 %cmpres = icmp eq i32 %a, 255
56 %selres = select i1 %cmpres, <4 x i64> zeroinitializer, <4 x i64> %b
57 %res = xor <4 x i64> %b, %selres