@@ -3848,18 +3848,118 @@ pub unsafe fn vget_high_p16(a: poly16x8_t) -> poly16x4_t {
3848
3848
#[ cfg_attr( target_arch = "arm" , target_feature( enable = "v7" ) ) ]
3849
3849
#[ cfg_attr( all( test, target_arch = "arm" ) , assert_instr( "vmov" ) ) ]
3850
3850
#[ cfg_attr( all( test, target_arch = "aarch64" ) , assert_instr( ext) ) ]
3851
- pub unsafe fn vget_high_p64 ( a : poly64x2_t ) -> poly64x1_t {
3852
- poly64x1_t ( simd_extract ( a, 1 ) )
3851
+ pub unsafe fn vget_high_f32 ( a : float32x4_t ) -> float32x2_t {
3852
+ simd_shuffle2 ( a, a , [ 2 , 3 ] )
3853
3853
}
3854
3854
3855
3855
/// Duplicate vector element to vector or scalar
3856
3856
#[ inline]
3857
3857
#[ target_feature( enable = "neon" ) ]
3858
3858
#[ cfg_attr( target_arch = "arm" , target_feature( enable = "v7" ) ) ]
3859
- #[ cfg_attr( all( test, target_arch = "arm" ) , assert_instr( "vmov" ) ) ]
3860
- #[ cfg_attr( all( test, target_arch = "aarch64" ) , assert_instr( ext) ) ]
3861
- pub unsafe fn vget_high_f32 ( a : float32x4_t ) -> float32x2_t {
3862
- simd_shuffle2 ( a, a, [ 2 , 3 ] )
3859
+ #[ cfg_attr( all( test, target_arch = "arm" ) , assert_instr( "ldr" ) ) ]
3860
+ #[ cfg_attr( all( test, target_arch = "aarch64" ) , assert_instr( ldr) ) ]
3861
+ pub unsafe fn vget_low_s8 ( a : int8x16_t ) -> int8x8_t {
3862
+ simd_shuffle8 ( a, a, [ 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 ] )
3863
+ }
3864
+
3865
+ /// Duplicate vector element to vector or scalar
3866
+ #[ inline]
3867
+ #[ target_feature( enable = "neon" ) ]
3868
+ #[ cfg_attr( target_arch = "arm" , target_feature( enable = "v7" ) ) ]
3869
+ #[ cfg_attr( all( test, target_arch = "arm" ) , assert_instr( "ldr" ) ) ]
3870
+ #[ cfg_attr( all( test, target_arch = "aarch64" ) , assert_instr( ldr) ) ]
3871
+ pub unsafe fn vget_low_s16 ( a : int16x8_t ) -> int16x4_t {
3872
+ simd_shuffle4 ( a, a, [ 0 , 1 , 2 , 3 ] )
3873
+ }
3874
+
3875
+ /// Duplicate vector element to vector or scalar
3876
+ #[ inline]
3877
+ #[ target_feature( enable = "neon" ) ]
3878
+ #[ cfg_attr( target_arch = "arm" , target_feature( enable = "v7" ) ) ]
3879
+ #[ cfg_attr( all( test, target_arch = "arm" ) , assert_instr( "ldr" ) ) ]
3880
+ #[ cfg_attr( all( test, target_arch = "aarch64" ) , assert_instr( ldr) ) ]
3881
+ pub unsafe fn vget_low_s32 ( a : int32x4_t ) -> int32x2_t {
3882
+ simd_shuffle2 ( a, a, [ 0 , 1 ] )
3883
+ }
3884
+
3885
+ /// Duplicate vector element to vector or scalar
3886
+ #[ inline]
3887
+ #[ target_feature( enable = "neon" ) ]
3888
+ #[ cfg_attr( target_arch = "arm" , target_feature( enable = "v7" ) ) ]
3889
+ #[ cfg_attr( all( test, target_arch = "arm" ) , assert_instr( "ldr" ) ) ]
3890
+ #[ cfg_attr( all( test, target_arch = "aarch64" ) , assert_instr( ldr) ) ]
3891
+ pub unsafe fn vget_low_s64 ( a : int64x2_t ) -> int64x1_t {
3892
+ int64x1_t ( simd_extract ( a, 0 ) )
3893
+ }
3894
+
3895
+ /// Duplicate vector element to vector or scalar
3896
+ #[ inline]
3897
+ #[ target_feature( enable = "neon" ) ]
3898
+ #[ cfg_attr( target_arch = "arm" , target_feature( enable = "v7" ) ) ]
3899
+ #[ cfg_attr( all( test, target_arch = "arm" ) , assert_instr( "ldr" ) ) ]
3900
+ #[ cfg_attr( all( test, target_arch = "aarch64" ) , assert_instr( ldr) ) ]
3901
+ pub unsafe fn vget_low_u8 ( a : uint8x16_t ) -> uint8x8_t {
3902
+ simd_shuffle8 ( a, a, [ 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 ] )
3903
+ }
3904
+
3905
+ /// Duplicate vector element to vector or scalar
3906
+ #[ inline]
3907
+ #[ target_feature( enable = "neon" ) ]
3908
+ #[ cfg_attr( target_arch = "arm" , target_feature( enable = "v7" ) ) ]
3909
+ #[ cfg_attr( all( test, target_arch = "arm" ) , assert_instr( "ldr" ) ) ]
3910
+ #[ cfg_attr( all( test, target_arch = "aarch64" ) , assert_instr( ldr) ) ]
3911
+ pub unsafe fn vget_low_u16 ( a : uint16x8_t ) -> uint16x4_t {
3912
+ simd_shuffle4 ( a, a, [ 0 , 1 , 2 , 3 ] )
3913
+ }
3914
+
3915
+ /// Duplicate vector element to vector or scalar
3916
+ #[ inline]
3917
+ #[ target_feature( enable = "neon" ) ]
3918
+ #[ cfg_attr( target_arch = "arm" , target_feature( enable = "v7" ) ) ]
3919
+ #[ cfg_attr( all( test, target_arch = "arm" ) , assert_instr( "ldr" ) ) ]
3920
+ #[ cfg_attr( all( test, target_arch = "aarch64" ) , assert_instr( ldr) ) ]
3921
+ pub unsafe fn vget_low_u32 ( a : uint32x4_t ) -> uint32x2_t {
3922
+ simd_shuffle2 ( a, a, [ 0 , 1 ] )
3923
+ }
3924
+
3925
+ /// Duplicate vector element to vector or scalar
3926
+ #[ inline]
3927
+ #[ target_feature( enable = "neon" ) ]
3928
+ #[ cfg_attr( target_arch = "arm" , target_feature( enable = "v7" ) ) ]
3929
+ #[ cfg_attr( all( test, target_arch = "arm" ) , assert_instr( "ldr" ) ) ]
3930
+ #[ cfg_attr( all( test, target_arch = "aarch64" ) , assert_instr( ldr) ) ]
3931
+ pub unsafe fn vget_low_u64 ( a : uint64x2_t ) -> uint64x1_t {
3932
+ uint64x1_t ( simd_extract ( a, 0 ) )
3933
+ }
3934
+
3935
+ /// Duplicate vector element to vector or scalar
3936
+ #[ inline]
3937
+ #[ target_feature( enable = "neon" ) ]
3938
+ #[ cfg_attr( target_arch = "arm" , target_feature( enable = "v7" ) ) ]
3939
+ #[ cfg_attr( all( test, target_arch = "arm" ) , assert_instr( "ldr" ) ) ]
3940
+ #[ cfg_attr( all( test, target_arch = "aarch64" ) , assert_instr( ldr) ) ]
3941
+ pub unsafe fn vget_low_p8 ( a : poly8x16_t ) -> poly8x8_t {
3942
+ simd_shuffle8 ( a, a, [ 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 ] )
3943
+ }
3944
+
3945
+ /// Duplicate vector element to vector or scalar
3946
+ #[ inline]
3947
+ #[ target_feature( enable = "neon" ) ]
3948
+ #[ cfg_attr( target_arch = "arm" , target_feature( enable = "v7" ) ) ]
3949
+ #[ cfg_attr( all( test, target_arch = "arm" ) , assert_instr( "ldr" ) ) ]
3950
+ #[ cfg_attr( all( test, target_arch = "aarch64" ) , assert_instr( ldr) ) ]
3951
+ pub unsafe fn vget_low_p16 ( a : poly16x8_t ) -> poly16x4_t {
3952
+ simd_shuffle4 ( a, a, [ 0 , 1 , 2 , 3 ] )
3953
+ }
3954
+
3955
+ /// Duplicate vector element to vector or scalar
3956
+ #[ inline]
3957
+ #[ target_feature( enable = "neon" ) ]
3958
+ #[ cfg_attr( target_arch = "arm" , target_feature( enable = "v7" ) ) ]
3959
+ #[ cfg_attr( all( test, target_arch = "arm" ) , assert_instr( "ldr" ) ) ]
3960
+ #[ cfg_attr( all( test, target_arch = "aarch64" ) , assert_instr( ldr) ) ]
3961
+ pub unsafe fn vget_low_f32 ( a : float32x4_t ) -> float32x2_t {
3962
+ simd_shuffle2 ( a, a, [ 0 , 1 ] )
3863
3963
}
3864
3964
3865
3965
/// Duplicate vector element to vector or scalar
@@ -5853,31 +5953,31 @@ mod tests {
5853
5953
unsafe fn test_vget_high_u8 ( ) {
5854
5954
let a = u8x16:: new ( 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 , 16 ) ;
5855
5955
let e = u8x8:: new ( 9 , 10 , 11 , 12 , 13 , 14 , 15 , 16 ) ;
5856
- let r: u8x8 = transmute ( vget_high_s8 ( transmute ( a) ) ) ;
5956
+ let r: u8x8 = transmute ( vget_high_u8 ( transmute ( a) ) ) ;
5857
5957
assert_eq ! ( r, e) ;
5858
5958
}
5859
5959
5860
5960
#[ simd_test( enable = "neon" ) ]
5861
5961
unsafe fn test_vget_high_u16 ( ) {
5862
5962
let a = u16x8:: new ( 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 ) ;
5863
5963
let e = u16x4:: new ( 5 , 6 , 7 , 8 ) ;
5864
- let r: u16x4 = transmute ( vget_high_s16 ( transmute ( a) ) ) ;
5964
+ let r: u16x4 = transmute ( vget_high_u16 ( transmute ( a) ) ) ;
5865
5965
assert_eq ! ( r, e) ;
5866
5966
}
5867
5967
5868
5968
#[ simd_test( enable = "neon" ) ]
5869
5969
unsafe fn test_vget_high_u32 ( ) {
5870
5970
let a = u32x4:: new ( 1 , 2 , 3 , 4 ) ;
5871
5971
let e = u32x2:: new ( 3 , 4 ) ;
5872
- let r: u32x2 = transmute ( vget_high_s32 ( transmute ( a) ) ) ;
5972
+ let r: u32x2 = transmute ( vget_high_u32 ( transmute ( a) ) ) ;
5873
5973
assert_eq ! ( r, e) ;
5874
5974
}
5875
5975
5876
5976
#[ simd_test( enable = "neon" ) ]
5877
5977
unsafe fn test_vget_high_u64 ( ) {
5878
5978
let a = u64x2:: new ( 1 , 2 ) ;
5879
5979
let e = u64x1:: new ( 2 ) ;
5880
- let r: u64x1 = transmute ( vget_high_s64 ( transmute ( a) ) ) ;
5980
+ let r: u64x1 = transmute ( vget_high_u64 ( transmute ( a) ) ) ;
5881
5981
assert_eq ! ( r, e) ;
5882
5982
}
5883
5983
@@ -5898,18 +5998,98 @@ mod tests {
5898
5998
}
5899
5999
5900
6000
#[ simd_test( enable = "neon" ) ]
5901
- unsafe fn test_vget_high_p64 ( ) {
6001
+ unsafe fn test_vget_high_f32 ( ) {
6002
+ let a = f32x4:: new ( 1.0 , 2.0 , 3.0 , 4.0 ) ;
6003
+ let e = f32x2:: new ( 3.0 , 4.0 ) ;
6004
+ let r: f32x2 = transmute ( vget_high_f32 ( transmute ( a) ) ) ;
6005
+ assert_eq ! ( r, e) ;
6006
+ }
6007
+
6008
+ #[ simd_test( enable = "neon" ) ]
6009
+ unsafe fn test_vget_low_s8 ( ) {
6010
+ let a = i8x16:: new ( 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 , 16 ) ;
6011
+ let e = i8x8:: new ( 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 ) ;
6012
+ let r: i8x8 = transmute ( vget_low_s8 ( transmute ( a) ) ) ;
6013
+ assert_eq ! ( r, e) ;
6014
+ }
6015
+
6016
+ #[ simd_test( enable = "neon" ) ]
6017
+ unsafe fn test_vget_low_s16 ( ) {
6018
+ let a = i16x8:: new ( 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 ) ;
6019
+ let e = i16x4:: new ( 1 , 2 , 3 , 4 ) ;
6020
+ let r: i16x4 = transmute ( vget_low_s16 ( transmute ( a) ) ) ;
6021
+ assert_eq ! ( r, e) ;
6022
+ }
6023
+
6024
+ #[ simd_test( enable = "neon" ) ]
6025
+ unsafe fn test_vget_low_s32 ( ) {
6026
+ let a = i32x4:: new ( 1 , 2 , 3 , 4 ) ;
6027
+ let e = i32x2:: new ( 1 , 2 ) ;
6028
+ let r: i32x2 = transmute ( vget_low_s32 ( transmute ( a) ) ) ;
6029
+ assert_eq ! ( r, e) ;
6030
+ }
6031
+
6032
+ #[ simd_test( enable = "neon" ) ]
6033
+ unsafe fn test_vget_low_s64 ( ) {
6034
+ let a = i64x2:: new ( 1 , 2 ) ;
6035
+ let e = i64x1:: new ( 1 ) ;
6036
+ let r: i64x1 = transmute ( vget_low_s64 ( transmute ( a) ) ) ;
6037
+ assert_eq ! ( r, e) ;
6038
+ }
6039
+
6040
+ #[ simd_test( enable = "neon" ) ]
6041
+ unsafe fn test_vget_low_u8 ( ) {
6042
+ let a = u8x16:: new ( 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 , 16 ) ;
6043
+ let e = u8x8:: new ( 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 ) ;
6044
+ let r: u8x8 = transmute ( vget_low_u8 ( transmute ( a) ) ) ;
6045
+ assert_eq ! ( r, e) ;
6046
+ }
6047
+
6048
+ #[ simd_test( enable = "neon" ) ]
6049
+ unsafe fn test_vget_low_u16 ( ) {
6050
+ let a = u16x8:: new ( 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 ) ;
6051
+ let e = u16x4:: new ( 1 , 2 , 3 , 4 ) ;
6052
+ let r: u16x4 = transmute ( vget_low_u16 ( transmute ( a) ) ) ;
6053
+ assert_eq ! ( r, e) ;
6054
+ }
6055
+
6056
+ #[ simd_test( enable = "neon" ) ]
6057
+ unsafe fn test_vget_low_u32 ( ) {
6058
+ let a = u32x4:: new ( 1 , 2 , 3 , 4 ) ;
6059
+ let e = u32x2:: new ( 1 , 2 ) ;
6060
+ let r: u32x2 = transmute ( vget_low_u32 ( transmute ( a) ) ) ;
6061
+ assert_eq ! ( r, e) ;
6062
+ }
6063
+
6064
+ #[ simd_test( enable = "neon" ) ]
6065
+ unsafe fn test_vget_low_u64 ( ) {
5902
6066
let a = u64x2:: new ( 1 , 2 ) ;
5903
- let e = u64x1:: new ( 2 ) ;
5904
- let r: u64x1 = transmute ( vget_high_p64 ( transmute ( a) ) ) ;
6067
+ let e = u64x1:: new ( 1 ) ;
6068
+ let r: u64x1 = transmute ( vget_low_u64 ( transmute ( a) ) ) ;
5905
6069
assert_eq ! ( r, e) ;
5906
6070
}
5907
6071
5908
6072
#[ simd_test( enable = "neon" ) ]
5909
- unsafe fn test_vget_high_f32 ( ) {
6073
+ unsafe fn test_vget_low_p8 ( ) {
6074
+ let a = u8x16:: new ( 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 , 16 ) ;
6075
+ let e = u8x8:: new ( 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 ) ;
6076
+ let r: u8x8 = transmute ( vget_low_p8 ( transmute ( a) ) ) ;
6077
+ assert_eq ! ( r, e) ;
6078
+ }
6079
+
6080
+ #[ simd_test( enable = "neon" ) ]
6081
+ unsafe fn test_vget_low_p16 ( ) {
6082
+ let a = u16x8:: new ( 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 ) ;
6083
+ let e = u16x4:: new ( 1 , 2 , 3 , 4 ) ;
6084
+ let r: u16x4 = transmute ( vget_low_p16 ( transmute ( a) ) ) ;
6085
+ assert_eq ! ( r, e) ;
6086
+ }
6087
+
6088
+ #[ simd_test( enable = "neon" ) ]
6089
+ unsafe fn test_vget_low_f32 ( ) {
5910
6090
let a = f32x4:: new ( 1.0 , 2.0 , 3.0 , 4.0 ) ;
5911
- let e = f32x2:: new ( 3 .0, 4 .0) ;
5912
- let r: f32x2 = transmute ( vget_high_f32 ( transmute ( a) ) ) ;
6091
+ let e = f32x2:: new ( 1 .0, 2 .0) ;
6092
+ let r: f32x2 = transmute ( vget_low_f32 ( transmute ( a) ) ) ;
5913
6093
assert_eq ! ( r, e) ;
5914
6094
}
5915
6095
0 commit comments