Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Side by Side Diff: tests_lit/llvm2ice_tests/vector-bitcast.ll

Issue 1755333002: Subzero. ARM32. Fixes bugs uncovered by the llvm test suite. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: make format; adds more lit tests (arm 64 bit) Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 ; This file tests bitcasts of vector type. For most operations, these 1 ; This file tests bitcasts of vector type. For most operations, these
2 ; should be lowered to a no-op on -O2. 2 ; should be lowered to a no-op on -O2.
3 3
4 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -O2 \ 4 ; RUN: %p2i -i %s --filetype=obj --disassemble --target=x8632 --args -O2 \
5 ; RUN: | FileCheck %s 5 ; RUN: | FileCheck --check-prefix=X86-O2 --check-prefix=X86 %s
6 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -Om1 \ 6 ; RUN: %p2i -i %s --filetype=obj --disassemble --target=x8632 --args -Om1 \
7 ; RUN: | FileCheck --check-prefix=OPTM1 %s 7 ; RUN: | FileCheck --check-prefix=X86 %s
8
9 ; RUN: %p2i -i %s --filetype=obj --disassemble --target=x8664 --args -O2 \
10 ; RUN: | FileCheck --check-prefix=X86-O2 --check-prefix=X86 %s
11 ; RUN: %p2i -i %s --filetype=obj --disassemble --target=x8664 --args -Om1 \
12 ; RUN: | FileCheck --check-prefix=X86 %s
13
14 ; RUN: %p2i -i %s --filetype=obj --disassemble --target=arm32 --args -O2 \
15 ; RUN: | FileCheck --check-prefix=ARM32-O2-O2 --check-prefix=ARM32 %s
16 ; RUN: %p2i -i %s --filetype=obj --disassemble --target=arm32 --args -Om1 \
17 ; RUN: | FileCheck --check-prefix=ARM32 %s
8 18
9 define internal <16 x i8> @test_bitcast_v16i8_to_v16i8(<16 x i8> %arg) { 19 define internal <16 x i8> @test_bitcast_v16i8_to_v16i8(<16 x i8> %arg) {
10 entry: 20 entry:
11 %res = bitcast <16 x i8> %arg to <16 x i8> 21 %res = bitcast <16 x i8> %arg to <16 x i8>
12 ret <16 x i8> %res 22 ret <16 x i8> %res
13 23
14 ; CHECK-LABEL: test_bitcast_v16i8_to_v16i8 24 ; X86-O2-LABEL: test_bitcast_v16i8_to_v16i8
15 ; CHECK-NEXT: ret 25 ; X86-O2-NEXT: ret
26
27 ; ARM32-O2-LABEL: test_bitcast_v16i8_to_v16i8
28 ; ARM32-O2-NEXT: bx
16 } 29 }
17 30
18 define internal <8 x i16> @test_bitcast_v16i8_to_v8i16(<16 x i8> %arg) { 31 define internal <8 x i16> @test_bitcast_v16i8_to_v8i16(<16 x i8> %arg) {
19 entry: 32 entry:
20 %res = bitcast <16 x i8> %arg to <8 x i16> 33 %res = bitcast <16 x i8> %arg to <8 x i16>
21 ret <8 x i16> %res 34 ret <8 x i16> %res
22 35
23 ; CHECK-LABEL: test_bitcast_v16i8_to_v8i16 36 ; X86-O2-LABEL: test_bitcast_v16i8_to_v8i16
24 ; CHECK-NEXT: ret 37 ; X86-O2-NEXT: ret
38
39 ; ARM32-O2-LABEL: test_bitcast_v16i8_to_v8i16
40 ; ARM32-O2-NEXT: bx
25 } 41 }
26 42
27 define internal <4 x i32> @test_bitcast_v16i8_to_v4i32(<16 x i8> %arg) { 43 define internal <4 x i32> @test_bitcast_v16i8_to_v4i32(<16 x i8> %arg) {
28 entry: 44 entry:
29 %res = bitcast <16 x i8> %arg to <4 x i32> 45 %res = bitcast <16 x i8> %arg to <4 x i32>
30 ret <4 x i32> %res 46 ret <4 x i32> %res
31 47
32 ; CHECK-LABEL: test_bitcast_v16i8_to_v4i32 48 ; X86-O2-LABEL: test_bitcast_v16i8_to_v4i32
33 ; CHECK-NEXT: ret 49 ; X86-O2-NEXT: ret
50
51 ; ARM32-O2-LABEL: test_bitcast_v16i8_to_v4i32
52 ; ARM32-O2-NEXT: bx
34 } 53 }
35 54
36 define internal <4 x float> @test_bitcast_v16i8_to_v4f32(<16 x i8> %arg) { 55 define internal <4 x float> @test_bitcast_v16i8_to_v4f32(<16 x i8> %arg) {
37 entry: 56 entry:
38 %res = bitcast <16 x i8> %arg to <4 x float> 57 %res = bitcast <16 x i8> %arg to <4 x float>
39 ret <4 x float> %res 58 ret <4 x float> %res
40 59
41 ; CHECK-LABEL: test_bitcast_v16i8_to_v4f32 60 ; X86-O2-LABEL: test_bitcast_v16i8_to_v4f32
42 ; CHECK-NEXT: ret 61 ; X86-O2-NEXT: ret
62
63 ; ARM32-O2-LABEL: test_bitcast_v16i8_to_v4f32
64 ; ARM32-O2-NEXT: bx
43 } 65 }
44 66
45 define internal <16 x i8> @test_bitcast_v8i16_to_v16i8(<8 x i16> %arg) { 67 define internal <16 x i8> @test_bitcast_v8i16_to_v16i8(<8 x i16> %arg) {
46 entry: 68 entry:
47 %res = bitcast <8 x i16> %arg to <16 x i8> 69 %res = bitcast <8 x i16> %arg to <16 x i8>
48 ret <16 x i8> %res 70 ret <16 x i8> %res
49 71
50 ; CHECK-LABEL: test_bitcast_v8i16_to_v16i8 72 ; X86-O2-LABEL: test_bitcast_v8i16_to_v16i8
51 ; CHECK-NEXT: ret 73 ; X86-O2-NEXT: ret
74
75 ; ARM32-O2-LABEL: test_bitcast_v8i16_to_v16i8
76 ; ARM32-O2-NEXT: bx
52 } 77 }
53 78
54 define internal <8 x i16> @test_bitcast_v8i16_to_v8i16(<8 x i16> %arg) { 79 define internal <8 x i16> @test_bitcast_v8i16_to_v8i16(<8 x i16> %arg) {
55 entry: 80 entry:
56 %res = bitcast <8 x i16> %arg to <8 x i16> 81 %res = bitcast <8 x i16> %arg to <8 x i16>
57 ret <8 x i16> %res 82 ret <8 x i16> %res
58 83
59 ; CHECK-LABEL: test_bitcast_v8i16_to_v8i16 84 ; X86-O2-LABEL: test_bitcast_v8i16_to_v8i16
60 ; CHECK-NEXT: ret 85 ; X86-O2-NEXT: ret
86
87 ; ARM32-O2-LABEL: test_bitcast_v8i16_to_v8i16
88 ; ARM32-O2-NEXT: bx
61 } 89 }
62 90
63 define internal <4 x i32> @test_bitcast_v8i16_to_v4i32(<8 x i16> %arg) { 91 define internal <4 x i32> @test_bitcast_v8i16_to_v4i32(<8 x i16> %arg) {
64 entry: 92 entry:
65 %res = bitcast <8 x i16> %arg to <4 x i32> 93 %res = bitcast <8 x i16> %arg to <4 x i32>
66 ret <4 x i32> %res 94 ret <4 x i32> %res
67 95
68 ; CHECK-LABEL: test_bitcast_v8i16_to_v4i32 96 ; X86-O2-LABEL: test_bitcast_v8i16_to_v4i32
69 ; CHECK-NEXT: ret 97 ; X86-O2-NEXT: ret
98
99 ; ARM32-O2-LABEL: test_bitcast_v8i16_to_v4i32
100 ; ARM32-O2-NEXT: bx
70 } 101 }
71 102
72 define internal <4 x float> @test_bitcast_v8i16_to_v4f32(<8 x i16> %arg) { 103 define internal <4 x float> @test_bitcast_v8i16_to_v4f32(<8 x i16> %arg) {
73 entry: 104 entry:
74 %res = bitcast <8 x i16> %arg to <4 x float> 105 %res = bitcast <8 x i16> %arg to <4 x float>
75 ret <4 x float> %res 106 ret <4 x float> %res
76 107
77 ; CHECK-LABEL: test_bitcast_v8i16_to_v4f32 108 ; X86-O2-LABEL: test_bitcast_v8i16_to_v4f32
78 ; CHECK-NEXT: ret 109 ; X86-O2-NEXT: ret
110
111 ; ARM32-O2-LABEL: test_bitcast_v8i16_to_v4f32
112 ; ARM32-O2-NEXT: bx
79 } 113 }
80 114
81 define internal <16 x i8> @test_bitcast_v4i32_to_v16i8(<4 x i32> %arg) { 115 define internal <16 x i8> @test_bitcast_v4i32_to_v16i8(<4 x i32> %arg) {
82 entry: 116 entry:
83 %res = bitcast <4 x i32> %arg to <16 x i8> 117 %res = bitcast <4 x i32> %arg to <16 x i8>
84 ret <16 x i8> %res 118 ret <16 x i8> %res
85 119
86 ; CHECK-LABEL: test_bitcast_v4i32_to_v16i8 120 ; X86-O2-LABEL: test_bitcast_v4i32_to_v16i8
87 ; CHECK-NEXT: ret 121 ; X86-O2-NEXT: ret
122
123 ; ARM32-O2-LABEL: test_bitcast_v4i32_to_v16i8
124 ; ARM32-O2-NEXT: bx
88 } 125 }
89 126
90 define internal <8 x i16> @test_bitcast_v4i32_to_v8i16(<4 x i32> %arg) { 127 define internal <8 x i16> @test_bitcast_v4i32_to_v8i16(<4 x i32> %arg) {
91 entry: 128 entry:
92 %res = bitcast <4 x i32> %arg to <8 x i16> 129 %res = bitcast <4 x i32> %arg to <8 x i16>
93 ret <8 x i16> %res 130 ret <8 x i16> %res
94 131
95 ; CHECK-LABEL: test_bitcast_v4i32_to_v8i16 132 ; X86-O2-LABEL: test_bitcast_v4i32_to_v8i16
96 ; CHECK-NEXT: ret 133 ; X86-O2-NEXT: ret
134
135 ; ARM32-O2-LABEL: test_bitcast_v4i32_to_v8i16
136 ; ARM32-O2-NEXT: bx
97 } 137 }
98 138
99 define internal <4 x i32> @test_bitcast_v4i32_to_v4i32(<4 x i32> %arg) { 139 define internal <4 x i32> @test_bitcast_v4i32_to_v4i32(<4 x i32> %arg) {
100 entry: 140 entry:
101 %res = bitcast <4 x i32> %arg to <4 x i32> 141 %res = bitcast <4 x i32> %arg to <4 x i32>
102 ret <4 x i32> %res 142 ret <4 x i32> %res
103 143
104 ; CHECK-LABEL: test_bitcast_v4i32_to_v4i32 144 ; X86-O2-LABEL: test_bitcast_v4i32_to_v4i32
105 ; CHECK-NEXT: ret 145 ; X86-O2-NEXT: ret
146
147 ; ARM32-O2-LABEL: test_bitcast_v4i32_to_v4i32
148 ; ARM32-O2-NEXT: bx
106 } 149 }
107 150
108 define internal <4 x float> @test_bitcast_v4i32_to_v4f32(<4 x i32> %arg) { 151 define internal <4 x float> @test_bitcast_v4i32_to_v4f32(<4 x i32> %arg) {
109 entry: 152 entry:
110 %res = bitcast <4 x i32> %arg to <4 x float> 153 %res = bitcast <4 x i32> %arg to <4 x float>
111 ret <4 x float> %res 154 ret <4 x float> %res
112 155
113 ; CHECK-LABEL: test_bitcast_v4i32_to_v4f32 156 ; X86-O2-LABEL: test_bitcast_v4i32_to_v4f32
114 ; CHECK-NEXT: ret 157 ; X86-O2-NEXT: ret
158
159 ; ARM32-O2-LABEL: test_bitcast_v4i32_to_v4f32
160 ; ARM32-O2-NEXT: bx
115 } 161 }
116 162
117 define internal <16 x i8> @test_bitcast_v4f32_to_v16i8(<4 x float> %arg) { 163 define internal <16 x i8> @test_bitcast_v4f32_to_v16i8(<4 x float> %arg) {
118 entry: 164 entry:
119 %res = bitcast <4 x float> %arg to <16 x i8> 165 %res = bitcast <4 x float> %arg to <16 x i8>
120 ret <16 x i8> %res 166 ret <16 x i8> %res
121 167
122 ; CHECK-LABEL: test_bitcast_v4f32_to_v16i8 168 ; X86-O2-LABEL: test_bitcast_v4f32_to_v16i8
123 ; CHECK-NEXT: ret 169 ; X86-O2-NEXT: ret
170
171 ; ARM32-O2-LABEL: test_bitcast_v4f32_to_v16i8
172 ; ARM32-O2-NEXT: bx
124 } 173 }
125 174
126 define internal <8 x i16> @test_bitcast_v4f32_to_v8i16(<4 x float> %arg) { 175 define internal <8 x i16> @test_bitcast_v4f32_to_v8i16(<4 x float> %arg) {
127 entry: 176 entry:
128 %res = bitcast <4 x float> %arg to <8 x i16> 177 %res = bitcast <4 x float> %arg to <8 x i16>
129 ret <8 x i16> %res 178 ret <8 x i16> %res
130 179
131 ; CHECK-LABEL: test_bitcast_v4f32_to_v8i16 180 ; X86-O2-LABEL: test_bitcast_v4f32_to_v8i16
132 ; CHECK-NEXT: ret 181 ; X86-O2-NEXT: ret
182
183 ; ARM32-O2-LABEL: test_bitcast_v4f32_to_v8i16
184 ; ARM32-O2-NEXT: bx
133 } 185 }
134 186
135 define internal <4 x i32> @test_bitcast_v4f32_to_v4i32(<4 x float> %arg) { 187 define internal <4 x i32> @test_bitcast_v4f32_to_v4i32(<4 x float> %arg) {
136 entry: 188 entry:
137 %res = bitcast <4 x float> %arg to <4 x i32> 189 %res = bitcast <4 x float> %arg to <4 x i32>
138 ret <4 x i32> %res 190 ret <4 x i32> %res
139 191
140 ; CHECK-LABEL: test_bitcast_v4f32_to_v4i32 192 ; X86-O2-LABEL: test_bitcast_v4f32_to_v4i32
141 ; CHECK-NEXT: ret 193 ; X86-O2-NEXT: ret
194
195 ; ARM32-O2-LABEL: test_bitcast_v4f32_to_v4i32
196 ; ARM32-O2-NEXT: bx
142 } 197 }
143 198
144 define internal <4 x float> @test_bitcast_v4f32_to_v4f32(<4 x float> %arg) { 199 define internal <4 x float> @test_bitcast_v4f32_to_v4f32(<4 x float> %arg) {
145 entry: 200 entry:
146 %res = bitcast <4 x float> %arg to <4 x float> 201 %res = bitcast <4 x float> %arg to <4 x float>
147 ret <4 x float> %res 202 ret <4 x float> %res
148 203
149 ; CHECK-LABEL: test_bitcast_v4f32_to_v4f32 204 ; X86-O2-LABEL: test_bitcast_v4f32_to_v4f32
150 ; CHECK-NEXT: ret 205 ; X86-O2-NEXT: ret
206
207 ; ARM32-O2-LABEL: test_bitcast_v4f32_to_v4f32
208 ; ARM32-O2-NEXT: bx
151 } 209 }
152 210
153 define internal i32 @test_bitcast_v8i1_to_i8(<8 x i1> %arg) { 211 define internal i32 @test_bitcast_v8i1_to_i8(<8 x i1> %arg) {
154 entry: 212 entry:
155 %res = bitcast <8 x i1> %arg to i8 213 %res = bitcast <8 x i1> %arg to i8
156 %res.i32 = zext i8 %res to i32 214 %res.i32 = zext i8 %res to i32
157 ret i32 %res.i32 215 ret i32 %res.i32
158 216
159 ; CHECK-LABEL: test_bitcast_v8i1_to_i8 217 ; X86-LABEL: test_bitcast_v8i1_to_i8
160 ; CHECK: call {{.*}} R_{{.*}} __Sz_bitcast_8xi1_i8 218 ; X86: call {{.*}} R_{{.*}} __Sz_bitcast_8xi1_i8
161 219
162 ; OPTM1-LABEL: test_bitcast_v8i1_to_i8 220 ; ARM32-LABEL: test_bitcast_v8i1_to_i8
163 ; OPMT1: call -4 221 ; ARM32: bl {{.*}} __Sz_bitcast_8xi1_i8
John 2016/03/02 21:38:59 typo... only found this out because :%s/OPTM1/X86
164 } 222 }
165 223
166 define internal i32 @test_bitcast_v16i1_to_i16(<16 x i1> %arg) { 224 define internal i32 @test_bitcast_v16i1_to_i16(<16 x i1> %arg) {
167 entry: 225 entry:
168 %res = bitcast <16 x i1> %arg to i16 226 %res = bitcast <16 x i1> %arg to i16
169 %res.i32 = zext i16 %res to i32 227 %res.i32 = zext i16 %res to i32
170 ret i32 %res.i32 228 ret i32 %res.i32
171 229
172 ; CHECK-LABEL: test_bitcast_v16i1_to_i16 230 ; X86-LABEL: test_bitcast_v16i1_to_i16
173 ; CHECK: call {{.*}} R_{{.*}} __Sz_bitcast_16xi1_i16 231 ; X86: call {{.*}} __Sz_bitcast_16xi1_i16
174 232
175 ; OPTM1-LABEL: test_bitcast_v16i1_to_i16 233 ; ARM32-LABEL: test_bitcast_v16i1_to_i16
176 ; OPMT1: call -4 234 ; ARM32: bl {{.*}} __Sz_bitcast_16xi1_i16
177 } 235 }
178 236
179 define internal <8 x i1> @test_bitcast_i8_to_v8i1(i32 %arg) { 237 define internal <8 x i1> @test_bitcast_i8_to_v8i1(i32 %arg) {
180 entry: 238 entry:
181 %arg.trunc = trunc i32 %arg to i8 239 %arg.trunc = trunc i32 %arg to i8
182 %res = bitcast i8 %arg.trunc to <8 x i1> 240 %res = bitcast i8 %arg.trunc to <8 x i1>
183 ret <8 x i1> %res 241 ret <8 x i1> %res
184 242
185 ; CHECK-LABEL: test_bitcast_i8_to_v8i1 243 ; X86-LABEL: test_bitcast_i8_to_v8i1
186 ; CHECK: call {{.*}} R_{{.*}} __Sz_bitcast_i8_8xi1 244 ; X86: call {{.*}} R_{{.*}} __Sz_bitcast_i8_8xi1
187 245
188 ; OPTM1-LABEL: test_bitcast_i8_to_v8i1 246 ; ARM32-LABEL: test_bitcast_i8_to_v8i1
189 ; OPTM1: call {{.*}} R_{{.*}} __Sz_bitcast_i8_8xi1 247 ; ARM32: bl {{.*}} __Sz_bitcast_i8_8xi1
190 } 248 }
191 249
192 define internal <16 x i1> @test_bitcast_i16_to_v16i1(i32 %arg) { 250 define internal <16 x i1> @test_bitcast_i16_to_v16i1(i32 %arg) {
193 entry: 251 entry:
194 %arg.trunc = trunc i32 %arg to i16 252 %arg.trunc = trunc i32 %arg to i16
195 %res = bitcast i16 %arg.trunc to <16 x i1> 253 %res = bitcast i16 %arg.trunc to <16 x i1>
196 ret <16 x i1> %res 254 ret <16 x i1> %res
197 255
198 ; CHECK-LABEL: test_bitcast_i16_to_v16i1 256 ; X86-LABEL: test_bitcast_i16_to_v16i1
199 ; CHECK: call {{.*}} R_{{.*}} __Sz_bitcast_i16_16xi1 257 ; X86: call {{.*}} R_{{.*}} __Sz_bitcast_i16_16xi1
200 258
201 ; OPTM1-LABEL: test_bitcast_i16_to_v16i1 259 ; ARM32-LABEL: test_bitcast_i16_to_v16i1
202 ; OPTM1: call {{.*}} R_{{.*}} __Sz_bitcast_i16_16xi1 260 ; ARM32: bl {{.*}} __Sz_bitcast_i16_16xi1
203 } 261 }
OLDNEW
« src/IceTargetLoweringARM32.h ('K') | « tests_lit/llvm2ice_tests/64bit.pnacl.ll ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698