@@ -219,6 +219,8 @@ extern "C" {
219
219
) -> int8x8_t ;
220
220
#[ cfg_attr( target_arch = "arm" , link_name = "llvm.arm.neon.vld1.v4f32.p0i8" ) ]
221
221
fn vld1q_v4f32 ( addr : * const u8 , align : u32 ) -> float32x4_t ;
222
+ #[ cfg_attr( target_arch = "arm" , link_name = "llvm.arm.neon.vld1.v4i32.p0i8" ) ]
223
+ fn vld1q_v4i32 ( addr : * const u8 , align : u32 ) -> int32x4_t ;
222
224
}
223
225
224
226
/// Absolute value (wrapping).
@@ -1769,6 +1771,26 @@ pub unsafe fn vld1q_u8(addr: *const u8) -> uint8x16_t {
1769
1771
ptr:: read ( addr as * const uint8x16_t )
1770
1772
}
1771
1773
1774
+ /// Load multiple single-element structures to one, two, three, or four registers
1775
+ #[ inline]
1776
+ #[ cfg( target_arch = "arm" ) ]
1777
+ #[ target_feature( enable = "neon" ) ]
1778
+ #[ target_feature( enable = "v7" ) ]
1779
+ #[ cfg_attr( test, assert_instr( "vld1.32" ) ) ]
1780
+ pub unsafe fn vld1q_s32 ( addr : * const i32 ) -> int32x4_t {
1781
+ vld1q_v4i32 ( addr as * const u8 , 4 )
1782
+ }
1783
+
1784
+ /// Load multiple single-element structures to one, two, three, or four registers
1785
+ #[ inline]
1786
+ #[ cfg( target_arch = "arm" ) ]
1787
+ #[ target_feature( enable = "neon" ) ]
1788
+ #[ target_feature( enable = "v7" ) ]
1789
+ #[ cfg_attr( test, assert_instr( "vld1.32" ) ) ]
1790
+ pub unsafe fn vld1q_u32 ( addr : * const u32 ) -> uint32x4_t {
1791
+ transmute ( vld1q_v4i32 ( addr as * const u8 , 4 ) )
1792
+ }
1793
+
1772
1794
/// Load multiple single-element structures to one, two, three, or four registers
1773
1795
#[ inline]
1774
1796
#[ cfg( target_arch = "arm" ) ]
@@ -1826,6 +1848,28 @@ mod tests {
1826
1848
assert_eq ! ( r, e) ;
1827
1849
}
1828
1850
1851
+ #[ cfg( target_arch = "arm" ) ]
1852
+ #[ simd_test( enable = "neon" ) ]
1853
+ unsafe fn test_vld1q_s32 ( ) {
1854
+ let e = i32x4:: new ( 1 , 2 , 3 , 4 ) ;
1855
+ let f = [ 0 , 1 , 2 , 3 , 4 ] ;
1856
+ // do a load that has 4 byte alignment to make sure we're not
1857
+ // over aligning it
1858
+ let r: i32x4 = transmute ( vld1q_s32 ( f[ 1 ..] . as_ptr ( ) ) ) ;
1859
+ assert_eq ! ( r, e) ;
1860
+ }
1861
+
1862
+ #[ cfg( target_arch = "arm" ) ]
1863
+ #[ simd_test( enable = "neon" ) ]
1864
+ unsafe fn test_vld1q_u32 ( ) {
1865
+ let e = u32x4:: new ( 1 , 2 , 3 , 4 ) ;
1866
+ let f = [ 0 , 1 , 2 , 3 , 4 ] ;
1867
+ // do a load that has 4 byte alignment to make sure we're not
1868
+ // over aligning it
1869
+ let r: u32x4 = transmute ( vld1q_u32 ( f[ 1 ..] . as_ptr ( ) ) ) ;
1870
+ assert_eq ! ( r, e) ;
1871
+ }
1872
+
1829
1873
#[ simd_test( enable = "neon" ) ]
1830
1874
unsafe fn test_vld1q_dup_f32 ( ) {
1831
1875
let e = f32x4:: new ( 1. , 1. , 1. , 1. ) ;
0 commit comments