@@ -1904,6 +1904,46 @@ pub unsafe fn vdupd_laneq_u64<const N: i32>(a: uint64x2_t) -> u64 {
1904
1904
simd_extract ( a, N as u32 )
1905
1905
}
1906
1906
1907
+ /// Set all vector lanes to the same value
1908
+ #[ inline]
1909
+ #[ target_feature( enable = "neon" ) ]
1910
+ #[ cfg_attr( test, assert_instr( str , N = 4 ) ) ]
1911
+ #[ rustc_legacy_const_generics( 1 ) ]
1912
+ pub unsafe fn vdupb_lane_p8 < const N : i32 > ( a : poly8x8_t ) -> p8 {
1913
+ static_assert_imm3 ! ( N ) ;
1914
+ simd_extract ( a, N as u32 )
1915
+ }
1916
+
1917
+ /// Set all vector lanes to the same value
1918
+ #[ inline]
1919
+ #[ target_feature( enable = "neon" ) ]
1920
+ #[ cfg_attr( test, assert_instr( str , N = 8 ) ) ]
1921
+ #[ rustc_legacy_const_generics( 1 ) ]
1922
+ pub unsafe fn vdupb_laneq_p8 < const N : i32 > ( a : poly8x16_t ) -> p8 {
1923
+ static_assert_imm4 ! ( N ) ;
1924
+ simd_extract ( a, N as u32 )
1925
+ }
1926
+
1927
+ /// Set all vector lanes to the same value
1928
+ #[ inline]
1929
+ #[ target_feature( enable = "neon" ) ]
1930
+ #[ cfg_attr( test, assert_instr( str , N = 2 ) ) ]
1931
+ #[ rustc_legacy_const_generics( 1 ) ]
1932
+ pub unsafe fn vduph_lane_p16 < const N : i32 > ( a : poly16x4_t ) -> p16 {
1933
+ static_assert_imm2 ! ( N ) ;
1934
+ simd_extract ( a, N as u32 )
1935
+ }
1936
+
1937
+ /// Set all vector lanes to the same value
1938
+ #[ inline]
1939
+ #[ target_feature( enable = "neon" ) ]
1940
+ #[ cfg_attr( test, assert_instr( str , N = 4 ) ) ]
1941
+ #[ rustc_legacy_const_generics( 1 ) ]
1942
+ pub unsafe fn vduph_laneq_p16 < const N : i32 > ( a : poly16x8_t ) -> p16 {
1943
+ static_assert_imm3 ! ( N ) ;
1944
+ simd_extract ( a, N as u32 )
1945
+ }
1946
+
1907
1947
/// Set all vector lanes to the same value
1908
1948
#[ inline]
1909
1949
#[ target_feature( enable = "neon" ) ]
@@ -6496,6 +6536,38 @@ mod test {
6496
6536
assert_eq ! ( r, e) ;
6497
6537
}
6498
6538
6539
+ #[ simd_test( enable = "neon" ) ]
6540
+ unsafe fn test_vdupb_lane_p8 ( ) {
6541
+ let a: i8x8 = i8x8:: new ( 1 , 1 , 1 , 4 , 1 , 6 , 7 , 8 ) ;
6542
+ let e: p8 = 1 ;
6543
+ let r: p8 = transmute ( vdupb_lane_p8 :: < 4 > ( transmute ( a) ) ) ;
6544
+ assert_eq ! ( r, e) ;
6545
+ }
6546
+
6547
+ #[ simd_test( enable = "neon" ) ]
6548
+ unsafe fn test_vdupb_laneq_p8 ( ) {
6549
+ let a: i8x16 = i8x16:: new ( 1 , 1 , 1 , 4 , 1 , 6 , 7 , 8 , 1 , 10 , 11 , 12 , 13 , 14 , 15 , 16 ) ;
6550
+ let e: p8 = 1 ;
6551
+ let r: p8 = transmute ( vdupb_laneq_p8 :: < 8 > ( transmute ( a) ) ) ;
6552
+ assert_eq ! ( r, e) ;
6553
+ }
6554
+
6555
+ #[ simd_test( enable = "neon" ) ]
6556
+ unsafe fn test_vduph_lane_p16 ( ) {
6557
+ let a: i16x4 = i16x4:: new ( 1 , 1 , 1 , 4 ) ;
6558
+ let e: p16 = 1 ;
6559
+ let r: p16 = transmute ( vduph_lane_p16 :: < 2 > ( transmute ( a) ) ) ;
6560
+ assert_eq ! ( r, e) ;
6561
+ }
6562
+
6563
+ #[ simd_test( enable = "neon" ) ]
6564
+ unsafe fn test_vduph_laneq_p16 ( ) {
6565
+ let a: i16x8 = i16x8:: new ( 1 , 1 , 1 , 4 , 1 , 6 , 7 , 8 ) ;
6566
+ let e: p16 = 1 ;
6567
+ let r: p16 = transmute ( vduph_laneq_p16 :: < 4 > ( transmute ( a) ) ) ;
6568
+ assert_eq ! ( r, e) ;
6569
+ }
6570
+
6499
6571
#[ simd_test( enable = "neon" ) ]
6500
6572
unsafe fn test_vdups_lane_f32 ( ) {
6501
6573
let a: f32x2 = f32x2:: new ( 1. , 1. ) ;
0 commit comments