OLD | NEW |
1 ; This file tests support for the select instruction with vector valued inputs. | 1 ; This file tests support for the select instruction with vector valued inputs. |
2 | 2 |
3 ; RUN: %p2i -i %s --args -O2 --verbose none \ | 3 ; RUN: %p2i -i %s --assemble --disassemble --args -O2 --verbose none \ |
4 ; RUN: | llvm-mc -triple=i686-none-nacl -filetype=obj \ | 4 ; RUN: | FileCheck %s |
5 ; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - | FileCheck %s | 5 ; RUN: %p2i -i %s --assemble --disassemble --args -Om1 --verbose none \ |
6 ; RUN: %p2i -i %s --args -Om1 --verbose none \ | 6 ; RUN: | FileCheck %s |
7 ; RUN: | llvm-mc -triple=i686-none-nacl -filetype=obj \ | 7 ; RUN: %p2i -i %s --assemble --disassemble --args -O2 -mattr=sse4.1 --verbose \ |
8 ; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - | FileCheck %s | 8 ; RUN: none \ |
9 ; RUN: %p2i -i %s --args -O2 -mattr=sse4.1 --verbose none \ | |
10 ; RUN: | llvm-mc -triple=i686-none-nacl -filetype=obj \ | |
11 ; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - \ | |
12 ; RUN: | FileCheck --check-prefix=SSE41 %s | 9 ; RUN: | FileCheck --check-prefix=SSE41 %s |
13 ; RUN: %p2i -i %s --args -Om1 -mattr=sse4.1 --verbose none \ | 10 ; RUN: %p2i -i %s --assemble --disassemble --args -Om1 -mattr=sse4.1 --verbose \ |
14 ; RUN: | llvm-mc -triple=i686-none-nacl -filetype=obj \ | 11 ; RUN: none \ |
15 ; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - \ | |
16 ; RUN: | FileCheck --check-prefix=SSE41 %s | 12 ; RUN: | FileCheck --check-prefix=SSE41 %s |
17 | 13 |
18 define <16 x i8> @test_select_v16i8(<16 x i1> %cond, <16 x i8> %arg1, <16 x i8>
%arg2) { | 14 define <16 x i8> @test_select_v16i8(<16 x i1> %cond, <16 x i8> %arg1, <16 x i8>
%arg2) { |
19 entry: | 15 entry: |
20 %res = select <16 x i1> %cond, <16 x i8> %arg1, <16 x i8> %arg2 | 16 %res = select <16 x i1> %cond, <16 x i8> %arg1, <16 x i8> %arg2 |
21 ret <16 x i8> %res | 17 ret <16 x i8> %res |
22 ; CHECK-LABEL: test_select_v16i8: | 18 ; CHECK-LABEL: test_select_v16i8 |
23 ; CHECK: pand | 19 ; CHECK: pand |
24 ; CHECK: pandn | 20 ; CHECK: pandn |
25 ; CHECK: por | 21 ; CHECK: por |
26 | 22 |
27 ; SSE41-LABEL: test_select_v16i8: | 23 ; SSE41-LABEL: test_select_v16i8 |
28 ; SSE41: pblendvb xmm{{[0-7]}}, {{xmm[0-7]|xmmword}} | 24 ; SSE41: pblendvb xmm{{[0-7]}}, {{xmm[0-7]|xmmword}} |
29 } | 25 } |
30 | 26 |
31 define <16 x i1> @test_select_v16i1(<16 x i1> %cond, <16 x i1> %arg1, <16 x i1>
%arg2) { | 27 define <16 x i1> @test_select_v16i1(<16 x i1> %cond, <16 x i1> %arg1, <16 x i1>
%arg2) { |
32 entry: | 28 entry: |
33 %res = select <16 x i1> %cond, <16 x i1> %arg1, <16 x i1> %arg2 | 29 %res = select <16 x i1> %cond, <16 x i1> %arg1, <16 x i1> %arg2 |
34 ret <16 x i1> %res | 30 ret <16 x i1> %res |
35 ; CHECK-LABEL: test_select_v16i1: | 31 ; CHECK-LABEL: test_select_v16i1 |
36 ; CHECK: pand | 32 ; CHECK: pand |
37 ; CHECK: pandn | 33 ; CHECK: pandn |
38 ; CHECK: por | 34 ; CHECK: por |
39 | 35 |
40 ; SSE41-LABEL: test_select_v16i1: | 36 ; SSE41-LABEL: test_select_v16i1 |
41 ; SSE41: pblendvb xmm{{[0-7]}}, {{xmm[0-7]|xmmword}} | 37 ; SSE41: pblendvb xmm{{[0-7]}}, {{xmm[0-7]|xmmword}} |
42 } | 38 } |
43 | 39 |
44 define <8 x i16> @test_select_v8i16(<8 x i1> %cond, <8 x i16> %arg1, <8 x i16> %
arg2) { | 40 define <8 x i16> @test_select_v8i16(<8 x i1> %cond, <8 x i16> %arg1, <8 x i16> %
arg2) { |
45 entry: | 41 entry: |
46 %res = select <8 x i1> %cond, <8 x i16> %arg1, <8 x i16> %arg2 | 42 %res = select <8 x i1> %cond, <8 x i16> %arg1, <8 x i16> %arg2 |
47 ret <8 x i16> %res | 43 ret <8 x i16> %res |
48 ; CHECK-LABEL: test_select_v8i16: | 44 ; CHECK-LABEL: test_select_v8i16 |
49 ; CHECK: pand | 45 ; CHECK: pand |
50 ; CHECK: pandn | 46 ; CHECK: pandn |
51 ; CHECK: por | 47 ; CHECK: por |
52 | 48 |
53 ; SSE41-LABEL: test_select_v8i16: | 49 ; SSE41-LABEL: test_select_v8i16 |
54 ; SSE41: pblendvb xmm{{[0-7]}}, {{xmm[0-7]|xmmword}} | 50 ; SSE41: pblendvb xmm{{[0-7]}}, {{xmm[0-7]|xmmword}} |
55 } | 51 } |
56 | 52 |
57 define <8 x i1> @test_select_v8i1(<8 x i1> %cond, <8 x i1> %arg1, <8 x i1> %arg2
) { | 53 define <8 x i1> @test_select_v8i1(<8 x i1> %cond, <8 x i1> %arg1, <8 x i1> %arg2
) { |
58 entry: | 54 entry: |
59 %res = select <8 x i1> %cond, <8 x i1> %arg1, <8 x i1> %arg2 | 55 %res = select <8 x i1> %cond, <8 x i1> %arg1, <8 x i1> %arg2 |
60 ret <8 x i1> %res | 56 ret <8 x i1> %res |
61 ; CHECK-LABEL: test_select_v8i1: | 57 ; CHECK-LABEL: test_select_v8i1 |
62 ; CHECK: pand | 58 ; CHECK: pand |
63 ; CHECK: pandn | 59 ; CHECK: pandn |
64 ; CHECK: por | 60 ; CHECK: por |
65 | 61 |
66 ; SSE41-LABEL: test_select_v8i1: | 62 ; SSE41-LABEL: test_select_v8i1 |
67 ; SSE41: pblendvb xmm{{[0-7]}}, {{xmm[0-7]|xmmword}} | 63 ; SSE41: pblendvb xmm{{[0-7]}}, {{xmm[0-7]|xmmword}} |
68 } | 64 } |
69 | 65 |
70 define <4 x i32> @test_select_v4i32(<4 x i1> %cond, <4 x i32> %arg1, <4 x i32> %
arg2) { | 66 define <4 x i32> @test_select_v4i32(<4 x i1> %cond, <4 x i32> %arg1, <4 x i32> %
arg2) { |
71 entry: | 67 entry: |
72 %res = select <4 x i1> %cond, <4 x i32> %arg1, <4 x i32> %arg2 | 68 %res = select <4 x i1> %cond, <4 x i32> %arg1, <4 x i32> %arg2 |
73 ret <4 x i32> %res | 69 ret <4 x i32> %res |
74 ; CHECK-LABEL: test_select_v4i32: | 70 ; CHECK-LABEL: test_select_v4i32 |
75 ; CHECK: pand | 71 ; CHECK: pand |
76 ; CHECK: pandn | 72 ; CHECK: pandn |
77 ; CHECK: por | 73 ; CHECK: por |
78 | 74 |
79 ; SSE41-LABEL: test_select_v4i32: | 75 ; SSE41-LABEL: test_select_v4i32 |
80 ; SSE41: pslld xmm0, 31 | 76 ; SSE41: pslld xmm0, 31 |
81 ; SSE41: blendvps xmm{{[0-7]}}, {{xmm[0-7]|xmmword}} | 77 ; SSE41: blendvps xmm{{[0-7]}}, {{xmm[0-7]|xmmword}} |
82 } | 78 } |
83 | 79 |
84 define <4 x float> @test_select_v4f32(<4 x i1> %cond, <4 x float> %arg1, <4 x fl
oat> %arg2) { | 80 define <4 x float> @test_select_v4f32(<4 x i1> %cond, <4 x float> %arg1, <4 x fl
oat> %arg2) { |
85 entry: | 81 entry: |
86 %res = select <4 x i1> %cond, <4 x float> %arg1, <4 x float> %arg2 | 82 %res = select <4 x i1> %cond, <4 x float> %arg1, <4 x float> %arg2 |
87 ret <4 x float> %res | 83 ret <4 x float> %res |
88 ; CHECK-LABEL: test_select_v4f32: | 84 ; CHECK-LABEL: test_select_v4f32 |
89 ; CHECK: pand | 85 ; CHECK: pand |
90 ; CHECK: pandn | 86 ; CHECK: pandn |
91 ; CHECK: por | 87 ; CHECK: por |
92 | 88 |
93 ; SSE41-LABEL: test_select_v4f32: | 89 ; SSE41-LABEL: test_select_v4f32 |
94 ; SSE41: pslld xmm0, 31 | 90 ; SSE41: pslld xmm0, 31 |
95 ; SSE41: blendvps xmm{{[0-7]}}, {{xmm[0-7]|xmmword}} | 91 ; SSE41: blendvps xmm{{[0-7]}}, {{xmm[0-7]|xmmword}} |
96 } | 92 } |
97 | 93 |
98 define <4 x i1> @test_select_v4i1(<4 x i1> %cond, <4 x i1> %arg1, <4 x i1> %arg2
) { | 94 define <4 x i1> @test_select_v4i1(<4 x i1> %cond, <4 x i1> %arg1, <4 x i1> %arg2
) { |
99 entry: | 95 entry: |
100 %res = select <4 x i1> %cond, <4 x i1> %arg1, <4 x i1> %arg2 | 96 %res = select <4 x i1> %cond, <4 x i1> %arg1, <4 x i1> %arg2 |
101 ret <4 x i1> %res | 97 ret <4 x i1> %res |
102 ; CHECK-LABEL: test_select_v4i1: | 98 ; CHECK-LABEL: test_select_v4i1 |
103 ; CHECK: pand | 99 ; CHECK: pand |
104 ; CHECK: pandn | 100 ; CHECK: pandn |
105 ; CHECK: por | 101 ; CHECK: por |
106 | 102 |
107 ; SSE41-LABEL: test_select_v4i1: | 103 ; SSE41-LABEL: test_select_v4i1 |
108 ; SSE41: pslld xmm0, 31 | 104 ; SSE41: pslld xmm0, 31 |
109 ; SSE41: blendvps xmm{{[0-7]}}, {{xmm[0-7]|xmmword}} | 105 ; SSE41: blendvps xmm{{[0-7]}}, {{xmm[0-7]|xmmword}} |
110 } | 106 } |
OLD | NEW |