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