@@ -1779,6 +1779,18 @@ pub unsafe fn vld1q_f32(addr: *const f32) -> float32x4_t {
1779
1779
vld1q_v4f32 ( addr as * const u8 , 4 )
1780
1780
}
1781
1781
1782
+ /// Load one single-element structure and Replicate to all lanes (of one register).
1783
+ #[ inline]
1784
+ #[ target_feature( enable = "neon" ) ]
1785
+ #[ cfg_attr( target_arch = "arm" , target_feature( enable = "v7" ) ) ]
1786
+ #[ cfg_attr( all( test, target_arch = "arm" ) , assert_instr( "vld1.32" ) ) ]
1787
+ #[ cfg_attr( all( test, target_arch = "aarch64" ) , assert_instr( ld1r) ) ]
1788
+ pub unsafe fn vld1q_dup_f32 ( addr : * const f32 ) -> float32x4_t {
1789
+ use crate :: core_arch:: simd:: f32x4;
1790
+ let v = * addr;
1791
+ transmute ( f32x4:: new ( v, v, v, v) )
1792
+ }
1793
+
1782
1794
#[ cfg( test) ]
1783
1795
mod tests {
1784
1796
use super :: * ;
@@ -1814,6 +1826,14 @@ mod tests {
1814
1826
assert_eq ! ( r, e) ;
1815
1827
}
1816
1828
1829
+ #[ simd_test( enable = "neon" ) ]
1830
+ unsafe fn test_vld1q_dup_f32 ( ) {
1831
+ let e = f32x4:: new ( 1. , 1. , 1. , 1. ) ;
1832
+ let f = [ 1. , 2. , 3. , 4. ] ;
1833
+ let r: f32x4 = transmute ( vld1q_dup_f32 ( f. as_ptr ( ) ) ) ;
1834
+ assert_eq ! ( r, e) ;
1835
+ }
1836
+
1817
1837
#[ simd_test( enable = "neon" ) ]
1818
1838
unsafe fn test_vget_lane_u8 ( ) {
1819
1839
let v = i8x8:: new ( 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 ) ;
0 commit comments