@@ -35,6 +35,69 @@ pub unsafe fn vabdq_f64(a: float64x2_t, b: float64x2_t) -> float64x2_t {
35
35
vabdq_f64_ ( a, b)
36
36
}
37
37
38
+ /// Unsigned Absolute difference Long
39
+ #[ inline]
40
+ #[ target_feature( enable = "neon" ) ]
41
+ #[ cfg_attr( test, assert_instr( uabdl) ) ]
42
+ pub unsafe fn vabdl_high_u8 ( a : uint8x16_t , b : uint8x16_t ) -> uint16x8_t {
43
+ let c: uint8x8_t = simd_shuffle8 ( a, a, [ 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 ] ) ;
44
+ let d: uint8x8_t = simd_shuffle8 ( b, b, [ 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 ] ) ;
45
+ simd_cast ( vabd_u8 ( c, d) )
46
+ }
47
+
48
+ /// Unsigned Absolute difference Long
49
+ #[ inline]
50
+ #[ target_feature( enable = "neon" ) ]
51
+ #[ cfg_attr( test, assert_instr( uabdl) ) ]
52
+ pub unsafe fn vabdl_high_u16 ( a : uint16x8_t , b : uint16x8_t ) -> uint32x4_t {
53
+ let c: uint16x4_t = simd_shuffle4 ( a, a, [ 4 , 5 , 6 , 7 ] ) ;
54
+ let d: uint16x4_t = simd_shuffle4 ( b, b, [ 4 , 5 , 6 , 7 ] ) ;
55
+ simd_cast ( vabd_u16 ( c, d) )
56
+ }
57
+
58
+ /// Unsigned Absolute difference Long
59
+ #[ inline]
60
+ #[ target_feature( enable = "neon" ) ]
61
+ #[ cfg_attr( test, assert_instr( uabdl) ) ]
62
+ pub unsafe fn vabdl_high_u32 ( a : uint32x4_t , b : uint32x4_t ) -> uint64x2_t {
63
+ let c: uint32x2_t = simd_shuffle2 ( a, a, [ 2 , 3 ] ) ;
64
+ let d: uint32x2_t = simd_shuffle2 ( b, b, [ 2 , 3 ] ) ;
65
+ simd_cast ( vabd_u32 ( c, d) )
66
+ }
67
+
68
+ /// Signed Absolute difference Long
69
+ #[ inline]
70
+ #[ target_feature( enable = "neon" ) ]
71
+ #[ cfg_attr( test, assert_instr( sabdl) ) ]
72
+ pub unsafe fn vabdl_high_s8 ( a : int8x16_t , b : int8x16_t ) -> int16x8_t {
73
+ let c: int8x8_t = simd_shuffle8 ( a, a, [ 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 ] ) ;
74
+ let d: int8x8_t = simd_shuffle8 ( b, b, [ 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 ] ) ;
75
+ let e: uint8x8_t = simd_cast ( vabd_s8 ( c, d) ) ;
76
+ simd_cast ( e)
77
+ }
78
+
79
+ /// Signed Absolute difference Long
80
+ #[ inline]
81
+ #[ target_feature( enable = "neon" ) ]
82
+ #[ cfg_attr( test, assert_instr( sabdl) ) ]
83
+ pub unsafe fn vabdl_high_s16 ( a : int16x8_t , b : int16x8_t ) -> int32x4_t {
84
+ let c: int16x4_t = simd_shuffle4 ( a, a, [ 4 , 5 , 6 , 7 ] ) ;
85
+ let d: int16x4_t = simd_shuffle4 ( b, b, [ 4 , 5 , 6 , 7 ] ) ;
86
+ let e: uint16x4_t = simd_cast ( vabd_s16 ( c, d) ) ;
87
+ simd_cast ( e)
88
+ }
89
+
90
+ /// Signed Absolute difference Long
91
+ #[ inline]
92
+ #[ target_feature( enable = "neon" ) ]
93
+ #[ cfg_attr( test, assert_instr( sabdl) ) ]
94
+ pub unsafe fn vabdl_high_s32 ( a : int32x4_t , b : int32x4_t ) -> int64x2_t {
95
+ let c: int32x2_t = simd_shuffle2 ( a, a, [ 2 , 3 ] ) ;
96
+ let d: int32x2_t = simd_shuffle2 ( b, b, [ 2 , 3 ] ) ;
97
+ let e: uint32x2_t = simd_cast ( vabd_s32 ( c, d) ) ;
98
+ simd_cast ( e)
99
+ }
100
+
38
101
/// Compare bitwise Equal (vector)
39
102
#[ inline]
40
103
#[ target_feature( enable = "neon" ) ]
@@ -2879,6 +2942,60 @@ mod test {
2879
2942
assert_eq ! ( r, e) ;
2880
2943
}
2881
2944
2945
+ #[ simd_test( enable = "neon" ) ]
2946
+ unsafe fn test_vabdl_high_u8 ( ) {
2947
+ let a: u8x16 = u8x16:: new ( 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 , 16 ) ;
2948
+ let b: u8x16 = u8x16:: new ( 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 ) ;
2949
+ let e: u16x8 = u16x8:: new ( 1 , 0 , 1 , 2 , 3 , 4 , 5 , 6 ) ;
2950
+ let r: u16x8 = transmute ( vabdl_high_u8 ( transmute ( a) , transmute ( b) ) ) ;
2951
+ assert_eq ! ( r, e) ;
2952
+ }
2953
+
2954
+ #[ simd_test( enable = "neon" ) ]
2955
+ unsafe fn test_vabdl_high_u16 ( ) {
2956
+ let a: u16x8 = u16x8:: new ( 1 , 2 , 3 , 4 , 8 , 9 , 11 , 12 ) ;
2957
+ let b: u16x8 = u16x8:: new ( 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 ) ;
2958
+ let e: u32x4 = u32x4:: new ( 2 , 1 , 1 , 2 ) ;
2959
+ let r: u32x4 = transmute ( vabdl_high_u16 ( transmute ( a) , transmute ( b) ) ) ;
2960
+ assert_eq ! ( r, e) ;
2961
+ }
2962
+
2963
+ #[ simd_test( enable = "neon" ) ]
2964
+ unsafe fn test_vabdl_high_u32 ( ) {
2965
+ let a: u32x4 = u32x4:: new ( 1 , 2 , 3 , 4 ) ;
2966
+ let b: u32x4 = u32x4:: new ( 10 , 10 , 10 , 10 ) ;
2967
+ let e: u64x2 = u64x2:: new ( 7 , 6 ) ;
2968
+ let r: u64x2 = transmute ( vabdl_high_u32 ( transmute ( a) , transmute ( b) ) ) ;
2969
+ assert_eq ! ( r, e) ;
2970
+ }
2971
+
2972
+ #[ simd_test( enable = "neon" ) ]
2973
+ unsafe fn test_vabdl_high_s8 ( ) {
2974
+ let a: i8x16 = i8x16:: new ( 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 , 16 ) ;
2975
+ let b: i8x16 = i8x16:: new ( 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 ) ;
2976
+ let e: i16x8 = i16x8:: new ( 1 , 0 , 1 , 2 , 3 , 4 , 5 , 6 ) ;
2977
+ let r: i16x8 = transmute ( vabdl_high_s8 ( transmute ( a) , transmute ( b) ) ) ;
2978
+ assert_eq ! ( r, e) ;
2979
+ }
2980
+
2981
+ #[ simd_test( enable = "neon" ) ]
2982
+ unsafe fn test_vabdl_high_s16 ( ) {
2983
+ let a: i16x8 = i16x8:: new ( 1 , 2 , 3 , 4 , 9 , 10 , 11 , 12 ) ;
2984
+ let b: i16x8 = i16x8:: new ( 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 ) ;
2985
+ let e: i32x4 = i32x4:: new ( 1 , 0 , 1 , 2 ) ;
2986
+ let r: i32x4 = transmute ( vabdl_high_s16 ( transmute ( a) , transmute ( b) ) ) ;
2987
+ assert_eq ! ( r, e) ;
2988
+ }
2989
+
2990
+ #[ simd_test( enable = "neon" ) ]
2991
+ unsafe fn test_vabdl_high_s32 ( ) {
2992
+ let a: i32x4 = i32x4:: new ( 1 , 2 , 3 , 4 ) ;
2993
+ let b: i32x4 = i32x4:: new ( 10 , 10 , 10 , 10 ) ;
2994
+ let e: i64x2 = i64x2:: new ( 7 , 6 ) ;
2995
+ let r: i64x2 = transmute ( vabdl_high_s32 ( transmute ( a) , transmute ( b) ) ) ;
2996
+ assert_eq ! ( r, e) ;
2997
+ }
2998
+
2882
2999
#[ simd_test( enable = "neon" ) ]
2883
3000
unsafe fn test_vceq_u64 ( ) {
2884
3001
let a: u64x1 = u64x1:: new ( 0 ) ;
0 commit comments