@@ -129,6 +129,82 @@ pub(crate) const unsafe fn simd_ilvl_d<T: Copy>(a: T, b: T) -> T {
129129 simd_shuffle ! ( b, a, [ 0 , 4 , 2 , 6 ] )
130130}
131131
132+ #[ inline( always) ]
133+ #[ rustc_const_unstable( feature = "stdarch_const_helpers" , issue = "none" ) ]
134+ pub ( crate ) const unsafe fn simd_replvei_b < const I : u32 , T : Copy > ( a : T ) -> T {
135+ simd_shuffle ! (
136+ a,
137+ a,
138+ [
139+ I , I , I , I , I , I , I , I , I , I , I , I , I , I , I , I ,
140+ I + 16 , I + 16 , I + 16 , I + 16 , I + 16 , I + 16 , I + 16 , I + 16 ,
141+ I + 16 , I + 16 , I + 16 , I + 16 , I + 16 , I + 16 , I + 16 , I + 16
142+ ]
143+ )
144+ }
145+
146+ #[ inline( always) ]
147+ #[ rustc_const_unstable( feature = "stdarch_const_helpers" , issue = "none" ) ]
148+ pub ( crate ) const unsafe fn simd_replvei_h < const I : u32 , T : Copy > ( a : T ) -> T {
149+ simd_shuffle ! (
150+ a,
151+ a,
152+ [
153+ I , I , I , I , I , I , I , I ,
154+ I + 8 , I + 8 , I + 8 , I + 8 , I + 8 , I + 8 , I + 8 , I + 8
155+ ]
156+ )
157+ }
158+
159+ #[ inline( always) ]
160+ #[ rustc_const_unstable( feature = "stdarch_const_helpers" , issue = "none" ) ]
161+ pub ( crate ) const unsafe fn simd_replvei_w < const I : u32 , T : Copy > ( a : T ) -> T {
162+ simd_shuffle ! ( a, a, [ I , I , I , I , I + 4 , I + 4 , I + 4 , I + 4 ] )
163+ }
164+
165+ #[ inline( always) ]
166+ #[ rustc_const_unstable( feature = "stdarch_const_helpers" , issue = "none" ) ]
167+ pub ( crate ) const unsafe fn simd_replvei_d < const I : u32 , T : Copy > ( a : T ) -> T {
168+ simd_shuffle ! ( a, a, [ I , I , I + 2 , I + 2 ] )
169+ }
170+
171+ #[ inline( always) ]
172+ #[ rustc_const_unstable( feature = "stdarch_const_helpers" , issue = "none" ) ]
173+ pub ( super ) const unsafe fn simd_replve0_b < T : Copy > ( a : T ) -> T {
174+ simd_shuffle ! (
175+ a,
176+ a,
177+ [
178+ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
179+ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0
180+ ]
181+ )
182+ }
183+
184+ #[ inline( always) ]
185+ #[ rustc_const_unstable( feature = "stdarch_const_helpers" , issue = "none" ) ]
186+ pub ( super ) const unsafe fn simd_replve0_h < T : Copy > ( a : T ) -> T {
187+ simd_shuffle ! ( a, a, [ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ] )
188+ }
189+
190+ #[ inline( always) ]
191+ #[ rustc_const_unstable( feature = "stdarch_const_helpers" , issue = "none" ) ]
192+ pub ( super ) const unsafe fn simd_replve0_w < T : Copy > ( a : T ) -> T {
193+ simd_shuffle ! ( a, a, [ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ] )
194+ }
195+
196+ #[ inline( always) ]
197+ #[ rustc_const_unstable( feature = "stdarch_const_helpers" , issue = "none" ) ]
198+ pub ( super ) const unsafe fn simd_replve0_d < T : Copy > ( a : T ) -> T {
199+ simd_shuffle ! ( a, a, [ 0 , 0 , 0 , 0 ] )
200+ }
201+
202+ #[ inline( always) ]
203+ #[ rustc_const_unstable( feature = "stdarch_const_helpers" , issue = "none" ) ]
204+ pub ( super ) const unsafe fn simd_replve0_q < T : Copy > ( a : T ) -> T {
205+ simd_shuffle ! ( a, a, [ 0 , 1 , 0 , 1 ] )
206+ }
207+
132208impl_vv ! ( "lasx" , lasx_xvpcnt_b, is:: simd_ctpop, m256i, i8x32) ;
133209impl_vv ! ( "lasx" , lasx_xvpcnt_h, is:: simd_ctpop, m256i, i16x16) ;
134210impl_vv ! ( "lasx" , lasx_xvpcnt_w, is:: simd_ctpop, m256i, i32x8) ;
@@ -143,6 +219,11 @@ impl_vv!("lasx", lasx_xvneg_w, is::simd_neg, m256i, i32x8);
143219impl_vv ! ( "lasx" , lasx_xvneg_d, is:: simd_neg, m256i, i64x4) ;
144220impl_vv ! ( "lasx" , lasx_xvfsqrt_s, is:: simd_fsqrt, m256, f32x8) ;
145221impl_vv ! ( "lasx" , lasx_xvfsqrt_d, is:: simd_fsqrt, m256d, f64x4) ;
222+ impl_vv ! ( "lasx" , lasx_xvreplve0_b, simd_replve0_b, m256i, i8x32) ;
223+ impl_vv ! ( "lasx" , lasx_xvreplve0_h, simd_replve0_h, m256i, i16x16) ;
224+ impl_vv ! ( "lasx" , lasx_xvreplve0_w, simd_replve0_w, m256i, i32x8) ;
225+ impl_vv ! ( "lasx" , lasx_xvreplve0_d, simd_replve0_d, m256i, i64x4) ;
226+ impl_vv ! ( "lasx" , lasx_xvreplve0_q, simd_replve0_q, m256i, i64x4) ;
146227
147228impl_gv ! ( "lasx" , lasx_xvreplgr2vr_b, ls:: simd_splat, m256i, i8x32, i32 ) ;
148229impl_gv ! ( "lasx" , lasx_xvreplgr2vr_h, ls:: simd_splat, m256i, i16x16, i32 ) ;
@@ -333,6 +414,10 @@ impl_vuv!("lasx", lasx_xvmini_bu, cs::simd_imin, m256i, u8x32, 5);
333414impl_vuv ! ( "lasx" , lasx_xvmini_hu, cs:: simd_imin, m256i, u16x16, 5 ) ;
334415impl_vuv ! ( "lasx" , lasx_xvmini_wu, cs:: simd_imin, m256i, u32x8, 5 ) ;
335416impl_vuv ! ( "lasx" , lasx_xvmini_du, cs:: simd_imin, m256i, u64x4, 5 ) ;
417+ impl_vuv ! ( "lasx" , lasx_xvrepl128vei_b, simd_replvei_b, m256i, i8x32, 4 , const ) ;
418+ impl_vuv ! ( "lasx" , lasx_xvrepl128vei_h, simd_replvei_h, m256i, i16x16, 3 , const ) ;
419+ impl_vuv ! ( "lasx" , lasx_xvrepl128vei_w, simd_replvei_w, m256i, i32x8, 2 , const ) ;
420+ impl_vuv ! ( "lasx" , lasx_xvrepl128vei_d, simd_replvei_d, m256i, i64x4, 1 , const ) ;
336421
337422impl_vug ! ( "lasx" , lasx_xvpickve2gr_w, is:: simd_extract, m256i, i32x8, i32 , 3 ) ;
338423impl_vug ! ( "lasx" , lasx_xvpickve2gr_d, is:: simd_extract, m256i, i64x4, i64 , 2 ) ;
0 commit comments