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