comparison test/CodeGen/X86/avx-select.ll @ 100:7d135dc70f03 LLVM 3.9

LLVM 3.9
author Miyagi Mitsuki <e135756@ie.u-ryukyu.ac.jp>
date Tue, 26 Jan 2016 22:53:40 +0900
parents 95c75e76d11b
children 1172e4bd9c6f
comparison
equal deleted inserted replaced
96:6418606d0ead 100:7d135dc70f03
1 ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=corei7-avx -mattr=+avx | FileCheck %s 1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mattr=+avx | FileCheck %s
2 3
3 ; CHECK: _select00
4 ; CHECK: vmovaps
5 ; CHECK-NEXT: LBB
6 define <8 x i32> @select00(i32 %a, <8 x i32> %b) nounwind { 4 define <8 x i32> @select00(i32 %a, <8 x i32> %b) nounwind {
5 ; CHECK-LABEL: select00:
6 ; CHECK: ## BB#0:
7 ; CHECK-NEXT: vxorps %xmm1, %xmm1, %xmm1
8 ; CHECK-NEXT: cmpl $255, %edi
9 ; CHECK-NEXT: je LBB0_2
10 ; CHECK-NEXT: ## BB#1:
11 ; CHECK-NEXT: vmovaps %ymm0, %ymm1
12 ; CHECK-NEXT: LBB0_2:
13 ; CHECK-NEXT: vxorps %ymm1, %ymm0, %ymm0
14 ; CHECK-NEXT: retq
7 %cmpres = icmp eq i32 %a, 255 15 %cmpres = icmp eq i32 %a, 255
8 %selres = select i1 %cmpres, <8 x i32> zeroinitializer, <8 x i32> %b 16 %selres = select i1 %cmpres, <8 x i32> zeroinitializer, <8 x i32> %b
9 %res = xor <8 x i32> %b, %selres 17 %res = xor <8 x i32> %b, %selres
10 ret <8 x i32> %res 18 ret <8 x i32> %res
11 } 19 }
12 20
13 ; CHECK: _select01
14 ; CHECK: vmovaps
15 ; CHECK-NEXT: LBB
16 define <4 x i64> @select01(i32 %a, <4 x i64> %b) nounwind { 21 define <4 x i64> @select01(i32 %a, <4 x i64> %b) nounwind {
22 ; CHECK-LABEL: select01:
23 ; CHECK: ## BB#0:
24 ; CHECK-NEXT: vxorps %xmm1, %xmm1, %xmm1
25 ; CHECK-NEXT: cmpl $255, %edi
26 ; CHECK-NEXT: je LBB1_2
27 ; CHECK-NEXT: ## BB#1:
28 ; CHECK-NEXT: vmovaps %ymm0, %ymm1
29 ; CHECK-NEXT: LBB1_2:
30 ; CHECK-NEXT: vxorps %ymm1, %ymm0, %ymm0
31 ; CHECK-NEXT: retq
17 %cmpres = icmp eq i32 %a, 255 32 %cmpres = icmp eq i32 %a, 255
18 %selres = select i1 %cmpres, <4 x i64> zeroinitializer, <4 x i64> %b 33 %selres = select i1 %cmpres, <4 x i64> zeroinitializer, <4 x i64> %b
19 %res = xor <4 x i64> %b, %selres 34 %res = xor <4 x i64> %b, %selres
20 ret <4 x i64> %res 35 ret <4 x i64> %res
21 } 36 }