@@ -12645,6 +12645,44 @@ mod tests {
12645
12645
let r: i32x4 = transmute ( vusmmlaq_s32 ( transmute ( a) , transmute ( b) , transmute ( c) ) ) ;
12646
12646
assert_eq ! ( r, e) ;
12647
12647
}
12648
+
12649
+ macro_rules! test_vcombine {
12650
+ ( $test_id: ident => $fn_id: ident ( [ $( $a: expr) ,* ] , [ $( $b: expr) ,* ] ) ) => {
12651
+ #[ allow( unused_assignments) ]
12652
+ #[ simd_test( enable = "neon" ) ]
12653
+ unsafe fn $test_id( ) {
12654
+ let a = [ $( $a) ,* ] ;
12655
+ let b = [ $( $b) ,* ] ;
12656
+ let e = [ $( $a) ,* $( , $b) * ] ;
12657
+ let c = $fn_id( transmute( a) , transmute( b) ) ;
12658
+ let mut d = e;
12659
+ d = transmute( c) ;
12660
+ assert_eq!( d, e) ;
12661
+ }
12662
+ }
12663
+ }
12664
+
12665
+ 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 ] ) ) ;
12666
+ 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 ] ) ) ;
12667
+ 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 ] ) ) ;
12668
+
12669
+ test_vcombine ! ( test_vcombine_s16 => vcombine_s16( [ 3_i16 , -4 , 5 , -6 ] , [ 13_i16 , -14 , 15 , -16 ] ) ) ;
12670
+ test_vcombine ! ( test_vcombine_u16 => vcombine_u16( [ 3_u16 , 4 , 5 , 6 ] , [ 13_u16 , 14 , 15 , 16 ] ) ) ;
12671
+ test_vcombine ! ( test_vcombine_p16 => vcombine_p16( [ 3_u16 , 4 , 5 , 6 ] , [ 13_u16 , 14 , 15 , 16 ] ) ) ;
12672
+ // FIXME: 16-bit floats
12673
+ // test_vcombine!(test_vcombine_f16 => vcombine_f16([3_f16, 4., 5., 6.],
12674
+ // [13_f16, 14., 15., 16.]));
12675
+
12676
+ test_vcombine ! ( test_vcombine_s32 => vcombine_s32( [ 3_i32 , -4 ] , [ 13_i32 , -14 ] ) ) ;
12677
+ test_vcombine ! ( test_vcombine_u32 => vcombine_u32( [ 3_u32 , 4 ] , [ 13_u32 , 14 ] ) ) ;
12678
+ // note: poly32x4 does not exist, and neither does vcombine_p32
12679
+ test_vcombine ! ( test_vcombine_f32 => vcombine_f32( [ 3_f32 , -4. ] , [ 13_f32 , -14. ] ) ) ;
12680
+
12681
+ test_vcombine ! ( test_vcombine_s64 => vcombine_s64( [ -3_i64 ] , [ 13_i64 ] ) ) ;
12682
+ test_vcombine ! ( test_vcombine_u64 => vcombine_u64( [ 3_u64 ] , [ 13_u64 ] ) ) ;
12683
+ test_vcombine ! ( test_vcombine_p64 => vcombine_p64( [ 3_u64 ] , [ 13_u64 ] ) ) ;
12684
+ #[ cfg( target_arch = "aarch64" ) ]
12685
+ test_vcombine ! ( test_vcombine_f64 => vcombine_f64( [ -3_f64 ] , [ 13_f64 ] ) ) ;
12648
12686
}
12649
12687
12650
12688
#[ cfg( all( test, target_arch = "arm" , target_endian = "little" ) ) ]
0 commit comments