@@ -3902,6 +3902,45 @@ mod tests {
3902
3902
|a : u32 , b : u32 | -> u32 { ( ( ( a as u64 ) - ( b as u64 ) ) / 2 ) as u32 } ,
3903
3903
) ;
3904
3904
}
3905
+
3906
+ #[ simd_test( enable = "neon" ) ]
3907
+ unsafe fn test_vreinterpretq_s8_u8 ( ) {
3908
+ let a = i8x16:: new ( -1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 , 16 ) ;
3909
+ let r: u8x16 = transmute ( vreinterpretq_s8_u8 ( transmute ( a) ) ) ;
3910
+ let e = u8x16:: new ( 0xFF , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 , 16 ) ;
3911
+ assert_eq ! ( r, e)
3912
+ }
3913
+ #[ simd_test( enable = "neon" ) ]
3914
+ unsafe fn test_vreinterpretq_u16_u8 ( ) {
3915
+ let a = u16x8:: new (
3916
+ 0x01_00 , 0x03_02 , 0x05_04 , 0x07_06 , 0x09_08 , 0x0B_0A , 0x0D_0C , 0x0F_0E ,
3917
+ ) ;
3918
+ let r: u8x16 = transmute ( vreinterpretq_u16_u8 ( transmute ( a) ) ) ;
3919
+ let e = u8x16:: new ( 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 ) ;
3920
+ assert_eq ! ( r, e)
3921
+ }
3922
+ #[ simd_test( enable = "neon" ) ]
3923
+ unsafe fn test_vreinterpretq_u32_u8 ( ) {
3924
+ let a = u32x4:: new ( 0x03_02_01_00 , 0x07_06_05_04 , 0x0B_0A_09_08 , 0x0F_0E_0D_0C ) ;
3925
+ let r: u8x16 = transmute ( vreinterpretq_u32_u8 ( transmute ( a) ) ) ;
3926
+ let e = u8x16:: new ( 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 ) ;
3927
+ assert_eq ! ( r, e)
3928
+ }
3929
+ #[ simd_test( enable = "neon" ) ]
3930
+ unsafe fn test_vreinterpretq_u64_u8 ( ) {
3931
+ let a: u64x2 = u64x2:: new ( 0x07_06_05_04_03_02_01_00 , 0x0F_0E_0D_0C_0B_0A_09_08 ) ;
3932
+ let r: u8x16 = transmute ( vreinterpretq_u64_u8 ( transmute ( a) ) ) ;
3933
+ let e = u8x16:: new ( 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 ) ;
3934
+ assert_eq ! ( r, e)
3935
+ }
3936
+ #[ simd_test( enable = "neon" ) ]
3937
+ unsafe fn test_vreinterpretq_u8_s8 ( ) {
3938
+ let a = u8x16:: new ( 0xFF , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 , 16 ) ;
3939
+ let r: i8x16 = transmute ( vreinterpretq_u8_s8 ( transmute ( a) ) ) ;
3940
+ let e = i8x16:: new ( -1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 , 16 ) ;
3941
+ assert_eq ! ( r, e)
3942
+ }
3943
+
3905
3944
}
3906
3945
3907
3946
#[ cfg( test) ]
0 commit comments