NEON/TypeCasting.h
Go to the documentation of this file.
1 // This file is part of Eigen, a lightweight C++ template library
2 // for linear algebra.
3 //
4 // Copyright (C) 2018 Rasmus Munk Larsen <rmlarsen@google.com>
5 // Copyright (C) 2020 Antonio Sanchez <cantonios@google.com>
6 //
7 // This Source Code Form is subject to the terms of the Mozilla
8 // Public License v. 2.0. If a copy of the MPL was not distributed
9 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 
11 #ifndef EIGEN_TYPE_CASTING_NEON_H
12 #define EIGEN_TYPE_CASTING_NEON_H
13 
14 #include "../../InternalHeaderCheck.h"
15 
16 namespace Eigen {
17 
18 namespace internal {
19 
20 
21 //==============================================================================
22 // preinterpret (truncation operations)
23 //==============================================================================
24 
25 template <>
27  return Packet8c(vget_low_s8(a));
28 }
29 template <>
30 EIGEN_STRONG_INLINE Packet4c preinterpret<Packet4c, Packet8c>(const Packet8c& a) {
31  return Packet4c(vget_lane_s32(vreinterpret_s32_s8(a), 0));
32 }
33 template <>
35  return preinterpret<Packet4c>(preinterpret<Packet8c>(a));
36 }
37 
38 template <>
40  return Packet8uc(vget_low_u8(a));
41 }
42 template <>
44  return Packet4uc(vget_lane_u32(vreinterpret_u32_u8(a), 0));
45 }
46 template <>
48  return preinterpret<Packet4uc>(preinterpret<Packet8uc>(a));
49 }
50 
51 template <>
52 EIGEN_STRONG_INLINE Packet4s preinterpret<Packet4s, Packet8s>(const Packet8s& a) {
53  return Packet4s(vget_low_s16(a));
54 }
55 
56 template <>
58  return Packet4us(vget_low_u16(a));
59 }
60 
61 template <>
62 EIGEN_STRONG_INLINE Packet2i preinterpret<Packet2i, Packet4i>(const Packet4i& a) {
63  return Packet2i(vget_low_s32(a));
64 }
65 template <>
67  return Packet2ui(vget_low_u32(a));
68 }
69 
70 template <>
71 EIGEN_STRONG_INLINE Packet2f preinterpret<Packet2f, Packet4f>(const Packet4f& a) {
72  return Packet2f(vget_low_f32(a));
73 }
74 
75 //==============================================================================
76 // preinterpret
77 //==============================================================================
78 template <>
79 EIGEN_STRONG_INLINE Packet2f preinterpret<Packet2f, Packet2i>(const Packet2i& a) {
80  return Packet2f(vreinterpret_f32_s32(a));
81 }
82 template <>
84  return Packet2f(vreinterpret_f32_u32(a));
85 }
86 template <>
87 EIGEN_STRONG_INLINE Packet4f preinterpret<Packet4f, Packet4i>(const Packet4i& a) {
88  return Packet4f(vreinterpretq_f32_s32(a));
89 }
90 template <>
92  return Packet4f(vreinterpretq_f32_u32(a));
93 }
94 
95 
96 template <>
98  return static_cast<Packet4c>(a);
99 }
100 template <>
102  return Packet8c(vreinterpret_s8_u8(a));
103 }
104 template <>
106  return Packet16c(vreinterpretq_s8_u8(a));
107 }
108 
109 
110 template <>
112  return static_cast<Packet4uc>(a);
113 }
114 template <>
116  return Packet8uc(vreinterpret_u8_s8(a));
117 }
118 template <>
120  return Packet16uc(vreinterpretq_u8_s8(a));
121 }
122 
123 template <>
125  return Packet4s(vreinterpret_s16_u16(a));
126 }
127 template <>
129  return Packet8s(vreinterpretq_s16_u16(a));
130 }
131 template <>
133  return Packet4us(vreinterpret_u16_s16(a));
134 }
135 template <>
137  return Packet8us(vreinterpretq_u16_s16(a));
138 }
139 
140 template <>
142  return Packet2i(vreinterpret_s32_f32(a));
143 }
144 template <>
146  return Packet2i(vreinterpret_s32_u32(a));
147 }
148 template <>
149 EIGEN_STRONG_INLINE Packet4i preinterpret<Packet4i, Packet4f>(const Packet4f& a) {
150  return Packet4i(vreinterpretq_s32_f32(a));
151 }
152 template <>
154  return Packet4i(vreinterpretq_s32_u32(a));
155 }
156 
157 template <>
159  return Packet2ui(vreinterpret_u32_f32(a));
160 }
161 template <>
163  return Packet2ui(vreinterpret_u32_s32(a));
164 }
165 template <>
167  return Packet4ui(vreinterpretq_u32_f32(a));
168 }
169 template <>
171  return Packet4ui(vreinterpretq_u32_s32(a));
172 }
173 
174 template <>
176  return Packet2l(vreinterpretq_s64_u64(a));
177 }
178 template <>
180  return Packet2ul(vreinterpretq_u64_s64(a));
181 }
182 
183 //==============================================================================
184 // pcast, SrcType = float
185 //==============================================================================
186 
187 
188 template <>
189 struct type_casting_traits<float, numext::int64_t> {
190  enum { VectorizedCast = 1, SrcCoeffRatio = 1, TgtCoeffRatio = 2 };
191 };
192 template <>
193 struct type_casting_traits<float, numext::uint64_t> {
194  enum { VectorizedCast = 1, SrcCoeffRatio = 1, TgtCoeffRatio = 2 };
195 };
196 // If float64 exists, first convert to that to keep as much precision as possible.
197 #if EIGEN_ARCH_ARM64
198 template <>
199 EIGEN_STRONG_INLINE Packet2l pcast<Packet4f, Packet2l>(const Packet4f& a) {
200  // Discard second half of input.
201  return vcvtq_s64_f64(vcvt_f64_f32(vget_low_f32(a)));
202 }
203 template <>
204 EIGEN_STRONG_INLINE Packet2l pcast<Packet2f, Packet2l>(const Packet2f& a) {
205  return vcvtq_s64_f64(vcvt_f64_f32(a));
206 }
207 template <>
208 EIGEN_STRONG_INLINE Packet2ul pcast<Packet4f, Packet2ul>(const Packet4f& a) {
209  // Discard second half of input.
210  return vcvtq_u64_f64(vcvt_f64_f32(vget_low_f32(a)));
211 }
212 template <>
213 EIGEN_STRONG_INLINE Packet2ul pcast<Packet2f, Packet2ul>(const Packet2f& a) {
214  return vcvtq_u64_f64(vcvt_f64_f32(a));
215 }
216 #else
217 template <>
218 EIGEN_STRONG_INLINE Packet2l pcast<Packet4f, Packet2l>(const Packet4f& a) {
219  // Discard second half of input.
220  return vmovl_s32(vget_low_s32(vcvtq_s32_f32(a)));
221 }
222 template <>
223 EIGEN_STRONG_INLINE Packet2l pcast<Packet2f, Packet2l>(const Packet2f& a) {
224  return vmovl_s32(vcvt_s32_f32(a));
225 }
226 template <>
227 EIGEN_STRONG_INLINE Packet2ul pcast<Packet4f, Packet2ul>(const Packet4f& a) {
228  // Discard second half of input.
229  return vmovl_u32(vget_low_u32(vcvtq_u32_f32(a)));
230 }
231 template <>
232 EIGEN_STRONG_INLINE Packet2ul pcast<Packet2f, Packet2ul>(const Packet2f& a) {
233  // Discard second half of input.
234  return vmovl_u32(vcvt_u32_f32(a));
235 }
236 #endif // EIGEN_ARCH_ARM64
237 
238 template <>
239 struct type_casting_traits<float, numext::int32_t> {
240  enum { VectorizedCast = 1, SrcCoeffRatio = 1, TgtCoeffRatio = 1 };
241 };
242 template <>
243 EIGEN_STRONG_INLINE Packet4i pcast<Packet4f, Packet4i>(const Packet4f& a) {
244  return vcvtq_s32_f32(a);
245 }
246 template <>
247 EIGEN_STRONG_INLINE Packet2i pcast<Packet2f, Packet2i>(const Packet2f& a) {
248  return vcvt_s32_f32(a);
249 }
250 
251 template <>
252 struct type_casting_traits<float, numext::uint32_t> {
253  enum { VectorizedCast = 1, SrcCoeffRatio = 1, TgtCoeffRatio = 1 };
254 };
255 template <>
256 EIGEN_STRONG_INLINE Packet4ui pcast<Packet4f, Packet4ui>(const Packet4f& a) {
257  return vcvtq_u32_f32(a);
258 }
259 template <>
260 EIGEN_STRONG_INLINE Packet2ui pcast<Packet2f, Packet2ui>(const Packet2f& a) {
261  return vcvt_u32_f32(a);
262 }
263 
264 template <>
265 struct type_casting_traits<float, numext::int16_t> {
266  enum { VectorizedCast = 1, SrcCoeffRatio = 2, TgtCoeffRatio = 1 };
267 };
268 template <>
269 EIGEN_STRONG_INLINE Packet8s pcast<Packet4f, Packet8s>(const Packet4f& a, const Packet4f& b) {
270  return vcombine_s16(vmovn_s32(vcvtq_s32_f32(a)), vmovn_s32(vcvtq_s32_f32(b)));
271 }
272 template <>
273 EIGEN_STRONG_INLINE Packet4s pcast<Packet4f, Packet4s>(const Packet4f& a) {
274  return vmovn_s32(vcvtq_s32_f32(a));
275 }
276 template <>
277 EIGEN_STRONG_INLINE Packet4s pcast<Packet2f, Packet4s>(const Packet2f& a, const Packet2f& b) {
278  return vmovn_s32(vcombine_s32(vcvt_s32_f32(a), vcvt_s32_f32(b)));
279 }
280 
281 template <>
282 struct type_casting_traits<float, numext::uint16_t> {
283  enum { VectorizedCast = 1, SrcCoeffRatio = 2, TgtCoeffRatio = 1 };
284 };
285 template <>
286 EIGEN_STRONG_INLINE Packet8us pcast<Packet4f, Packet8us>(const Packet4f& a, const Packet4f& b) {
287  return vcombine_u16(vmovn_u32(vcvtq_u32_f32(a)), vmovn_u32(vcvtq_u32_f32(b)));
288 }
289 template <>
290 EIGEN_STRONG_INLINE Packet4us pcast<Packet4f, Packet4us>(const Packet4f& a) {
291  return vmovn_u32(vcvtq_u32_f32(a));
292 }
293 template <>
294 EIGEN_STRONG_INLINE Packet4us pcast<Packet2f, Packet4us>(const Packet2f& a, const Packet2f& b) {
295  return vmovn_u32(vcombine_u32(vcvt_u32_f32(a), vcvt_u32_f32(b)));
296 }
297 
298 template <>
299 struct type_casting_traits<float, numext::int8_t> {
300  enum { VectorizedCast = 1, SrcCoeffRatio = 4, TgtCoeffRatio = 1 };
301 };
302 template <>
303 EIGEN_STRONG_INLINE Packet16c pcast<Packet4f, Packet16c>(const Packet4f& a, const Packet4f& b, const Packet4f& c,
304  const Packet4f& d) {
305  const int16x8_t ab_s16 = pcast<Packet4f, Packet8s>(a, b);
306  const int16x8_t cd_s16 = pcast<Packet4f, Packet8s>(c, d);
307  return vcombine_s8(vmovn_s16(ab_s16), vmovn_s16(cd_s16));
308 }
309 template <>
310 EIGEN_STRONG_INLINE Packet8c pcast<Packet4f, Packet8c>(const Packet4f& a, const Packet4f& b) {
311  const int16x8_t ab_s16 = pcast<Packet4f, Packet8s>(a, b);
312  return vmovn_s16(ab_s16);
313 }
314 template <>
315 EIGEN_STRONG_INLINE Packet8c pcast<Packet2f, Packet8c>(const Packet2f& a, const Packet2f& b, const Packet2f& c,
316  const Packet2f& d) {
317  const int16x4_t ab_s16 = pcast<Packet2f, Packet4s>(a, b);
318  const int16x4_t cd_s16 = pcast<Packet2f, Packet4s>(c, d);
319  return vmovn_s16(vcombine_s16(ab_s16, cd_s16));
320 }
321 template <>
322 EIGEN_STRONG_INLINE Packet4c pcast<Packet4f, Packet4c>(const Packet4f& a) {
323  const int32x4_t a_s32x4 = vcvtq_s32_f32(a);
324  const int16x4_t a_s16x4 = vmovn_s32(a_s32x4);
325  const int16x8_t aa_s16x8 = vcombine_s16(a_s16x4, a_s16x4);
326  const int8x8_t aa_s8x8 = vmovn_s16(aa_s16x8);
327  return vget_lane_s32(vreinterpret_s32_s8(aa_s8x8), 0);
328 }
329 
330 template <>
331 struct type_casting_traits<float, numext::uint8_t> {
332  enum { VectorizedCast = 1, SrcCoeffRatio = 4, TgtCoeffRatio = 1 };
333 };
334 template <>
335 EIGEN_STRONG_INLINE Packet16uc pcast<Packet4f, Packet16uc>(const Packet4f& a, const Packet4f& b, const Packet4f& c,
336  const Packet4f& d) {
337  return preinterpret<Packet16uc>(pcast<Packet4f, Packet16c>(a, b, c, d));
338 }
339 template <>
340 EIGEN_STRONG_INLINE Packet8uc pcast<Packet4f, Packet8uc>(const Packet4f& a, const Packet4f& b) {
341  return preinterpret<Packet8uc>(pcast<Packet4f, Packet8c>(a, b));
342 }
343 template <>
344 EIGEN_STRONG_INLINE Packet8uc pcast<Packet2f, Packet8uc>(const Packet2f& a, const Packet2f& b, const Packet2f& c,
345  const Packet2f& d) {
346  return preinterpret<Packet8uc>(pcast<Packet2f, Packet8c>(a, b, c, d));
347 }
348 template <>
349 EIGEN_STRONG_INLINE Packet4uc pcast<Packet4f, Packet4uc>(const Packet4f& a) {
350  return static_cast<Packet4uc>(pcast<Packet4f, Packet4c>(a));
351 }
352 
353 //==============================================================================
354 // pcast, SrcType = int8_t
355 //==============================================================================
356 template <>
357 struct type_casting_traits<numext::int8_t, float> {
358  enum { VectorizedCast = 1, SrcCoeffRatio = 1, TgtCoeffRatio = 4 };
359 };
360 template <>
361 EIGEN_STRONG_INLINE Packet4f pcast<Packet16c, Packet4f>(const Packet16c& a) {
362  // Discard all but first 4 bytes.
363  return vcvtq_f32_s32(vmovl_s16(vget_low_s16(vmovl_s8(vget_low_s8(a)))));
364 }
365 template <>
366 EIGEN_STRONG_INLINE Packet4f pcast<Packet4c, Packet4f>(const Packet4c& a) {
367  return vcvtq_f32_s32(vmovl_s16(vget_low_s16(vmovl_s8(vreinterpret_s8_s32(vdup_n_s32(a))))));
368 }
369 template <>
370 EIGEN_STRONG_INLINE Packet2f pcast<Packet8c, Packet2f>(const Packet8c& a) {
371  // Discard all but first 2 bytes.
372  return vcvt_f32_s32(vget_low_s32(vmovl_s16(vget_low_s16(vmovl_s8(a)))));
373 }
374 
375 template <>
376 struct type_casting_traits<numext::int8_t, numext::int64_t> {
377  enum { VectorizedCast = 1, SrcCoeffRatio = 1, TgtCoeffRatio = 8 };
378 };
379 template <>
380 EIGEN_STRONG_INLINE Packet2l pcast<Packet16c, Packet2l>(const Packet16c& a) {
381  // Discard all but first two bytes.
382  return vmovl_s32(vget_low_s32(vmovl_s16(vget_low_s16(vmovl_s8(vget_low_s8(a))))));
383 }
384 
385 template <>
386 struct type_casting_traits<numext::int8_t, numext::uint64_t> {
387  enum { VectorizedCast = 1, SrcCoeffRatio = 1, TgtCoeffRatio = 8 };
388 };
389 template <>
390 EIGEN_STRONG_INLINE Packet2ul pcast<Packet16c, Packet2ul>(const Packet16c& a) {
391  return preinterpret<Packet2ul>(pcast<Packet16c, Packet2l>(a));
392 }
393 
394 template <>
395 struct type_casting_traits<numext::int8_t, numext::int32_t> {
396  enum { VectorizedCast = 1, SrcCoeffRatio = 1, TgtCoeffRatio = 4 };
397 };
398 template <>
399 EIGEN_STRONG_INLINE Packet4i pcast<Packet16c, Packet4i>(const Packet16c& a) {
400  // Discard all but first 4 bytes.
401  return vmovl_s16(vget_low_s16(vmovl_s8(vget_low_s8(a))));
402 }
403 template <>
404 EIGEN_STRONG_INLINE Packet4i pcast<Packet8c, Packet4i>(const Packet8c& a) {
405  return vmovl_s16(vget_low_s16(vmovl_s8(a)));
406 }
407 template <>
408 EIGEN_STRONG_INLINE Packet4i pcast<Packet4c, Packet4i>(const Packet4c& a) {
409  return pcast<Packet8c, Packet4i>(vreinterpret_s8_s32(vdup_n_s32(a)));
410 }
411 template <>
412 EIGEN_STRONG_INLINE Packet2i pcast<Packet8c, Packet2i>(const Packet8c& a) {
413  // Discard all but first 2 bytes.
414  return vget_low_s32(vmovl_s16(vget_low_s16(vmovl_s8(a))));
415 }
416 
417 
418 template <>
419 struct type_casting_traits<numext::int8_t, numext::uint32_t> {
420  enum { VectorizedCast = 1, SrcCoeffRatio = 1, TgtCoeffRatio = 4 };
421 };
422 template <>
423 EIGEN_STRONG_INLINE Packet4ui pcast<Packet16c, Packet4ui>(const Packet16c& a) {
424  return preinterpret<Packet4ui>(pcast<Packet16c, Packet4i>(a));
425 }
426 template <>
427 EIGEN_STRONG_INLINE Packet2ui pcast<Packet8c, Packet2ui>(const Packet8c& a) {
428  return preinterpret<Packet2ui>(pcast<Packet8c, Packet2i>(a));
429 }
430 template <>
431 EIGEN_STRONG_INLINE Packet4ui pcast<Packet4c, Packet4ui>(const Packet4c& a) {
432  return preinterpret<Packet4ui>(pcast<Packet4c, Packet4i>(a));
433 }
434 
435 template <>
436 struct type_casting_traits<numext::int8_t, numext::int16_t> {
437  enum { VectorizedCast = 1, SrcCoeffRatio = 1, TgtCoeffRatio = 2 };
438 };
439 template <>
440 EIGEN_STRONG_INLINE Packet8s pcast<Packet16c, Packet8s>(const Packet16c& a) {
441  // Discard second half of input.
442  return vmovl_s8(vget_low_s8(a));
443 }
444 template <>
445 EIGEN_STRONG_INLINE Packet8s pcast<Packet8c, Packet8s>(const Packet8c& a) {
446  return vmovl_s8(a);
447 }
448 template <>
449 EIGEN_STRONG_INLINE Packet4s pcast<Packet8c, Packet4s>(const Packet8c& a) {
450  // Discard second half of input.
451  return vget_low_s16(vmovl_s8(a));
452 }
453 template <>
454 EIGEN_STRONG_INLINE Packet4s pcast<Packet4c, Packet4s>(const Packet4c& a) {
455  return pcast<Packet8c, Packet4s>(vreinterpret_s8_s32(vdup_n_s32(a)));
456 }
457 
458 template <>
459 struct type_casting_traits<numext::int8_t, numext::uint16_t> {
460  enum { VectorizedCast = 1, SrcCoeffRatio = 1, TgtCoeffRatio = 2 };
461 };
462 template <>
463 EIGEN_STRONG_INLINE Packet8us pcast<Packet16c, Packet8us>(const Packet16c& a) {
464  return preinterpret<Packet8us>(pcast<Packet16c, Packet8s>(a));
465 }
466 template <>
467 EIGEN_STRONG_INLINE Packet8us pcast<Packet8c, Packet8us>(const Packet8c& a) {
468  return preinterpret<Packet8us>(pcast<Packet8c, Packet8s>(a));
469 }
470 template <>
471 EIGEN_STRONG_INLINE Packet4us pcast<Packet8c, Packet4us>(const Packet8c& a) {
472  return preinterpret<Packet4us>(pcast<Packet8c, Packet4s>(a));
473 }
474 template <>
475 EIGEN_STRONG_INLINE Packet4us pcast<Packet4c, Packet4us>(const Packet4c& a) {
476  return preinterpret<Packet4us>(pcast<Packet4c, Packet4s>(a));
477 }
478 
479 
480 //==============================================================================
481 // pcast, SrcType = uint8_t
482 //==============================================================================
483 template <>
484 struct type_casting_traits<numext::uint8_t, float> {
485  enum { VectorizedCast = 1, SrcCoeffRatio = 1, TgtCoeffRatio = 4 };
486 };
487 template <>
488 EIGEN_STRONG_INLINE Packet4f pcast<Packet16uc, Packet4f>(const Packet16uc& a) {
489  // Discard all but first 4 bytes.
490  return vcvtq_f32_u32(vmovl_u16(vget_low_u16(vmovl_u8(vget_low_u8(a)))));
491 }
492 template <>
493 EIGEN_STRONG_INLINE Packet4f pcast<Packet4uc, Packet4f>(const Packet4uc& a) {
494  return vcvtq_f32_u32(vmovl_u16(vget_low_u16(vmovl_u8(vreinterpret_u8_u32(vdup_n_u32(a))))));
495 }
496 template <>
497 EIGEN_STRONG_INLINE Packet2f pcast<Packet8uc, Packet2f>(const Packet8uc& a) {
498  // Discard all but first 2 bytes.
499  return vcvt_f32_u32(vget_low_u32(vmovl_u16(vget_low_u16(vmovl_u8(a)))));
500 }
501 
502 template <>
503 struct type_casting_traits<numext::uint8_t, numext::uint64_t> {
504  enum { VectorizedCast = 1, SrcCoeffRatio = 1, TgtCoeffRatio = 8 };
505 };
506 template <>
507 EIGEN_STRONG_INLINE Packet2ul pcast<Packet16uc, Packet2ul>(const Packet16uc& a) {
508  // Discard all but first two bytes.
509  return vmovl_u32(vget_low_u32(vmovl_u16(vget_low_u16(vmovl_u8(vget_low_u8(a))))));
510 }
511 
512 template <>
513 struct type_casting_traits<numext::uint8_t, numext::int64_t> {
514  enum { VectorizedCast = 1, SrcCoeffRatio = 1, TgtCoeffRatio = 8 };
515 };
516 template <>
517 EIGEN_STRONG_INLINE Packet2l pcast<Packet16uc, Packet2l>(const Packet16uc& a) {
518  return preinterpret<Packet2l>(pcast<Packet16uc, Packet2ul>(a));
519 }
520 
521 template <>
522 struct type_casting_traits<numext::uint8_t, numext::uint32_t> {
523  enum { VectorizedCast = 1, SrcCoeffRatio = 1, TgtCoeffRatio = 4 };
524 };
525 template <>
526 EIGEN_STRONG_INLINE Packet4ui pcast<Packet16uc, Packet4ui>(const Packet16uc& a) {
527  // Discard all but first 4 bytes.
528  return vmovl_u16(vget_low_u16(vmovl_u8(vget_low_u8(a))));
529 }
530 template <>
531 EIGEN_STRONG_INLINE Packet4ui pcast<Packet8uc, Packet4ui>(const Packet8uc& a) {
532  return vmovl_u16(vget_low_u16(vmovl_u8(a)));
533 }
534 template <>
535 EIGEN_STRONG_INLINE Packet2ui pcast<Packet8uc, Packet2ui>(const Packet8uc& a) {
536  // Discard all but first 2 bytes.
537  return vget_low_u32(vmovl_u16(vget_low_u16(vmovl_u8(a))));
538 }
539 template <>
540 EIGEN_STRONG_INLINE Packet4ui pcast<Packet4uc, Packet4ui>(const Packet4uc& a) {
541  return pcast<Packet8uc, Packet4ui>(vreinterpret_u8_u32(vdup_n_u32(a)));
542 }
543 
544 template <>
545 struct type_casting_traits<numext::uint8_t, numext::int32_t> {
546  enum { VectorizedCast = 1, SrcCoeffRatio = 1, TgtCoeffRatio = 4 };
547 };
548 template <>
549 EIGEN_STRONG_INLINE Packet4i pcast<Packet16uc, Packet4i>(const Packet16uc& a) {
550  return preinterpret<Packet4i>(pcast<Packet16uc, Packet4ui>(a));
551 }
552 template <>
553 EIGEN_STRONG_INLINE Packet2i pcast<Packet8uc, Packet2i>(const Packet8uc& a) {
554  return preinterpret<Packet2i>(pcast<Packet8uc, Packet2ui>(a));
555 }
556 template <>
557 EIGEN_STRONG_INLINE Packet4i pcast<Packet4uc, Packet4i>(const Packet4uc& a) {
558  return preinterpret<Packet4i>(pcast<Packet4uc, Packet4ui>(a));
559 }
560 
561 template <>
562 struct type_casting_traits<numext::uint8_t, numext::uint16_t> {
563  enum { VectorizedCast = 1, SrcCoeffRatio = 1, TgtCoeffRatio = 2 };
564 };
565 template <>
566 EIGEN_STRONG_INLINE Packet8us pcast<Packet16uc, Packet8us>(const Packet16uc& a) {
567  // Discard second half of input.
568  return vmovl_u8(vget_low_u8(a));
569 }
570 template <>
571 EIGEN_STRONG_INLINE Packet8us pcast<Packet8uc, Packet8us>(const Packet8uc& a) {
572  return vmovl_u8(a);
573 }
574 template <>
575 EIGEN_STRONG_INLINE Packet4us pcast<Packet4uc, Packet4us>(const Packet4uc& a) {
576  return vget_low_u16(vmovl_u8(vreinterpret_u8_u32(vdup_n_u32(a))));
577 }
578 
579 
580 template <>
581 struct type_casting_traits<numext::uint8_t, numext::int16_t> {
582  enum { VectorizedCast = 1, SrcCoeffRatio = 1, TgtCoeffRatio = 2 };
583 };
584 template <>
585 EIGEN_STRONG_INLINE Packet8s pcast<Packet16uc, Packet8s>(const Packet16uc& a) {
586  return preinterpret<Packet8s>(pcast<Packet16uc, Packet8us>(a));
587 }
588 template <>
589 EIGEN_STRONG_INLINE Packet8s pcast<Packet8uc, Packet8s>(const Packet8uc& a) {
590  return preinterpret<Packet8s>(pcast<Packet8uc, Packet8us>(a));
591 }
592 template <>
593 EIGEN_STRONG_INLINE Packet4s pcast<Packet4uc, Packet4s>(const Packet4uc& a) {
594  return preinterpret<Packet4s>(pcast<Packet4uc, Packet4us>(a));
595 }
596 
597 
598 //==============================================================================
599 // pcast, SrcType = int16_t
600 //==============================================================================
601 template <>
602 struct type_casting_traits<numext::int16_t, float> {
603  enum { VectorizedCast = 1, SrcCoeffRatio = 1, TgtCoeffRatio = 2 };
604 };
605 template <>
606 EIGEN_STRONG_INLINE Packet4f pcast<Packet8s, Packet4f>(const Packet8s& a) {
607  // Discard second half of input.
608  return vcvtq_f32_s32(vmovl_s16(vget_low_s16(a)));
609 }
610 template <>
611 EIGEN_STRONG_INLINE Packet4f pcast<Packet4s, Packet4f>(const Packet4s& a) {
612  return vcvtq_f32_s32(vmovl_s16(a));
613 }
614 template <>
615 EIGEN_STRONG_INLINE Packet2f pcast<Packet4s, Packet2f>(const Packet4s& a) {
616  // Discard second half of input.
617  return vcvt_f32_s32(vget_low_s32(vmovl_s16(a)));
618 }
619 
620 template <>
621 struct type_casting_traits<numext::int16_t, numext::int64_t> {
622  enum { VectorizedCast = 1, SrcCoeffRatio = 1, TgtCoeffRatio = 4 };
623 };
624 template <>
625 EIGEN_STRONG_INLINE Packet2l pcast<Packet8s, Packet2l>(const Packet8s& a) {
626  // Discard all but first two values.
627  return vmovl_s32(vget_low_s32(vmovl_s16(vget_low_s16(a))));
628 }
629 
630 template <>
631 struct type_casting_traits<numext::int16_t, numext::uint64_t> {
632  enum { VectorizedCast = 1, SrcCoeffRatio = 1, TgtCoeffRatio = 4 };
633 };
634 template <>
635 EIGEN_STRONG_INLINE Packet2ul pcast<Packet8s, Packet2ul>(const Packet8s& a) {
636  return preinterpret<Packet2ul>(pcast<Packet8s, Packet2l>(a));
637 }
638 
639 template <>
640 struct type_casting_traits<numext::int16_t, numext::int32_t> {
641  enum { VectorizedCast = 1, SrcCoeffRatio = 1, TgtCoeffRatio = 2 };
642 };
643 template <>
644 EIGEN_STRONG_INLINE Packet4i pcast<Packet8s, Packet4i>(const Packet8s& a) {
645  // Discard second half of input.
646  return vmovl_s16(vget_low_s16(a));
647 }
648 template <>
649 EIGEN_STRONG_INLINE Packet4i pcast<Packet4s, Packet4i>(const Packet4s& a) {
650  return vmovl_s16(a);
651 }
652 template <>
653 EIGEN_STRONG_INLINE Packet2i pcast<Packet4s, Packet2i>(const Packet4s& a) {
654  // Discard second half of input.
655  return vget_low_s32(vmovl_s16(a));
656 }
657 
658 template <>
659 struct type_casting_traits<numext::int16_t, numext::uint32_t> {
660  enum { VectorizedCast = 1, SrcCoeffRatio = 1, TgtCoeffRatio = 2 };
661 };
662 template <>
663 EIGEN_STRONG_INLINE Packet4ui pcast<Packet8s, Packet4ui>(const Packet8s& a) {
664  return preinterpret<Packet4ui>(pcast<Packet8s, Packet4i>(a));
665 }
666 template <>
667 EIGEN_STRONG_INLINE Packet4ui pcast<Packet4s, Packet4ui>(const Packet4s& a) {
668  return preinterpret<Packet4ui>(pcast<Packet4s, Packet4i>(a));
669 }
670 template <>
671 EIGEN_STRONG_INLINE Packet2ui pcast<Packet4s, Packet2ui>(const Packet4s& a) {
672  return preinterpret<Packet2ui>(pcast<Packet4s, Packet2i>(a));
673 }
674 
675 
676 template <>
677 struct type_casting_traits<numext::int16_t, numext::int8_t> {
678  enum { VectorizedCast = 1, SrcCoeffRatio = 2, TgtCoeffRatio = 1 };
679 };
680 template <>
681 EIGEN_STRONG_INLINE Packet16c pcast<Packet8s, Packet16c>(const Packet8s& a, const Packet8s& b) {
682  return vcombine_s8(vmovn_s16(a), vmovn_s16(b));
683 }
684 template <>
685 EIGEN_STRONG_INLINE Packet8c pcast<Packet8s, Packet8c>(const Packet8s& a) {
686  return vmovn_s16(a);
687 }
688 template <>
689 EIGEN_STRONG_INLINE Packet8c pcast<Packet4s, Packet8c>(const Packet4s& a, const Packet4s& b) {
690  return vmovn_s16(vcombine_s16(a, b));
691 }
692 template <>
693 EIGEN_STRONG_INLINE Packet4c pcast<Packet4s, Packet4c>(const Packet4s& a) {
694  const int8x8_t aa_s8x8 = pcast<Packet4s, Packet8c>(a, a);
695  return vget_lane_s32(vreinterpret_s32_s8(aa_s8x8), 0);
696 }
697 
698 template <>
699 struct type_casting_traits<numext::int16_t, numext::uint8_t> {
700  enum { VectorizedCast = 1, SrcCoeffRatio = 2, TgtCoeffRatio = 1 };
701 };
702 template <>
703 EIGEN_STRONG_INLINE Packet16uc pcast<Packet8s, Packet16uc>(const Packet8s& a, const Packet8s& b) {
704  return preinterpret<Packet16uc>(pcast<Packet8s, Packet16c>(a, b));
705 }
706 template <>
707 EIGEN_STRONG_INLINE Packet8uc pcast<Packet8s, Packet8uc>(const Packet8s& a) {
708  return preinterpret<Packet8uc>(pcast<Packet8s, Packet8c>(a));
709 }
710 template <>
711 EIGEN_STRONG_INLINE Packet8uc pcast<Packet4s, Packet8uc>(const Packet4s& a, const Packet4s& b) {
712  return preinterpret<Packet8uc>(pcast<Packet4s, Packet8c>(a, b));
713 }
714 template <>
715 EIGEN_STRONG_INLINE Packet4uc pcast<Packet4s, Packet4uc>(const Packet4s& a) {
716  return static_cast<Packet4uc>(pcast<Packet4s, Packet4c>(a));
717 }
718 
719 //==============================================================================
720 // pcast, SrcType = uint16_t
721 //==============================================================================
722 template <>
723 struct type_casting_traits<numext::uint16_t, float> {
724  enum { VectorizedCast = 1, SrcCoeffRatio = 1, TgtCoeffRatio = 2 };
725 };
726 template <>
727 EIGEN_STRONG_INLINE Packet4f pcast<Packet8us, Packet4f>(const Packet8us& a) {
728  // Discard second half of input.
729  return vcvtq_f32_u32(vmovl_u16(vget_low_u16(a)));
730 }
731 template <>
732 EIGEN_STRONG_INLINE Packet4f pcast<Packet4us, Packet4f>(const Packet4us& a) {
733  return vcvtq_f32_u32(vmovl_u16(a));
734 }
735 template <>
736 EIGEN_STRONG_INLINE Packet2f pcast<Packet4us, Packet2f>(const Packet4us& a) {
737  // Discard second half of input.
738  return vcvt_f32_u32(vget_low_u32(vmovl_u16(a)));
739 }
740 
741 template <>
742 struct type_casting_traits<numext::uint16_t, numext::uint64_t> {
743  enum { VectorizedCast = 1, SrcCoeffRatio = 1, TgtCoeffRatio = 4 };
744 };
745 template <>
746 EIGEN_STRONG_INLINE Packet2ul pcast<Packet8us, Packet2ul>(const Packet8us& a) {
747  // Discard all but first two values.
748  return vmovl_u32(vget_low_u32(vmovl_u16(vget_low_u16(a))));
749 }
750 
751 template <>
752 struct type_casting_traits<numext::uint16_t, numext::int64_t> {
753  enum { VectorizedCast = 1, SrcCoeffRatio = 1, TgtCoeffRatio = 4 };
754 };
755 template <>
756 EIGEN_STRONG_INLINE Packet2l pcast<Packet8us, Packet2l>(const Packet8us& a) {
757  return preinterpret<Packet2l>(pcast<Packet8us, Packet2ul>(a));
758 }
759 
760 template <>
761 struct type_casting_traits<numext::uint16_t, numext::uint32_t> {
762  enum { VectorizedCast = 1, SrcCoeffRatio = 1, TgtCoeffRatio = 2 };
763 };
764 template <>
765 EIGEN_STRONG_INLINE Packet4ui pcast<Packet8us, Packet4ui>(const Packet8us& a) {
766  // Discard second half of input.
767  return vmovl_u16(vget_low_u16(a));
768 }
769 template <>
770 EIGEN_STRONG_INLINE Packet4ui pcast<Packet4us, Packet4ui>(const Packet4us& a) {
771  return vmovl_u16(a);
772 }
773 template <>
774 EIGEN_STRONG_INLINE Packet2ui pcast<Packet4us, Packet2ui>(const Packet4us& a) {
775  // Discard second half of input.
776  return vget_low_u32(vmovl_u16(a));
777 }
778 
779 template <>
780 struct type_casting_traits<numext::uint16_t, numext::int32_t> {
781  enum { VectorizedCast = 1, SrcCoeffRatio = 1, TgtCoeffRatio = 2 };
782 };
783 template <>
784 EIGEN_STRONG_INLINE Packet4i pcast<Packet8us, Packet4i>(const Packet8us& a) {
785  return preinterpret<Packet4i>(pcast<Packet8us, Packet4ui>(a));
786 }
787 template <>
788 EIGEN_STRONG_INLINE Packet4i pcast<Packet4us, Packet4i>(const Packet4us& a) {
789  return preinterpret<Packet4i>(pcast<Packet4us, Packet4ui>(a));
790 }
791 template <>
792 EIGEN_STRONG_INLINE Packet2i pcast<Packet4us, Packet2i>(const Packet4us& a) {
793  return preinterpret<Packet2i>(pcast<Packet4us, Packet2ui>(a));
794 }
795 
796 
797 template <>
798 struct type_casting_traits<numext::uint16_t, numext::uint8_t> {
799  enum { VectorizedCast = 1, SrcCoeffRatio = 2, TgtCoeffRatio = 1 };
800 };
801 template <>
802 EIGEN_STRONG_INLINE Packet16uc pcast<Packet8us, Packet16uc>(const Packet8us& a, const Packet8us& b) {
803  return vcombine_u8(vmovn_u16(a), vmovn_u16(b));
804 }
805 template <>
806 EIGEN_STRONG_INLINE Packet8uc pcast<Packet8us, Packet8uc>(const Packet8us& a) {
807  return vmovn_u16(a);
808 }
809 template <>
810 EIGEN_STRONG_INLINE Packet8uc pcast<Packet4us, Packet8uc>(const Packet4us& a, const Packet4us& b) {
811  return vmovn_u16(vcombine_u16(a, b));
812 }
813 template <>
814 EIGEN_STRONG_INLINE Packet4uc pcast<Packet4us, Packet4uc>(const Packet4us& a) {
815  uint8x8_t aa_u8x8 = pcast<Packet4us, Packet8uc>(a, a);
816  return vget_lane_u32(vreinterpret_u32_u8(aa_u8x8), 0);
817 }
818 
819 template <>
820 struct type_casting_traits<numext::uint16_t, numext::int8_t> {
821  enum { VectorizedCast = 1, SrcCoeffRatio = 2, TgtCoeffRatio = 1 };
822 };
823 template <>
824 EIGEN_STRONG_INLINE Packet16c pcast<Packet8us, Packet16c>(const Packet8us& a, const Packet8us& b) {
825  return preinterpret<Packet16c>(pcast<Packet8us, Packet16uc>(a, b));
826 }
827 template <>
828 EIGEN_STRONG_INLINE Packet8c pcast<Packet8us, Packet8c>(const Packet8us& a) {
829  return preinterpret<Packet8c>(pcast<Packet8us, Packet8uc>(a));
830 }
831 template <>
832 EIGEN_STRONG_INLINE Packet8c pcast<Packet4us, Packet8c>(const Packet4us& a, const Packet4us& b) {
833  return preinterpret<Packet8c>(pcast<Packet4us, Packet8uc>(a, b));
834 }
835 template <>
836 EIGEN_STRONG_INLINE Packet4c pcast<Packet4us, Packet4c>(const Packet4us& a) {
837  return static_cast<Packet4c>(pcast<Packet4us, Packet4uc>(a));
838 }
839 
840 //==============================================================================
841 // pcast, SrcType = int32_t
842 //==============================================================================
843 template <>
844 struct type_casting_traits<numext::int32_t, float> {
845  enum { VectorizedCast = 1, SrcCoeffRatio = 1, TgtCoeffRatio = 1 };
846 };
847 template <>
848 EIGEN_STRONG_INLINE Packet4f pcast<Packet4i, Packet4f>(const Packet4i& a) {
849  return vcvtq_f32_s32(a);
850 }
851 template <>
852 EIGEN_STRONG_INLINE Packet2f pcast<Packet2i, Packet2f>(const Packet2i& a) {
853  return vcvt_f32_s32(a);
854 }
855 
856 template <>
857 struct type_casting_traits<numext::int32_t, numext::int64_t> {
858  enum { VectorizedCast = 1, SrcCoeffRatio = 1, TgtCoeffRatio = 2 };
859 };
860 template <>
861 EIGEN_STRONG_INLINE Packet2l pcast<Packet4i, Packet2l>(const Packet4i& a) {
862  // Discard second half of input.
863  return vmovl_s32(vget_low_s32(a));
864 }
865 template <>
866 EIGEN_STRONG_INLINE Packet2l pcast<Packet2i, Packet2l>(const Packet2i& a) {
867  return vmovl_s32(a);
868 }
869 
870 template <>
871 struct type_casting_traits<numext::int32_t, numext::uint64_t> {
872  enum { VectorizedCast = 1, SrcCoeffRatio = 1, TgtCoeffRatio = 2 };
873 };
874 template <>
875 EIGEN_STRONG_INLINE Packet2ul pcast<Packet4i, Packet2ul>(const Packet4i& a) {
876  return preinterpret<Packet2ul>(pcast<Packet4i, Packet2l>(a));
877 }
878 template <>
879 EIGEN_STRONG_INLINE Packet2ul pcast<Packet2i, Packet2ul>(const Packet2i& a) {
880  return preinterpret<Packet2ul>(pcast<Packet2i, Packet2l>(a));
881 }
882 
883 
884 template <>
885 struct type_casting_traits<numext::int32_t, numext::int16_t> {
886  enum { VectorizedCast = 1, SrcCoeffRatio = 2, TgtCoeffRatio = 1 };
887 };
888 template <>
889 EIGEN_STRONG_INLINE Packet8s pcast<Packet4i, Packet8s>(const Packet4i& a, const Packet4i& b) {
890  return vcombine_s16(vmovn_s32(a), vmovn_s32(b));
891 }
892 template <>
893 EIGEN_STRONG_INLINE Packet4s pcast<Packet4i, Packet4s>(const Packet4i& a) {
894  return vmovn_s32(a);
895 }
896 template <>
897 EIGEN_STRONG_INLINE Packet4s pcast<Packet2i, Packet4s>(const Packet2i& a, const Packet2i& b) {
898  return vmovn_s32(vcombine_s32(a, b));
899 }
900 
901 template <>
902 struct type_casting_traits<numext::int32_t, numext::uint16_t> {
903  enum { VectorizedCast = 1, SrcCoeffRatio = 2, TgtCoeffRatio = 1 };
904 };
905 template <>
906 EIGEN_STRONG_INLINE Packet8us pcast<Packet4i, Packet8us>(const Packet4i& a, const Packet4i& b) {
907  return vcombine_u16(vmovn_u32(vreinterpretq_u32_s32(a)), vmovn_u32(vreinterpretq_u32_s32(b)));
908 }
909 template <>
910 EIGEN_STRONG_INLINE Packet4us pcast<Packet4i, Packet4us>(const Packet4i& a) {
911  return vmovn_u32(vreinterpretq_u32_s32(a));
912 }
913 template <>
914 EIGEN_STRONG_INLINE Packet4us pcast<Packet2i, Packet4us>(const Packet2i& a, const Packet2i& b) {
915  return vmovn_u32(vreinterpretq_u32_s32(vcombine_s32(a, b)));
916 }
917 
918 template <>
919 struct type_casting_traits<numext::int32_t, numext::int8_t> {
920  enum { VectorizedCast = 1, SrcCoeffRatio = 4, TgtCoeffRatio = 1 };
921 };
922 template <>
923 EIGEN_STRONG_INLINE Packet16c pcast<Packet4i, Packet16c>(const Packet4i& a, const Packet4i& b, const Packet4i& c,
924  const Packet4i& d) {
925  const int16x8_t ab_s16 = pcast<Packet4i, Packet8s>(a, b);
926  const int16x8_t cd_s16 = pcast<Packet4i, Packet8s>(c, d);
927  return vcombine_s8(vmovn_s16(ab_s16), vmovn_s16(cd_s16));
928 }
929 template <>
930 EIGEN_STRONG_INLINE Packet8c pcast<Packet4i, Packet8c>(const Packet4i& a, const Packet4i& b) {
931  const int16x8_t ab_s16 = pcast<Packet4i, Packet8s>(a, b);
932  return vmovn_s16(ab_s16);
933 }
934 template <>
935 EIGEN_STRONG_INLINE Packet8c pcast<Packet2i, Packet8c>(const Packet2i& a, const Packet2i& b, const Packet2i& c,
936  const Packet2i& d) {
937  const int16x4_t ab_s16 = vmovn_s32(vcombine_s32(a, b));
938  const int16x4_t cd_s16 = vmovn_s32(vcombine_s32(c, d));
939  return vmovn_s16(vcombine_s16(ab_s16, cd_s16));
940 }
941 template <>
942 EIGEN_STRONG_INLINE Packet4c pcast<Packet4i, Packet4c>(const Packet4i& a) {
943  const int16x4_t a_s16x4 = vmovn_s32(a);
944  const int16x8_t aa_s16x8 = vcombine_s16(a_s16x4, a_s16x4);
945  const int8x8_t aa_s8x8 = vmovn_s16(aa_s16x8);
946  return vget_lane_s32(vreinterpret_s32_s8(aa_s8x8), 0);
947 }
948 
949 template <>
950 struct type_casting_traits<numext::int32_t, numext::uint8_t> {
951  enum { VectorizedCast = 1, SrcCoeffRatio = 4, TgtCoeffRatio = 1 };
952 };
953 template <>
954 EIGEN_STRONG_INLINE Packet16uc pcast<Packet4i, Packet16uc>(const Packet4i& a, const Packet4i& b, const Packet4i& c,
955  const Packet4i& d) {
956  return preinterpret<Packet16uc>(pcast<Packet4i, Packet16c>(a, b, c, d));
957 }
958 template <>
959 EIGEN_STRONG_INLINE Packet8uc pcast<Packet4i, Packet8uc>(const Packet4i& a, const Packet4i& b) {
960  return preinterpret<Packet8uc>(pcast<Packet4i, Packet8c>(a, b));
961 }
962 template <>
963 EIGEN_STRONG_INLINE Packet8uc pcast<Packet2i, Packet8uc>(const Packet2i& a, const Packet2i& b, const Packet2i& c,
964  const Packet2i& d) {
965  return preinterpret<Packet8uc>(pcast<Packet2i, Packet8c>(a, b, c, d));
966 }
967 template <>
968 EIGEN_STRONG_INLINE Packet4uc pcast<Packet4i, Packet4uc>(const Packet4i& a) {
969  return static_cast<Packet4uc>(pcast<Packet4i, Packet4c>(a));
970 }
971 
972 //==============================================================================
973 // pcast, SrcType = uint32_t
974 //==============================================================================
975 template <>
976 struct type_casting_traits<numext::uint32_t, float> {
977  enum { VectorizedCast = 1, SrcCoeffRatio = 1, TgtCoeffRatio = 1 };
978 };
979 template <>
980 EIGEN_STRONG_INLINE Packet4f pcast<Packet4ui, Packet4f>(const Packet4ui& a) {
981  return vcvtq_f32_u32(a);
982 }
983 template <>
984 EIGEN_STRONG_INLINE Packet2f pcast<Packet2ui, Packet2f>(const Packet2ui& a) {
985  return vcvt_f32_u32(a);
986 }
987 
988 template <>
989 struct type_casting_traits<numext::uint32_t, numext::uint64_t> {
990  enum { VectorizedCast = 1, SrcCoeffRatio = 1, TgtCoeffRatio = 2 };
991 };
992 template <>
993 EIGEN_STRONG_INLINE Packet2ul pcast<Packet4ui, Packet2ul>(const Packet4ui& a) {
994  // Discard second half of input.
995  return vmovl_u32(vget_low_u32(a));
996 }
997 template <>
998 EIGEN_STRONG_INLINE Packet2ul pcast<Packet2ui, Packet2ul>(const Packet2ui& a) {
999  return vmovl_u32(a);
1000 }
1001 
1002 template <>
1003 struct type_casting_traits<numext::uint32_t, numext::int64_t> {
1004  enum { VectorizedCast = 1, SrcCoeffRatio = 1, TgtCoeffRatio = 2 };
1005 };
1006 template <>
1007 EIGEN_STRONG_INLINE Packet2l pcast<Packet4ui, Packet2l>(const Packet4ui& a) {
1008  return preinterpret<Packet2l>(pcast<Packet4ui, Packet2ul>(a));
1009 }
1010 template <>
1011 EIGEN_STRONG_INLINE Packet2l pcast<Packet2ui, Packet2l>(const Packet2ui& a) {
1012  return preinterpret<Packet2l>(pcast<Packet2ui, Packet2ul>(a));
1013 }
1014 
1015 
1016 template <>
1017 struct type_casting_traits<numext::uint32_t, numext::uint16_t> {
1018  enum { VectorizedCast = 1, SrcCoeffRatio = 2, TgtCoeffRatio = 1 };
1019 };
1020 template <>
1021 EIGEN_STRONG_INLINE Packet8us pcast<Packet4ui, Packet8us>(const Packet4ui& a, const Packet4ui& b) {
1022  return vcombine_u16(vmovn_u32(a), vmovn_u32(b));
1023 }
1024 template <>
1025 EIGEN_STRONG_INLINE Packet4us pcast<Packet2ui, Packet4us>(const Packet2ui& a, const Packet2ui& b) {
1026  return vmovn_u32(vcombine_u32(a, b));
1027 }
1028 template <>
1029 EIGEN_STRONG_INLINE Packet4us pcast<Packet4ui, Packet4us>(const Packet4ui& a) {
1030  return vmovn_u32(a);
1031 }
1032 
1033 template <>
1034 struct type_casting_traits<numext::uint32_t, numext::int16_t> {
1035  enum { VectorizedCast = 1, SrcCoeffRatio = 2, TgtCoeffRatio = 1 };
1036 };
1037 template <>
1038 EIGEN_STRONG_INLINE Packet8s pcast<Packet4ui, Packet8s>(const Packet4ui& a, const Packet4ui& b) {
1039  return preinterpret<Packet8s>(pcast<Packet4ui, Packet8us>(a, b));
1040 }
1041 template <>
1042 EIGEN_STRONG_INLINE Packet4s pcast<Packet2ui, Packet4s>(const Packet2ui& a, const Packet2ui& b) {
1043  return preinterpret<Packet4s>(pcast<Packet2ui, Packet4us>(a, b));
1044 }
1045 template <>
1046 EIGEN_STRONG_INLINE Packet4s pcast<Packet4ui, Packet4s>(const Packet4ui& a) {
1047  return preinterpret<Packet4s>(pcast<Packet4ui, Packet4us>(a));
1048 }
1049 
1050 template <>
1051 struct type_casting_traits<numext::uint32_t, numext::uint8_t> {
1052  enum { VectorizedCast = 1, SrcCoeffRatio = 4, TgtCoeffRatio = 1 };
1053 };
1054 template <>
1055 EIGEN_STRONG_INLINE Packet16uc pcast<Packet4ui, Packet16uc>(const Packet4ui& a, const Packet4ui& b, const Packet4ui& c,
1056  const Packet4ui& d) {
1057  const uint16x8_t ab_u16 = vcombine_u16(vmovn_u32(a), vmovn_u32(b));
1058  const uint16x8_t cd_u16 = vcombine_u16(vmovn_u32(c), vmovn_u32(d));
1059  return vcombine_u8(vmovn_u16(ab_u16), vmovn_u16(cd_u16));
1060 }
1061 template <>
1062 EIGEN_STRONG_INLINE Packet8uc pcast<Packet4ui, Packet8uc>(const Packet4ui& a, const Packet4ui& b) {
1063  const uint16x8_t ab_u16 = vcombine_u16(vmovn_u32(a), vmovn_u32(b));
1064  return vmovn_u16(ab_u16);
1065 }
1066 template <>
1067 EIGEN_STRONG_INLINE Packet8uc pcast<Packet2ui, Packet8uc>(const Packet2ui& a, const Packet2ui& b, const Packet2ui& c,
1068  const Packet2ui& d) {
1069  const uint16x4_t ab_u16 = vmovn_u32(vcombine_u32(a, b));
1070  const uint16x4_t cd_u16 = vmovn_u32(vcombine_u32(c, d));
1071  return vmovn_u16(vcombine_u16(ab_u16, cd_u16));
1072 }
1073 template <>
1074 EIGEN_STRONG_INLINE Packet4uc pcast<Packet4ui, Packet4uc>(const Packet4ui& a) {
1075  const uint16x4_t a_u16x4 = vmovn_u32(a);
1076  const uint16x8_t aa_u16x8 = vcombine_u16(a_u16x4, a_u16x4);
1077  const uint8x8_t aa_u8x8 = vmovn_u16(aa_u16x8);
1078  return vget_lane_u32(vreinterpret_u32_u8(aa_u8x8), 0);
1079 }
1080 
1081 template <>
1082 struct type_casting_traits<numext::uint32_t, numext::int8_t> {
1083  enum { VectorizedCast = 1, SrcCoeffRatio = 4, TgtCoeffRatio = 1 };
1084 };
1085 template <>
1086 EIGEN_STRONG_INLINE Packet16c pcast<Packet4ui, Packet16c>(const Packet4ui& a, const Packet4ui& b, const Packet4ui& c,
1087  const Packet4ui& d) {
1088  return preinterpret<Packet16c>(pcast<Packet4ui, Packet16uc>(a, b, c, d));
1089 }
1090 template <>
1091 EIGEN_STRONG_INLINE Packet8c pcast<Packet4ui, Packet8c>(const Packet4ui& a, const Packet4ui& b) {
1092  return preinterpret<Packet8c>(pcast<Packet4ui, Packet8uc>(a, b));
1093 }
1094 template <>
1095 EIGEN_STRONG_INLINE Packet8c pcast<Packet2ui, Packet8c>(const Packet2ui& a, const Packet2ui& b, const Packet2ui& c,
1096  const Packet2ui& d) {
1097  return preinterpret<Packet8c>(pcast<Packet2ui, Packet8uc>(a, b, c, d));
1098 }
1099 template <>
1100 EIGEN_STRONG_INLINE Packet4c pcast<Packet4ui, Packet4c>(const Packet4ui& a) {
1101  return static_cast<Packet4c>(pcast<Packet4ui, Packet4uc>(a));
1102 }
1103 
1104 //==============================================================================
1105 // pcast, SrcType = int64_t
1106 //==============================================================================
1107 template <>
1108 struct type_casting_traits<numext::int64_t, float> {
1109  enum { VectorizedCast = 1, SrcCoeffRatio = 2, TgtCoeffRatio = 1 };
1110 };
1111 template <>
1112 EIGEN_STRONG_INLINE Packet4f pcast<Packet2l, Packet4f>(const Packet2l& a, const Packet2l& b) {
1113  return vcvtq_f32_s32(vcombine_s32(vmovn_s64(a), vmovn_s64(b)));
1114 }
1115 template <>
1116 EIGEN_STRONG_INLINE Packet2f pcast<Packet2l, Packet2f>(const Packet2l& a) {
1117  return vcvt_f32_s32(vmovn_s64(a));
1118 }
1119 
1120 
1121 template <>
1122 struct type_casting_traits<numext::int64_t, numext::int32_t> {
1123  enum { VectorizedCast = 1, SrcCoeffRatio = 2, TgtCoeffRatio = 1 };
1124 };
1125 template <>
1126 EIGEN_STRONG_INLINE Packet4i pcast<Packet2l, Packet4i>(const Packet2l& a, const Packet2l& b) {
1127  return vcombine_s32(vmovn_s64(a), vmovn_s64(b));
1128 }
1129 template <>
1130 EIGEN_STRONG_INLINE Packet2i pcast<Packet2l, Packet2i>(const Packet2l& a) {
1131  return vmovn_s64(a);
1132 }
1133 
1134 template <>
1135 struct type_casting_traits<numext::int64_t, numext::uint32_t> {
1136  enum { VectorizedCast = 1, SrcCoeffRatio = 2, TgtCoeffRatio = 1 };
1137 };
1138 template <>
1139 EIGEN_STRONG_INLINE Packet4ui pcast<Packet2l, Packet4ui>(const Packet2l& a, const Packet2l& b) {
1140  return vcombine_u32(vmovn_u64(vreinterpretq_u64_s64(a)), vmovn_u64(vreinterpretq_u64_s64(b)));
1141 }
1142 template <>
1143 EIGEN_STRONG_INLINE Packet2ui pcast<Packet2l, Packet2ui>(const Packet2l& a) {
1144  return vmovn_u64(vreinterpretq_u64_s64(a));
1145 }
1146 
1147 template <>
1148 struct type_casting_traits<numext::int64_t, numext::int16_t> {
1149  enum { VectorizedCast = 1, SrcCoeffRatio = 4, TgtCoeffRatio = 1 };
1150 };
1151 template <>
1152 EIGEN_STRONG_INLINE Packet8s pcast<Packet2l, Packet8s>(const Packet2l& a, const Packet2l& b, const Packet2l& c,
1153  const Packet2l& d) {
1154  const int32x4_t ab_s32 = pcast<Packet2l, Packet4i>(a, b);
1155  const int32x4_t cd_s32 = pcast<Packet2l, Packet4i>(c, d);
1156  return vcombine_s16(vmovn_s32(ab_s32), vmovn_s32(cd_s32));
1157 }
1158 template <>
1159 EIGEN_STRONG_INLINE Packet4s pcast<Packet2l, Packet4s>(const Packet2l& a, const Packet2l& b) {
1160  const int32x4_t ab_s32 = pcast<Packet2l, Packet4i>(a, b);
1161  return vmovn_s32(ab_s32);
1162 }
1163 
1164 template <>
1165 struct type_casting_traits<numext::int64_t, numext::uint16_t> {
1166  enum { VectorizedCast = 1, SrcCoeffRatio = 4, TgtCoeffRatio = 1 };
1167 };
1168 template <>
1169 EIGEN_STRONG_INLINE Packet8us pcast<Packet2l, Packet8us>(const Packet2l& a, const Packet2l& b, const Packet2l& c,
1170  const Packet2l& d) {
1171  return preinterpret<Packet8us>(pcast<Packet2l, Packet8s>(a, b, c, d));
1172 }
1173 template <>
1174 EIGEN_STRONG_INLINE Packet4us pcast<Packet2l, Packet4us>(const Packet2l& a, const Packet2l& b) {
1175  return preinterpret<Packet4us>(pcast<Packet2l, Packet4s>(a, b));
1176 }
1177 
1178 template <>
1179 struct type_casting_traits<numext::int64_t, numext::int8_t> {
1180  enum { VectorizedCast = 1, SrcCoeffRatio = 8, TgtCoeffRatio = 1 };
1181 };
1182 template <>
1183 EIGEN_STRONG_INLINE Packet16c pcast<Packet2l, Packet16c>(const Packet2l& a, const Packet2l& b, const Packet2l& c,
1184  const Packet2l& d, const Packet2l& e, const Packet2l& f,
1185  const Packet2l& g, const Packet2l& h) {
1186  const int16x8_t abcd_s16 = pcast<Packet2l, Packet8s>(a, b, c, d);
1187  const int16x8_t efgh_s16 = pcast<Packet2l, Packet8s>(e, f, g, h);
1188  return vcombine_s8(vmovn_s16(abcd_s16), vmovn_s16(efgh_s16));
1189 }
1190 template <>
1191 EIGEN_STRONG_INLINE Packet8c pcast<Packet2l, Packet8c>(const Packet2l& a, const Packet2l& b, const Packet2l& c,
1192  const Packet2l& d) {
1193  const int16x8_t abcd_s16 = pcast<Packet2l, Packet8s>(a, b, c, d);
1194  return vmovn_s16(abcd_s16);
1195 }
1196 template <>
1197 EIGEN_STRONG_INLINE Packet4c pcast<Packet2l, Packet4c>(const Packet2l& a, const Packet2l& b) {
1198  const int16x4_t ab_s16 = pcast<Packet2l, Packet4s>(a, b);
1199  const int16x8_t abab_s16 = vcombine_s16(ab_s16, ab_s16);
1200  const int8x8_t abab_s8 = vmovn_s16(abab_s16);
1201  return vget_lane_s32(vreinterpret_s32_s8(abab_s8), 0);
1202 }
1203 
1204 template <>
1205 struct type_casting_traits<numext::int64_t, numext::uint8_t> {
1206  enum { VectorizedCast = 1, SrcCoeffRatio = 8, TgtCoeffRatio = 1 };
1207 };
1208 template <>
1209 EIGEN_STRONG_INLINE Packet16uc pcast<Packet2l, Packet16uc>(const Packet2l& a, const Packet2l& b, const Packet2l& c,
1210  const Packet2l& d, const Packet2l& e, const Packet2l& f,
1211  const Packet2l& g, const Packet2l& h) {
1212  const uint16x8_t abcd_u16 = pcast<Packet2l, Packet8us>(a, b, c, d);
1213  const uint16x8_t efgh_u16 = pcast<Packet2l, Packet8us>(e, f, g, h);
1214  return vcombine_u8(vmovn_u16(abcd_u16), vmovn_u16(efgh_u16));
1215 }
1216 template <>
1217 EIGEN_STRONG_INLINE Packet8uc pcast<Packet2l, Packet8uc>(const Packet2l& a, const Packet2l& b, const Packet2l& c,
1218  const Packet2l& d) {
1219  return preinterpret<Packet8uc>(pcast<Packet2l, Packet8c>(a, b, c, d));
1220 }
1221 template <>
1222 EIGEN_STRONG_INLINE Packet4uc pcast<Packet2l, Packet4uc>(const Packet2l& a, const Packet2l& b) {
1223  return static_cast<Packet4uc>(pcast<Packet2l, Packet4c>(a, b));
1224 }
1225 
1226 //==============================================================================
1227 // pcast, SrcType = uint64_t
1228 //==============================================================================
1229 template <>
1230 struct type_casting_traits<numext::uint64_t, float> {
1231  enum { VectorizedCast = 1, SrcCoeffRatio = 2, TgtCoeffRatio = 1 };
1232 };
1233 template <>
1234 EIGEN_STRONG_INLINE Packet4f pcast<Packet2ul, Packet4f>(const Packet2ul& a, const Packet2ul& b) {
1235  return vcvtq_f32_u32(vcombine_u32(vmovn_u64(a), vmovn_u64(b)));
1236 }
1237 template <>
1238 EIGEN_STRONG_INLINE Packet2f pcast<Packet2ul, Packet2f>(const Packet2ul& a) {
1239  return vcvt_f32_u32(vmovn_u64(a));
1240 }
1241 
1242 
1243 template <>
1244 struct type_casting_traits<numext::uint64_t, numext::uint32_t> {
1245  enum { VectorizedCast = 1, SrcCoeffRatio = 2, TgtCoeffRatio = 1 };
1246 };
1247 template <>
1248 EIGEN_STRONG_INLINE Packet4ui pcast<Packet2ul, Packet4ui>(const Packet2ul& a, const Packet2ul& b) {
1249  return vcombine_u32(vmovn_u64(a), vmovn_u64(b));
1250 }
1251 template <>
1252 EIGEN_STRONG_INLINE Packet2ui pcast<Packet2ul, Packet2ui>(const Packet2ul& a) {
1253  return vmovn_u64(a);
1254 }
1255 
1256 template <>
1257 struct type_casting_traits<numext::uint64_t, numext::int32_t> {
1258  enum { VectorizedCast = 1, SrcCoeffRatio = 2, TgtCoeffRatio = 1 };
1259 };
1260 template <>
1261 EIGEN_STRONG_INLINE Packet4i pcast<Packet2ul, Packet4i>(const Packet2ul& a, const Packet2ul& b) {
1262  return preinterpret<Packet4i>(pcast<Packet2ul, Packet4ui>(a, b));
1263 }
1264 template <>
1265 EIGEN_STRONG_INLINE Packet2i pcast<Packet2ul, Packet2i>(const Packet2ul& a) {
1266  return preinterpret<Packet2i>(pcast<Packet2ul, Packet2ui>(a));
1267 }
1268 
1269 template <>
1270 struct type_casting_traits<numext::uint64_t, numext::uint16_t> {
1271  enum { VectorizedCast = 1, SrcCoeffRatio = 4, TgtCoeffRatio = 1 };
1272 };
1273 template <>
1274 EIGEN_STRONG_INLINE Packet8us pcast<Packet2ul, Packet8us>(const Packet2ul& a, const Packet2ul& b, const Packet2ul& c,
1275  const Packet2ul& d) {
1276  const uint16x4_t ab_u16 = vmovn_u32(vcombine_u32(vmovn_u64(a), vmovn_u64(b)));
1277  const uint16x4_t cd_u16 = vmovn_u32(vcombine_u32(vmovn_u64(c), vmovn_u64(d)));
1278  return vcombine_u16(ab_u16, cd_u16);
1279 }
1280 template <>
1281 EIGEN_STRONG_INLINE Packet4us pcast<Packet2ul, Packet4us>(const Packet2ul& a, const Packet2ul& b) {
1282  return vmovn_u32(vcombine_u32(vmovn_u64(a), vmovn_u64(b)));
1283 }
1284 
1285 template <>
1286 struct type_casting_traits<numext::uint64_t, numext::int16_t> {
1287  enum { VectorizedCast = 1, SrcCoeffRatio = 4, TgtCoeffRatio = 1 };
1288 };
1289 template <>
1290 EIGEN_STRONG_INLINE Packet8s pcast<Packet2ul, Packet8s>(const Packet2ul& a, const Packet2ul& b, const Packet2ul& c,
1291  const Packet2ul& d) {
1292  return preinterpret<Packet8s>(pcast<Packet2ul, Packet8us>(a, b, c, d));
1293 }
1294 template <>
1295 EIGEN_STRONG_INLINE Packet4s pcast<Packet2ul, Packet4s>(const Packet2ul& a, const Packet2ul& b) {
1296  return preinterpret<Packet4s>(pcast<Packet2ul, Packet4us>(a, b));
1297 }
1298 
1299 template <>
1300 struct type_casting_traits<numext::uint64_t, numext::uint8_t> {
1301  enum { VectorizedCast = 1, SrcCoeffRatio = 8, TgtCoeffRatio = 1 };
1302 };
1303 template <>
1304 EIGEN_STRONG_INLINE Packet16uc pcast<Packet2ul, Packet16uc>(const Packet2ul& a, const Packet2ul& b, const Packet2ul& c,
1305  const Packet2ul& d, const Packet2ul& e, const Packet2ul& f,
1306  const Packet2ul& g, const Packet2ul& h) {
1307  const uint16x8_t abcd_u16 = pcast<Packet2ul, Packet8us>(a, b, c, d);
1308  const uint16x8_t efgh_u16 = pcast<Packet2ul, Packet8us>(e, f, g, h);
1309  return vcombine_u8(vmovn_u16(abcd_u16), vmovn_u16(efgh_u16));
1310 }
1311 template <>
1312 EIGEN_STRONG_INLINE Packet8uc pcast<Packet2ul, Packet8uc>(const Packet2ul& a, const Packet2ul& b, const Packet2ul& c,
1313  const Packet2ul& d) {
1314  const uint16x8_t abcd_u16 = pcast<Packet2ul, Packet8us>(a, b, c, d);
1315  return vmovn_u16(abcd_u16);
1316 }
1317 template <>
1318 EIGEN_STRONG_INLINE Packet4uc pcast<Packet2ul, Packet4uc>(const Packet2ul& a, const Packet2ul& b) {
1319  const uint16x4_t ab_u16 = pcast<Packet2ul, Packet4us>(a, b);
1320  const uint16x8_t abab_u16 = vcombine_u16(ab_u16, ab_u16);
1321  const uint8x8_t abab_u8 = vmovn_u16(abab_u16);
1322  return vget_lane_u32(vreinterpret_u32_u8(abab_u8), 0);
1323 }
1324 
1325 template <>
1326 struct type_casting_traits<numext::uint64_t, numext::int8_t> {
1327  enum { VectorizedCast = 1, SrcCoeffRatio = 8, TgtCoeffRatio = 1 };
1328 };
1329 template <>
1330 EIGEN_STRONG_INLINE Packet16c pcast<Packet2ul, Packet16c>(const Packet2ul& a, const Packet2ul& b, const Packet2ul& c,
1331  const Packet2ul& d, const Packet2ul& e, const Packet2ul& f,
1332  const Packet2ul& g, const Packet2ul& h) {
1333  return preinterpret<Packet16c>(pcast<Packet2ul, Packet16uc>(a, b, c, d, e, f, g, h));
1334 }
1335 template <>
1336 EIGEN_STRONG_INLINE Packet8c pcast<Packet2ul, Packet8c>(const Packet2ul& a, const Packet2ul& b, const Packet2ul& c,
1337  const Packet2ul& d) {
1338  return preinterpret<Packet8c>(pcast<Packet2ul, Packet8uc>(a, b, c, d));
1339 }
1340 template <>
1341 EIGEN_STRONG_INLINE Packet4c pcast<Packet2ul, Packet4c>(const Packet2ul& a, const Packet2ul& b) {
1342  return static_cast<Packet4c>(pcast<Packet2ul, Packet4uc>(a, b));
1343 }
1344 
1345 #if EIGEN_ARCH_ARM64
1346 
1347 //==============================================================================
1348 // pcast/preinterpret, Double
1349 //==============================================================================
1350 
1351 template <>
1352 EIGEN_STRONG_INLINE Packet2d preinterpret<Packet2d, Packet2l>(const Packet2l& a) {
1353  return Packet2d(vreinterpretq_f64_s64(a));
1354 }
1355 template <>
1356 EIGEN_STRONG_INLINE Packet2d preinterpret<Packet2d, Packet2ul>(const Packet2ul& a) {
1357  return Packet2d(vreinterpretq_f64_u64(a));
1358 }
1359 template <>
1360 EIGEN_STRONG_INLINE Packet2l preinterpret<Packet2l, Packet2d>(const Packet2d& a) {
1361  return Packet2l(vreinterpretq_s64_f64(a));
1362 }
1363 template <>
1364 EIGEN_STRONG_INLINE Packet2ul preinterpret<Packet2ul, Packet2d>(const Packet2d& a) {
1365  return Packet2ul(vreinterpretq_u64_f64(a));
1366 }
1367 template <>
1368 EIGEN_STRONG_INLINE Packet2d preinterpret<Packet2d, Packet4i>(const Packet4i& a) {
1369  return Packet2d(vreinterpretq_f64_s32(a));
1370 }
1371 template <>
1372 EIGEN_STRONG_INLINE Packet4i preinterpret<Packet4i, Packet2d>(const Packet2d& a) {
1373  return Packet4i(vreinterpretq_s32_f64(a));
1374 }
1375 
1376 
1377 template <>
1378 struct type_casting_traits<double, float> {
1379  enum { VectorizedCast = 1, SrcCoeffRatio = 2, TgtCoeffRatio = 1 };
1380 };
1381 template <>
1382 EIGEN_STRONG_INLINE Packet4f pcast<Packet2d, Packet4f>(const Packet2d& a, const Packet2d& b) {
1383  return vcombine_f32(vcvt_f32_f64(a), vcvt_f32_f64(b));
1384 }
1385 template <>
1386 EIGEN_STRONG_INLINE Packet2f pcast<Packet2d, Packet2f>(const Packet2d& a) {
1387  return vcvt_f32_f64(a);
1388 }
1389 
1390 template <>
1391 struct type_casting_traits<double, numext::int64_t> {
1392  enum { VectorizedCast = 1, SrcCoeffRatio = 1, TgtCoeffRatio = 1 };
1393 };
1394 template <>
1395 EIGEN_STRONG_INLINE Packet2l pcast<Packet2d, Packet2l>(const Packet2d& a) {
1396  return vcvtq_s64_f64(a);
1397 }
1398 
1399 template <>
1400 struct type_casting_traits<double, numext::uint64_t> {
1401  enum { VectorizedCast = 1, SrcCoeffRatio = 1, TgtCoeffRatio = 1 };
1402 };
1403 template <>
1404 EIGEN_STRONG_INLINE Packet2ul pcast<Packet2d, Packet2ul>(const Packet2d& a) {
1405  return vcvtq_u64_f64(a);
1406 }
1407 
1408 template <>
1409 struct type_casting_traits<double, numext::int32_t> {
1410  enum { VectorizedCast = 1, SrcCoeffRatio = 2, TgtCoeffRatio = 1 };
1411 };
1412 template <>
1413 EIGEN_STRONG_INLINE Packet4i pcast<Packet2d, Packet4i>(const Packet2d& a, const Packet2d& b) {
1414  return vcombine_s32(vmovn_s64(vcvtq_s64_f64(a)), vmovn_s64(vcvtq_s64_f64(b)));
1415 }
1416 template <>
1417 EIGEN_STRONG_INLINE Packet2i pcast<Packet2d, Packet2i>(const Packet2d& a) {
1418  return vmovn_s64(vcvtq_s64_f64(a));
1419 }
1420 
1421 template <>
1422 struct type_casting_traits<double, numext::uint32_t> {
1423  enum { VectorizedCast = 1, SrcCoeffRatio = 2, TgtCoeffRatio = 1 };
1424 };
1425 template <>
1426 EIGEN_STRONG_INLINE Packet4ui pcast<Packet2d, Packet4ui>(const Packet2d& a, const Packet2d& b) {
1427  return vcombine_u32(vmovn_u64(vcvtq_u64_f64(a)), vmovn_u64(vcvtq_u64_f64(b)));
1428 }
1429 template <>
1430 EIGEN_STRONG_INLINE Packet2ui pcast<Packet2d, Packet2ui>(const Packet2d& a) {
1431  return vmovn_u64(vcvtq_u64_f64(a));
1432 }
1433 
1434 template <>
1435 struct type_casting_traits<double, numext::int16_t> {
1436  enum { VectorizedCast = 1, SrcCoeffRatio = 4, TgtCoeffRatio = 1 };
1437 };
1438 template <>
1439 EIGEN_STRONG_INLINE Packet8s pcast<Packet2d, Packet8s>(const Packet2d& a, const Packet2d& b, const Packet2d& c,
1440  const Packet2d& d) {
1441  const int32x4_t ab_s32 = pcast<Packet2d, Packet4i>(a, b);
1442  const int32x4_t cd_s32 = pcast<Packet2d, Packet4i>(c, d);
1443  return vcombine_s16(vmovn_s32(ab_s32), vmovn_s32(cd_s32));
1444 }
1445 template <>
1446 EIGEN_STRONG_INLINE Packet4s pcast<Packet2d, Packet4s>(const Packet2d& a, const Packet2d& b) {
1447  const int32x4_t ab_s32 = pcast<Packet2d, Packet4i>(a, b);
1448  return vmovn_s32(ab_s32);
1449 }
1450 
1451 template <>
1452 struct type_casting_traits<double, numext::uint16_t> {
1453  enum { VectorizedCast = 1, SrcCoeffRatio = 4, TgtCoeffRatio = 1 };
1454 };
1455 template <>
1456 EIGEN_STRONG_INLINE Packet8us pcast<Packet2d, Packet8us>(const Packet2d& a, const Packet2d& b, const Packet2d& c,
1457  const Packet2d& d) {
1458  return preinterpret<Packet8us>(pcast<Packet2d, Packet8s>(a, b, c, d));
1459 }
1460 template <>
1461 EIGEN_STRONG_INLINE Packet4us pcast<Packet2d, Packet4us>(const Packet2d& a, const Packet2d& b) {
1462  return preinterpret<Packet4us>(pcast<Packet2d, Packet4s>(a, b));
1463 }
1464 
1465 template <>
1466 struct type_casting_traits<double, numext::int8_t> {
1467  enum { VectorizedCast = 1, SrcCoeffRatio = 8, TgtCoeffRatio = 1 };
1468 };
1469 template <>
1470 EIGEN_STRONG_INLINE Packet16c pcast<Packet2d, Packet16c>(const Packet2d& a, const Packet2d& b, const Packet2d& c,
1471  const Packet2d& d, const Packet2d& e, const Packet2d& f,
1472  const Packet2d& g, const Packet2d& h) {
1473  const int16x8_t abcd_s16 = pcast<Packet2d, Packet8s>(a, b, c, d);
1474  const int16x8_t efgh_s16 = pcast<Packet2d, Packet8s>(e, f, g, h);
1475  return vcombine_s8(vmovn_s16(abcd_s16), vmovn_s16(efgh_s16));
1476 }
1477 template <>
1478 EIGEN_STRONG_INLINE Packet8c pcast<Packet2d, Packet8c>(const Packet2d& a, const Packet2d& b, const Packet2d& c,
1479  const Packet2d& d) {
1480  const int16x8_t abcd_s16 = pcast<Packet2d, Packet8s>(a, b, c, d);
1481  return vmovn_s16(abcd_s16);
1482 }
1483 template <>
1484 EIGEN_STRONG_INLINE Packet4c pcast<Packet2d, Packet4c>(const Packet2d& a, const Packet2d& b) {
1485  const int32x4_t ab_s32 = pcast<Packet2d, Packet4i>(a, b);
1486  return pcast<Packet4i, Packet4c>(ab_s32);
1487 }
1488 
1489 template <>
1490 struct type_casting_traits<double, numext::uint8_t> {
1491  enum { VectorizedCast = 1, SrcCoeffRatio = 8, TgtCoeffRatio = 1 };
1492 };
1493 template <>
1494 EIGEN_STRONG_INLINE Packet16uc pcast<Packet2d, Packet16uc>(const Packet2d& a, const Packet2d& b, const Packet2d& c,
1495  const Packet2d& d, const Packet2d& e, const Packet2d& f,
1496  const Packet2d& g, const Packet2d& h) {
1497  const uint16x8_t abcd_u16 = pcast<Packet2d, Packet8us>(a, b, c, d);
1498  const uint16x8_t efgh_u16 = pcast<Packet2d, Packet8us>(e, f, g, h);
1499  return vcombine_u8(vmovn_u16(abcd_u16), vmovn_u16(efgh_u16));
1500 }
1501 template <>
1502 EIGEN_STRONG_INLINE Packet8uc pcast<Packet2d, Packet8uc>(const Packet2d& a, const Packet2d& b, const Packet2d& c,
1503  const Packet2d& d) {
1504  return preinterpret<Packet8uc>(pcast<Packet2d, Packet8c>(a, b, c, d));
1505 }
1506 template <>
1507 EIGEN_STRONG_INLINE Packet4uc pcast<Packet2d, Packet4uc>(const Packet2d& a, const Packet2d& b) {
1508  return static_cast<Packet4uc>(pcast<Packet2d, Packet4c>(a, b));
1509 }
1510 
1511 template <>
1512 struct type_casting_traits<float, double> {
1513  enum { VectorizedCast = 1, SrcCoeffRatio = 1, TgtCoeffRatio = 2 };
1514 };
1515 template <>
1516 EIGEN_STRONG_INLINE Packet2d pcast<Packet4f, Packet2d>(const Packet4f& a) {
1517  // Discard second-half of input.
1518  return vcvt_f64_f32(vget_low_f32(a));
1519 }
1520 template <>
1521 EIGEN_STRONG_INLINE Packet2d pcast<Packet2f, Packet2d>(const Packet2f& a) {
1522  return vcvt_f64_f32(a);
1523 }
1524 
1525 template <>
1526 struct type_casting_traits<numext::int8_t, double> {
1527  enum { VectorizedCast = 1, SrcCoeffRatio = 1, TgtCoeffRatio = 8 };
1528 };
1529 template <>
1530 EIGEN_STRONG_INLINE Packet2d pcast<Packet16c, Packet2d>(const Packet16c& a) {
1531  // Discard all but first two values.
1532  // MSVC defines most intrinsics as macros, so we need to do this in two lines for portability.
1533  Packet2f tmp = pcast<Packet8c, Packet2f>(vget_low_s8(a));
1534  return vcvt_f64_f32(tmp);
1535 }
1536 
1537 template <>
1538 struct type_casting_traits<numext::uint8_t, double> {
1539  enum { VectorizedCast = 1, SrcCoeffRatio = 1, TgtCoeffRatio = 8 };
1540 };
1541 template <>
1542 EIGEN_STRONG_INLINE Packet2d pcast<Packet16uc, Packet2d>(const Packet16uc& a) {
1543  // Discard all but first two values.
1544  Packet2f tmp = pcast<Packet8uc, Packet2f>(vget_low_u8(a));
1545  return vcvt_f64_f32(tmp);
1546 }
1547 
1548 template <>
1549 struct type_casting_traits<numext::int16_t, double> {
1550  enum { VectorizedCast = 1, SrcCoeffRatio = 1, TgtCoeffRatio = 4 };
1551 };
1552 template <>
1553 EIGEN_STRONG_INLINE Packet2d pcast<Packet8s, Packet2d>(const Packet8s& a) {
1554  // Discard all but first two values.
1555  Packet2f tmp = pcast<Packet4s, Packet2f>(vget_low_s16(a));
1556  return vcvt_f64_f32(tmp);
1557 }
1558 
1559 template <>
1560 struct type_casting_traits<numext::uint16_t, double> {
1561  enum { VectorizedCast = 1, SrcCoeffRatio = 1, TgtCoeffRatio = 4 };
1562 };
1563 template <>
1564 EIGEN_STRONG_INLINE Packet2d pcast<Packet8us, Packet2d>(const Packet8us& a) {
1565  // Discard all but first two values.
1566  Packet2f tmp = pcast<Packet4us, Packet2f>(vget_low_u16(a));
1567  return vcvt_f64_f32(tmp);
1568 }
1569 
1570 template <>
1571 struct type_casting_traits<numext::int32_t, double> {
1572  enum { VectorizedCast = 1, SrcCoeffRatio = 1, TgtCoeffRatio = 2 };
1573 };
1574 template <>
1575 EIGEN_STRONG_INLINE Packet2d pcast<Packet4i, Packet2d>(const Packet4i& a) {
1576  // Discard second half of input.
1577  return vcvtq_f64_s64(vmovl_s32(vget_low_s32(a)));
1578 }
1579 template <>
1580 EIGEN_STRONG_INLINE Packet2d pcast<Packet2i, Packet2d>(const Packet2i& a) {
1581  return vcvtq_f64_s64(vmovl_s32(a));
1582 }
1583 
1584 template <>
1585 struct type_casting_traits<numext::uint32_t, double> {
1586  enum { VectorizedCast = 1, SrcCoeffRatio = 1, TgtCoeffRatio = 2 };
1587 };
1588 template <>
1589 EIGEN_STRONG_INLINE Packet2d pcast<Packet4ui, Packet2d>(const Packet4ui& a) {
1590  // Discard second half of input.
1591  return vcvtq_f64_u64(vmovl_u32(vget_low_u32(a)));
1592 }
1593 template <>
1594 EIGEN_STRONG_INLINE Packet2d pcast<Packet2ui, Packet2d>(const Packet2ui& a) {
1595  return vcvtq_f64_u64(vmovl_u32(a));
1596 }
1597 
1598 template <>
1599 struct type_casting_traits<numext::int64_t, double> {
1600  enum { VectorizedCast = 1, SrcCoeffRatio = 1, TgtCoeffRatio = 1 };
1601 };
1602 template <>
1603 EIGEN_STRONG_INLINE Packet2d pcast<Packet2l, Packet2d>(const Packet2l& a) {
1604  return vcvtq_f64_s64(a);
1605 }
1606 
1607 template <>
1608 struct type_casting_traits<numext::uint64_t, double> {
1609  enum { VectorizedCast = 1, SrcCoeffRatio = 1, TgtCoeffRatio = 1 };
1610 };
1611 template <>
1612 EIGEN_STRONG_INLINE Packet2d pcast<Packet2ul, Packet2d>(const Packet2ul& a) {
1613  return vcvtq_f64_u64(a);
1614 }
1615 
1616 #endif // EIGEN_ARCH_ARM64
1617 
1618 } // end namespace internal
1619 
1620 } // end namespace Eigen
1621 
1622 #endif // EIGEN_TYPE_CASTING_NEON_H
Array< int, 3, 1 > b
Array< double, 1, 3 > e(1./3., 0.5, 2.)
Array33i c
Packet16uc pcast< Packet8us, Packet16uc >(const Packet8us &a, const Packet8us &b)
Packet4ui pcast< Packet16uc, Packet4ui >(const Packet16uc &a)
Packet4us pcast< Packet8c, Packet4us >(const Packet8c &a)
Packet2ui pcast< Packet8c, Packet2ui >(const Packet8c &a)
Packet4f pcast< Packet4uc, Packet4f >(const Packet4uc &a)
Packet2ui pcast< Packet8uc, Packet2ui >(const Packet8uc &a)
Packet8uc pcast< Packet4f, Packet8uc >(const Packet4f &a, const Packet4f &b)
Packet4ui preinterpret< Packet4ui, Packet4f >(const Packet4f &a)
Packet16c pcast< Packet4ui, Packet16c >(const Packet4ui &a, const Packet4ui &b, const Packet4ui &c, const Packet4ui &d)
Packet16c pcast< Packet2l, Packet16c >(const Packet2l &a, const Packet2l &b, const Packet2l &c, const Packet2l &d, const Packet2l &e, const Packet2l &f, const Packet2l &g, const Packet2l &h)
Packet8c pcast< Packet4f, Packet8c >(const Packet4f &a, const Packet4f &b)
Packet2f preinterpret< Packet2f, Packet2i >(const Packet2i &a)
uint32x2_t Packet2ui
Packet4i pcast< Packet2l, Packet4i >(const Packet2l &a, const Packet2l &b)
Packet4us pcast< Packet4c, Packet4us >(const Packet4c &a)
Packet2l pcast< Packet4f, Packet2l >(const Packet4f &a)
Packet4us pcast< Packet2ul, Packet4us >(const Packet2ul &a, const Packet2ul &b)
Packet2ul preinterpret< Packet2ul, Packet2l >(const Packet2l &a)
__vector int Packet4i
Packet2d pcast< Packet4f, Packet2d >(const Packet4f &a)
Packet8uc pcast< Packet2i, Packet8uc >(const Packet2i &a, const Packet2i &b, const Packet2i &c, const Packet2i &d)
Packet4ui pcast< Packet4uc, Packet4ui >(const Packet4uc &a)
Packet4uc pcast< Packet2ul, Packet4uc >(const Packet2ul &a, const Packet2ul &b)
Packet2f pcast< Packet4s, Packet2f >(const Packet4s &a)
Packet4f preinterpret< Packet4f, Packet4ui >(const Packet4ui &a)
Packet4i pcast< Packet16uc, Packet4i >(const Packet16uc &a)
Packet8uc pcast< Packet2ui, Packet8uc >(const Packet2ui &a, const Packet2ui &b, const Packet2ui &c, const Packet2ui &d)
Packet4f pcast< Packet2d, Packet4f >(const Packet2d &a, const Packet2d &b)
Packet2f pcast< Packet2i, Packet2f >(const Packet2i &a)
__vector unsigned char Packet16uc
Packet8us pcast< Packet2ul, Packet8us >(const Packet2ul &a, const Packet2ul &b, const Packet2ul &c, const Packet2ul &d)
Packet8c pcast< Packet2f, Packet8c >(const Packet2f &a, const Packet2f &b, const Packet2f &c, const Packet2f &d)
Packet8c pcast< Packet2i, Packet8c >(const Packet2i &a, const Packet2i &b, const Packet2i &c, const Packet2i &d)
Packet4s pcast< Packet4c, Packet4s >(const Packet4c &a)
Packet4uc pcast< Packet4f, Packet4uc >(const Packet4f &a)
Packet2f pcast< Packet2l, Packet2f >(const Packet2l &a)
Packet2f pcast< Packet4us, Packet2f >(const Packet4us &a)
Packet8c pcast< Packet4ui, Packet8c >(const Packet4ui &a, const Packet4ui &b)
Packet2l pcast< Packet2f, Packet2l >(const Packet2f &a)
Packet16c pcast< Packet2ul, Packet16c >(const Packet2ul &a, const Packet2ul &b, const Packet2ul &c, const Packet2ul &d, const Packet2ul &e, const Packet2ul &f, const Packet2ul &g, const Packet2ul &h)
Packet8c pcast< Packet4s, Packet8c >(const Packet4s &a, const Packet4s &b)
Packet4uc pcast< Packet4ui, Packet4uc >(const Packet4ui &a)
Packet4s pcast< Packet2ul, Packet4s >(const Packet2ul &a, const Packet2ul &b)
Packet4uc pcast< Packet4us, Packet4uc >(const Packet4us &a)
Packet4s pcast< Packet4ui, Packet4s >(const Packet4ui &a)
Packet2ui pcast< Packet4s, Packet2ui >(const Packet4s &a)
Packet2l pcast< Packet4ui, Packet2l >(const Packet4ui &a)
Packet4uc preinterpret< Packet4uc, Packet16uc >(const Packet16uc &a)
Packet4f preinterpret< Packet4f, Packet4i >(const Packet4i &a)
Packet4uc pcast< Packet4s, Packet4uc >(const Packet4s &a)
eigen_packet_wrapper< int32_t,2 > Packet4c
Packet4i pcast< Packet8s, Packet4i >(const Packet8s &a)
Packet2ui pcast< Packet2ul, Packet2ui >(const Packet2ul &a)
Packet4ui pcast< Packet4s, Packet4ui >(const Packet4s &a)
Packet2ui pcast< Packet2f, Packet2ui >(const Packet2f &a)
__vector unsigned short int Packet8us
Packet2l pcast< Packet16c, Packet2l >(const Packet16c &a)
Packet2f pcast< Packet2ul, Packet2f >(const Packet2ul &a)
Packet8c pcast< Packet4us, Packet8c >(const Packet4us &a, const Packet4us &b)
Packet8us pcast< Packet8c, Packet8us >(const Packet8c &a)
Packet4f pcast< Packet8s, Packet4f >(const Packet8s &a)
Packet8us preinterpret< Packet8us, Packet8s >(const Packet8s &a)
Packet4c pcast< Packet4s, Packet4c >(const Packet4s &a)
Packet2i pcast< Packet2ul, Packet2i >(const Packet2ul &a)
Packet8us pcast< Packet16c, Packet8us >(const Packet16c &a)
Packet4uc pcast< Packet4i, Packet4uc >(const Packet4i &a)
Packet8s pcast< Packet8c, Packet8s >(const Packet8c &a)
Packet4ui preinterpret< Packet4ui, Packet4i >(const Packet4i &a)
Packet4f pcast< Packet16c, Packet4f >(const Packet16c &a)
Packet8s pcast< Packet4i, Packet8s >(const Packet4i &a, const Packet4i &b)
Packet4ui pcast< Packet4c, Packet4ui >(const Packet4c &a)
Packet2f preinterpret< Packet2f, Packet2ui >(const Packet2ui &a)
Packet2l preinterpret< Packet2l, Packet2ul >(const Packet2ul &a)
Packet4i pcast< Packet2d, Packet4i >(const Packet2d &a, const Packet2d &b)
Packet4c pcast< Packet4i, Packet4c >(const Packet4i &a)
Packet4ui pcast< Packet8us, Packet4ui >(const Packet8us &a)
Packet8uc pcast< Packet2ul, Packet8uc >(const Packet2ul &a, const Packet2ul &b, const Packet2ul &c, const Packet2ul &d)
Packet8uc pcast< Packet8us, Packet8uc >(const Packet8us &a)
Packet8us pcast< Packet2l, Packet8us >(const Packet2l &a, const Packet2l &b, const Packet2l &c, const Packet2l &d)
Packet4s pcast< Packet4i, Packet4s >(const Packet4i &a)
Packet8s pcast< Packet8uc, Packet8s >(const Packet8uc &a)
Packet2f pcast< Packet2ui, Packet2f >(const Packet2ui &a)
Packet4f pcast< Packet4c, Packet4f >(const Packet4c &a)
Packet2d preinterpret< Packet2d, Packet4i >(const Packet4i &a)
Packet4c pcast< Packet2l, Packet4c >(const Packet2l &a, const Packet2l &b)
Packet4s pcast< Packet2i, Packet4s >(const Packet2i &a, const Packet2i &b)
Packet4us pcast< Packet4f, Packet4us >(const Packet4f &a)
__vector signed char Packet16c
Packet4i pcast< Packet4f, Packet4i >(const Packet4f &a)
Packet4uc pcast< Packet2l, Packet4uc >(const Packet2l &a, const Packet2l &b)
Packet2i pcast< Packet4s, Packet2i >(const Packet4s &a)
Packet4us pcast< Packet2l, Packet4us >(const Packet2l &a, const Packet2l &b)
Packet2ul pcast< Packet16uc, Packet2ul >(const Packet16uc &a)
__vector unsigned int Packet4ui
Packet2i pcast< Packet2l, Packet2i >(const Packet2l &a)
Packet4uc preinterpret< Packet4uc, Packet4c >(const Packet4c &a)
Packet4f pcast< Packet8us, Packet4f >(const Packet8us &a)
Packet4s preinterpret< Packet4s, Packet8s >(const Packet8s &a)
Packet4ui pcast< Packet8s, Packet4ui >(const Packet8s &a)
Packet2ul pcast< Packet8s, Packet2ul >(const Packet8s &a)
Packet2ul pcast< Packet8us, Packet2ul >(const Packet8us &a)
Packet2l pcast< Packet2i, Packet2l >(const Packet2i &a)
Packet8uc pcast< Packet4i, Packet8uc >(const Packet4i &a, const Packet4i &b)
Packet16c pcast< Packet8us, Packet16c >(const Packet8us &a, const Packet8us &b)
Packet8us pcast< Packet4ui, Packet8us >(const Packet4ui &a, const Packet4ui &b)
Packet4i pcast< Packet2ul, Packet4i >(const Packet2ul &a, const Packet2ul &b)
Packet16uc pcast< Packet4i, Packet16uc >(const Packet4i &a, const Packet4i &b, const Packet4i &c, const Packet4i &d)
Packet4uc preinterpret< Packet4uc, Packet8uc >(const Packet8uc &a)
Packet2ui pcast< Packet4us, Packet2ui >(const Packet4us &a)
Packet8s pcast< Packet4f, Packet8s >(const Packet4f &a, const Packet4f &b)
Packet4i pcast< Packet4c, Packet4i >(const Packet4c &a)
Packet8us pcast< Packet4i, Packet8us >(const Packet4i &a, const Packet4i &b)
Packet4f pcast< Packet4ui, Packet4f >(const Packet4ui &a)
Packet8uc pcast< Packet4us, Packet8uc >(const Packet4us &a, const Packet4us &b)
Packet2l pcast< Packet4i, Packet2l >(const Packet4i &a)
Packet8us pcast< Packet16uc, Packet8us >(const Packet16uc &a)
Packet4i pcast< Packet8c, Packet4i >(const Packet8c &a)
Packet4f pcast< Packet4i, Packet4f >(const Packet4i &a)
Packet4s pcast< Packet2ui, Packet4s >(const Packet2ui &a, const Packet2ui &b)
Packet4s pcast< Packet4uc, Packet4s >(const Packet4uc &a)
Packet8s pcast< Packet2ul, Packet8s >(const Packet2ul &a, const Packet2ul &b, const Packet2ul &c, const Packet2ul &d)
Packet8c pcast< Packet2l, Packet8c >(const Packet2l &a, const Packet2l &b, const Packet2l &c, const Packet2l &d)
Packet8s pcast< Packet16c, Packet8s >(const Packet16c &a)
__vector short int Packet8s
Packet8uc pcast< Packet4ui, Packet8uc >(const Packet4ui &a, const Packet4ui &b)
Packet16c pcast< Packet8s, Packet16c >(const Packet8s &a, const Packet8s &b)
Packet8c pcast< Packet2ui, Packet8c >(const Packet2ui &a, const Packet2ui &b, const Packet2ui &c, const Packet2ui &d)
Packet8us pcast< Packet8uc, Packet8us >(const Packet8uc &a)
Packet8uc preinterpret< Packet8uc, Packet8c >(const Packet8c &a)
Packet2f pcast< Packet8c, Packet2f >(const Packet8c &a)
Packet2f preinterpret< Packet2f, Packet4f >(const Packet4f &a)
Packet8uc pcast< Packet4s, Packet8uc >(const Packet4s &a, const Packet4s &b)
Packet4us pcast< Packet4ui, Packet4us >(const Packet4ui &a)
Packet2ul pcast< Packet2ui, Packet2ul >(const Packet2ui &a)
uint16x4_t Packet4us
Packet8c pcast< Packet2ul, Packet8c >(const Packet2ul &a, const Packet2ul &b, const Packet2ul &c, const Packet2ul &d)
Packet4ui pcast< Packet16c, Packet4ui >(const Packet16c &a)
Packet4us pcast< Packet2ui, Packet4us >(const Packet2ui &a, const Packet2ui &b)
Packet2ui preinterpret< Packet2ui, Packet4ui >(const Packet4ui &a)
uint8x8_t Packet8uc
Packet4i pcast< Packet4uc, Packet4i >(const Packet4uc &a)
Packet2i pcast< Packet8c, Packet2i >(const Packet8c &a)
Packet4c pcast< Packet4us, Packet4c >(const Packet4us &a)
Packet2ul pcast< Packet4i, Packet2ul >(const Packet4i &a)
Packet4ui pcast< Packet2ul, Packet4ui >(const Packet2ul &a, const Packet2ul &b)
Packet16uc pcast< Packet4ui, Packet16uc >(const Packet4ui &a, const Packet4ui &b, const Packet4ui &c, const Packet4ui &d)
Packet2l pcast< Packet2ui, Packet2l >(const Packet2ui &a)
Packet2ul pcast< Packet4ui, Packet2ul >(const Packet4ui &a)
float32x2_t Packet2f
Packet4ui pcast< Packet8uc, Packet4ui >(const Packet8uc &a)
Packet4i pcast< Packet8us, Packet4i >(const Packet8us &a)
Packet2ul pcast< Packet4f, Packet2ul >(const Packet4f &a)
Packet4s pcast< Packet4f, Packet4s >(const Packet4f &a)
Packet2i preinterpret< Packet2i, Packet2ui >(const Packet2ui &a)
Packet4ui pcast< Packet2l, Packet4ui >(const Packet2l &a, const Packet2l &b)
Packet8uc pcast< Packet2l, Packet8uc >(const Packet2l &a, const Packet2l &b, const Packet2l &c, const Packet2l &d)
Packet4ui pcast< Packet4us, Packet4ui >(const Packet4us &a)
Packet8c pcast< Packet8s, Packet8c >(const Packet8s &a)
Packet2i preinterpret< Packet2i, Packet2f >(const Packet2f &a)
Packet8c pcast< Packet4i, Packet8c >(const Packet4i &a, const Packet4i &b)
Packet4i preinterpret< Packet4i, Packet4f >(const Packet4f &a)
Packet8c preinterpret< Packet8c, Packet8uc >(const Packet8uc &a)
Packet16c preinterpret< Packet16c, Packet16uc >(const Packet16uc &a)
Packet4us preinterpret< Packet4us, Packet4s >(const Packet4s &a)
Packet8uc pcast< Packet2f, Packet8uc >(const Packet2f &a, const Packet2f &b, const Packet2f &c, const Packet2f &d)
Packet8c preinterpret< Packet8c, Packet16c >(const Packet16c &a)
Packet4us pcast< Packet4uc, Packet4us >(const Packet4uc &a)
Packet2ul pcast< Packet2f, Packet2ul >(const Packet2f &a)
Packet2i pcast< Packet4us, Packet2i >(const Packet4us &a)
Packet16uc preinterpret< Packet16uc, Packet16c >(const Packet16c &a)
Packet2f pcast< Packet8uc, Packet2f >(const Packet8uc &a)
Packet4c preinterpret< Packet4c, Packet4uc >(const Packet4uc &a)
Packet4f pcast< Packet2l, Packet4f >(const Packet2l &a, const Packet2l &b)
Packet8s pcast< Packet2l, Packet8s >(const Packet2l &a, const Packet2l &b, const Packet2l &c, const Packet2l &d)
Packet4s pcast< Packet2l, Packet4s >(const Packet2l &a, const Packet2l &b)
Packet8uc pcast< Packet8s, Packet8uc >(const Packet8s &a)
Packet8us pcast< Packet4f, Packet8us >(const Packet4f &a, const Packet4f &b)
Packet2ui preinterpret< Packet2ui, Packet2f >(const Packet2f &a)
Packet8c pcast< Packet8us, Packet8c >(const Packet8us &a)
Packet4f pcast< Packet2ul, Packet4f >(const Packet2ul &a, const Packet2ul &b)
Packet4ui pcast< Packet4f, Packet4ui >(const Packet4f &a)
Packet2l pcast< Packet8us, Packet2l >(const Packet8us &a)
Packet4f pcast< Packet16uc, Packet4f >(const Packet16uc &a)
Packet2l pcast< Packet16uc, Packet2l >(const Packet16uc &a)
Packet4s preinterpret< Packet4s, Packet4us >(const Packet4us &a)
Packet2ul pcast< Packet16c, Packet2ul >(const Packet16c &a)
Packet4us pcast< Packet2i, Packet4us >(const Packet2i &a, const Packet2i &b)
Packet16uc pcast< Packet4f, Packet16uc >(const Packet4f &a, const Packet4f &b, const Packet4f &c, const Packet4f &d)
Packet16c pcast< Packet4i, Packet16c >(const Packet4i &a, const Packet4i &b, const Packet4i &c, const Packet4i &d)
Packet4s pcast< Packet8c, Packet4s >(const Packet8c &a)
Packet4i preinterpret< Packet4i, Packet2d >(const Packet2d &a)
Packet4s pcast< Packet2f, Packet4s >(const Packet2f &a, const Packet2f &b)
Packet4us pcast< Packet4i, Packet4us >(const Packet4i &a)
Packet2ui pcast< Packet2l, Packet2ui >(const Packet2l &a)
Packet4i pcast< Packet4s, Packet4i >(const Packet4s &a)
Packet16uc pcast< Packet2ul, Packet16uc >(const Packet2ul &a, const Packet2ul &b, const Packet2ul &c, const Packet2ul &d, const Packet2ul &e, const Packet2ul &f, const Packet2ul &g, const Packet2ul &h)
__vector float Packet4f
int32x2_t Packet2i
Packet4c pcast< Packet2ul, Packet4c >(const Packet2ul &a, const Packet2ul &b)
Packet2i pcast< Packet2f, Packet2i >(const Packet2f &a)
Packet8s pcast< Packet4ui, Packet8s >(const Packet4ui &a, const Packet4ui &b)
Packet2l pcast< Packet8s, Packet2l >(const Packet8s &a)
Packet2ui preinterpret< Packet2ui, Packet2i >(const Packet2i &a)
Packet2i preinterpret< Packet2i, Packet4i >(const Packet4i &a)
Packet16uc pcast< Packet8s, Packet16uc >(const Packet8s &a, const Packet8s &b)
Packet8s preinterpret< Packet8s, Packet8us >(const Packet8us &a)
eigen_packet_wrapper< uint32_t,5 > Packet4uc
Packet16c pcast< Packet4f, Packet16c >(const Packet4f &a, const Packet4f &b, const Packet4f &c, const Packet4f &d)
Packet8s pcast< Packet16uc, Packet8s >(const Packet16uc &a)
Packet4c preinterpret< Packet4c, Packet16c >(const Packet16c &a)
Packet16uc pcast< Packet2l, Packet16uc >(const Packet2l &a, const Packet2l &b, const Packet2l &c, const Packet2l &d, const Packet2l &e, const Packet2l &f, const Packet2l &g, const Packet2l &h)
Packet4i preinterpret< Packet4i, Packet4ui >(const Packet4ui &a)
Packet4us pcast< Packet2f, Packet4us >(const Packet2f &a, const Packet2f &b)
Packet4f pcast< Packet4s, Packet4f >(const Packet4s &a)
Packet8uc preinterpret< Packet8uc, Packet16uc >(const Packet16uc &a)
Packet4i pcast< Packet16c, Packet4i >(const Packet16c &a)
Packet4c pcast< Packet4ui, Packet4c >(const Packet4ui &a)
int16x4_t Packet4s
Packet4c pcast< Packet4f, Packet4c >(const Packet4f &a)
Packet2ul pcast< Packet2i, Packet2ul >(const Packet2i &a)
Packet4us preinterpret< Packet4us, Packet8us >(const Packet8us &a)
Packet2i pcast< Packet8uc, Packet2i >(const Packet8uc &a)
Packet4i pcast< Packet4us, Packet4i >(const Packet4us &a)
Packet4f pcast< Packet4us, Packet4f >(const Packet4us &a)
Packet4c preinterpret< Packet4c, Packet8c >(const Packet8c &a)
std::int32_t int32_t
Definition: Meta.h:40
std::int8_t int8_t
Definition: Meta.h:36
std::uint8_t uint8_t
Definition: Meta.h:35
std::int16_t int16_t
Definition: Meta.h:38
std::int64_t int64_t
Definition: Meta.h:42
std::uint16_t uint16_t
Definition: Meta.h:37
std::uint32_t uint32_t
Definition: Meta.h:39
std::uint64_t uint64_t
Definition: Meta.h:41
: InteropHeaders
Definition: Core:139