@@ -2727,6 +2727,75 @@ pub unsafe fn vzip2q_f64(a: float64x2_t, b: float64x2_t) -> float64x2_t {
2727
2727
simd_shuffle2 ( a, b, [ 1 , 3 ] )
2728
2728
}
2729
2729
2730
+ /// Unsigned Absolute difference and Accumulate Long
2731
+ #[ inline]
2732
+ #[ target_feature( enable = "neon" ) ]
2733
+ #[ cfg_attr( test, assert_instr( uabal) ) ]
2734
+ pub unsafe fn vabal_high_u8 ( a : uint16x8_t , b : uint8x16_t , c : uint8x16_t ) -> uint16x8_t {
2735
+ let d: uint8x8_t = simd_shuffle8 ( b, b, [ 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 ] ) ;
2736
+ let e: uint8x8_t = simd_shuffle8 ( c, c, [ 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 ] ) ;
2737
+ let f: uint8x8_t = vabd_u8 ( d, e) ;
2738
+ simd_add ( a, simd_cast ( f) )
2739
+ }
2740
+
2741
+ /// Unsigned Absolute difference and Accumulate Long
2742
+ #[ inline]
2743
+ #[ target_feature( enable = "neon" ) ]
2744
+ #[ cfg_attr( test, assert_instr( uabal) ) ]
2745
+ pub unsafe fn vabal_high_u16 ( a : uint32x4_t , b : uint16x8_t , c : uint16x8_t ) -> uint32x4_t {
2746
+ let d: uint16x4_t = simd_shuffle4 ( b, b, [ 4 , 5 , 6 , 7 ] ) ;
2747
+ let e: uint16x4_t = simd_shuffle4 ( c, c, [ 4 , 5 , 6 , 7 ] ) ;
2748
+ let f: uint16x4_t = vabd_u16 ( d, e) ;
2749
+ simd_add ( a, simd_cast ( f) )
2750
+ }
2751
+
2752
+ /// Unsigned Absolute difference and Accumulate Long
2753
+ #[ inline]
2754
+ #[ target_feature( enable = "neon" ) ]
2755
+ #[ cfg_attr( test, assert_instr( uabal) ) ]
2756
+ pub unsafe fn vabal_high_u32 ( a : uint64x2_t , b : uint32x4_t , c : uint32x4_t ) -> uint64x2_t {
2757
+ let d: uint32x2_t = simd_shuffle2 ( b, b, [ 2 , 3 ] ) ;
2758
+ let e: uint32x2_t = simd_shuffle2 ( c, c, [ 2 , 3 ] ) ;
2759
+ let f: uint32x2_t = vabd_u32 ( d, e) ;
2760
+ simd_add ( a, simd_cast ( f) )
2761
+ }
2762
+
2763
+ /// Signed Absolute difference and Accumulate Long
2764
+ #[ inline]
2765
+ #[ target_feature( enable = "neon" ) ]
2766
+ #[ cfg_attr( test, assert_instr( sabal) ) ]
2767
+ pub unsafe fn vabal_high_s8 ( a : int16x8_t , b : int8x16_t , c : int8x16_t ) -> int16x8_t {
2768
+ let d: int8x8_t = simd_shuffle8 ( b, b, [ 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 ] ) ;
2769
+ let e: int8x8_t = simd_shuffle8 ( c, c, [ 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 ] ) ;
2770
+ let f: int8x8_t = vabd_s8 ( d, e) ;
2771
+ let f: uint8x8_t = simd_cast ( f) ;
2772
+ simd_add ( a, simd_cast ( f) )
2773
+ }
2774
+
2775
+ /// Signed Absolute difference and Accumulate Long
2776
+ #[ inline]
2777
+ #[ target_feature( enable = "neon" ) ]
2778
+ #[ cfg_attr( test, assert_instr( sabal) ) ]
2779
+ pub unsafe fn vabal_high_s16 ( a : int32x4_t , b : int16x8_t , c : int16x8_t ) -> int32x4_t {
2780
+ let d: int16x4_t = simd_shuffle4 ( b, b, [ 4 , 5 , 6 , 7 ] ) ;
2781
+ let e: int16x4_t = simd_shuffle4 ( c, c, [ 4 , 5 , 6 , 7 ] ) ;
2782
+ let f: int16x4_t = vabd_s16 ( d, e) ;
2783
+ let f: uint16x4_t = simd_cast ( f) ;
2784
+ simd_add ( a, simd_cast ( f) )
2785
+ }
2786
+
2787
+ /// Signed Absolute difference and Accumulate Long
2788
+ #[ inline]
2789
+ #[ target_feature( enable = "neon" ) ]
2790
+ #[ cfg_attr( test, assert_instr( sabal) ) ]
2791
+ pub unsafe fn vabal_high_s32 ( a : int64x2_t , b : int32x4_t , c : int32x4_t ) -> int64x2_t {
2792
+ let d: int32x2_t = simd_shuffle2 ( b, b, [ 2 , 3 ] ) ;
2793
+ let e: int32x2_t = simd_shuffle2 ( c, c, [ 2 , 3 ] ) ;
2794
+ let f: int32x2_t = vabd_s32 ( d, e) ;
2795
+ let f: uint32x2_t = simd_cast ( f) ;
2796
+ simd_add ( a, simd_cast ( f) )
2797
+ }
2798
+
2730
2799
#[ cfg( test) ]
2731
2800
mod test {
2732
2801
use super :: * ;
@@ -5318,4 +5387,64 @@ mod test {
5318
5387
let r: f64x2 = transmute ( vzip2q_f64 ( transmute ( a) , transmute ( b) ) ) ;
5319
5388
assert_eq ! ( r, e) ;
5320
5389
}
5390
+
5391
+ #[ simd_test( enable = "neon" ) ]
5392
+ unsafe fn test_vabal_high_u8 ( ) {
5393
+ let a: u16x8 = u16x8:: new ( 9 , 10 , 11 , 12 , 13 , 14 , 15 , 16 ) ;
5394
+ let b: u8x16 = u8x16:: new ( 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 , 16 ) ;
5395
+ let c: u8x16 = u8x16:: new ( 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 20 , 0 , 2 , 4 , 6 , 8 , 10 , 12 ) ;
5396
+ let e: u16x8 = u16x8:: new ( 20 , 20 , 20 , 20 , 20 , 20 , 20 , 20 ) ;
5397
+ let r: u16x8 = transmute ( vabal_high_u8 ( transmute ( a) , transmute ( b) , transmute ( c) ) ) ;
5398
+ assert_eq ! ( r, e) ;
5399
+ }
5400
+
5401
+ #[ simd_test( enable = "neon" ) ]
5402
+ unsafe fn test_vabal_high_u16 ( ) {
5403
+ let a: u32x4 = u32x4:: new ( 9 , 10 , 11 , 12 ) ;
5404
+ let b: u16x8 = u16x8:: new ( 1 , 2 , 3 , 4 , 9 , 10 , 11 , 12 ) ;
5405
+ let c: u16x8 = u16x8:: new ( 10 , 10 , 10 , 10 , 20 , 0 , 2 , 4 ) ;
5406
+ let e: u32x4 = u32x4:: new ( 20 , 20 , 20 , 20 ) ;
5407
+ let r: u32x4 = transmute ( vabal_high_u16 ( transmute ( a) , transmute ( b) , transmute ( c) ) ) ;
5408
+ assert_eq ! ( r, e) ;
5409
+ }
5410
+
5411
+ #[ simd_test( enable = "neon" ) ]
5412
+ unsafe fn test_vabal_high_u32 ( ) {
5413
+ let a: u64x2 = u64x2:: new ( 15 , 16 ) ;
5414
+ let b: u32x4 = u32x4:: new ( 1 , 2 , 15 , 16 ) ;
5415
+ let c: u32x4 = u32x4:: new ( 10 , 10 , 10 , 12 ) ;
5416
+ let e: u64x2 = u64x2:: new ( 20 , 20 ) ;
5417
+ let r: u64x2 = transmute ( vabal_high_u32 ( transmute ( a) , transmute ( b) , transmute ( c) ) ) ;
5418
+ assert_eq ! ( r, e) ;
5419
+ }
5420
+
5421
+ #[ simd_test( enable = "neon" ) ]
5422
+ unsafe fn test_vabal_high_s8 ( ) {
5423
+ let a: i16x8 = i16x8:: new ( 9 , 10 , 11 , 12 , 13 , 14 , 15 , 16 ) ;
5424
+ let b: i8x16 = i8x16:: new ( 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 , 16 ) ;
5425
+ let c: i8x16 = i8x16:: new ( 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 20 , 0 , 2 , 4 , 6 , 8 , 10 , 12 ) ;
5426
+ let e: i16x8 = i16x8:: new ( 20 , 20 , 20 , 20 , 20 , 20 , 20 , 20 ) ;
5427
+ let r: i16x8 = transmute ( vabal_high_s8 ( transmute ( a) , transmute ( b) , transmute ( c) ) ) ;
5428
+ assert_eq ! ( r, e) ;
5429
+ }
5430
+
5431
+ #[ simd_test( enable = "neon" ) ]
5432
+ unsafe fn test_vabal_high_s16 ( ) {
5433
+ let a: i32x4 = i32x4:: new ( 9 , 10 , 11 , 12 ) ;
5434
+ let b: i16x8 = i16x8:: new ( 1 , 2 , 3 , 4 , 9 , 10 , 11 , 12 ) ;
5435
+ let c: i16x8 = i16x8:: new ( 10 , 10 , 10 , 10 , 20 , 0 , 2 , 4 ) ;
5436
+ let e: i32x4 = i32x4:: new ( 20 , 20 , 20 , 20 ) ;
5437
+ let r: i32x4 = transmute ( vabal_high_s16 ( transmute ( a) , transmute ( b) , transmute ( c) ) ) ;
5438
+ assert_eq ! ( r, e) ;
5439
+ }
5440
+
5441
+ #[ simd_test( enable = "neon" ) ]
5442
+ unsafe fn test_vabal_high_s32 ( ) {
5443
+ let a: i64x2 = i64x2:: new ( 15 , 16 ) ;
5444
+ let b: i32x4 = i32x4:: new ( 1 , 2 , 15 , 16 ) ;
5445
+ let c: i32x4 = i32x4:: new ( 10 , 10 , 10 , 12 ) ;
5446
+ let e: i64x2 = i64x2:: new ( 20 , 20 ) ;
5447
+ let r: i64x2 = transmute ( vabal_high_s32 ( transmute ( a) , transmute ( b) , transmute ( c) ) ) ;
5448
+ assert_eq ! ( r, e) ;
5449
+ }
5321
5450
}
0 commit comments