12#ifndef EIGEN_TYPE_CASTING_LSX_H
13#define EIGEN_TYPE_CASTING_LSX_H
16#include "../../InternalHeaderCheck.h"
28struct type_casting_traits<float, double> : vectorized_type_casting_traits<float, double> {};
30struct type_casting_traits<double, float> : vectorized_type_casting_traits<double, float> {};
34struct type_casting_traits<float, int8_t> : vectorized_type_casting_traits<float, int8_t> {};
36struct type_casting_traits<int8_t, float> : vectorized_type_casting_traits<int8_t, float> {};
38struct type_casting_traits<float, uint8_t> : vectorized_type_casting_traits<float, uint8_t> {};
40struct type_casting_traits<uint8_t, float> : vectorized_type_casting_traits<uint8_t, float> {};
42struct type_casting_traits<float, int16_t> : vectorized_type_casting_traits<float, int16_t> {};
44struct type_casting_traits<int16_t, float> : vectorized_type_casting_traits<int16_t, float> {};
46struct type_casting_traits<float, uint16_t> : vectorized_type_casting_traits<float, uint16_t> {};
48struct type_casting_traits<uint16_t, float> : vectorized_type_casting_traits<uint16_t, float> {};
50struct type_casting_traits<float, int32_t> : vectorized_type_casting_traits<float, int32_t> {};
52struct type_casting_traits<int32_t, float> : vectorized_type_casting_traits<int32_t, float> {};
54struct type_casting_traits<float, uint32_t> : vectorized_type_casting_traits<float, uint32_t> {};
56struct type_casting_traits<uint32_t, float> : vectorized_type_casting_traits<uint32_t, float> {};
58struct type_casting_traits<float, int64_t> : vectorized_type_casting_traits<float, int64_t> {};
60struct type_casting_traits<int64_t, float> : vectorized_type_casting_traits<int64_t, float> {};
62struct type_casting_traits<float, uint64_t> : vectorized_type_casting_traits<float, uint64_t> {};
64struct type_casting_traits<uint64_t, float> : vectorized_type_casting_traits<uint64_t, float> {};
68struct type_casting_traits<double, int8_t> : vectorized_type_casting_traits<double, int8_t> {};
70struct type_casting_traits<int8_t, double> : vectorized_type_casting_traits<int8_t, double> {};
72struct type_casting_traits<double, uint8_t> : vectorized_type_casting_traits<double, uint8_t> {};
74struct type_casting_traits<uint8_t, double> : vectorized_type_casting_traits<uint8_t, double> {};
76struct type_casting_traits<double, int16_t> : vectorized_type_casting_traits<double, int16_t> {};
78struct type_casting_traits<int16_t, double> : vectorized_type_casting_traits<int16_t, double> {};
80struct type_casting_traits<double, uint16_t> : vectorized_type_casting_traits<double, uint16_t> {};
82struct type_casting_traits<uint16_t, double> : vectorized_type_casting_traits<uint16_t, double> {};
84struct type_casting_traits<double, int32_t> : vectorized_type_casting_traits<double, int32_t> {};
86struct type_casting_traits<int32_t, double> : vectorized_type_casting_traits<int32_t, double> {};
88struct type_casting_traits<double, uint32_t> : vectorized_type_casting_traits<double, uint32_t> {};
90struct type_casting_traits<uint32_t, double> : vectorized_type_casting_traits<uint32_t, double> {};
92struct type_casting_traits<double, int64_t> : vectorized_type_casting_traits<double, int64_t> {};
94struct type_casting_traits<int64_t, double> : vectorized_type_casting_traits<int64_t, double> {};
96struct type_casting_traits<double, uint64_t> : vectorized_type_casting_traits<double, uint64_t> {};
98struct type_casting_traits<uint64_t, double> : vectorized_type_casting_traits<uint64_t, double> {};
102struct type_casting_traits<int8_t, int16_t> : vectorized_type_casting_traits<int8_t, int16_t> {};
104struct type_casting_traits<int16_t, int8_t> : vectorized_type_casting_traits<int16_t, int8_t> {};
106struct type_casting_traits<int8_t, uint16_t> : vectorized_type_casting_traits<int8_t, uint16_t> {};
108struct type_casting_traits<uint16_t, int8_t> : vectorized_type_casting_traits<uint16_t, int8_t> {};
110struct type_casting_traits<int8_t, int32_t> : vectorized_type_casting_traits<int8_t, int32_t> {};
112struct type_casting_traits<int32_t, int8_t> : vectorized_type_casting_traits<int32_t, int8_t> {};
114struct type_casting_traits<int8_t, uint32_t> : vectorized_type_casting_traits<int8_t, uint32_t> {};
116struct type_casting_traits<uint32_t, int8_t> : vectorized_type_casting_traits<uint32_t, int8_t> {};
118struct type_casting_traits<int8_t, int64_t> : vectorized_type_casting_traits<int8_t, int64_t> {};
120struct type_casting_traits<int64_t, int8_t> : vectorized_type_casting_traits<int64_t, int8_t> {};
122struct type_casting_traits<int8_t, uint64_t> : vectorized_type_casting_traits<int8_t, uint64_t> {};
124struct type_casting_traits<uint64_t, int8_t> : vectorized_type_casting_traits<uint64_t, int8_t> {};
128struct type_casting_traits<uint8_t, int16_t> : vectorized_type_casting_traits<uint8_t, int16_t> {};
130struct type_casting_traits<int16_t, uint8_t> : vectorized_type_casting_traits<int16_t, uint8_t> {};
132struct type_casting_traits<uint8_t, uint16_t> : vectorized_type_casting_traits<uint8_t, uint16_t> {};
134struct type_casting_traits<uint16_t, uint8_t> : vectorized_type_casting_traits<uint16_t, uint8_t> {};
136struct type_casting_traits<uint8_t, int32_t> : vectorized_type_casting_traits<uint8_t, int32_t> {};
138struct type_casting_traits<int32_t, uint8_t> : vectorized_type_casting_traits<int32_t, uint8_t> {};
140struct type_casting_traits<uint8_t, uint32_t> : vectorized_type_casting_traits<uint8_t, uint32_t> {};
142struct type_casting_traits<uint32_t, uint8_t> : vectorized_type_casting_traits<uint32_t, uint8_t> {};
144struct type_casting_traits<uint8_t, int64_t> : vectorized_type_casting_traits<uint8_t, int64_t> {};
146struct type_casting_traits<int64_t, uint8_t> : vectorized_type_casting_traits<int64_t, uint8_t> {};
148struct type_casting_traits<uint8_t, uint64_t> : vectorized_type_casting_traits<uint8_t, uint64_t> {};
150struct type_casting_traits<uint64_t, uint8_t> : vectorized_type_casting_traits<uint64_t, uint8_t> {};
154struct type_casting_traits<int16_t, int32_t> : vectorized_type_casting_traits<int16_t, int32_t> {};
156struct type_casting_traits<int32_t, int16_t> : vectorized_type_casting_traits<int32_t, int16_t> {};
158struct type_casting_traits<int16_t, uint32_t> : vectorized_type_casting_traits<int16_t, uint32_t> {};
160struct type_casting_traits<uint32_t, int16_t> : vectorized_type_casting_traits<uint32_t, int16_t> {};
162struct type_casting_traits<int16_t, int64_t> : vectorized_type_casting_traits<int16_t, int64_t> {};
164struct type_casting_traits<int64_t, int16_t> : vectorized_type_casting_traits<int64_t, int16_t> {};
166struct type_casting_traits<int16_t, uint64_t> : vectorized_type_casting_traits<int16_t, uint64_t> {};
168struct type_casting_traits<uint64_t, int16_t> : vectorized_type_casting_traits<uint64_t, int16_t> {};
172struct type_casting_traits<uint16_t, int32_t> : vectorized_type_casting_traits<uint16_t, int32_t> {};
174struct type_casting_traits<int32_t, uint16_t> : vectorized_type_casting_traits<int32_t, uint16_t> {};
176struct type_casting_traits<uint16_t, uint32_t> : vectorized_type_casting_traits<uint16_t, uint32_t> {};
178struct type_casting_traits<uint32_t, uint16_t> : vectorized_type_casting_traits<uint32_t, uint16_t> {};
180struct type_casting_traits<uint16_t, int64_t> : vectorized_type_casting_traits<uint16_t, int64_t> {};
182struct type_casting_traits<int64_t, uint16_t> : vectorized_type_casting_traits<int64_t, uint16_t> {};
184struct type_casting_traits<uint16_t, uint64_t> : vectorized_type_casting_traits<uint16_t, uint64_t> {};
186struct type_casting_traits<uint64_t, uint16_t> : vectorized_type_casting_traits<uint64_t, uint16_t> {};
190struct type_casting_traits<int32_t, int64_t> : vectorized_type_casting_traits<int32_t, int64_t> {};
192struct type_casting_traits<int64_t, int32_t> : vectorized_type_casting_traits<int64_t, int32_t> {};
194struct type_casting_traits<int32_t, uint64_t> : vectorized_type_casting_traits<int32_t, uint64_t> {};
196struct type_casting_traits<uint64_t, int32_t> : vectorized_type_casting_traits<uint64_t, int32_t> {};
200struct type_casting_traits<uint32_t, int64_t> : vectorized_type_casting_traits<uint32_t, int64_t> {};
202struct type_casting_traits<int64_t, uint32_t> : vectorized_type_casting_traits<int64_t, uint32_t> {};
204struct type_casting_traits<uint32_t, uint64_t> : vectorized_type_casting_traits<uint32_t, uint64_t> {};
206struct type_casting_traits<uint64_t, uint32_t> : vectorized_type_casting_traits<uint64_t, uint32_t> {};
212EIGEN_STRONG_INLINE Packet4f preinterpret<Packet4f, Packet4i>(
const Packet4i& a) {
213 return (__m128)((__m128i)a);
216EIGEN_STRONG_INLINE Packet4f preinterpret<Packet4f, Packet4ui>(
const Packet4ui& a) {
217 return (__m128)((__m128i)a);
220EIGEN_STRONG_INLINE Packet2d preinterpret<Packet2d, Packet2l>(
const Packet2l& a) {
221 return (__m128d)((__m128i)a);
224EIGEN_STRONG_INLINE Packet2d preinterpret<Packet2d, Packet2ul>(
const Packet2ul& a) {
225 return (__m128d)((__m128i)a);
228EIGEN_STRONG_INLINE Packet2d preinterpret<Packet2d, Packet4i>(
const Packet4i& a) {
229 return (__m128d)((__m128i)a);
232EIGEN_STRONG_INLINE Packet16c preinterpret<Packet16c, Packet16uc>(
const Packet16uc& a) {
236EIGEN_STRONG_INLINE Packet8s preinterpret<Packet8s, Packet8us>(
const Packet8us& a) {
240EIGEN_STRONG_INLINE Packet4i preinterpret<Packet4i, Packet4f>(
const Packet4f& a) {
244EIGEN_STRONG_INLINE Packet4i preinterpret<Packet4i, Packet4ui>(
const Packet4ui& a) {
248EIGEN_STRONG_INLINE Packet4i preinterpret<Packet4i, Packet2d>(
const Packet2d& a) {
252EIGEN_STRONG_INLINE Packet2l preinterpret<Packet2l, Packet2d>(
const Packet2d& a) {
256EIGEN_STRONG_INLINE Packet16uc preinterpret<Packet16uc, Packet16c>(
const Packet16c& a) {
260EIGEN_STRONG_INLINE Packet8us preinterpret<Packet8us, Packet8s>(
const Packet8s& a) {
264EIGEN_STRONG_INLINE Packet4ui preinterpret<Packet4ui, Packet4f>(
const Packet4f& a) {
268EIGEN_STRONG_INLINE Packet4ui preinterpret<Packet4ui, Packet4i>(
const Packet4i& a) {
272EIGEN_STRONG_INLINE Packet2ul preinterpret<Packet2ul, Packet2d>(
const Packet2d& a) {
276EIGEN_STRONG_INLINE Packet2ul preinterpret<Packet2ul, Packet2l>(
const Packet2l& a) {
281EIGEN_STRONG_INLINE Packet2l pcast<Packet4f, Packet2l>(
const Packet4f& a) {
282 Packet2d tmp = __lsx_vfcvtl_d_s(a);
283 return __lsx_vftintrz_l_d(tmp);
286EIGEN_STRONG_INLINE Packet2ul pcast<Packet4f, Packet2ul>(
const Packet4f& a) {
287 Packet2d tmp = __lsx_vfcvtl_d_s(a);
288 return __lsx_vftintrz_lu_d(tmp);
291EIGEN_STRONG_INLINE Packet4i pcast<Packet4f, Packet4i>(
const Packet4f& a) {
292 return __lsx_vftintrz_w_s(a);
295EIGEN_STRONG_INLINE Packet4ui pcast<Packet4f, Packet4ui>(
const Packet4f& a) {
296 return __lsx_vftintrz_wu_s(a);
299EIGEN_STRONG_INLINE Packet8s pcast<Packet4f, Packet8s>(
const Packet4f& a,
const Packet4f& b) {
300 return __lsx_vpickev_h(__lsx_vftintrz_w_s(b), __lsx_vftintrz_w_s(a));
303EIGEN_STRONG_INLINE Packet8us pcast<Packet4f, Packet8us>(
const Packet4f& a,
const Packet4f& b) {
304 return __lsx_vpickev_h(__lsx_vftintrz_wu_s(b), __lsx_vftintrz_wu_s(a));
307EIGEN_STRONG_INLINE Packet16c pcast<Packet4f, Packet16c>(
const Packet4f& a,
const Packet4f& b,
const Packet4f& c,
309 Packet8s tmp1 = __lsx_vpickev_h(__lsx_vftintrz_w_s(b), __lsx_vftintrz_w_s(a));
310 Packet8s tmp2 = __lsx_vpickev_h(__lsx_vftintrz_w_s(d), __lsx_vftintrz_w_s(c));
311 return __lsx_vpickev_b((__m128i)tmp2, (__m128i)tmp1);
314EIGEN_STRONG_INLINE Packet16uc pcast<Packet4f, Packet16uc>(
const Packet4f& a,
const Packet4f& b,
const Packet4f& c,
316 Packet8us tmp1 = __lsx_vpickev_h(__lsx_vftintrz_wu_s(b), __lsx_vftintrz_wu_s(a));
317 Packet8us tmp2 = __lsx_vpickev_h(__lsx_vftintrz_wu_s(d), __lsx_vftintrz_wu_s(c));
318 return __lsx_vpickev_b((__m128i)tmp2, (__m128i)tmp1);
322EIGEN_STRONG_INLINE Packet4f pcast<Packet16c, Packet4f>(
const Packet16c& a) {
323 Packet8s tmp1 = __lsx_vsllwil_h_b((__m128i)a, 0);
324 Packet4i tmp2 = __lsx_vsllwil_w_h((__m128i)tmp1, 0);
325 return __lsx_vffint_s_w(tmp2);
328EIGEN_STRONG_INLINE Packet2l pcast<Packet16c, Packet2l>(
const Packet16c& a) {
329 Packet8s tmp1 = __lsx_vsllwil_h_b((__m128i)a, 0);
330 Packet4i tmp2 = __lsx_vsllwil_w_h((__m128i)tmp1, 0);
331 return __lsx_vsllwil_d_w((__m128i)tmp2, 0);
334EIGEN_STRONG_INLINE Packet2ul pcast<Packet16c, Packet2ul>(
const Packet16c& a) {
335 Packet8s tmp1 = __lsx_vsllwil_h_b((__m128i)a, 0);
336 Packet4i tmp2 = __lsx_vsllwil_w_h((__m128i)tmp1, 0);
337 return (Packet2ul)__lsx_vsllwil_d_w((__m128i)tmp2, 0);
340EIGEN_STRONG_INLINE Packet4i pcast<Packet16c, Packet4i>(
const Packet16c& a) {
341 Packet8s tmp1 = __lsx_vsllwil_h_b((__m128i)a, 0);
342 return __lsx_vsllwil_w_h((__m128i)tmp1, 0);
345EIGEN_STRONG_INLINE Packet4ui pcast<Packet16c, Packet4ui>(
const Packet16c& a) {
346 Packet8s tmp1 = __lsx_vsllwil_h_b((__m128i)a, 0);
347 return (Packet4ui)__lsx_vsllwil_w_h((__m128i)tmp1, 0);
350EIGEN_STRONG_INLINE Packet8s pcast<Packet16c, Packet8s>(
const Packet16c& a) {
351 return __lsx_vsllwil_h_b((__m128i)a, 0);
354EIGEN_STRONG_INLINE Packet8us pcast<Packet16c, Packet8us>(
const Packet16c& a) {
355 return (Packet8us)__lsx_vsllwil_h_b((__m128i)a, 0);
359EIGEN_STRONG_INLINE Packet4f pcast<Packet16uc, Packet4f>(
const Packet16uc& a) {
360 Packet8us tmp1 = __lsx_vsllwil_hu_bu((__m128i)a, 0);
361 Packet4ui tmp2 = __lsx_vsllwil_wu_hu((__m128i)tmp1, 0);
362 return __lsx_vffint_s_wu(tmp2);
365EIGEN_STRONG_INLINE Packet2ul pcast<Packet16uc, Packet2ul>(
const Packet16uc& a) {
366 Packet8us tmp1 = __lsx_vsllwil_hu_bu((__m128i)a, 0);
367 Packet4ui tmp2 = __lsx_vsllwil_wu_hu((__m128i)tmp1, 0);
368 return __lsx_vsllwil_du_wu((__m128i)tmp2, 0);
371EIGEN_STRONG_INLINE Packet2l pcast<Packet16uc, Packet2l>(
const Packet16uc& a) {
372 Packet8us tmp1 = __lsx_vsllwil_hu_bu((__m128i)a, 0);
373 Packet4ui tmp2 = __lsx_vsllwil_wu_hu((__m128i)tmp1, 0);
374 return (Packet2l)__lsx_vsllwil_du_wu((__m128i)tmp2, 0);
377EIGEN_STRONG_INLINE Packet4ui pcast<Packet16uc, Packet4ui>(
const Packet16uc& a) {
378 Packet8us tmp1 = __lsx_vsllwil_hu_bu((__m128i)a, 0);
379 return __lsx_vsllwil_wu_hu((__m128i)tmp1, 0);
382EIGEN_STRONG_INLINE Packet4i pcast<Packet16uc, Packet4i>(
const Packet16uc& a) {
383 Packet8us tmp1 = __lsx_vsllwil_hu_bu((__m128i)a, 0);
384 return (Packet4i)__lsx_vsllwil_wu_hu((__m128i)tmp1, 0);
387EIGEN_STRONG_INLINE Packet8us pcast<Packet16uc, Packet8us>(
const Packet16uc& a) {
388 return __lsx_vsllwil_hu_bu((__m128i)a, 0);
391EIGEN_STRONG_INLINE Packet8s pcast<Packet16uc, Packet8s>(
const Packet16uc& a) {
392 return (Packet8s)__lsx_vsllwil_hu_bu((__m128i)a, 0);
396EIGEN_STRONG_INLINE Packet4f pcast<Packet8s, Packet4f>(
const Packet8s& a) {
397 Packet4i tmp1 = __lsx_vsllwil_w_h((__m128i)a, 0);
398 return __lsx_vffint_s_w(tmp1);
401EIGEN_STRONG_INLINE Packet2l pcast<Packet8s, Packet2l>(
const Packet8s& a) {
402 Packet4i tmp1 = __lsx_vsllwil_w_h((__m128i)a, 0);
403 return __lsx_vsllwil_d_w((__m128i)tmp1, 0);
406EIGEN_STRONG_INLINE Packet2ul pcast<Packet8s, Packet2ul>(
const Packet8s& a) {
407 Packet4i tmp1 = __lsx_vsllwil_w_h((__m128i)a, 0);
408 return (Packet2ul)__lsx_vsllwil_d_w((__m128i)tmp1, 0);
411EIGEN_STRONG_INLINE Packet4i pcast<Packet8s, Packet4i>(
const Packet8s& a) {
412 return __lsx_vsllwil_w_h((__m128i)a, 0);
415EIGEN_STRONG_INLINE Packet4ui pcast<Packet8s, Packet4ui>(
const Packet8s& a) {
416 return (Packet4ui)__lsx_vsllwil_w_h((__m128i)a, 0);
419EIGEN_STRONG_INLINE Packet16c pcast<Packet8s, Packet16c>(
const Packet8s& a,
const Packet8s& b) {
420 return __lsx_vpickev_b((__m128i)b, (__m128i)a);
423EIGEN_STRONG_INLINE Packet16uc pcast<Packet8s, Packet16uc>(
const Packet8s& a,
const Packet8s& b) {
424 return (Packet16uc)__lsx_vpickev_b((__m128i)b, (__m128i)a);
428EIGEN_STRONG_INLINE Packet4f pcast<Packet8us, Packet4f>(
const Packet8us& a) {
429 Packet4ui tmp1 = __lsx_vsllwil_wu_hu((__m128i)a, 0);
430 return __lsx_vffint_s_wu(tmp1);
433EIGEN_STRONG_INLINE Packet2ul pcast<Packet8us, Packet2ul>(
const Packet8us& a) {
434 Packet4ui tmp1 = __lsx_vsllwil_wu_hu((__m128i)a, 0);
435 return __lsx_vsllwil_du_wu((__m128i)tmp1, 0);
438EIGEN_STRONG_INLINE Packet2l pcast<Packet8us, Packet2l>(
const Packet8us& a) {
439 Packet4ui tmp1 = __lsx_vsllwil_wu_hu((__m128i)a, 0);
440 return (Packet2l)__lsx_vsllwil_du_wu((__m128i)tmp1, 0);
443EIGEN_STRONG_INLINE Packet4ui pcast<Packet8us, Packet4ui>(
const Packet8us& a) {
444 return __lsx_vsllwil_wu_hu((__m128i)a, 0);
447EIGEN_STRONG_INLINE Packet4i pcast<Packet8us, Packet4i>(
const Packet8us& a) {
448 return (Packet4i)__lsx_vsllwil_wu_hu((__m128i)a, 0);
451EIGEN_STRONG_INLINE Packet16uc pcast<Packet8us, Packet16uc>(
const Packet8us& a,
const Packet8us& b) {
452 return __lsx_vpickev_b((__m128i)b, (__m128i)a);
455EIGEN_STRONG_INLINE Packet16c pcast<Packet8us, Packet16c>(
const Packet8us& a,
const Packet8us& b) {
456 return (Packet16c)__lsx_vpickev_b((__m128i)b, (__m128i)a);
460EIGEN_STRONG_INLINE Packet4f pcast<Packet4i, Packet4f>(
const Packet4i& a) {
461 return __lsx_vffint_s_w(a);
464EIGEN_STRONG_INLINE Packet2l pcast<Packet4i, Packet2l>(
const Packet4i& a) {
465 return __lsx_vsllwil_d_w((__m128i)a, 0);
468EIGEN_STRONG_INLINE Packet2ul pcast<Packet4i, Packet2ul>(
const Packet4i& a) {
469 return (Packet2ul)__lsx_vsllwil_d_w((__m128i)a, 0);
472EIGEN_STRONG_INLINE Packet8s pcast<Packet4i, Packet8s>(
const Packet4i& a,
const Packet4i& b) {
473 return __lsx_vpickev_h((__m128i)b, (__m128i)a);
476EIGEN_STRONG_INLINE Packet8us pcast<Packet4i, Packet8us>(
const Packet4i& a,
const Packet4i& b) {
477 return (Packet8us)__lsx_vpickev_h((__m128i)b, (__m128i)a);
480EIGEN_STRONG_INLINE Packet16c pcast<Packet4i, Packet16c>(
const Packet4i& a,
const Packet4i& b,
const Packet4i& c,
482 Packet8s tmp1 = __lsx_vpickev_h((__m128i)b, (__m128i)a);
483 Packet8s tmp2 = __lsx_vpickev_h((__m128i)d, (__m128i)c);
484 return __lsx_vpickev_b((__m128i)tmp2, (__m128i)tmp1);
487EIGEN_STRONG_INLINE Packet16uc pcast<Packet4i, Packet16uc>(
const Packet4i& a,
const Packet4i& b,
const Packet4i& c,
489 Packet8s tmp1 = __lsx_vpickev_h((__m128i)b, (__m128i)a);
490 Packet8s tmp2 = __lsx_vpickev_h((__m128i)d, (__m128i)c);
491 return (Packet16uc)__lsx_vpickev_b((__m128i)tmp2, (__m128i)tmp1);
495EIGEN_STRONG_INLINE Packet4f pcast<Packet4ui, Packet4f>(
const Packet4ui& a) {
496 return __lsx_vffint_s_wu(a);
499EIGEN_STRONG_INLINE Packet2ul pcast<Packet4ui, Packet2ul>(
const Packet4ui& a) {
500 return __lsx_vsllwil_du_wu((__m128i)a, 0);
503EIGEN_STRONG_INLINE Packet2l pcast<Packet4ui, Packet2l>(
const Packet4ui& a) {
504 return (Packet2l)__lsx_vsllwil_du_wu((__m128i)a, 0);
507EIGEN_STRONG_INLINE Packet8us pcast<Packet4ui, Packet8us>(
const Packet4ui& a,
const Packet4ui& b) {
508 return __lsx_vpickev_h((__m128i)b, (__m128i)a);
511EIGEN_STRONG_INLINE Packet8s pcast<Packet4ui, Packet8s>(
const Packet4ui& a,
const Packet4ui& b) {
512 return (Packet8s)__lsx_vpickev_h((__m128i)b, (__m128i)a);
515EIGEN_STRONG_INLINE Packet16uc pcast<Packet4ui, Packet16uc>(
const Packet4ui& a,
const Packet4ui& b,
const Packet4ui& c,
516 const Packet4ui& d) {
517 Packet8us tmp1 = __lsx_vpickev_h((__m128i)b, (__m128i)a);
518 Packet8us tmp2 = __lsx_vpickev_h((__m128i)d, (__m128i)c);
519 return __lsx_vpickev_b((__m128i)tmp2, (__m128i)tmp1);
522EIGEN_STRONG_INLINE Packet16c pcast<Packet4ui, Packet16c>(
const Packet4ui& a,
const Packet4ui& b,
const Packet4ui& c,
523 const Packet4ui& d) {
524 Packet8us tmp1 = __lsx_vpickev_h((__m128i)b, (__m128i)a);
525 Packet8us tmp2 = __lsx_vpickev_h((__m128i)d, (__m128i)c);
526 return (Packet16c)__lsx_vpickev_b((__m128i)tmp2, (__m128i)tmp1);
530EIGEN_STRONG_INLINE Packet4f pcast<Packet2l, Packet4f>(
const Packet2l& a,
const Packet2l& b) {
531 return __lsx_vfcvt_s_d(__lsx_vffint_d_l(b), __lsx_vffint_d_l(a));
534EIGEN_STRONG_INLINE Packet4i pcast<Packet2l, Packet4i>(
const Packet2l& a,
const Packet2l& b) {
535 return __lsx_vpickev_w((__m128i)b, (__m128i)a);
538EIGEN_STRONG_INLINE Packet4ui pcast<Packet2l, Packet4ui>(
const Packet2l& a,
const Packet2l& b) {
539 return (Packet4ui)__lsx_vpickev_w((__m128i)b, (__m128i)a);
542EIGEN_STRONG_INLINE Packet8s pcast<Packet2l, Packet8s>(
const Packet2l& a,
const Packet2l& b,
const Packet2l& c,
544 Packet4i tmp1 = __lsx_vpickev_w((__m128i)b, (__m128i)a);
545 Packet4i tmp2 = __lsx_vpickev_w((__m128i)d, (__m128i)c);
546 return __lsx_vpickev_h((__m128i)tmp2, (__m128i)tmp1);
549EIGEN_STRONG_INLINE Packet8us pcast<Packet2l, Packet8us>(
const Packet2l& a,
const Packet2l& b,
const Packet2l& c,
551 Packet4i tmp1 = __lsx_vpickev_w((__m128i)b, (__m128i)a);
552 Packet4i tmp2 = __lsx_vpickev_w((__m128i)d, (__m128i)c);
553 return (Packet8us)__lsx_vpickev_h((__m128i)tmp2, (__m128i)tmp1);
556EIGEN_STRONG_INLINE Packet16c pcast<Packet2l, Packet16c>(
const Packet2l& a,
const Packet2l& b,
const Packet2l& c,
557 const Packet2l& d,
const Packet2l& e,
const Packet2l& f,
558 const Packet2l& g,
const Packet2l& h) {
559 const Packet8s abcd = pcast<Packet2l, Packet8s>(a, b, c, d);
560 const Packet8s efgh = pcast<Packet2l, Packet8s>(e, f, g, h);
561 return __lsx_vpickev_b((__m128i)efgh, (__m128i)abcd);
564EIGEN_STRONG_INLINE Packet16uc pcast<Packet2l, Packet16uc>(
const Packet2l& a,
const Packet2l& b,
const Packet2l& c,
565 const Packet2l& d,
const Packet2l& e,
const Packet2l& f,
566 const Packet2l& g,
const Packet2l& h) {
567 const Packet8us abcd = pcast<Packet2l, Packet8us>(a, b, c, d);
568 const Packet8us efgh = pcast<Packet2l, Packet8us>(e, f, g, h);
569 return __lsx_vpickev_b((__m128i)efgh, (__m128i)abcd);
573EIGEN_STRONG_INLINE Packet4f pcast<Packet2ul, Packet4f>(
const Packet2ul& a,
const Packet2ul& b) {
574 return __lsx_vfcvt_s_d(__lsx_vffint_d_lu(b), __lsx_vffint_d_lu(a));
577EIGEN_STRONG_INLINE Packet4ui pcast<Packet2ul, Packet4ui>(
const Packet2ul& a,
const Packet2ul& b) {
578 return __lsx_vpickev_w((__m128i)b, (__m128i)a);
581EIGEN_STRONG_INLINE Packet4i pcast<Packet2ul, Packet4i>(
const Packet2ul& a,
const Packet2ul& b) {
582 return (Packet4i)__lsx_vpickev_w((__m128i)b, (__m128i)a);
585EIGEN_STRONG_INLINE Packet8us pcast<Packet2ul, Packet8us>(
const Packet2ul& a,
const Packet2ul& b,
const Packet2ul& c,
586 const Packet2ul& d) {
587 Packet4ui tmp1 = __lsx_vpickev_w((__m128i)b, (__m128i)a);
588 Packet4ui tmp2 = __lsx_vpickev_w((__m128i)d, (__m128i)c);
589 return __lsx_vpickev_h((__m128i)tmp2, (__m128i)tmp1);
592EIGEN_STRONG_INLINE Packet8s pcast<Packet2ul, Packet8s>(
const Packet2ul& a,
const Packet2ul& b,
const Packet2ul& c,
593 const Packet2ul& d) {
594 Packet4ui tmp1 = __lsx_vpickev_w((__m128i)b, (__m128i)a);
595 Packet4ui tmp2 = __lsx_vpickev_w((__m128i)d, (__m128i)c);
596 return (Packet8s)__lsx_vpickev_h((__m128i)tmp2, (__m128i)tmp1);
599EIGEN_STRONG_INLINE Packet16uc pcast<Packet2ul, Packet16uc>(
const Packet2ul& a,
const Packet2ul& b,
const Packet2ul& c,
600 const Packet2ul& d,
const Packet2ul& e,
const Packet2ul& f,
601 const Packet2ul& g,
const Packet2ul& h) {
602 const Packet8s abcd = pcast<Packet2ul, Packet8s>(a, b, c, d);
603 const Packet8s efgh = pcast<Packet2ul, Packet8s>(e, f, g, h);
604 return __lsx_vpickev_b((__m128i)efgh, (__m128i)abcd);
607EIGEN_STRONG_INLINE Packet16c pcast<Packet2ul, Packet16c>(
const Packet2ul& a,
const Packet2ul& b,
const Packet2ul& c,
608 const Packet2ul& d,
const Packet2ul& e,
const Packet2ul& f,
609 const Packet2ul& g,
const Packet2ul& h) {
610 const Packet8us abcd = pcast<Packet2ul, Packet8us>(a, b, c, d);
611 const Packet8us efgh = pcast<Packet2ul, Packet8us>(e, f, g, h);
612 return __lsx_vpickev_b((__m128i)efgh, (__m128i)abcd);
616EIGEN_STRONG_INLINE Packet4f pcast<Packet2d, Packet4f>(
const Packet2d& a,
const Packet2d& b) {
617 return __lsx_vfcvt_s_d(b, a);
620EIGEN_STRONG_INLINE Packet2l pcast<Packet2d, Packet2l>(
const Packet2d& a) {
621 return __lsx_vftintrz_l_d(a);
624EIGEN_STRONG_INLINE Packet2ul pcast<Packet2d, Packet2ul>(
const Packet2d& a) {
625 return __lsx_vftintrz_lu_d(a);
628EIGEN_STRONG_INLINE Packet4i pcast<Packet2d, Packet4i>(
const Packet2d& a,
const Packet2d& b) {
629 return __lsx_vpickev_w(__lsx_vftintrz_l_d(b), __lsx_vftintrz_l_d(a));
632EIGEN_STRONG_INLINE Packet4ui pcast<Packet2d, Packet4ui>(
const Packet2d& a,
const Packet2d& b) {
633 return __lsx_vpickev_w(__lsx_vftintrz_lu_d(b), __lsx_vftintrz_lu_d(a));
636EIGEN_STRONG_INLINE Packet8s pcast<Packet2d, Packet8s>(
const Packet2d& a,
const Packet2d& b,
const Packet2d& c,
638 Packet4i tmp1 = __lsx_vpickev_w(__lsx_vftintrz_l_d(b), __lsx_vftintrz_l_d(a));
639 Packet4i tmp2 = __lsx_vpickev_w(__lsx_vftintrz_l_d(d), __lsx_vftintrz_l_d(c));
640 return __lsx_vpickev_h((__m128i)tmp2, (__m128i)tmp1);
643EIGEN_STRONG_INLINE Packet8us pcast<Packet2d, Packet8us>(
const Packet2d& a,
const Packet2d& b,
const Packet2d& c,
645 Packet4ui tmp1 = __lsx_vpickev_w(__lsx_vftintrz_lu_d(b), __lsx_vftintrz_lu_d(a));
646 Packet4ui tmp2 = __lsx_vpickev_w(__lsx_vftintrz_lu_d(d), __lsx_vftintrz_lu_d(c));
647 return __lsx_vpickev_h((__m128i)tmp2, (__m128i)tmp1);
650EIGEN_STRONG_INLINE Packet16c pcast<Packet2d, Packet16c>(
const Packet2d& a,
const Packet2d& b,
const Packet2d& c,
651 const Packet2d& d,
const Packet2d& e,
const Packet2d& f,
652 const Packet2d& g,
const Packet2d& h) {
653 const Packet8s abcd = pcast<Packet2d, Packet8s>(a, b, c, d);
654 const Packet8s efgh = pcast<Packet2d, Packet8s>(e, f, g, h);
655 return __lsx_vpickev_b((__m128i)efgh, (__m128i)abcd);
658EIGEN_STRONG_INLINE Packet16uc pcast<Packet2d, Packet16uc>(
const Packet2d& a,
const Packet2d& b,
const Packet2d& c,
659 const Packet2d& d,
const Packet2d& e,
const Packet2d& f,
660 const Packet2d& g,
const Packet2d& h) {
661 const Packet8us abcd = pcast<Packet2d, Packet8us>(a, b, c, d);
662 const Packet8us efgh = pcast<Packet2d, Packet8us>(e, f, g, h);
663 return __lsx_vpickev_b((__m128i)efgh, (__m128i)abcd);
667EIGEN_STRONG_INLINE Packet2d pcast<Packet4f, Packet2d>(
const Packet4f& a) {
668 return __lsx_vfcvtl_d_s(a);
671EIGEN_STRONG_INLINE Packet2d pcast<Packet16c, Packet2d>(
const Packet16c& a) {
672 Packet8s tmp1 = __lsx_vsllwil_h_b((__m128i)a, 0);
673 Packet4i tmp2 = __lsx_vsllwil_w_h((__m128i)tmp1, 0);
674 return __lsx_vffint_d_l(__lsx_vsllwil_d_w((__m128i)tmp2, 0));
677EIGEN_STRONG_INLINE Packet2d pcast<Packet16uc, Packet2d>(
const Packet16uc& a) {
678 Packet8us tmp1 = __lsx_vsllwil_hu_bu((__m128i)a, 0);
679 Packet4ui tmp2 = __lsx_vsllwil_wu_hu((__m128i)tmp1, 0);
680 return __lsx_vffint_d_lu(__lsx_vsllwil_du_wu((__m128i)tmp2, 0));
683EIGEN_STRONG_INLINE Packet2d pcast<Packet8s, Packet2d>(
const Packet8s& a) {
684 Packet4i tmp = __lsx_vsllwil_w_h((__m128i)a, 0);
685 return __lsx_vffint_d_l(__lsx_vsllwil_d_w((__m128i)tmp, 0));
688EIGEN_STRONG_INLINE Packet2d pcast<Packet8us, Packet2d>(
const Packet8us& a) {
689 Packet4ui tmp = __lsx_vsllwil_wu_hu((__m128i)a, 0);
690 return __lsx_vffint_d_lu(__lsx_vsllwil_du_wu((__m128i)tmp, 0));
693EIGEN_STRONG_INLINE Packet2d pcast<Packet4i, Packet2d>(
const Packet4i& a) {
694 return __lsx_vffint_d_l(__lsx_vsllwil_d_w((__m128i)a, 0));
697EIGEN_STRONG_INLINE Packet2d pcast<Packet4ui, Packet2d>(
const Packet4ui& a) {
698 return __lsx_vffint_d_lu(__lsx_vsllwil_du_wu((__m128i)a, 0));
701EIGEN_STRONG_INLINE Packet2d pcast<Packet2l, Packet2d>(
const Packet2l& a) {
702 return __lsx_vffint_d_l(a);
705EIGEN_STRONG_INLINE Packet2d pcast<Packet2ul, Packet2d>(
const Packet2ul& a) {
706 return __lsx_vffint_d_lu(a);