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

Side by Side Diff: tests_lit/assembler/arm32/insert-extract.ll

Issue 1655313002: Subzero: ARM32: lowering of vector insert and extract. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Code review feedback. Created 4 years, 10 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
(Empty)
1 ; Show that we know how to translate insertelement and extractelement.
2
3 ; REQUIRES: allow_dump
4
5 ; Compile using standalone assembler.
6 ; RUN: %p2i --filetype=asm -i %s --target=arm32 --args -Om1 \
7 ; RUN: | FileCheck %s --check-prefix=ASM
8
9 ; Show bytes in assembled standalone code.
10 ; RUN: %p2i --filetype=asm -i %s --target=arm32 --assemble --disassemble \
11 ; RUN: --args -Om1 \
12 ; RUN: | FileCheck %s --check-prefix=DIS
13
14 ; Compile using integrated assembler.
15 ; RUN: %p2i --filetype=iasm -i %s --target=arm32 --args -Om1 \
16 ; RUN: | FileCheck %s --check-prefix=IASM
17
18 ; Show bytes in assembled integrated code.
19 ; RUN: %p2i --filetype=iasm -i %s --target=arm32 --assemble --disassemble \
20 ; RUN: --args -Om1 \
21 ; RUN: | FileCheck %s --check-prefix=DIS
22
23 define internal i32 @extract1_v4i32(<4 x i32> %src) {
24 ; ASM-LABEL: extract1_v4i32:
25 ; DIS-LABEL: 00000000 <extract1_v4i32>:
26 ; IASM-LABEL: extract1_v4i32:
27
28 %1 = extractelement <4 x i32> %src, i32 1
29
30 ; ASM: vmov.32 r0, d0[1]
31 ; DIS: 10: ee300b10
32
33 ret i32 %1
34 }
35
36 define internal i32 @extract2_v4i32(<4 x i32> %src) {
37 ; ASM-LABEL: extract2_v4i32:
38 ; DIS-LABEL: 00000030 <extract2_v4i32>:
39 ; IASM-LABEL: extract2_v4i32:
40
41 %1 = extractelement <4 x i32> %src, i32 2
42
43 ; ASM: vmov.32 r0, d1[0]
44 ; DIS: 40: ee110b10
45
46 ret i32 %1
47 }
48
49 define internal i32 @extract3_v8i16(<8 x i16> %src) {
50 ; ASM-LABEL: extract3_v8i16:
51 ; DIS-LABEL: 00000060 <extract3_v8i16>:
52 ; IASM-LABEL: extract3_v8i16:
53
54 %1 = extractelement <8 x i16> %src, i32 3
55
56 ; ASM: vmov.s16 r0, d0[3]
57 ; DIS: 70: ee300b70
58 %2 = sext i16 %1 to i32
59 ret i32 %2
60 }
61
62 define internal i32 @extract4_v8i16(<8 x i16> %src) {
63 ; ASM-LABEL: extract4_v8i16:
64 ; DIS-LABEL: 00000090 <extract4_v8i16>:
65 ; IASM-LABEL: extract4_v8i16:
66
67 %1 = extractelement <8 x i16> %src, i32 4
68
69 ; ASM: vmov.s16 r0, d1[0]
70 ; DIS: a0: ee110b30
71
72 %2 = sext i16 %1 to i32
73 ret i32 %2
74 }
75
76 define internal i32 @extract7_v4i8(<16 x i8> %src) {
77 ; ASM-LABEL: extract7_v4i8:
78 ; DIS-LABEL: 000000c0 <extract7_v4i8>:
79 ; IASM-LABEL: extract7_v4i8:
80
81 %1 = extractelement <16 x i8> %src, i32 7
82
83 ; ASM: vmov.s8 r0, d0[7]
84 ; DIS: d0: ee700b70
85
86 %2 = sext i8 %1 to i32
87 ret i32 %2
88 }
89
90 define internal i32 @extract8_v16i8(<16 x i8> %src) {
91 ; ASM-LABEL: extract8_v16i8:
92 ; DIS-LABEL: 000000f0 <extract8_v16i8>:
93 ; IASM-LABEL: extract8_v16i8:
94
95 %1 = extractelement <16 x i8> %src, i32 8
96
97 ; ASM: vmov.s8 r0, d1[0]
98 ; DIS: 100: ee510b10
99
100 %2 = sext i8 %1 to i32
101 ret i32 %2
102 }
103
104 define internal float @extract1_v4float(<4 x float> %src) {
105 ; ASM-LABEL: extract1_v4float:
106 ; DIS-LABEL: 00000120 <extract1_v4float>:
107 ; IASM-LABEL: extract1_v4float:
108
109 %1 = extractelement <4 x float> %src, i32 1
110
111 ; ASM: vmov.f32 s0, s1
112 ; DIS: 130: eeb00a60
113
114 ret float %1
115 }
116
117 define internal float @extract2_v4float(<4 x float> %src) {
118 ; ASM-LABEL: extract2_v4float:
119 ; DIS-LABEL: 00000150 <extract2_v4float>:
120 ; IASM-LABEL: extract2_v4float:
121
122 %1 = extractelement <4 x float> %src, i32 2
123
124 ; ASM: vmov.f32 s0, s2
125 ; DIS: 160: eeb00a41
126
127 ret float %1
128 }
129
130 define internal <4 x i32> @insert1_v4i32(<4 x i32> %src, i32 %s) {
131 ; ASM-LABEL: insert1_v4i32:
132 ; DIS-LABEL: 00000180 <insert1_v4i32>:
133 ; IASM-LABEL: insert1_v4i32:
134
135 %1 = insertelement <4 x i32> %src, i32 %s, i32 1
136
137 ; ASM: vmov.32 d0[1], r0
138 ; DIS: 198: ee200b10
139
140 ret <4 x i32> %1
141 }
142
143 define internal <4 x i32> @insert2_v4i32(<4 x i32> %src, i32 %s) {
144 ; ASM-LABEL: insert2_v4i32:
145 ; DIS-LABEL: 000001b0 <insert2_v4i32>:
146 ; IASM-LABEL: insert2_v4i32:
147
148 %1 = insertelement <4 x i32> %src, i32 %s, i32 2
149
150 ; ASM: vmov.32 d1[0], r0
151 ; DIS: 1c8: ee010b10
152
153 ret <4 x i32> %1
154 }
155
156 define internal <8 x i16> @insert3_v8i16(<8 x i16> %src, i32 %s) {
157 ; ASM-LABEL: insert3_v8i16:
158 ; DIS-LABEL: 000001e0 <insert3_v8i16>:
159 ; IASM-LABEL: insert3_v8i16:
160
161 %s2 = trunc i32 %s to i16
162 %1 = insertelement <8 x i16> %src, i16 %s2, i32 3
163
164 ; ASM: vmov.16 d0[3], r0
165 ; DIS: 200: ee200b70
166 ret <8 x i16> %1
167 }
168
169 define internal <8 x i16> @insert4_v8i16(<8 x i16> %src, i32 %s) {
170 ; ASM-LABEL: insert4_v8i16:
171 ; DIS-LABEL: 00000220 <insert4_v8i16>:
172 ; IASM-LABEL: insert4_v8i16:
173
174 %s2 = trunc i32 %s to i16
175 %1 = insertelement <8 x i16> %src, i16 %s2, i32 4
176
177 ; ASM: vmov.16 d1[0], r0
178 ; DIS: 240: ee010b30
179 ret <8 x i16> %1
180 }
181
182 define internal <16 x i8> @insert7_v4i8(<16 x i8> %src, i32 %s) {
183 ; ASM-LABEL: insert7_v4i8:
184 ; DIS-LABEL: 00000260 <insert7_v4i8>:
185 ; IASM-LABEL: insert7_v4i8:
186
187 %s2 = trunc i32 %s to i8
188 %1 = insertelement <16 x i8> %src, i8 %s2, i32 7
189
190 ; ASM: vmov.8 d0[7], r0
191 ; DIS: 280: ee600b70
192
193 ret <16 x i8> %1
194 }
195
196 define internal <16 x i8> @insert8_v16i8(<16 x i8> %src, i32 %s) {
197 ; ASM-LABEL: insert8_v16i8:
198 ; DIS-LABEL: 000002a0 <insert8_v16i8>:
199 ; IASM-LABEL: insert8_v16i8:
200
201 %s2 = trunc i32 %s to i8
202 %1 = insertelement <16 x i8> %src, i8 %s2, i32 8
203
204 ; ASM: vmov.8 d1[0], r0
205 ; DIS: 2c0: ee410b10
206
207 ret <16 x i8> %1
208 }
209
210 define internal <4 x float> @insert1_v4float(<4 x float> %src, float %s) {
211 ; ASM-LABEL: insert1_v4float:
212 ; DIS-LABEL: 000002e0 <insert1_v4float>:
213 ; IASM-LABEL: insert1_v4float:
214
215 %1 = insertelement <4 x float> %src, float %s, i32 1
216
217 ; ASM: vmov.f32 s1, s4
218 ; DIS: 2f8: eef00a42
219
220 ret <4 x float> %1
221 }
222
223 define internal <4 x float> @insert2_v4float(<4 x float> %src, float %s) {
224 ; ASM-LABEL: insert2_v4float:
225 ; DIS-LABEL: 00000310 <insert2_v4float>:
226 ; IASM-LABEL: insert2_v4float:
227
228 %1 = insertelement <4 x float> %src, float %s, i32 2
229
230 ; ASM: vmov.f32 s2, s4
231 ; DIS: 328: eeb01a42
232
233 ret <4 x float> %1
234 }
OLDNEW
« src/IceTargetLoweringARM32.cpp ('K') | « src/IceTargetLoweringARM32.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698