@@ -12659,6 +12659,44 @@ mod tests {
12659
12659
let r: i32x4 = transmute ( vusmmlaq_s32 ( transmute ( a) , transmute ( b) , transmute ( c) ) ) ;
12660
12660
assert_eq ! ( r, e) ;
12661
12661
}
12662
+
12663
+ macro_rules! test_vcombine {
12664
+ ( $test_id: ident => $fn_id: ident ( [ $( $a: expr) ,* ] , [ $( $b: expr) ,* ] ) ) => {
12665
+ #[ allow( unused_assignments) ]
12666
+ #[ simd_test( enable = "neon" ) ]
12667
+ unsafe fn $test_id( ) {
12668
+ let a = [ $( $a) ,* ] ;
12669
+ let b = [ $( $b) ,* ] ;
12670
+ let e = [ $( $a) ,* $( , $b) * ] ;
12671
+ let c = $fn_id( transmute( a) , transmute( b) ) ;
12672
+ let mut d = e;
12673
+ d = transmute( c) ;
12674
+ assert_eq!( d, e) ;
12675
+ }
12676
+ }
12677
+ }
12678
+
12679
+ test_vcombine ! ( test_vcombine_s8 => vcombine_s8( [ 3_i8 , -4 , 5 , -6 , 7 , 8 , 9 , 10 ] , [ 13_i8 , -14 , 15 , -16 , 17 , 18 , 19 , 110 ] ) ) ;
12680
+ test_vcombine ! ( test_vcombine_u8 => vcombine_u8( [ 3_u8 , 4 , 5 , 6 , 7 , 8 , 9 , 10 ] , [ 13_u8 , 14 , 15 , 16 , 17 , 18 , 19 , 110 ] ) ) ;
12681
+ test_vcombine ! ( test_vcombine_p8 => vcombine_p8( [ 3_u8 , 4 , 5 , 6 , 7 , 8 , 9 , 10 ] , [ 13_u8 , 14 , 15 , 16 , 17 , 18 , 19 , 110 ] ) ) ;
12682
+
12683
+ test_vcombine ! ( test_vcombine_s16 => vcombine_s16( [ 3_i16 , -4 , 5 , -6 ] , [ 13_i16 , -14 , 15 , -16 ] ) ) ;
12684
+ test_vcombine ! ( test_vcombine_u16 => vcombine_u16( [ 3_u16 , 4 , 5 , 6 ] , [ 13_u16 , 14 , 15 , 16 ] ) ) ;
12685
+ test_vcombine ! ( test_vcombine_p16 => vcombine_p16( [ 3_u16 , 4 , 5 , 6 ] , [ 13_u16 , 14 , 15 , 16 ] ) ) ;
12686
+ // FIXME: 16-bit floats
12687
+ // test_vcombine!(test_vcombine_f16 => vcombine_f16([3_f16, 4., 5., 6.],
12688
+ // [13_f16, 14., 15., 16.]));
12689
+
12690
+ test_vcombine ! ( test_vcombine_s32 => vcombine_s32( [ 3_i32 , -4 ] , [ 13_i32 , -14 ] ) ) ;
12691
+ test_vcombine ! ( test_vcombine_u32 => vcombine_u32( [ 3_u32 , 4 ] , [ 13_u32 , 14 ] ) ) ;
12692
+ // note: poly32x4 does not exist, and neither does vcombine_p32
12693
+ test_vcombine ! ( test_vcombine_f32 => vcombine_f32( [ 3_f32 , -4. ] , [ 13_f32 , -14. ] ) ) ;
12694
+
12695
+ test_vcombine ! ( test_vcombine_s64 => vcombine_s64( [ -3_i64 ] , [ 13_i64 ] ) ) ;
12696
+ test_vcombine ! ( test_vcombine_u64 => vcombine_u64( [ 3_u64 ] , [ 13_u64 ] ) ) ;
12697
+ test_vcombine ! ( test_vcombine_p64 => vcombine_p64( [ 3_u64 ] , [ 13_u64 ] ) ) ;
12698
+ #[ cfg( target_arch = "aarch64" ) ]
12699
+ test_vcombine ! ( test_vcombine_f64 => vcombine_f64( [ -3_f64 ] , [ 13_f64 ] ) ) ;
12662
12700
}
12663
12701
12664
12702
#[ cfg( all( test, target_arch = "arm" , target_endian = "little" ) ) ]
0 commit comments