@@ -5,6 +5,68 @@ use crate::core_arch::simd::{self as cs, *};
55use crate :: intrinsics:: simd as is;
66use crate :: mem:: transmute;
77
8+ #[ inline( always) ]
9+ #[ rustc_const_unstable( feature = "stdarch_const_helpers" , issue = "none" ) ]
10+ const unsafe fn simd_pickev_b < T : Copy > ( a : T , b : T ) -> T {
11+ simd_shuffle ! (
12+ b,
13+ a,
14+ [
15+ 0 , 2 , 4 , 6 , 8 , 10 , 12 , 14 , 32 , 34 , 36 , 38 , 40 , 42 , 44 , 46 ,
16+ 16 , 18 , 20 , 22 , 24 , 26 , 28 , 30 , 48 , 50 , 52 , 54 , 56 , 58 , 60 , 62
17+ ]
18+ )
19+ }
20+
21+ #[ inline( always) ]
22+ #[ rustc_const_unstable( feature = "stdarch_const_helpers" , issue = "none" ) ]
23+ const unsafe fn simd_pickev_d < T : Copy > ( a : T , b : T ) -> T {
24+ simd_shuffle ! ( b, a, [ 0 , 4 , 2 , 6 ] )
25+ }
26+
27+ #[ inline( always) ]
28+ #[ rustc_const_unstable( feature = "stdarch_const_helpers" , issue = "none" ) ]
29+ const unsafe fn simd_pickev_w < T : Copy > ( a : T , b : T ) -> T {
30+ simd_shuffle ! ( b, a, [ 0 , 2 , 8 , 10 , 4 , 6 , 12 , 14 ] )
31+ }
32+
33+ #[ inline( always) ]
34+ #[ rustc_const_unstable( feature = "stdarch_const_helpers" , issue = "none" ) ]
35+ const unsafe fn simd_pickev_h < T : Copy > ( a : T , b : T ) -> T {
36+ simd_shuffle ! ( b, a, [ 0 , 2 , 4 , 6 , 16 , 18 , 20 , 22 , 8 , 10 , 12 , 14 , 24 , 26 , 28 , 30 ] )
37+ }
38+
39+ #[ inline( always) ]
40+ #[ rustc_const_unstable( feature = "stdarch_const_helpers" , issue = "none" ) ]
41+ const unsafe fn simd_pickod_b < T : Copy > ( a : T , b : T ) -> T {
42+ simd_shuffle ! (
43+ b,
44+ a,
45+ [
46+ 1 , 3 , 5 , 7 , 9 , 11 , 13 , 15 , 33 , 35 , 37 , 39 , 41 , 43 , 45 , 47 ,
47+ 17 , 19 , 21 , 23 , 25 , 27 , 29 , 31 , 49 , 51 , 53 , 55 , 57 , 59 , 61 , 63
48+ ]
49+ )
50+ }
51+
52+ #[ inline( always) ]
53+ #[ rustc_const_unstable( feature = "stdarch_const_helpers" , issue = "none" ) ]
54+ const unsafe fn simd_pickod_d < T : Copy > ( a : T , b : T ) -> T {
55+ simd_shuffle ! ( b, a, [ 1 , 5 , 3 , 7 ] )
56+ }
57+
58+ #[ inline( always) ]
59+ #[ rustc_const_unstable( feature = "stdarch_const_helpers" , issue = "none" ) ]
60+ const unsafe fn simd_pickod_w < T : Copy > ( a : T , b : T ) -> T {
61+ simd_shuffle ! ( b, a, [ 1 , 3 , 9 , 11 , 5 , 7 , 13 , 15 ] )
62+ }
63+
64+ #[ inline( always) ]
65+ #[ rustc_const_unstable( feature = "stdarch_const_helpers" , issue = "none" ) ]
66+ const unsafe fn simd_pickod_h < T : Copy > ( a : T , b : T ) -> T {
67+ simd_shuffle ! ( b, a, [ 1 , 3 , 5 , 7 , 17 , 19 , 21 , 23 , 9 , 11 , 13 , 15 , 25 , 27 , 29 , 31 ] )
68+ }
69+
870impl_vv ! ( "lasx" , lasx_xvpcnt_b, is:: simd_ctpop, m256i, i8x32) ;
971impl_vv ! ( "lasx" , lasx_xvpcnt_h, is:: simd_ctpop, m256i, i16x16) ;
1072impl_vv ! ( "lasx" , lasx_xvpcnt_w, is:: simd_ctpop, m256i, i32x8) ;
@@ -160,6 +222,14 @@ impl_vvv!("lasx", lasx_xvabsd_bu, ls::simd_absd, m256i, u8x32);
160222impl_vvv ! ( "lasx" , lasx_xvabsd_hu, ls:: simd_absd, m256i, u16x16) ;
161223impl_vvv ! ( "lasx" , lasx_xvabsd_wu, ls:: simd_absd, m256i, u32x8) ;
162224impl_vvv ! ( "lasx" , lasx_xvabsd_du, ls:: simd_absd, m256i, u64x4) ;
225+ impl_vvv ! ( "lasx" , lasx_xvpickev_b, simd_pickev_b, m256i, i8x32) ;
226+ impl_vvv ! ( "lasx" , lasx_xvpickev_h, simd_pickev_h, m256i, i16x16) ;
227+ impl_vvv ! ( "lasx" , lasx_xvpickev_w, simd_pickev_w, m256i, i32x8) ;
228+ impl_vvv ! ( "lasx" , lasx_xvpickev_d, simd_pickev_d, m256i, i64x4) ;
229+ impl_vvv ! ( "lasx" , lasx_xvpickod_b, simd_pickod_b, m256i, i8x32) ;
230+ impl_vvv ! ( "lasx" , lasx_xvpickod_h, simd_pickod_h, m256i, i16x16) ;
231+ impl_vvv ! ( "lasx" , lasx_xvpickod_w, simd_pickod_w, m256i, i32x8) ;
232+ impl_vvv ! ( "lasx" , lasx_xvpickod_d, simd_pickod_d, m256i, i64x4) ;
163233
164234impl_vuv ! ( "lasx" , lasx_xvslli_b, is:: simd_shl, m256i, i8x32) ;
165235impl_vuv ! ( "lasx" , lasx_xvslli_h, is:: simd_shl, m256i, i16x16) ;
0 commit comments